Ejemplo n.º 1
0
                     @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'], 
         );
     if ($_POST['file_path']!="") {
         $filename = $_POST['file_path'];
                 $ext = explode(".", $filename);
                 $new_ext = $ext[count($ext) - 1];
                 $new_filename = $ad_id . "_".time()."." . $new_ext;
                 $file = '../media/tmp/' . $filename;