if (isset($_POST['Training_Plan_ID'])) { $tp->setValue('planid', $_POST['Training_Plan_ID']); $tpid = $_POST['Training_Plan_ID']; } else { $tpid = ''; } if (isset($_POST['pimg'])) { $pimg = $_POST['pimg']; } $tp->saveTrainingPlan(); if ($tpid == '') { $tpid = $tp->getValue('planid'); } if (isset($pimg)) { if ($pimg != '') { $tp->delGeninfo($pimg); } } /** if($_FILES['opimg']['size'][0]>0) ///if there are preview files uploaded with message { ///put all files held in $_FILE[mfile] in to a new array $new_arr $new_arr = array(); $files = $_FILES['opimg']; $num = count($files["name"]); for ($i=0; $i<$num ; $i++) { $new_arr[$i] = array(); } foreach ($files as $key => $row)