Ejemplo n.º 1
0
 /**
  * 插入一条记录
  * @para $data as array
  * return insert_id
  */
 public static function insertRow($data)
 {
     self::initDB();
     $sql = array2sql($data);
     $sql = "INSERT INTO `" . self::$table . "` SET " . $sql;
     $query = self::$dbConn->query($sql);
     if ($query) {
         $insertId = self::$dbConn->insert_id();
         return $insertId;
     } else {
         self::$errCode = "003";
         self::$errMsg = "error";
         return false;
     }
 }
Ejemplo n.º 2
0
 function act_sureAddCon()
 {
     $data = array();
     $id = trim($_POST['conId']);
     $data['auditName'] = post_check(trim($_POST['auditName']));
     $data['auditValues'] = post_check(trim($_POST['auditValues']));
     $data['notes'] = post_check(trim($_POST['notes']));
     $is_enable = trim($_POST['is_enable']);
     if ($is_enable == 1) {
         $data['is_enable'] = 1;
     } else {
         $data['is_enable'] = 0;
     }
     if (empty($id)) {
         $insertid = InvConditionModel::insertRow($data);
         if ($insertid) {
             return true;
         } else {
             return false;
         }
     } else {
         $updatedata = InvConditionModel::update($data, "and id='{$id}'");
         if ($updatedata) {
             return true;
         } else {
             return false;
         }
     }
 }
Ejemplo n.º 3
0
 public function view_editConditon()
 {
     $id = intval($_GET['id']);
     $condition = InvConditionModel::getInvConditionList("*", "where id={$id}");
     $this->smarty->assign('condition', $condition);
     $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '仓库'), array('url' => 'index.php?mod=inventory&act=inventory', 'title' => '盘点管理'), array('url' => 'index.php?mod=inventory&act=invCondition', 'title' => '盘点审核条件列表'), array('url' => '', 'title' => '修改审核条件'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toptitle', '修改审核条件');
     $toplevel = 0;
     //一级菜单的序号  0 开始
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = 04;
     //当前的二级菜单
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('curusername', $_SESSION['userName']);
     $this->smarty->display('invConditionAdd.htm');
 }