require_once("../../common.inc.php"); //require_once("../fckeditor/fckeditor.php"); // page variable name $page_field = "level2"; // include("config.php"); //file define $num_of_files = 0; $attachment_text=array( "-----", "Photo1", "File1", "Photo2", "Photo3", "Photo4", "Movie" ); $col_name=array( "-----", "photo1", "file1", "photo2", "photo3", "photo4", "movie" ); //initial if (empty($id)) { $id = ""; $temp_id = md5(uniqid(time())); } if (empty($page)) { $page = "1"; } $sorting = ""; $display = ""; $name = ""; $ename = ""; //Load data if ($id != "") { $sql = "SELECT * FROM `".$page_tbname."` WHERE `id` = '$id'"; $row = $db->getrow($sql); if($row[category_id]!=""){ $category_id=$row[category_id]; } $sorting = $row["sorting"]; if ($row["display"] == 1) { $displayd = 'checked'; $displayh = ''; } else { $displayd = ''; $displayh = 'checked'; } $date = $row["date"]; $name = $row["name"]; $ename = $row["ename"]; } else { $displayd = 'checked'; $displayh = ''; } $files_content = ""; //upload file for ($i=1;$i<=$num_of_files;$i++) { if ($id != "") { $sql = "SELECT * FROM `attachment` WHERE `table_name` = '".$page_tbname."' AND `table_id` = '".$id."' AND `col_name` = '".$col_name[$i]."'"; $rs = $db->query($sql); if (mysql_num_rows($rs) > 0) { $rowfile = $db->fetch_array($rs); ${"file".$i} = 'File name: '.$rowfile["real_name"].' Delete'; } } $files_content .= '