Hey Guys,
I am still having trouble getting this to work. I believe I have my categories setup properly for the array - I think? Below is a screen shot of my PHP MY ADMIN Panel with my category structure.
Also, I have included the code for my entire form. This form is used not only to submit new testimonials from patients but also to update them when need be.
<? require($_SERVER['DOCUMENT_ROOT'] . "/inc/adminFunctions.php");
require($_SERVER['DOCUMENT_ROOT'] . "/inc/categories.class.php");
require($_SERVER['DOCUMENT_ROOT'] . "/inc/content.class.php");
require($_SERVER['DOCUMENT_ROOT'] . "/inc/FCKeditor/fckeditor.php");
checkAccess("Testimonials");
$NewsParrentCategoryID = 2;
$Categories = new Categories; $Categories = $Categories -> getChildern($NewsParrentCategoryID);
$Media = new Content;
$error[]="";
if ($_POST['action'] == "Delete") $Media -> deleteArchive($_POST['Details']['ContentID'], "/sa/testimonials/");
if ($_POST['action'] == "Submit") $error = $Media -> addUpdate($_POST['Details'], "/sa/testimonials/");
$Details = $_POST['Details'];
if ($_GET['action'] == "DeleteFile") unlink ($_SERVER['DOCUMENT_ROOT'] .$_GET['FileID']);
if ($_GET['ContentID'] != "" ) $Details = $Media -> getDetails($_GET['ContentID']);
if ($Details['cReleaseDate'] == "" ) $Details['cReleaseDate'] = date('m/d/Y');
$imageFile = "/images/media/".$Details['ContentID'].".jpg";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<titleTestimonials Editor</title>
<link rel="STYLESHEET" type="text/css" href="/style.css">
<link rel="STYLESHEET" type="text/css" href="/sa/admin.css">
</head>
<body>
<? include($_SERVER['DOCUMENT_ROOT'] . "/sa/header.php")?>
<? $links = array( "Browse" =>"index.php");
$title = ($Details['ContentID'] == "")? "Add Testimonial": "Update '". $Details['cName']."'";
printHeader($title, $links); ?>
<br>
<FORM METHOD="post" ACTION="<?=$_SERVER['PHP_SELF']?>" enctype="multipart/form-data">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="100%">
<tr>
<td valign="top" width="470">
<strong>Testimonial Details</strong>
<input type="Hidden" name="Details[cCategoryID]" value="<?=$NewsParrentCategoryID?>">
<input type="Hidden" name="Details[cReleaseDate]" value="01/01/2007">
<TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0" width="480">
<TR>
<TD CLASS="tableheadder" colspan="4"></TD>
</TR>
<TR>
<TD COLSPAN="2" <? if (in_array("cName", $error)) echo "class=\"error\"";?>>Name<BR><INPUT TYPE="TEXT" NAME="Details[cName]" SIZE="50" style="width:510px;" MAXLENGTH="255" VALUE="<?=$Details['cName']?>"></TD>
</TR>
<TR>
<td>Weight/Sizes/Inches Lost <BR><INPUT TYPE="TEXT" NAME="Details[cSubTitle]" SIZE="50" style="width:250px;" MAXLENGTH="255" VALUE="<?=$Details[cSubTitle]?>"></TD>
<td valign="top">Image <? if ( file_exists($_SERVER['DOCUMENT_ROOT'].$imageFile)) echo "<a href=\"$imageFile\" target=\"_blank\" CLASS=\"std\">preview current</a>";?><BR><input NAME="image" TYPE="file" style="width:250px;"></td>
</TR>
<TR>
<td>Category<BR>
<div class="form">
<select name="Details[cCategoryID]" size="9" multiple="multiple" style="width:250px;">
<? foreach ($Categories[$NewsParrentCategoryID ] as $CategoryID => $CatDetails){
echo "<option value=\"$CategoryID\"";
if ($CategoryID == $Details[cCategoryID]) echo " SELECTED";
echo "> ".$CatDetails["cName"]."</option>\n" ;
} ?>
</select>
</TD>
<td valign="top"> </td>
</TR>
<tr valign="top">
<td colspan="2">Quote<BR><INPUT TYPE="TEXT" NAME="Details[cImageCaption]" SIZE="50" style="width:510px;" MAXLENGTH="255" VALUE="<?=$Details[cImageCaption]?>"></TD>
</tr>
<TR>
<TD COLSPAN="2" <? if (in_array("cBody", $error)) echo "class=\"error\"";?>>Testimonial<BR>
<? $FCKeditor = new FCKeditor('Details[cBody]', 510, 300, false) ;
$FCKeditor->Value = $Details['cBody'] ; $FCKeditor->Create() ;?>
</td>
<INPUT TYPE="Hidden" NAME="Details[ContentID]" VALUE="<?=$Details['ContentID']?>">
</tr>
<TR>
<TD align="right" colspan="2"><INPUT TYPE="submit" NAME="action" VALUE="Submit"> <INPUT TYPE="submit" NAME="action" VALUE="Delete" onclick="javascript: return confirm('Are you sure you want to DELETE this Testimonial ?');"></td>
</TR>
</TABLE>
</FORM>
<? include($_SERVER['DOCUMENT_ROOT'] . "/sa/footer.php")?>
Any help would be greatly appreciated! Thanks!
[attachment deleted by admin]