Ejemplo n.º 1
0
 public function view_whIoInvoicesTypeSubmit()
 {
     $whIoInvoicesTypeArr = array();
     if ($_GET['type'] == 'add') {
         if (isset($_POST['invoiceNameInput']) && !empty($_POST['invoiceNameInput'])) {
             $whIoInvoicesTypeArr[] = "invoiceName = '" . trim($_POST['invoiceNameInput']) . "'";
         }
         if (isset($_POST['ioTypeIdInput']) && !empty($_POST['ioTypeIdInput'])) {
             $whIoInvoicesTypeArr[] = "ioTypeId = '" . trim($_POST['ioTypeIdInput']) . "'";
         }
         if (isset($_POST['storeIdInput']) && !empty($_POST['storeIdInput'])) {
             $whIoInvoicesTypeArr[] = "storeId = '" . trim($_POST['storeIdInput']) . "'";
         }
         if (isset($_POST['noteInput']) && !empty($_POST['noteInput'])) {
             $whIoInvoicesTypeArr[] = "note = '" . trim($_POST['noteInput']) . "'";
         }
         $whIoInvoicesTypeArr[] = "ioType  = '" . trim($_POST['ioTypeInput']) . "'";
         $this->where = "SET " . implode(",", $whIoInvoicesTypeArr);
     } else {
         if ($_GET['type'] == 'edit') {
             if (isset($_POST['invoiceNameEdit']) && !empty($_POST['invoiceNameEdit'])) {
                 $whIoInvoicesTypeArr[] = "invoiceName = '" . trim($_POST['invoiceNameEdit']) . "'";
             }
             if (isset($_POST['ioTypeIdEdit']) && !empty($_POST['ioTypeIdEdit'])) {
                 $whIoInvoicesTypeArr[] = "ioTypeId = '" . trim($_POST['ioTypeIdEdit']) . "'";
             }
             if (isset($_POST['storeIdEdit']) && !empty($_POST['storeIdEdit'])) {
                 $whIoInvoicesTypeArr[] = "storeId = '" . trim($_POST['storeIdEdit']) . "'";
             }
             $whIoInvoicesTypeArr[] = "ioType  = '" . trim($_POST['ioTypeEdit']) . "'";
             $whIoInvoicesTypeArr[] = "note = '" . trim($_POST['noteEdit']) . "'";
             $this->where = "SET " . implode(",", $whIoInvoicesTypeArr) . " where id = " . trim($_POST['key_id']);
         }
     }
     $WarehouseManagement = new WarehouseManagementAct();
     $whIoInvoicesTypeSubmitList = $WarehouseManagement->act_whIoInvoicesTypeSubmit($this->where, $_GET['type']);
     if ($whIoInvoicesTypeSubmitList) {
         header("location:index.php?mod=warehouseManagement&act=whIoInvoicesTypeList");
     }
 }