Example #1
0
                 $new_filename = $ad_id . "_".time()."." . $new_ext;
                 $file = '../media/tmp/' . $filename;
                 $newfile = '../media/advisor/' . $new_filename;
                 
                 if (!copy($file, $newfile)) {
                     echo "failed to copy $file...\n" . $file . " to " . $newfile . "  and  ";
                     
                     @unlink("../media/tmp/" . $filename);
                     $data['picture'] = "no";
                 } 
                 else {
                     $data['picture'] = $new_filename;
                     @unlink("../media/tmp/" . $filename);
                 }
     }
     $m_advisor->update_advisor($data,$ad_id);
     ?>
     <script type="text/javascript">
     window.open("./advisor_list.php","_self");
     </script>
     <?
 }else{
     $ad_id=$m_advisor->generate_id();
     $data = array(
         'id' => $ad_id, 
         'title' => $_POST['title'], 
         'name' => $_POST['name'], 
         'Position' => $_POST['Position'], 
         'title_en' => $_POST['title_en'], 
         'name_en' => $_POST['name_en'], 
         'Position_en' => $_POST['Position_en'], 
Example #2
0
<?
require_once("../model/m_advisor.php");
$m_advisor = new M_advisor;
$edit=false;
$advisor=null;
$count=0;
foreach ($_POST['id'] as $key => $value) {
	$count+=1;
	$data = array('sort_order' => $count);
	$m_advisor->update_advisor($data,$value);
	echo $count."<br>";
}
?>