Esempio n. 1
0
 public static function changeCategory($condition, $category)
 {
     self::initDB();
     $sql = "UPDATE `qc_category_type_relation` SET sampleTypeId={$category} WHERE path like '{$condition}'";
     //echo $sql;
     $query = self::$dbConn->query($sql);
     if ($query) {
         //$ret =self::$dbConn->fetch_array_all($query);
         return true;
     } else {
         self::$errCode = "003";
         self::$errMsg = "444444444";
         return false;
         //失败则设置错误码和错误信息, 返回false
     }
 }
Esempio n. 2
0
 function act_getSampleTypeName($path)
 {
     $reDataArr = array();
     $whereStr = " where path = '{$path}' AND is_delete != 1 ";
     $selectStr = "`path`,`sampleTypeId`";
     $sampleTypeIdArr = qcCategoryListModel::getCategoryList($selectStr, $whereStr);
     if (empty($sampleTypeIdArr)) {
         return false;
     }
     $whereStr2 = " where id = {$sampleTypeIdArr[0]['sampleTypeId']} ";
     $qcStandardModel = new qcStandardModel();
     $listArr = $qcStandardModel->skuTypeQcList($whereStr2);
     if (empty($listArr)) {
         return false;
     } else {
         $reDataArr[$sampleTypeIdArr[0]['sampleTypeId']] = $listArr[0]['typeName'] . "-" . $listArr[0]['describe'];
         return $reDataArr;
     }
 }
Esempio n. 3
0
 public function view_skuCategoryList()
 {
     if (!isset($_SESSION['userName'])) {
         header('Location:index.php?mod=login&act=index');
     }
     require_once WEB_PATH . "lib/Tree.class.php";
     //调用action层, 获取列表数据
     /*$OmAvailableApiAct   = new OmAvailableApiAct();
     		$skuTypeQcArrList  	 = $OmAvailableApiAct->act_getCategoryInfoAll();*/
     $qcCategoryListAct = new qcCategoryListAct();
     $condition = isset($_GET['condition']) ? trim($_GET['condition']) : "";
     if ($condition != "") {
         $info = "and path like '{$condition}'";
     } else {
         $info = "";
     }
     $where = "WHERE is_delete=0 {$info} ";
     $total = $qcCategoryListAct->act_getCategoryListNum($where);
     $num = 100;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= "ORDER BY path ";
     $where .= $page->limit;
     $qcStandard = new qcStandardAct();
     $skuTypeQcArrList = $qcStandard->act_skuTypeQcList($this->where);
     $sampleTypeList = array();
     foreach ($skuTypeQcArrList as $skuTypeQcArrListValue) {
         $sampleTypeList[$skuTypeQcArrListValue['id']] = $skuTypeQcArrListValue['typeName'];
     }
     $categoryList = $qcCategoryListAct->act_getCategoryList('*', $where);
     /*$menu = new Tree();
     		$menu->icon = array('', '', '');
     		$menu->nbsp = '   ';
     		foreach ($categoryList as $n => $t) {
     			$result[$n]['checked'] = '';//($this->is_checked($t, $roleid, $priv_data)) ? ' checked' : '';
     			$result[$n]['level'] = $t['file'];
     			$result[$n]['parentid'] = $t['pid'] ? $t['pid'] : 0;
     			$result[$n]['id'] = $t['id'];
     			$result[$n]['name'] = $t['name'];
     			$result[$n]['sampleTypeId'] = $t['sampleTypeId'];
     			$result[$n]['sampleType'] = isset($sampleTypeList[$t['sampleTypeId']]) ? $sampleTypeList[$t['sampleTypeId']] : '';
     			$result[$n]['parentid_node'] = ($t['pid']) ? ' class="child-of-node-' . $t['pid'] . '"' : '';
     		}
     		$str = "<tr data-tt-id='\$id' \$parentid_node>
     				   <td style='padding-left:30px;'>\$name</td>
     				   <td style='padding-left:30px;'>\$level</td>
     				   <td> ".tep_selectHTML_show($sampleTypeList, 'choiceSampleType_\$id', '\$sampleTypeId')."
     				   </td>
     				   <td style='padding-left:30px;'>\$sampleType</td>
     				</tr>";
     		$str = "<tr id='node-\$id' \$parentid_node>
                                <td style='padding-left:30px;'  align='left'>\$spacer \$name</td>
     						   <td>
     						   		<a class='btn' href='__URL__/add?id={\$id}' target='_blank'><i class='icon-plus'></i></a>
     						   		<a class='btn' href='__URL__/edit?id={\$id}'><i class='icon-pencil'></i></a>
     						   		<a class='btn' href='__URL__/delete?id={\$id}'><i class='icon-trash'></i></a>
     						   </td>
     	    </tr>";
     		$menu->init($result);
     		$categoryList = $menu->get_tree(0, $str);*/
     //'<i class="icon-plus"></i>'
     //var_dump($categoryList);
     if (!empty($_GET['page'])) {
         if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) {
             $n = 1;
         } else {
             $n = (intval($_GET['page']) - 1) * $num + 1;
         }
     } else {
         $n = 1;
     }
     if ($total > $num) {
         //输出分页显示
         $show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $show_page = $page->fpage(array(0, 2, 3));
     }
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('sampleTypeList', $sampleTypeList);
     //print_r($sampleTypeList);
     //二级导航
     $this->smarty->assign('secnev', '4');
     $this->smarty->assign('module', '产品分类列表');
     $this->smarty->assign('username', $_SESSION['userName']);
     $navarr = array("<a href='index.php?mod=nowSampleStandard&act=nowSampleType'>QC检测标准</a>", ">>", "产品分类列表");
     $this->smarty->assign('navarr', $navarr);
     $category1 = qcCategoryListModel::getCategory1();
     $this->smarty->assign("category1", $category1);
     $this->smarty->assign('categoryList', $categoryList);
     $this->smarty->display('qcCategoryList.htm');
 }