Exemplo n.º 1
0
 public function view_whIoTypeSubmit()
 {
     if (!isset($_SESSION['userName'])) {
         header('Location:index.php?mod=login&act=login');
     }
     $whIoTypeArr = array();
     if ($_GET['type'] == 'add') {
         if (isset($_POST['typeCodeInput']) && !empty($_POST['typeCodeInput'])) {
             $whIoTypeArr[] = "typeCode = '" . trim($_POST['typeCodeInput']) . "'";
         }
         if (isset($_POST['typeNameInput']) && !empty($_POST['typeNameInput'])) {
             $whIoTypeArr[] = "typeName = '" . trim($_POST['typeNameInput']) . "'";
         }
         if (isset($_POST['ioTypeInput']) && !empty($_POST['ioTypeInput'])) {
             $whIoTypeArr[] = "ioType = '" . trim($_POST['ioTypeInput']) . "'";
         }
         if (isset($_POST['storeIdInput']) && !empty($_POST['storeIdInput'])) {
             $whIoTypeArr[] = "storeId = '" . trim($_POST['storeIdInput']) . "'";
         }
         $this->where = "SET " . implode(",", $whIoTypeArr);
     } else {
         if ($_GET['type'] == 'edit') {
             if (isset($_POST['typeCodeEdit']) && !empty($_POST['typeCodeEdit'])) {
                 $whIoTypeArr[] = "typeCode = '" . trim($_POST['typeCodeEdit']) . "'";
             }
             if (isset($_POST['typeNameEdit']) && !empty($_POST['typeNameEdit'])) {
                 $whIoTypeArr[] = "typeName = '" . trim($_POST['typeNameEdit']) . "'";
             }
             if (isset($_POST['ioTypeEdit'])) {
                 $whIoTypeArr[] = "ioType = '" . trim($_POST['ioTypeEdit']) . "'";
             }
             if (isset($_POST['storeIdEdit']) && !empty($_POST['storeIdEdit'])) {
                 $whIoTypeArr[] = "storeId = '" . trim($_POST['storeIdEdit']) . "'";
             }
             //echo "<pre>";print_r($whIoTypeArr);exit;
             $this->where = "SET " . implode(",", $whIoTypeArr) . " where id = " . trim($_POST['key_id']);
         }
     }
     $WarehouseManagement = new WarehouseManagementAct();
     $whIoTypeSubmitList = $WarehouseManagement->act_whIoTypeSubmit($this->where, $_GET['type']);
     if ($whIoTypeSubmitList) {
         header("location:index.php?mod=warehouseManagement&act=whIoTypeList");
     }
 }