Exemplo n.º 1
0
     $videoName = $_FILES['video']['name'];
     //echo $videoName  ;
     echo $_FILES['picture']['tmp_name'];
     echo USER_UPLOAD_PATH . $videoName;
     if (move_uploaded_file($_FILES['video']['tmp_name'], USER_UPLOAD_PATH . $videoName)) {
         $valArray['video'] = $videoName;
         echo "file sent";
     } else {
         echo "file not sent";
     }
     $savenewtest = $adminObj->insertMealIteams($valArray);
 }
 unset($_REQUEST['savenewtype']);
 if (isset($_REQUEST['editmealitem'])) {
     $id = $_REQUEST['editmealitem'];
     $getmealiteamsbyid = $adminObj->editMealIteams($id);
     $mealtype = $adminObj->selectMealType();
     $smarty->assign("mealtype", $mealtype);
     $smarty->assign("tdata", $getmealiteamsbyid);
     $smarty->display('file:[admin]mealitemedit.tpl');
     die;
 }
 if (isset($_REQUEST['saveeditmealitem'])) {
     $valArray['id'] = $_REQUEST['id'];
     $valArray['mealtype_id'] = $_REQUEST['mealtype'];
     $valArray['title'] = $_REQUEST['title'];
     $valArray['description'] = $_REQUEST['description'];
     $pictureName = $_FILES['picture']['name'];
     if (move_uploaded_file($_FILES['picture']['tmp_name'], USER_UPLOAD_PATH . $pictureName)) {
         $valArray['picture'] = $pictureName;
         echo "file sent";