Example #1
0
 public function indexAction()
 {
     $categoryObj = new CategoryModel();
     $list = $categoryObj->getCategoryList();
     var_dump($list);
     // 		exit;
 }
    function content_52663c55b72394_37986392($_smarty_tpl)
    {
        echo $_smarty_tpl->getSubTemplate("header.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<script type="text/javascript" src="./js/goodslist.js"></script>
<div class="fourvar">
            	<div class="pathvar">
                <?php 
        echo $_smarty_tpl->getSubTemplate('pcNav.htm', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

                </div>
            </div>
			<div class="servar products-servar">
			<span style="color: red;" id="error"><?php 
        echo $_GET['status'];
        ?>
</span>
            </div>
            <div class="main feedback-main">
					<table class="products-action" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
                            <td>SPU:
                            <input value="<?php 
        echo $_smarty_tpl->tpl_vars['spu']->value;
        ?>
" disabled="disabled"/>
							<input name="spu" id="spu" value="<?php 
        echo $_smarty_tpl->tpl_vars['spu']->value;
        ?>
" type="hidden"/>
							</td>
						</tr>
                        <tr>
                           	    <td>
                                    类别:
									<select name="sku_category" id="pid_one" onchange="select_one();">
										<option value="0">请选择</option>
										<?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = CategoryModel::getCategoryList('*', "where is_delete=0 and pid=0");
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
										<option value="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['name'];
            ?>
</option>
										<?php 
        }
        ?>
									</select>
									<span align="left" id="div_two" style="width:auto; display:none"></span>
									<span align="left" id="div_three" style="width:auto; display:none"></span>
									<span align="left" id="div_four" style="width:auto; display:none"></span>
								</td>
						</tr>
                        <tr>
                            <td><input type="button" value="提交" id="editAutoCreateSpu"/>
							<input type="button" value="返回" id="back"/></td>
						</tr>
					</table>
            </div>
            <div class="bottomvar">
            	<div class="texvar">

            	</div>
            	<div class="pagination">
            	</div>
            </div>
<?php 
        echo $_smarty_tpl->getSubTemplate("footer.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
    }
    function content_526616b983b8b3_14494234($_smarty_tpl)
    {
        echo $_smarty_tpl->getSubTemplate("header.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<script type="text/javascript" src="./js/fancyBox/source/jquery.fancybox.js?v=2.1.3"></script>
<link rel="stylesheet" type="text/css" href="./js/fancyBox/source/jquery.fancybox.css?v=2.1.2" media="screen" />
<script type="text/javascript" src="./js/goodslist.js"></script>
<div class="fourvar">
            	<div class="pathvar">
                <?php 
        echo $_smarty_tpl->getSubTemplate('pcNav.htm', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

                </div>
                <div class="texvar">
                </div>
                <div class="pagination">
                <?php 
        echo $_smarty_tpl->tpl_vars['show_page']->value;
        ?>

                </div>
            </div>
			<div class="servar products-servar">
								  <span>查找:
								   <input name="seachdata" type="text" id="seachdata" value="<?php 
        echo $_GET['seachdata'];
        ?>
"/>
								   <select name="searchs" id="searchs" >
									<option value="1" <?php 
        if ($_GET['searchs'] == 1) {
            ?>
selected='selected'<?php 
        }
        ?>
>SPU</option>
									<option value="2" <?php 
        if ($_GET['searchs'] == 2) {
            ?>
selected='selected'<?php 
        }
        ?>
>SKU</option>
								  </select>
								   </span>
								   <span>新/老品:
								   <select name="isNew" id="isNew" >
								    <option value="0" ></option>
									<option value="1" <?php 
        if ($_GET['isNew'] == 1) {
            ?>
selected='selected'<?php 
        }
        ?>
>新品</option>
									<option value="2" <?php 
        if ($_GET['isNew'] == 2) {
            ?>
selected='selected'<?php 
        }
        ?>
>老品</option>
								  </select>
								   </span>
                                   <span>采购员:
								   <select name="purchaseId" id="purchaseId" >
								    <option value="0" > </option>
								    <?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = Auth::getApiPurchaseUsers();
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
									<option value="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['userId'];
            ?>
" <?php 
            if ($_GET['purchaseId'] == $_smarty_tpl->tpl_vars['value']->value['userId']) {
                ?>
selected='selected'<?php 
            }
            ?>
><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['userName'];
            ?>
</option>
									<?php 
        }
        ?>
								  </select>
								   </span>
								<span>类别&nbsp;&nbsp;
									<select name="sku_category" id="pid_one" onchange="select_one();">
										<option value="0"></option>
										<?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = CategoryModel::getCategoryList('*', "where is_delete=0 and pid=0");
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
										<option value="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['name'];
            ?>
</option>
										<?php 
        }
        ?>
									</select>
									<span align="left" id="div_two" style="width:auto; display:none"></span>
									<span align="left" id="div_three" style="width:auto; display:none"></span>
									<span align="left" id="div_four" style="width:auto; display:none"></span>
								</span>
                                   <span><button id='seachGoods'/>搜索</button></span>
                                   &nbsp;
                                   <?php 
        if ($_smarty_tpl->tpl_vars['categorySearch']->value != '') {
            ?>
                                   <span style="color: green;">上次您搜索的类别为:<?php 
            echo $_smarty_tpl->tpl_vars['categorySearch']->value;
            ?>
</span>
                                   <?php 
        }
        ?>
                                   <span style="color: red;" id="error"><?php 
        echo $_GET['status'];
        ?>
</span>
            </div>
            <div class="main feedback-main">
            	<table class="products-action" cellspacing="0" width="100%">
                   <tr class="title">
					    <td>产品图片</td>
                        <td width="25%">产品名称</td>
                        <td>SPU</td>
                        <td>SKU</td>
						<td>产品类别</td>
						<td>产品成本</td>
						<td>包材</td>
						<td>重量</td>
						<td>采购负责人</td>
						<td>新/老品</td>
                        <td>供应商</td>
						<td>操作</td>
                    </tr>
                    <?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['productList']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
                                <tr id="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
">
									<td>
									<a class="fancybox" href="http://192.168.200.200:9998/imgs/<?php 
            echo get_sku_imgName($_smarty_tpl->tpl_vars['value']->value['sku']);
            ?>
-G.jpg" target="_blank">
									<img  src="http://192.168.200.200:9998/imgs/<?php 
            echo get_sku_imgName($_smarty_tpl->tpl_vars['value']->value['sku']);
            ?>
-G_thumnail.jpg" width="50" height="50" style="border-style:solid;border-width:0" />
									</a>
									</td>
                                    <td><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['goodsName'];
            ?>
</td>
                                    <td><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['spu'];
            ?>
</td>
                                    <td><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['sku'];
            ?>
</td>
									<td><?php 
            echo getAllCateNameByPath($_smarty_tpl->tpl_vars['value']->value['goodsCategory']);
            ?>
</td>
									<td><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['goodsCost'];
            ?>
</td>
									<td><?php 
            echo PackingMaterialsModel::getPmNameById($_smarty_tpl->tpl_vars['value']->value['pmId']);
            ?>
</td>
									<td><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['goodsWeight'];
            ?>
</td>
									<td><?php 
            echo getPersonNameById($_smarty_tpl->tpl_vars['value']->value['purchaseId']);
            ?>
</td>
									<td><?php 
            if ($_smarty_tpl->tpl_vars['value']->value['isNew'] == 0) {
                ?>
老品<?php 
            } else {
                ?>
新品<?php 
            }
            ?>
</td>
                                    <td><?php 
            echo OmAvailableModel::getParterNameBySku($_smarty_tpl->tpl_vars['value']->value['sku']);
            ?>
</td>
									<td>
									<input type="button" value="修改" tid="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
" class="mod"/>
									<input type="button" value="删除" tid="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
" class="del"/>
									</td>
                                </tr>
                                <?php 
        }
        ?>
                </table>
            </div>
            <div class="bottomvar">
            	<div class="texvar">

            	</div>
            	<div class="pagination">
					<?php 
        echo $_smarty_tpl->tpl_vars['show_page']->value;
        ?>

            	</div>
            </div>
<?php 
        echo $_smarty_tpl->getSubTemplate("footer.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<script type="text/javascript">
		$(document).ready(function() {
			$(".fancybox").fancybox({
				helpers: {
					title : {
						type : 'outside'
					},
					overlay : {
						speedOut : 0
					}
				}
			});

		});
</script><?php 
    }
Example #4
0
 function act_goodsAddXlsSave()
 {
     $uploadfile = date("Y") . date("m") . date("d") . rand(1, 3009) . ".xls";
     if ($_FILES['upfile']['tmp_name'] == '') {
         echo "请选择上传的excel文件";
         exit;
     }
     if (move_uploaded_file($_FILES['upfile']['tmp_name'], './upload/' . $uploadfile)) {
         echo "<font color=BLUE>文件上传成功!</font><br>";
     } else {
         echo "<font color=red> 文件上传失败!</font><br>";
     }
     echo $uploadfile;
     $fileName = 'upload/' . $uploadfile;
     $filePath = $fileName;
     $username = $_SESSION['userName'];
     $userId = $_SESSION['userId'];
     $stockdetailpower = UserModel::getUserPower($userId);
     $stockdetailpower = explode(',', $stockdetailpower[0]['powerName']);
     $PHPExcel = new PHPExcel();
     $PHPReader = new PHPExcel_Reader_Excel2007();
     if (!$PHPReader->canRead($filePath)) {
         $PHPReader = new PHPExcel_Reader_Excel5();
         if (!$PHPReader->canRead($filePath)) {
             echo 'no Excel';
             return;
         }
     }
     $PHPExcel = $PHPReader->load($filePath);
     $currentSheet = $PHPExcel->getSheet(0);
     $allRow = $currentSheet->getHighestRow();
     for ($c = 2; $c <= $allRow; $c++) {
         $data = array();
         $nowtime = time();
         $storeid = '';
         $aa = 'A' . $c;
         $bb = 'B' . $c;
         $cc = 'C' . $c;
         $dd = 'D' . $c;
         $ee = 'E' . $c;
         $ff = 'F' . $c;
         $gg = 'G' . $c;
         $hh = 'H' . $c;
         $ii = 'I' . $c;
         $jj = 'J' . $c;
         $kk = 'K' . $c;
         $ll = 'L' . $c;
         $mm = 'M' . $c;
         $nn = 'N' . $c;
         $oo = 'O' . $c;
         $pp = 'P' . $c;
         $qq = 'Q' . $c;
         $rr = 'R' . $c;
         $ss = 'S' . $c;
         $tt = 'T' . $c;
         $sku = post_check(trim($currentSheet->getCell($bb)->getValue()));
         if (!preg_match("/^[A-Z0-9]+(_[A-Z0-9]+)*\$/", $sku)) {
             if ($sku != '') {
                 echo "数据料号:<font color='#FF0000'>" . $sku . "</font>书写不规范,请认真检查再提交...";
                 exit;
             }
         }
         //检测是否导入完成
         if (empty($sku)) {
             $mask++;
             if ($mask > 9) {
                 break;
             }
             continue;
         } else {
             $mask = 1;
         }
         // 过滤下数据
         $goodsCost = trim($currentSheet->getCell($dd)->getValue());
         $goodsWeight = trim($currentSheet->getCell($ff)->getValue());
         if (!preg_match("/[\\d]/", $goodsCost) && $goodsCost != '') {
             echo "货品成本数据有误";
             exit;
         } else {
             if (!preg_match("/[\\d]/", $goodsWeight) && $goodsWeight != '') {
                 echo "货品重量数据有误";
                 exit;
             }
         }
         $spu = post_check(trim($currentSheet->getCell($aa)->getValue()));
         $goodsName = post_check(trim($currentSheet->getCell($cc)->getValue()));
         $goodsCost = empty($goodsCost) ? 0 : round_num($goodsCost, 2);
         //仓位号
         $goods_location = post_check(trim($currentSheet->getCell($ee)->getValue()));
         $goodsWeight = empty($goodsWeight) ? 0 : number_format($goodsWeight, 3, '.', '');
         $goodsNote = post_check(trim($currentSheet->getCell($gg)->getValue()));
         $goodsDecNameByEN = post_check(trim($currentSheet->getCell($hh)->getValue()));
         $goodsCustomsCode = post_check(trim($currentSheet->getCell($ii)->getValue()));
         $goodsDecNameByCN = post_check(trim($currentSheet->getCell($jj)->getValue()));
         $goodsDecWorth = post_check(trim($currentSheet->getCell($kk)->getValue()));
         $goodsLength = post_check(trim($currentSheet->getCell($ll)->getValue()));
         $goodsWidth = post_check(trim($currentSheet->getCell($mm)->getValue()));
         $goodsHeight = post_check(trim($currentSheet->getCell($nn)->getValue()));
         //类别
         $goods_categoryname = post_check(trim($currentSheet->getCell($oo)->getValue()));
         $pid_name = post_check(trim($currentSheet->getCell($pp)->getValue()));
         //仓库
         $warehouseName = post_check(trim($currentSheet->getCell($qq)->getValue()));
         //采购员
         $purchaseName = post_check(trim($currentSheet->getCell($rr)->getValue()));
         //包装材料
         $packingmaterial = post_check(trim($currentSheet->getCell($ss)->getValue()));
         //供应商
         $capacity = post_check(trim($currentSheet->getCell($tt)->getValue()));
         if ($goodsLength == '') {
             $goodsLength = 0;
         }
         if ($goodsWidth == '') {
             $goodsWidth = 0;
         }
         if ($goodsHeight == '') {
             $goodsHeight = 0;
         }
         $spu = strpos($spu, '_') === false ? str_pad($spu, 3, '0', STR_PAD_LEFT) : $spu;
         $sku = strpos($sku, '_') === false ? str_pad($sku, 3, '0', STR_PAD_LEFT) : $sku;
         //	if($department != '采购部' && $spu !=''){
         //		echo "<br/>非采购部人员不能导入或修改spu的值";
         //		exit();
         //	}
         /* 仓库对应的IDfactory */
         if (!empty($warehouseName)) {
             /*
             $wh 	 = RelationModel::getWarehouse("and warehouseName='{$warehouseName}'");
             var_dump($wh);die; 
             $storeid = $wh[0]['id'];
             */
             $storeid = 1;
         }
         /* 货品类别 */
         if (!empty($goods_categoryname) && !empty($pid_name)) {
             $pcate = CategoryModel::getCategoryList("id", "where name='{$pid_name}'");
             if ($pcate) {
                 $cate = CategoryModel::getCategoryList("path", "where pid='{$pcate[0]['id']}' and name='{$goods_categoryname}'");
                 if ($cate) {
                     $goodsCategory = $cate[0]['path'];
                 } else {
                     echo "<br/>第<font color='red'>{$c}</font>条记录中<font color='orange'>货品类别或父类有误,</font>请检查后再提交...<br/>";
                     exit;
                 }
             } else {
                 echo "<br/>第<font color='red'>{$c}</font>条记录中<font color='orange'>货品类别或父类有误,</font>请检查后再提交...<br/>";
                 exit;
             }
             //$goodsCategory = "1-3-5";               //调用类别接口获取类别id
         }
         if ($purchaseName == "") {
             echo "有部分数据没填采购名字,请认真检查再提交...";
             exit;
         } else {
             $purchaseId = 1;
             //需调用接口获取采购员id
         }
         /*
         需要调接口获取用户部门
         if($department == '采购部' && trim($goodsCategory) == ''){//采购部人员操作时,导入货品类别不能为空
         	echo "有部分数据没填货品类别,请认真检查再提交...";
         	exit();
         }
         */
         //统计供应商id
         if (!empty($capacity)) {
             $capacity_a = array();
             $capacity_a = array_filter(explode(',', $capacity));
             $capacityid = 1;
             //调用供应商接口获取id
         }
         $data = array('goodsName' => $goodsName, 'goodsDecNameByEN' => $goodsDecNameByEN, 'goodsDecNameByCN' => $goodsDecNameByCN, 'spu' => $spu, 'sku' => $sku, 'goodsCost' => $goodsCost, 'goodsWeight' => $goodsWeight, 'goodsNote' => $goodsNote, 'goodsLength' => $goodsLength, 'goodsWidth' => $goodsWidth, 'goodsHeight' => $goodsHeight, 'goodsCategory' => $goodsCategory, 'goodsCustomsCode' => $goodsCustomsCode, 'goodsDecWorth' => $goodsDecWorth, 'purchaseId' => $purchaseId);
         $result = GoodsModel::getGoodsList("id", "where sku='{$sku}'");
         if (empty($result)) {
             $data['goodsCreatedTime'] = $nowtime;
             $data['isNew'] = 1;
             //默认是新品
             /*
             if(empty($goodsCategory) && $department == '采购部'){//拦截错误的货品类别和父类记录
             	$cn = $c - 2;
             	echo "<br/>第<font color='red'>$cn</font>条记录中<font color='orange'>货品类别或父类有误,</font>请检查后再提交...<br/>";
             	exit();
             }
             */
             //if(empty($spu)  && $department == '采购部'){//首次插入数据时spu必须非空且要符合规范
             if (empty($spu)) {
                 //首次插入数据时spu必须非空且要符合规范
                 echo "spu存在为空的列,请认真检查再提交...";
                 exit;
             }
             //if(!preg_match("/^[A-Z0-9]+(_[A-Z0-9]+)*$/",$spu) && $department == '采购部'){
             if (!preg_match("/^[A-Z0-9]+(_[A-Z0-9]+)*\$/", $spu)) {
                 echo "SPU号:<font color='#FF0000'>" . $spu . "</font>书写不规范,请认真检查再提交...";
                 exit;
             }
             /*
             foreach($sqlnew as $arrnew){//如果在料号转换中存在和导入的sku相同的新料号,则认为该sku仍然是老品
             	if($arrnew['new_sku'] == $goods_sn){
             		$isNew = 0;
             		break;
             	}
             }
             */
             $goodsid = GoodsModel::insertRow($data);
             if ($goodsid) {
                 $goodsCode = $goodsid + 1000000;
                 $u_data = array('goodsCode' => $goodsCode);
                 $where = "AND id='{$goodsid}'";
                 if (GoodsModel::update($u_data, $where)) {
                     //插入物品与仓位关联表
                     if (!empty($storeid)) {
                         $good_wh_data = array('goodsId' => $goodsid, 'locationId' => $storeid);
                     }
                     //跟新sku自动表进入系统
                     $u_sku_data = array('status' => 2);
                     SpuModel::update($u_sku_data, "AND sku='{$spu}'");
                     $status = " -[<font color='#33CC33'>物品编号:{$sku} 导入成功 </font>]";
                     echo $status . '<br>';
                 } else {
                     $status = " -[<font color='#FF0000'>物品编号:{$sku} 导入失败<br/></font>]";
                     echo $status . '<br>';
                 }
             }
             /*
             if($goods_cost){
             	//增加价格变化到价格表 add by guanyongjun 2013-06-08
             	$sqlcost		= "INSERT INTO ebay_goods_cost (goods_sn,goods_cost,add_time,cguser,storeid,mainsku) VALUES('{$goods_sn}','{$goods_cost}','{$nowtime}','{$cguser}','{$storeid}','".get_mainsku($goods_sn)."')";
             	echo $sqlcost."<br/>";
             	$dbcon->execute($sqlcost);
             }
             */
         } else {
             if ($spu == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['spu']);
             }
             if ($goodsName == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsName']);
             }
             if ($goodsDecNameByEN == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsDecNameByEN']);
             }
             if ($goodsDecNameByCN == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsDecNameByCN']);
             }
             if ($sku == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['sku']);
             }
             if ($goodsCost == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsCost']);
             }
             if ($goodsWeight == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsWeight']);
             }
             if ($goodsNote == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsNote']);
             }
             if ($goodsLength == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsLength']);
             }
             if ($goodsWidth == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsWidth']);
             }
             if ($goodsHeight == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsHeight']);
             }
             if ($goodsCategory == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsCategory']);
             }
             if ($goodsCustomsCode == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsCustomsCode']);
             }
             if ($goodsDecWorth == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['goodsDecWorth']);
             }
             if ($purchaseName == '' || !in_array('stock_name', $stockdetailpower)) {
                 unset($data['purchaseId']);
             }
             $where = "AND sku='{$sku}'";
             if (!empty($data)) {
                 if (GoodsModel::update($data, $where)) {
                     //插入物品与仓位关联表
                     if (!empty($storeid)) {
                         $good_wh_data = array('goodsId' => $goodsid, 'locationId' => $storeid);
                         RelationModel::insertGoodsWhRow($good_wh_data);
                     }
                     $status = " -[<font color='#FF0000'>物品编号:{$sku} 更新失败</font>]";
                     echo $status . '<br>';
                 } else {
                     $status = " -[<font color='#FF0000'>物品编号:{$sku} 更新失败</font>]";
                     echo $status . '<br>';
                 }
                 /*
                 					if($goods_cost != '' && $goods_cost && in_array('stock_cost', $stockdetailpower)  ) {
                 //增加价格变化到价格表 add by guanyongjun 2013-06-08
                 $sqlcost		= "SELECT goods_cost FROM ebay_goods WHERE goods_sn = '{$goods_sn}' AND goods_cost = '{$goods_cost}'";
                 //echo $sqlcost;
                 //exit;
                 $sqlcost		= $dbcon->execute($sqlcost);
                 $sqlcost		= $dbcon->getResultArray($sqlcost);
                 if(!$sqlcost){
                 	$costtime		= time();
                 	$sqlcost		= "INSERT INTO ebay_goods_cost (goods_sn,goods_cost,add_time,cguser,storeid,mainsku) VALUES('{$goods_sn}','{$goods_cost}','{$costtime}','{$cguser}','{$storeid}','".get_mainsku($goods_sn)."')";
                 	echo $sqlcost."<br/>";
                 	$dbcon->execute($sqlcost);
                 }
                 					}
                 
                 					if($isuse!==''  && in_array('stock_status', $stockdetailpower) ){
                 //更新价格表状态 add by guanyongjun 2013-06-08
                 $sqlcost		= "UPDATE ebay_goods_cost SET isuse = '".intval($isuse)."' WHERE goods_sn = '{$goods_sn}'";
                 $dbcon->execute($sqlcost);
                 					}
                 */
             } else {
                 $status = " -[<font color='#FF0000'>物品编号:{$sku} 已经是最新</font>]";
                 echo $status . '<br>';
             }
         }
         echo '<br>';
     }
 }
    function content_526616c12e7fe9_50900572($_smarty_tpl)
    {
        echo $_smarty_tpl->getSubTemplate("header.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<script type="text/javascript" src="./js/fancyBox/source/jquery.fancybox.js?v=2.1.3"></script>
<link rel="stylesheet" type="text/css" href="./js/fancyBox/source/jquery.fancybox.css?v=2.1.2" media="screen" />
<script type="text/javascript" src="./js/property.js"></script>
<div class="fourvar">
            	<div class="pathvar">
                <?php 
        echo $_smarty_tpl->getSubTemplate('pcNav.htm', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

                </div>
                <div class="texvar">
                </div>
                <div class="pagination">
                <?php 
        echo $_smarty_tpl->tpl_vars['show_page']->value;
        ?>

                </div>
            </div>
			<div class="servar products-servar">
								  <span>属性名:
								   <input name="inputName" type="text" id="inputName" value="<?php 
        echo $_GET['inputName'];
        ?>
"/>
								   </span>
								<span>类别&nbsp;&nbsp;
									<select name="sku_category" id="pid_one" onchange="select_one();">
										<option value="0">请选择</option>
										<?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = CategoryModel::getCategoryList('*', "where is_delete=0 and pid=0");
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
										<option value="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
"/><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['name'];
            ?>
</option>
										<?php 
        }
        ?>
									</select>
									<span align="left" id="div_two" style="width:auto; display:none"></span>
									<span align="left" id="div_three" style="width:auto; display:none"></span>
									<span align="left" id="div_four" style="width:auto; display:none"></span>
								</span>
                                   <span><button id='seachInput'/>搜索</button></span>
                                   &nbsp;
                                   <?php 
        if ($_smarty_tpl->tpl_vars['categorySearch']->value != '') {
            ?>
                                   <span style="color: green;">上次您搜索的类别为:<?php 
            echo $_smarty_tpl->tpl_vars['categorySearch']->value;
            ?>
</span>
                                   <?php 
        }
        ?>
                                   <span style="color: red;"><?php 
        echo $_smarty_tpl->tpl_vars['status']->value;
        ?>
</span>
            </div>
            <div class="servar products-servar">
                <span>
                	<a href="index.php?mod=property&act=addInput">新增属性</a>
                </span>
            </div>
            <div class="main">
            	<table cellspacing="0" width="100%">
                	<tr class="title">
                    	<td>属性名</td>
						<td>录入方式</td>
						<td>关联类型</td>
                    </tr>
                    <?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['inputList']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
                    <tr>
                        <input name="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
" id="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
" type="hidden"/>
                    	<td><a href="index.php?mod=property&act=updateInput&id=<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['inputName'];
            ?>
</a></td>
                        <td>文本</td>
                        <td><?php 
            echo getAllCateNameByPath($_smarty_tpl->tpl_vars['value']->value['categoryPath']);
            ?>
</td>
                    </tr>
                    <?php 
        }
        ?>
                </table>
            </div>
            <div class="bottomvar">
            	<div class="texvar">

            	</div>
            	<div class="pagination">
					<?php 
        echo $_smarty_tpl->tpl_vars['show_page']->value;
        ?>

            	</div>
            </div>
<?php 
        echo $_smarty_tpl->getSubTemplate("footer.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
    }
    function content_526616c8597fb5_27412182($_smarty_tpl)
    {
        echo $_smarty_tpl->getSubTemplate("header.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<script type="text/javascript" src="./js/property.js"></script>
<div class="fourvar">
            	<div class="pathvar">
                <?php 
        echo $_smarty_tpl->getSubTemplate('pcNav.htm', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

                </div>
                <div class="texvar">
                </div>
                <div class="pagination">
                </div>
            </div>
<div class="servar products-servar">


            </div>
            <div class="main feedback-main">
					<table class="products-action" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
                            <input id="id" value="<?php 
        echo $_smarty_tpl->tpl_vars['id']->value;
        ?>
" type="hidden"/>
                            <td><span style="color:#F00;">*</span>属性名:
							<input id="propertyName" value="<?php 
        echo $_smarty_tpl->tpl_vars['propertyName']->value;
        ?>
"/>
							</td>
						</tr>
                        <tr>
                           	    <td>
                                    &nbsp;&nbsp;
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    &nbsp;&nbsp;
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <span style="color:#F00;">*</span>类别:
									<select name="sku_category" id="pid_one" onchange="select_one();">
										<option value="0">请选择</option>
										<?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = CategoryModel::getCategoryList('*', "where is_delete=0 and pid=0");
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
										<option value="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['name'];
            ?>
</option>
										<?php 
        }
        ?>
									</select>
									<span align="left" id="div_two" style="width:auto; display:none"></span>
									<span align="left" id="div_three" style="width:auto; display:none"></span>
									<span align="left" id="div_four" style="width:auto; display:none"></span>
                                    <span style="color: green;">修改前类型为:<?php 
        echo $_smarty_tpl->tpl_vars['categoryStr']->value;
        ?>
</span>
								</td>
						</tr>
                        <tr>
                            <td><span style="color:#F00;">*</span>录入方式:
									<select name="isRadio" id="isRadio">
										<option value="1" <?php 
        if ($_smarty_tpl->tpl_vars['isRadio']->value == 1) {
            ?>
selected='selected'<?php 
        }
        ?>
>单选</option>
										<option value="2" <?php 
        if ($_smarty_tpl->tpl_vars['isRadio']->value == 2) {
            ?>
selected='selected'<?php 
        }
        ?>
>多选</option>
									</select>
							</td>
						</tr>
                        <tr>
                            <td><input type="button" value="提交" id="updatePP"/>
							<input type="button" value="返回" id="back"/></td>
						</tr>
					</table>
            </div>
            <div class="bottomvar">
            	<div class="texvar">

            	</div>
            	<div class="pagination">
            	</div>
            </div>
<?php 
        echo $_smarty_tpl->getSubTemplate("footer.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
    }
    function content_526616c5806164_72182535($_smarty_tpl)
    {
        echo $_smarty_tpl->getSubTemplate("header.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<script type="text/javascript" src="./js/fancyBox/source/jquery.fancybox.js?v=2.1.3"></script>
<link rel="stylesheet" type="text/css" href="./js/fancyBox/source/jquery.fancybox.css?v=2.1.2" media="screen" />
<script type="text/javascript" src="./js/property.js"></script>
<div class="fourvar">
            	<div class="pathvar">
                <?php 
        echo $_smarty_tpl->getSubTemplate('pcNav.htm', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

                </div>
                <div class="texvar">
                </div>
                <div class="pagination">
                <?php 
        echo $_smarty_tpl->tpl_vars['show_page']->value;
        ?>

                </div>
            </div>
			<div class="servar products-servar">
								  <span>属性名:
								   <input name="propertyName" type="text" id="propertyName" value="<?php 
        echo $_GET['propertyName'];
        ?>
"/>
								   </span>
								   <span>录入方式:
								   <select name="isRadio" id="isRadio" >
								    <option value="0" >==请选择==</option>
									<option value="1" <?php 
        if ($_GET['isRadio'] == 1) {
            ?>
selected='selected'<?php 
        }
        ?>
>单选</option>
									<option value="2" <?php 
        if ($_GET['isRadio'] == 2) {
            ?>
selected='selected'<?php 
        }
        ?>
>多选</option>
								  </select>
								   </span>
								<span>类别&nbsp;&nbsp;
									<select name="sku_category" id="pid_one" onchange="select_one();">
										<option value="0">请选择</option>
										<?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = CategoryModel::getCategoryList('*', "where is_delete=0 and pid=0");
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
										<option value="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
"/><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['name'];
            ?>
</option>
										<?php 
        }
        ?>
									</select>
									<span align="left" id="div_two" style="width:auto; display:none"></span>
									<span align="left" id="div_three" style="width:auto; display:none"></span>
									<span align="left" id="div_four" style="width:auto; display:none"></span>
								</span>
                                   <span><button id='seachProperty'/>搜索</button></span>
                                   &nbsp;
                                   <?php 
        if ($_smarty_tpl->tpl_vars['categorySearch']->value != '') {
            ?>
                                   <span style="color: green;">上次您搜索的类别为:<?php 
            echo $_smarty_tpl->tpl_vars['categorySearch']->value;
            ?>
</span>
                                   <?php 
        }
        ?>
                                   <span style="color: red;"><?php 
        echo $_smarty_tpl->tpl_vars['status']->value;
        ?>
</span>
            </div>
            <div class="servar products-servar">
                <span>
                	<a href="index.php?mod=property&act=addProperty">新增属性</a>
                </span>
            </div>
            <div class="main feedback-main">
            	<table class="products-action" cellspacing="0" width="100%">
                	<tr class="title">
                    	<td width="10%">属性名</td>
                        <td width="50%">属性值</td>
						<td width="5%">录入方式</td>
						<td width="15%">关联类型</td>
                        <td width="20%">操作</td>
                    </tr>
                    <?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['propertyList']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
                    <tr>
                        <input name="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
" id="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
" type="hidden"/>
                    	<td><a href="index.php?mod=property&act=updateProperty&id=<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['propertyName'];
            ?>
</a></td>
                        <td><?php 
            echo OmAvailableModel::getProValStrByProId($_smarty_tpl->tpl_vars['value']->value['id']);
            ?>
</td>
                        <td><?php 
            if ($_smarty_tpl->tpl_vars['value']->value['isRadio'] == 1) {
                ?>
单选<?php 
            } else {
                ?>
多选<?php 
            }
            ?>
</td>
                        <td><?php 
            echo getAllCateNameByPath($_smarty_tpl->tpl_vars['value']->value['categoryPath']);
            ?>
</td>
                        <td>
                            <input type="button" onclick="window.location.href = 'index.php?mod=property&act=updatePropertyValue&id=<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
'" value="修改属性值"/>
                            <input type="button" onclick="window.location.href = 'index.php?mod=property&act=addPropertyValue&id=<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
'" value="添加属性值"/>
                        </td>
                    </tr>
                    <?php 
        }
        ?>
                </table>
            </div>
            <div class="bottomvar">
            	<div class="texvar">

            	</div>
            	<div class="pagination">
					<?php 
        echo $_smarty_tpl->tpl_vars['show_page']->value;
        ?>

            	</div>
            </div>
<?php 
        echo $_smarty_tpl->getSubTemplate("footer.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
    }
Example #8
0
 function act_getCategoryInfoAndIsHasChild()
 {
     $id = $_POST['id'];
     $list = CategoryModel::getCategoryList("*", "where is_delete=0 and pid='{$id}'");
     if ($list) {
         $count = CategoryModel::getCategoryCount("where is_delete=0 and path like '%{$id}-%-%'");
         return array($list, $count);
     } else {
         self::$errCode = 101;
         self::$errMsg = 'error';
         return false;
     }
 }
    function content_526616d124ef17_38368080($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_date_format')) {
            include 'D:\\wamp\\www\\ftpPc.valsun.cn\\lib\\template\\smarty\\plugins\\modifier.date_format.php';
        }
        echo $_smarty_tpl->getSubTemplate("header.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<script type="text/javascript" src="./js/goodslist.js"></script>
<div class="fourvar">
            	<div class="pathvar">
                <?php 
        echo $_smarty_tpl->getSubTemplate('pcNav.htm', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

                </div>
                <div class="texvar">
                </div>
                <div class="pagination">
                <?php 
        echo $_smarty_tpl->tpl_vars['show_page']->value;
        ?>

                </div>
            </div>
			<div class="servar products-servar">
            					  <span>SPU:
								   <input name="spu" type="text" id="spu" value="<?php 
        echo $_GET['spu'];
        ?>
"/>
								   </span>
								   <span>审核状态:
								   <select name="auditStatus" id="auditStatus" >
								    <option value="0" > </option>
									<option value="1" <?php 
        if ($_GET['auditStatus'] == 1) {
            ?>
selected='selected'<?php 
        }
        ?>
>待审核</option>
									<option value="2" <?php 
        if ($_GET['auditStatus'] == 2) {
            ?>
selected='selected'<?php 
        }
        ?>
>审核通过</option>
								  	<option value="3" <?php 
        if ($_GET['auditStatus'] == 3) {
            ?>
selected='selected'<?php 
        }
        ?>
>审核不通过</option>
								  </select>
                                  <span>采购员:
								   <select name="purchaseId" id="purchaseId" >
								    <option value="0" > </option>
								    <?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = Auth::getApiPurchaseUsers();
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
									<option value="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['userId'];
            ?>
" <?php 
            if ($_GET['purchaseId'] == $_smarty_tpl->tpl_vars['value']->value['userId']) {
                ?>
selected='selected'<?php 
            }
            ?>
><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['userName'];
            ?>
</option>
									<?php 
        }
        ?>
								  </select>
								   </span>
								   </span>
								   <span>类别&nbsp;&nbsp;
									<select name="sku_category" id="pid_one" onchange="select_one();">
										<option value="0">请选择</option>
										<?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = CategoryModel::getCategoryList('*', "where is_delete=0 and pid=0");
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
										<option value="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['name'];
            ?>
</option>
										<?php 
        }
        ?>
									</select>
									<span align="left" id="div_two" style="width:auto; display:none"></span>
									<span align="left" id="div_three" style="width:auto; display:none"></span>
									<span align="left" id="div_four" style="width:auto; display:none"></span>
								</span>
                                   <span><button id='seachSpuArchive'>搜索</button></span>
                                   <?php 
        if ($_smarty_tpl->tpl_vars['categorySearch']->value != '') {
            ?>
                                   <span style="color: green;">上次您搜索的类别为:<?php 
            echo $_smarty_tpl->tpl_vars['categorySearch']->value;
            ?>
</span>
                                   <?php 
        }
        ?>
            &nbsp;
			<span style="color: red;"><?php 
        echo $_smarty_tpl->tpl_vars['status']->value;
        ?>
</span>
            </div>
            <div class="main feedback-main">
            	<table class="products-action" cellspacing="0" width="100%">
                   <tr class="title">
                        <tr>
                            <td>SPU</td>
							<td>采购员</td>
							<td>类型</td>
							<td>在线状态</td>
							<td>审核状态</td>
							<td>添加时间</td>
							<td>单/虚拟料号</td>
							<td>操作</td>
                        </tr>
                    </tr>
                    <?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['spuArchiveList']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
                                <tr>
                                    <td><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['spu'];
            ?>
</td>
                                    <td><?php 
            echo getPersonNameById($_smarty_tpl->tpl_vars['value']->value['purchaseId']);
            ?>
</td>
									<td><?php 
            echo getAllCateNameByPath($_smarty_tpl->tpl_vars['value']->value['categoryPath']);
            ?>
</td>
                                    <td>
                                    <?php 
            if ($_smarty_tpl->tpl_vars['value']->value['spuStatus'] == 1) {
                ?>
下线<?php 
            }
            ?>
                                    <?php 
            if ($_smarty_tpl->tpl_vars['value']->value['spuStatus'] == 2) {
                ?>
上线<?php 
            }
            ?>
                                    <?php 
            if ($_smarty_tpl->tpl_vars['value']->value['spuStatus'] == 3) {
                ?>
部分停售<?php 
            }
            ?>
                                    <?php 
            if ($_smarty_tpl->tpl_vars['value']->value['spuStatus'] == 4) {
                ?>
停售<?php 
            }
            ?>
                                    <?php 
            if ($_smarty_tpl->tpl_vars['value']->value['spuStatus'] == 5) {
                ?>
部分下线<?php 
            }
            ?>
                                    </td>
                                    <td>
                                    <?php 
            if ($_smarty_tpl->tpl_vars['value']->value['auditStatus'] == 1) {
                ?>
待审核<?php 
            }
            ?>
                                    <?php 
            if ($_smarty_tpl->tpl_vars['value']->value['auditStatus'] == 2) {
                ?>
<img alt="审核通过" src="http://misc.erp.valsun.cn/img/right.png"/><?php 
            }
            ?>
                                    <?php 
            if ($_smarty_tpl->tpl_vars['value']->value['auditStatus'] == 3) {
                ?>
<img alt="审核不通过" src="http://misc.erp.valsun.cn/img/wrong.png"/><?php 
            }
            ?>
                                    </td>
                                    <td><?php 
            echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['value']->value['spuCreatedTime'], "Y-m-d H:i");
            ?>
</td>
                                    <td><?php 
            if ($_smarty_tpl->tpl_vars['value']->value['isSingSpu'] == 1) {
                ?>
单料号<?php 
            } else {
                ?>
虚拟料号<?php 
            }
            ?>
</td>
                                    <td>
										<input type="button" onclick="window.location.href = 'index.php?mod=autoCreateSpu&act=scanSpuArchive&spu=<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['spu'];
            ?>
'" value="查看"/>
                                        <input type="button" onclick="window.location.href = 'index.php?mod=autoCreateSpu&act=updateSpuArchive&spu=<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['spu'];
            ?>
'" value="编辑"/>

                                    </td>
                                </tr>
                     <?php 
        }
        ?>
                </table>
            </div>
            <div class="bottomvar">
            	<div class="texvar">

            	</div>
            	<div class="pagination">
					<?php 
        echo $_smarty_tpl->tpl_vars['show_page']->value;
        ?>

            	</div>
            </div>
<?php 
        echo $_smarty_tpl->getSubTemplate("footer.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
    }
Example #10
0
 function act_delCategory()
 {
     $id = trim($_POST['id']);
     if (CategoryModel::getCategoryList("*", "where is_delete=0 and pid='{$id}'")) {
         self::$errCode = 03;
         self::$errMsg = '请先删除子分类!';
         return false;
     } else {
         $where = "and `id` = '{$id}'";
         $data = array('is_delete' => 1);
         if (CategoryModel::update($data, $where)) {
             return true;
         } else {
             self::$errCode = 03;
             self::$errMsg = '删除失败,请重试!';
             return false;
         }
     }
 }