require_once("../../common.inc.php"); function nl2br_revert($string) { return preg_replace('`([\\n\\r])`', '$1', $string); } // page variable name $page_field = "services"; include("config.php"); getget(); //upload number of file define $num_of_files = 5; $attachment_text=array( "-----", "Detail Photo 1", "Detail Photo 2", "Detail Photo 3", "Detail Photo 4", "Detail Photo 5", "Detail Photo 6", "Detail Photo 7", "Detail Photo 8", "Detail Photo 9", "Detail Photo 10" ); $col_name=array( "-----", "detailphoto1", "detailphoto2", "detailphoto3", "detailphoto4", "detailphoto5", "detailphoto6", "detailphoto7", "detailphoto8", "detailphoto9", "detailphoto10" ); //initial if (empty($id)) { $id = ""; $temp_id = md5(uniqid(time())); } if (empty($page)) { $page = "1"; } $sorting = ""; $display = ""; $itemno = ""; $name = ""; $ebrandname =""; $e_txtareadesc = ""; //Load data if ($id != "") { $sql = "SELECT * FROM `".$page_tbname."` WHERE `id` = '$id'"; $row = $db->getrow($sql); $sorting = $row["sorting"]; if ($row["status"] == 1) { $displayd = 'checked'; $displayh = ''; } else { $displayd = ''; $displayh = 'checked'; } $date = $row["date"]; $cate_id = $row["cate_id"]; //en $e_title = htmlspecialchars($row["e_title"]); $e_summary = htmlspecialchars($row["e_summary"]); $e_content = $row["e_content"]; //sc $sc_title = htmlspecialchars($row["sc_title"]); $sc_summary = htmlspecialchars($row["sc_summary"]); $sc_content = $row["sc_content"]; //zh $zh_title = htmlspecialchars($row["zh_title"]); $zh_summary = htmlspecialchars($row["zh_summary"]); $zh_content = $row["zh_content"]; $services_type_list = ""; $sql = "SELECT * FROM services_categories"; $rs = $db->query($sql); while($row=$db->fetch_array($rs)){ $services_type_list .= ''; } } else { //echo "hihi"; $displayd = 'checked'; $displayh = ''; $date = date('Y-m-d'); $services_type_list = ""; $sql = "SELECT * FROM services_categories"; $rs = $db->query($sql); while($row=$db->fetch_array($rs)){ $services_type_list .= ''; } } $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 .= ' '.$attachment_text[$i].' '; if ($id != "") { $files_content .= ${"file".$i}; } $files_content .= ' '; } ?> Smartinfo CMS =$section_name;?> > =$page_title;?> > if ($id != "") echo "Modify"; else echo "Add";?> Common Information Show > Show > Hidden Sorting Services Type Please select an option =$services_type_list;?> News Information Title Summary =$e_summary?> Content =$e_content?> News Information (簡体中文) Title (簡体中文) Summary =$sc_summary?> Content (簡体中文) =$sc_content?> News Information (繁體中文) Title (繁體中文) Summary =$zh_summary?> Content (繁體中文) =$zh_content?> =$files_content?>