Ejemplo n.º 1
0
         }
     }
     if ($_POST['quantity'] != "" && $_POST['itemid'] != "0" && !preg_match("/^[0-9]+\$/", $_POST['quantity']) || $_POST[$itmqty] != "" && !preg_match("/^[0-9]+\$/", $_POST[$itmqty])) {
         $fv->addErrormsg($_L['INV_validqty_err']);
     }
     if ($_POST['quantity'] != "" && $_POST['itemid'] != "0" && preg_match("/^[0-9]+\$/", $_POST['quantity'])) {
         if ($_POST['quantity'] <= 0) {
             $fv->addErrormsg($_L['INV_qtygrtz_err']);
         }
     } elseif ($_POST[$itmqty] != "" && preg_match("/^[0-9]+\$/", $_POST[$itmqty])) {
         if ($_POST[$itmqty] <= 0) {
             $fv->addErrormsg($_L['INV_qtygrtz_err']);
         }
     }
 } elseif (isset($_POST['itemid']) && $_POST['itemid'] != "0") {
     $fv->EmptyCheck('std_amount', $_L['INV_nostdamnt_err']);
     $fv->EmptyCheck('quantity', $_L['INV_noqty_err']);
     if ($_POST['std_amount'] != "" && !preg_match("/^[0-9]*(\\.[0-9]+)?+\$/", $_POST['std_amount'])) {
         $fv->addErrormsg($_L['INV_validstdamnt_err']);
     }
     if ($_POST['amount'] != "" && !preg_match("/^[0-9]*(\\.[0-9]+)?+\$/", $_POST['amount'])) {
         $fv->addErrormsg($_L['INV_validamnt_err']);
     }
     if ($_POST['std_amount'] != "" && preg_match("/^[0-9]*(\\.[0-9]+)?+\$/", $_POST['std_amount'])) {
         if ($_POST['std_amount'] <= 0) {
             $fv->addErrormsg($_L['INV_stdamntgrtz_err']);
         }
     }
     if ($_POST['amount'] != "" && preg_match("/^[0-9]*(\\.[0-9]+)?+\$/", $_POST['amount'])) {
         if ($_POST['amount'] <= 0) {
             $fv->addErrormsg($_L['INV_amntgrtz_err']);
Ejemplo n.º 2
0
$outfile = "hoteldescription.txt";
$validationMsgs = "";
if (isset($_POST['Submit'])) {
    $action = $_POST['Submit'];
    switch ($action) {
        case $_L['HWS_btn_updatedec']:
            $data = $_POST[hoteldesc];
            $fh = fopen($outfile, 'w');
            fwrite($fh, $data);
            fclose($fh);
            break;
        case $_L['HWS_addimg']:
            // instantiate form validator object
            $fv = new formValidator();
            //from functions.php
            $fv->EmptyCheck('imgurl', $_L['HWS_err_imgurl']);
            if ($fv->checkErrors()) {
                // display errors
                $validationMsgs = "<div align=\"left\"><h2>" . $_L['PR_formerr'] . "</h2>" . $fv->displayErrors() . "</div>";
            } else {
                $hoteldesc = $_POST["hoteldesc"];
                $imgtitle = $_POST["imgtitle"];
                $imgurl = $_POST["imgurl"];
                $imgdesc = $_POST["imgdesc"];
                $imgpg = $_POST["imgpage"];
                $isvideo = $_POST["isvideo"];
                $picid = modify_hotelgallery($picid, $imgtitle, $imgurl, $imgdesc, $imgpg, $isvideo);
            }
            break;
        case $_L['BTN_delete']:
            if (isset($_POST['deleteImg'])) {