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 
    }
Beispiel #2
0
 public function view_getGoodsList()
 {
     //调用action层, 获取列表数据
     $GoodsAct = new GoodsAct();
     $flag = false;
     $userId = $_SESSION['userId'];
     $seachdata = isset($_GET['seachdata']) ? post_check($_GET['seachdata']) : '';
     $searchs = isset($_GET['searchs']) ? $_GET['searchs'] : '';
     $isNew = isset($_GET['isNew']) ? $_GET['isNew'] : '';
     $pid = isset($_GET['pid']) ? $_GET['pid'] : '';
     $purchaseId = isset($_GET['purchaseId']) ? $_GET['purchaseId'] : '';
     $goodsStatus = intval(isset($_GET['goodsStatus']) ? $_GET['goodsStatus'] : '');
     $where = 'where is_delete=0 ';
     if (intval($searchs) != 0 && !empty($seachdata)) {
         if ($searchs == 1) {
             $where .= "and spu='{$seachdata}' ";
             $flag = true;
         } elseif ($searchs == 2) {
             $where .= "and sku='{$seachdata}' ";
             $flag = true;
         }
     }
     if ($isNew) {
         if ($isNew == 1) {
             $where .= "and isNew='1' ";
             $flag = true;
         } elseif ($isNew == 2) {
             $where .= "and isNew='0' ";
             $flag = true;
         }
     }
     if ($pid) {
         //$where .= "and goodsCategory like'$pid%' ";//有bug
         $where .= "AND goodsCategory REGEXP '^{$pid}(-[0-9]+)*\$' ";
         $flag = true;
     }
     if (intval($purchaseId) > 0) {
         $where .= "and purchaseId='{$purchaseId}' ";
         $flag = true;
     }
     if ($goodsStatus > 0) {
         $where .= "and goodsStatus='{$goodsStatus}' ";
         $flag = true;
     }
     $total = $GoodsAct->act_getGoodsListNum($where);
     $num = 50;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $select = '*';
     $where .= "order by sku desc " . $page->limit;
     if ($flag == false) {
         $productList = $GoodsAct->act_getGoodsListNum('WHERE 1=0');
     } else {
         $productList = $GoodsAct->act_getGoodsList($select, $where);
     }
     if (!empty($productList)) {
         $countPro = count($productList);
         for ($i = 0; $i < $countPro; $i++) {
             if ($productList[$i]['purchaseId'] == $userId) {
                 //登陆人员和采购是同一个人的时候,才显示供应商
                 $productList[$i]['supplier'] = OmAvailableModel::getParterNameBySku($productList[$i]['sku']);
             }
             if ($i > 0 && $productList[$i]['spu'] == $productList[$i - 1]['spu']) {
                 $productList[$i]['visibleSpu'] = '';
             } else {
                 $productList[$i]['visibleSpu'] = $productList[$i]['spu'];
             }
         }
     }
     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));
     }
     $pidArr = explode('-', $pid);
     $navlist = array(array('url' => 'index.php?mod=goods&act=getGoodsList', 'title' => '产品信息'), array('url' => 'index.php?mod=goods&act=getGoodsList', 'title' => '产品信息列表'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('onevar', 1);
     $this->smarty->assign('twovar', 11);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('title', '产品列表');
     $this->smarty->assign('pidArr', $pidArr);
     $this->smarty->assign('productList', empty($productList) ? array() : $productList);
     $this->smarty->display("goodsList.htm");
 }