예제 #1
0
 public function view_positionListB()
 {
     //$state    = isset($_GET['state'])?post_check($_GET['state']):'';
     //$this->smarty->assign('state',$state);
     $position_arr = array();
     $PositionAct = new PositionAct();
     $position_info = $PositionAct->act_getPositionList("*", "where storeId=2");
     if (!empty($position_info)) {
         foreach ($position_info as $position) {
             $x = $position['x_alixs'];
             $y = $position['y_alixs'];
             $z = $position['z_alixs'];
             $f = $position['floor'];
             $position_arr["({$x},{$y},{$z},{$f})"] = $position['pName'];
         }
     }
     $this->smarty->assign('position_arr', $position_arr);
     $hang = 40;
     //一列行数
     $row_position_nums = 4;
     //一行仓位数
     $second_north_row = 6;
     //二楼北区列数
     //$second_south_row = 7;		//二楼南区列数
     //$third_row = 8;				//三楼南区列数
     //$distance = 10;				//南北区距离
     $distance_row = $row_position_nums + 1;
     //每列X坐标间隔数
     $this->smarty->assign('hang', $hang);
     $this->smarty->assign('row_position_nums', $row_position_nums);
     $this->smarty->assign('second_north_row', $second_north_row);
     //$this->smarty->assign('second_south_row', $second_south_row);
     //$this->smarty->assign('third_row', $third_row);
     //$this->smarty->assign('distance', $distance);
     $this->smarty->assign('distance_row', $distance_row);
     $navlist = array(array('url' => 'index.php?mod=warehouseManagement&act=whStore', 'title' => '仓位设置'), array('url' => 'index.php?mod=position&act=positionList', 'title' => 'B仓管理'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toptitle', 'B仓管理');
     $toplevel = 4;
     //一级菜单的序号  0 开始
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = "011";
     //当前的二级菜单
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('curusername', $_SESSION['userName']);
     $this->smarty->display('positionInfoB.htm');
 }
예제 #2
0
 function act_opisitionManage()
 {
     $data = array();
     $position_a = array();
     $position_d = array();
     $mark = true;
     $position = $_POST['position'];
     $x_alixs = $_POST['axis_x'];
     $y_alixs = $_POST['axis_y'];
     $floor = $_POST['floor'];
     $storeid = $_POST['storeid'];
     $storey = intval(trim($_POST['storey']));
     $position_a = explode('|', $position);
     foreach ($position_a as $po_a) {
         $position_d = explode(',', $po_a);
         $pname = trim($position_d[0]);
         if (!empty($pname)) {
             $lists = PositionModel::getPositionList("*", "where pName='{$pname}' and storeId={$storeid} and storey = '{$storey}'");
             if (!empty($lists)) {
                 $data = array('x_alixs' => $x_alixs, 'y_alixs' => $y_alixs, 'z_alixs' => $position_d[1], 'floor' => $floor, 'is_enable' => $position_d[2], 'type' => $position_d[3]);
                 if (!PositionModel::update($data, "and id='{$lists[0]['id']}'")) {
                     $mark = false;
                 }
             } else {
                 $list = PositionModel::getPositionList("*", "where x_alixs='{$x_alixs}' and y_alixs='{$y_alixs}' and z_alixs='{$position_d['1']}' and floor='{$floor}' and storeId={$storeid} and storey='{$storey}'");
                 if (!empty($list)) {
                     $data = array('pName' => $position_d[0], 'is_enable' => $position_d[2], 'type' => $position_d[3]);
                     if (!PositionModel::update($data, "and id='{$list[0]['id']}'")) {
                         $mark = false;
                     }
                 } else {
                     if (!empty($position_d[0])) {
                         $data = array('pName' => $position_d[0], 'x_alixs' => $x_alixs, 'y_alixs' => $y_alixs, 'z_alixs' => $position_d[1], 'floor' => $floor, 'is_enable' => $position_d[2], 'type' => $position_d[3], 'storeId' => $storeid, 'storey' => $storey);
                         if (!PositionModel::insertRow($data)) {
                             $mark = false;
                         }
                     }
                 }
             }
         }
     }
     if ($mark) {
         return true;
     } else {
         self::$errCode = "003";
         self::$errMsg = "更新失败,请重试!";
         return false;
     }
 }