コード例 #1
0
             throw new Exception('Can not insert location: ZIP or STATE is missing', __LINE__);
         }
     }
     if ($lo) {
         $lo->l_facility = addslashes(htmlspecialchars(strip_tags($loco->facility)));
         $lo->l_city = addslashes($loco->city);
         $lo->l_state = addslashes($loco->state);
         $lo->l_commu2 = addslashes($loco->commu2);
         $lo->l_inderserved = $loco->underserved ? 1 : 0;
         $descr = addslashes("{$loco->description}");
         $lo->l_description = $descr;
         $commdescr = addslashes("{$loco->commdescr}");
         $lo->l_commdescr = $commdescr;
         $progress .= ' updating...';
         if (!$testrun) {
             $lo->save();
         }
         // testrun
     }
     // lo
     $progress .= ' Done!<br>';
 } catch (Exception $e) {
     if ($testrun) {
         $progress .= " TEST FAILED: " . $e->getMessage() . ' (' . $e->getCode() . ')<br>';
         $mesg = "Errors detected: see below";
         $result = 0;
     } else {
         $progress .= " PROBLEM RECORD: " . $e->getMessage() . ' (' . $e->getCode() . ')<br>';
         $mesg = "Errors detected: see below";
         $result = 0;
     }
コード例 #2
0
     		$locations->l_school = $l_school;*/
     $l_commu2 = '';
     if (isset($l_commu2_1)) {
         $l_commu2 .= $l_commu2_1;
     }
     if (isset($l_commu2_2)) {
         $l_commu2 .= ($l_commu2 ? ',' : '') . $l_commu2_2;
     }
     if (isset($l_commu2_3)) {
         $l_commu2 .= ($l_commu2 ? ',' : '') . $l_commu2_3;
     }
     $locations->l_commu2 = $l_commu2;
     // 2!!!
     $locations->l_description = $l_description;
     $locations->l_commdescr = $l_commdescr;
     $locations->save();
 } elseif ($_REQUEST['view_pic']) {
     $locations = new PCLocation($db, $l_id);
     $nom = intval($_REQUEST['view_pic']) - 1;
     $locations->showpic($nom);
     exit;
 } elseif ($_REQUEST['action'] === 'update') {
     // return from the picture upload form
     $next = true;
     $locations = new PCLocation($db, $l_id);
 }
 // all pre-processing done
 if ($_POST['upload_pic_0'] || $_POST['upload_pic_1'] || $_POST['upload_pic_2'] || $_POST['upload_pic_3'] || $_POST['upload_pic_4']) {
     if (!isset($locations)) {
         $locations = new PCLocation($db, $l_id);
     }