Example #1
0
 public function __construct()
 {
     parent::__construct();
     $this->smarty->template_dir = WEB_PATH . 'pda/html/';
     $this->smarty->assign('curusername', $_SESSION['userId'] ? getUserNameById($_SESSION['userId']) : '');
     //设置当前用户名
 }
Example #2
0
 /**
  * 提交信息生成订单
  * @param string type 来源 package ,cart 。普通
  * @param int cart_ids 购物车id
  */
 public function makeOrder()
 {
     $work_id = I('get.workid');
     if (!is_numeric($work_id)) {
         $this->assign('message', '作品信息');
         $this->display('Public/error');
         exit;
     }
     $data['work_id'] = $work_id;
     $data['order_category'] = 2;
     $session = session('user');
     $user_id = 2;
     // $session['user_id'];
     $data['user_id'] = $user_id;
     if (empty($user_id)) {
         $this->assign('message', '请登录后再操作');
         $this->display('Public/error');
         exit;
     }
     $data['order_number'] = '2cyj' . makeOrderCardId();
     $worksModel = D('Works');
     $work = $worksModel->getOrderWorkByid($work_id);
     if (!$work) {
         $this->assign('message', '生成订单异常,请重新操作');
         $this->display('Public/error');
         exit;
     }
     $data['author_id'] = $work['user_id'];
     $data['auther'] = getUserNameById($work['user_id']);
     $data['work_title'] = $work['title'];
     $data['create_date'] = date('Y-m-d H:i:s', time());
     $data['update_date'] = $data['create_date'];
     $data['money'] = $work['money'];
     $data['order_type'] = 0;
     $data['handle'] = 1;
     $data['ajax_type'] = 0;
     $OrderModel = D('Order');
     $id = $OrderModel->add($data);
     if ($id) {
         redirect('/Order/pay/orderid/' . $id);
     } else {
         $this->assign('message', '订单生成异常');
         $this->display('Public/error');
         exit;
     }
 }
Example #3
0
 public function act_selectsku()
 {
     $sku = isset($_POST['sku']) ? trim($_POST['sku']) : "";
     $sku = get_goodsSn($sku);
     $goodsinfo = wrapperSkuOutModel::skuinfo($sku);
     $res = array();
     if (empty($goodsinfo)) {
         self::$errCode = 3;
         self::$errMsg = "<font color='red'>系统没有相应包装材料,请核对!</font>" . $sku;
         return $sku;
     } else {
         self::$errCode = 2;
         self::$errMsg = "包装材料正确,请扫描仓位!";
         $cguser = getUserNameById($goodsinfo['purchaseId']);
         $res['res_info'] = $goodsinfo['goodsName'] . "<br>采购:" . $cguser;
         $res['sku'] = $sku;
         return $res;
     }
 }
Example #4
0
 public function act_export()
 {
     $checkUser = $_GET['checkUser'];
     $sku = $_GET['sku'];
     $startdate = $_GET['startdate'];
     $enddate = $_GET['enddate'];
     if (empty($checkUser) && empty($sku) && empty($startdate) && empty($enddate)) {
         echo "请选择导出条件";
         exit;
     }
     if (!empty($checkUser)) {
         $where[] = "tallyUserId='{$checkUser}'";
     }
     if (!empty($sku)) {
         $where[] = "sku = '{$sku}'";
     }
     if (!empty($startdate)) {
         $start = strtotime($startdate);
         $where[] = "entryTime >{$start}";
     }
     if (!empty($enddate)) {
         $end = strtotime($enddate);
         $where[] = "entryTime <{$end}";
     }
     $where = implode(" AND ", $where);
     $where = " where is_delete=0 and entryStatus=0 and " . $where;
     $lists = packageCheckModel::selectList($where);
     $excel = new ExportDataExcel('browser', "pointKpiExport" . date('Y-m-d') . ".xls");
     $excel->initialize();
     /** edit by Gary**/
     $tharr = array("点货人", "点货时间", "SKU", "数量", "良品数", "上架数", "批次号", '打标时间', '贴标时间', '检测时间', '上架时间', '备注');
     $excel->addRow($tharr);
     foreach ($lists as $list) {
         $user = getUserNameById($list['tallyUserId']);
         $time = date('Y-m-d H:i:s', $list['entryTime']);
         $sku = $list['sku'];
         $num = $list['num'];
         $ichibanNums = $list['ichibanNums'];
         $shelvesNums = $list['shelvesNums'];
         $batchNum = $list['batchNum'];
         //新增打标、贴标、检测、上架时间
         $printTime = $list['printTime'] ? date('Y-m-d H:i:s', $list['printTime']) : '无';
         $pasteTime = getSkuTime(array('type' => 'paste', 'tallyList' => $list['id']));
         $checkTime = $list['ichibanTime'] ? date('Y-m-d H:i:s', $list['ichibanTime']) : '无';
         $inputArray = array('type' => 'input', 'sku' => $list['sku'], 'finishTime' => $list['finishTime'], 'shelvesNums' => $list['shelvesNums']);
         $inputTime = getSkuTime($inputArray);
         $tdarr = array($user, $time, $sku, $num, $ichibanNums, $shelvesNums, $batchNum, $printTime, $pasteTime, $checkTime, $inputTime, $list['note']);
         /** end**/
         $excel->addRow($tdarr);
     }
     $excel->finalize();
     exit;
 }
include_once 'app/users.php';
//include_once('../user.php');
if (empty($_SESSION['logged_in'])) {
    redirect('index.php');
}
if (isset($_GET['uid'])) {
    $user = $_GET['uid'];
} else {
    $user = $_SESSION['uid'];
}
$interactions = getInteractions($user);
if ($interactions) {
    foreach ($interactions as $i) {
        $timestamp = $i['created_on'];
        $user = getUserNameById($i['created_by']);
        $author = getUserNameById($i['author']);
        if ($i['type'] == 'ideathread') {
            $title = getIdeaTitle($i['id']);
            $url = SITE_URL . '/home.php?iid=' . $i['id'];
        }
        if ($i['type'] == 'project') {
            $title = getProjectTitle($i['id']);
            $url = SITE_URL . '/home.php?pid=' . $i['id'];
        }
        if ($i['action'] == 'like') {
            $action = 'liked';
            $icon_image = SITE_URL . '/images/icons/like.png';
        }
        if ($i['action'] == 'comment') {
            $action = 'commented on';
            $icon_image = SITE_URL . '/images/icons/comment.jpg';
    function content_52b9238817e343_27919694($_smarty_tpl)
    {
        echo $_smarty_tpl->getSubTemplate("header.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<div class="fourvar">
	<div class="pathvar">
		您的位置:<a href="index.php?mod=productStockalarm&act=index">预警管理</a>&nbsp;>>&nbsp;<?php 
        echo $_smarty_tpl->tpl_vars['title']->value;
        ?>

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

	</div>
</div>
<div class="servar">
	<span>关键字:<input id="key" type="text" <?php 
        if ($_smarty_tpl->tpl_vars['key']->value) {
            ?>
 value="<?php 
            echo $_smarty_tpl->tpl_vars['key']->value;
            ?>
" <?php 
        }
        ?>
/>
	<span>搜索类型:<select id="type">
			<option value='-1'>请选择类型</option>
			<option value='sku'  <?php 
        if ($_smarty_tpl->tpl_vars['type']->value == "sku") {
            ?>
selected="selected"<?php 
        }
        ?>
>料号子SKU</option>
			<option value='spu' selected="selected">主料号</option>
			<option value= "goodsName" <?php 
        if ($_smarty_tpl->tpl_vars['type']->value == "goodsName") {
            ?>
selected="selected"<?php 
        }
        ?>
>产品名称</option>
	</select>
	</span>
	</span>
		 <span>产品状态:<select id="flag">
			<option value='-1'>选择状态</option> 
			<option value='1' <?php 
        if ($_smarty_tpl->tpl_vars['status']->value == "1") {
            ?>
 selected<?php 
        }
        ?>
>在线</option> 
			<option value='2' <?php 
        if ($_smarty_tpl->tpl_vars['status']->value == "2") {
            ?>
 selected<?php 
        }
        ?>
>下线</option> 
			<option value='3' <?php 
        if ($_smarty_tpl->tpl_vars['status']->value == "3") {
            ?>
 selected<?php 
        }
        ?>
>零库存</option> 
			<option value='4' <?php 
        if ($_smarty_tpl->tpl_vars['status']->value == "4") {
            ?>
 selected<?php 
        }
        ?>
>停售</option> 
			<option value='5' <?php 
        if ($_smarty_tpl->tpl_vars['status']->value == "5") {
            ?>
 selected<?php 
        }
        ?>
>部分平台在线</option> 
	</select>
	</span>
		 <span>供应商:<select id="pid">
			<option value='-1'>请选择供应商</option>
			<?php 
        $_smarty_tpl->tpl_vars['list'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['list']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['partnerList']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['list']->key => $_smarty_tpl->tpl_vars['list']->value) {
            $_smarty_tpl->tpl_vars['list']->_loop = true;
            ?>
 
			<option value="<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['id'];
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['pid']->value == $_smarty_tpl->tpl_vars['list']->value['id']) {
                ?>
selected="selected"<?php 
            }
            ?>
><?php 
            echo $_smarty_tpl->tpl_vars['list']->value['company_name'];
            ?>
</option>
			<?php 
        }
        ?>
 
	</select>
	</span>	 
	<span>采购员:
			<select id="pcid">
			<option value="-1">请选择采购员</option> 
			<?php 
        $_smarty_tpl->tpl_vars['list'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['list']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['purchaseList']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['list']->key => $_smarty_tpl->tpl_vars['list']->value) {
            $_smarty_tpl->tpl_vars['list']->_loop = true;
            ?>
			<option value="<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['userId'];
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['pcid']->value == $_smarty_tpl->tpl_vars['list']->value['userId']) {
                ?>
selected="selected"<?php 
            }
            ?>
><?php 
            echo $_smarty_tpl->tpl_vars['list']->value["userName"];
            ?>
</option>
			<?php 
        }
        ?>
			</select> 
	</span>
	<div style="border:2px red ;height:10px;"></div>
	 <span>
		 预警状态:
		<select id="is_warn">
		<option value='-1' <?php 
        if ($_smarty_tpl->tpl_vars['is_warn']->value == '-1') {
            ?>
 selected<?php 
        }
        ?>
>全部货品信息</option> 
		<option value='1'  <?php 
        if ($_smarty_tpl->tpl_vars['is_warn']->value == '1') {
            ?>
 selected<?php 
        }
        ?>
>预警货品信息</option> 
		</select>
	</span>
	<span>每天均量排序:
		<select id="dailyNum">
			<option value='-1' <?php 
        if ($_GET['dailyNum'] == '-1') {
            ?>
 selected<?php 
        }
        ?>
>--请选择顺序排列--</option> 
			<option value='1' <?php 
        if ($_GET['dailyNum'] == '1') {
            ?>
 selected<?php 
        }
        ?>
>--销量从高到低--</option> 
			<option value='2' <?php 
        if ($_GET['dailyNum'] == '2') {
            ?>
 selected<?php 
        }
        ?>
>--销量从低到高--</option> 
		</select>
	</span>

	<span>已订购筛选:
		<select id="bookNum">
			<option value='-1' <?php 
        if ($_GET['bookNum'] == '-1') {
            ?>
 selected<?php 
        }
        ?>
>--请选择--</option> 
			<option value='1' <?php 
        if ($_GET['bookNum'] == '1') {
            ?>
 selected<?php 
        }
        ?>
>已订购</option> 
		</select>
	</span>

	 <span> <a href="javascript:void(0)" id="search-btn">搜 索</a>
	</span>
	 <span> <a href="javascript:void(0)" id="createPur">生成采购订单</a>
	</span>
	<span> <a href="javascript:void(0)" id="pl-partner">批量更新供应商</a>
	</span>
	<span> <a href="javascript:void(0)" id="stop-sale">暂时停售</a></span>
	<span> <a href="javascript:void(0)" id="forever-stop-sale">永久停售</a></span>
	<span> <a href="javascript:void(0)" id="begin-sale">开始销售</a></span>
	
</div>
<div class="main products-main reply-main warning-main pagemargin-main">
	<table cellspacing="0" width="100%">
		<tbody>
			<tr class="purchase-title title">
				<td>
					<input type="checkbox" name="inverse-check" id="inverse-check" />
				</td>
				<td>image</td>
				<td>SKU</td>
				<td>SPU</td>
				<td>成本</td>
				<td>实际库存</td>
				<td>待发货</td>
				<td>虚拟库存</td>
				<td>被拦截</td>
				<td>自动拦截</td>
				<td>待审核</td>
				<td>可用天数</td>
				<td>每天均量</td>
				<td>预警天数</td>
				<td>采购天数</td>
				<td>采购数量</td>
				<td>已订购</td>
				<td>在途数量</td>
				<td>建议采购数量</td>
				<td>下月预测</td>
				<td>重量</td>
				<td>在线状态</td>
				<td>采购</td>
			</tr>
			<?php 
        $_smarty_tpl->tpl_vars['list'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['list']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['skuInfo']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['smarty']->value['foreach']['foo']['iteration'] = 0;
        foreach ($_from as $_smarty_tpl->tpl_vars['list']->key => $_smarty_tpl->tpl_vars['list']->value) {
            $_smarty_tpl->tpl_vars['list']->_loop = true;
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']['foo']['iteration']++;
            ?>
			<tr <?php 
            if ($_smarty_tpl->getVariable('smarty')->value['foreach']['foo']['iteration'] % 2 == 0) {
                ?>
style="background-color:#f2f2f2;"<?php 
            }
            ?>
>
				<td class="table-line" rowspan="2" style="border-bottom:1px solid #ccc;">
					<input type="checkbox" name="inverse" value="<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['sku'];
            ?>
" data-rec="<?php 
            echo ceil($_smarty_tpl->tpl_vars['list']->value['purchaseDays'] * $_smarty_tpl->tpl_vars['list']->value['everyday_sale']);
            ?>
"/>
				</td>
				<td rowspan="2" class="table-line" style="border-bottom:1px solid #ccc;">
					<a href="javascript:void(0)" id="imgb-<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['sku'];
            ?>
" class="fancybox">
						<img src="" class="skuimg" id="imgs-<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['sku'];
            ?>
"  width="60" height="60" data-spu="<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['spu'];
            ?>
" data-sku="<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['sku'];
            ?>
">
			   		</a>
				</td>
		
				<td align="left" class="table-line" >
					<a href="javascript:void(0)" class="<?php 
            if ($_smarty_tpl->tpl_vars['list']->value['is_warning']) {
                ?>
openwarning<?php 
            } else {
                ?>
unwarning<?php 
            }
            ?>
"></a>
					<span class="font-16"><?php 
            echo $_smarty_tpl->tpl_vars['list']->value['sku'];
            ?>
</span>
				</td>
				<td><span class="font-16"><?php 
            echo $_smarty_tpl->tpl_vars['list']->value['spu'];
            ?>
</span></td>
				<td class="table-line" >
					<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['goodsCost'];
            ?>

				</td>
				<td class="table-line" >
					<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['actualStockCount'];
            ?>
		
				</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['list']->value['waitingSendCount'];
            ?>
</td>
				<td class="table-line" >
					<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['availableStockCount'];
            ?>

				</td>
				<td class="table-line" >
					<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['interceptSendCount'];
            ?>

				</td>
				<td class="table-line" >
					<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['shortageSendCount'];
            ?>

				</td>
				<td class="table-line">
					<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['waitingAuditCount'];
            ?>

				</td>
				<td >
					<?php 
            echo $_smarty_tpl->tpl_vars['availableStockCount']->value / $_smarty_tpl->tpl_vars['averageDailyCount']->value;
            ?>

				</td>
				<td>
					<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['averageDailyCount'];
            ?>

				</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['list']->value['goodsdays'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['list']->value['purchasedays'];
            ?>
</td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['list']->value['purchasedays'];
            ?>
</td>
				<td><?php 
            echo checkSkuOnWayNum($_smarty_tpl->tpl_vars['list']->value['sku']);
            ?>
</td>
				<td></td>
				<td></td>
				<td></td>
				<td><?php 
            echo $_smarty_tpl->tpl_vars['list']->value['goodsWeight'];
            ?>
</td>
				<td><?php 
            if ($_smarty_tpl->tpl_vars['list']->value['status'] == 1) {
                ?>
在线<?php 
            } elseif ($_smarty_tpl->tpl_vars['list']->value['status'] == 2) {
                ?>
暂时停售<?php 
            } elseif ($_smarty_tpl->tpl_vars['list']->value['status'] == 3) {
                ?>
永久性停售<?php 
            } else {
                ?>
在线<?php 
            }
            ?>
</td>
				<td><?php 
            echo getUserNameById($_smarty_tpl->tpl_vars['list']->value['purchaseId']);
            ?>
</td>
			</tr>
			<tr <?php 
            if ($_smarty_tpl->getVariable('smarty')->value['foreach']['foo']['iteration'] % 2 == 0) {
                ?>
style="background-color:#f2f2f2;"<?php 
            }
            ?>
>
				<td  colspan="7" style="border-bottom:1px solid #ccc;">
					<?php 
            echo $_smarty_tpl->tpl_vars['list']->value['goodsName'];
            ?>

				</td>
				<td colspan="2"  style="border-bottom:1px solid #ccc;">

				</td>
				<?php 
            $_smarty_tpl->tpl_vars['ptlist'] = new Smarty_variable(CommonModel::getSkuPartner($_smarty_tpl->tpl_vars['list']->value['sku']), null, 0);
            ?>
				<td  colspan="7" style="border-bottom:1px solid #ccc;">
					
				</td>
				<td  style="border-bottom:1px solid #ccc;">
				</td>
				<td colspan="7" style="border-bottom:1px solid #ccc;">
					<?php 
            $_smarty_tpl->tpl_vars['pt'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['pt']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['ptlist']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['pt']->key => $_smarty_tpl->tpl_vars['pt']->value) {
                $_smarty_tpl->tpl_vars['pt']->_loop = true;
                echo $_smarty_tpl->tpl_vars['pt']->value['company_name'];
            }
            ?>
				</td>
			</tr>
			<?php 
        }
        ?>

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

</div>
</div>

<input type="hidden" value="<?php 
        echo $_smarty_tpl->tpl_vars['_userid']->value;
        ?>
" id="userid" />
<?php 
        echo $_smarty_tpl->getSubTemplate("footer.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<script type="text/javascript">


//搜索入口	
function search(){
	var type,key,pid,pcid,is_warn,flag,url,dailyNum;
	url		= "index.php?mod=productStockalarm&act=analyze";
	key   	= encodeURIComponent($.trim($("#key").val()));
	type	= $.trim($("#type").val());
	pid		= $.trim($("#pid").val());
	pcid  	= $.trim($("#pcid").val());
	flag  	= $.trim($("#flag").val());
	is_warn = $.trim($("#is_warn").val());
	dailyNum = $.trim($("#dailyNum").val());
	bookNum = $.trim($("#bookNum").val());
	if(type != -1 && key != ''){
		url += "&type="+type+"&key="+key;
	}
	if(flag != -1){
		url += "&status="+flag;
	}
	if(pid != -1){
		url += "&pid="+pid;
	}
	if(is_warn != -1){
		url += "&is_warn="+is_warn;
	}
	if(pcid !=-1){
		url += "&pcid="+pcid;
	}
	if(dailyNum != -1){
		url += "&dailyNum="+dailyNum;
	}
	if(bookNum != -1){
		url += "&bookNum="+bookNum;
	}

	if(type != -1 && key == ''){
		alertify.error("请输入要查找的关键词!");
		$("#key").focus();
		return false;
	}
	window.location.href = url;
}
$("#search-btn").click(function() {
	search();
});
//全选入口
$("#inverse-check").click(function(){
	select_all("inverse-check","input[name='inverse']",0);
});
//生成采购订单
$("#createPur").click(function(){
	var skuArr , url,skulist = [];
	var skuArr 	= $('input[name="inverse"]:checked');
	if(skuArr.length == 0){
		alertify.alert('请选择需下订单的料号');
		return false;
	}else{
		$.each(skuArr ,function(i,item){
			var skuObj = {};
			skuObj.sku = $(item).val();
			skuObj.rec = $(item).data("rec"); //建议采购数量
			skulist.push(skuObj);
		});
	}
	var url  = "json.php?mod=purchaseOrder&act=createOrder";
	$.post(url, {"skulist":skulist}, function(rtn){
		console.log(rtn);
		var data = rtn.msg;
		if(data == 'noPower'){
			alertify.alert('您不是采购员,没有权限生成采购订单');
		}else if(data == 'success'){
			alertify.alert('生成采购订单成功',function(){
				window.location.reload();
			});
		}else{
			alertify.alert('生成采购订单失败'+data.msg);
		}
	},'jsonp');
});

$("#pl-partner").click(function(){
		var skulist,partner,url; 
		skulist = getSkuList();
		partnerId = $("#pid").val();
	    url  = "json.php?mod=purchaseOrder&act=updatePartner";
		if(skulist.length == 0 || partnerId == -1){
			alertify.alert('请选择需要更新供应商的料号 and 供应商。。。');
		}else{
			$.post(url,{"skulist":skulist,"partnerId":partnerId},function(rtn){
				//console.log(rtn);
				alertify.alert('批量更新供应商成功。。。',function(){
					window.location.reload();
				});
			});
		}
});

//新更新缓存
$("#updateCache").click(function(){
	var url  	= "json.php?mod=productStockalarm&act=updateWarnNew";
	var skuArr 	= $('input[name="inverse"]:checked'), sku = "", tips = "", errmsg = "";
	if (skuArr.length == 0) {
		alertify.alert('请选择需要更新缓存的料号');
		return false;
	}
	tips	= "<span id='label-tips' style='line-height:180%;font-size:14px;'></span>";
	alertify.alert(tips);
	$("#aOK").hide();
	var curid = isok = iserr = 0;
	$.each (skuArr,function(i,item) {
		sku = $(item).val();
		$("#label-tips").html("正在批更新料号缓存,请稍候...<br/>处理期间,请不要关闭或刷新当前页面,谢谢配合!");
		$.post (url, {"sku":sku}, function(rtn) {
			if (rtn.errCode=='0') {
				$("#label-tips").html(rtn.data);
			} else {
				$("#label-tips").html(rtn.errMsg);
				iserr++
			}
			if (curid==(skuArr.length-1)) {
				$("#aOK").show().click(function(){
					window.location.reload();
				});
			}
			if (iserr>0) {
				errmsg	= "   一共失败: "+iserr+" 个料号";
			}
			$("#label-tips").html($("#label-tips").html()+"<br/>处理进度:"+ ((curid+1) +" / "+skuArr.length)+errmsg);
			curid++
		},'jsonp');
	});	
});

function getSkuList(){
	var skuArr , skulist = [];
	var skuArr 	= $('input[name="inverse"]:checked');
	if(skuArr.length != 0){
		$.each(skuArr ,function(i,item){
			var sku = $(item).val();
			skulist.push(sku);
		});
	}
	return skulist;
}

$("#stop-sale").click(function(){//暂时停售
		var skuArr = getSkuList();
		if(skuArr.length == 0){
			alertify.alert('请选择需要暂时停售的料号,这个操作日均量将不会更新');
			return;
		}
		changeSkuStatus(skuArr,2);
});

$("#forever-stop-sale").click(function(){//永久停售
		var skuArr = getSkuList();
		if(skuArr.length == 0){
			alertify.alert('请选择需要永久停售的料号,这个操作日均量将不会更新');
			return;
		}
		changeSkuStatus(skuArr,3);
});

$("#begin-sale").click(function(){//开始上线销售
		var skuArr = getSkuList();
		if(skuArr.length == 0){
			alertify.alert('请选择需要上线销售的料号');
			return;
		}
		changeSkuStatus(skuArr,1);
});

function changeSkuStatus(skuArr,status){ //记录sku 在采购系统中的状态
	var url = "json.php?mod=sku&act=changeSkuStatus";
	$.post(url,{"skuArr":skuArr,"status":status},function(rtn){
			console.log(rtn);
			if($.inArray(0,rtn) == -1){
				alertify.alert("操作成功。。。。",function(){
					window.location.reload();
				});
			}else{
			alertify.alert("操作failed。。。。。",function(){
				window.location.reload();
			});
			}
	},"json");
}

window.onkeyup = function(e) {
	if(e.keyCode == 13) {
		search();
	}
}


</script>
<?php 
    }
Example #7
0
    if ($participants['sender'] == $_SESSION['uid']) {
        $conv_partner = $participants['recipient'];
    } else {
        $conv_partner = $participants['sender'];
    }
    $messages = getMessageDetails($_GET['conv']);
    ?>
<div class="user-name-tops">
  <a href ="<?php 
    echo SITE_URL;
    ?>
/user.php?uid=<?php 
    echo $conv_partner;
    ?>
">  <?php 
    echo ucwords(getUserNameById($conv_partner));
    ?>
</a>
</div>
<div class="inboxs-messages">

    <?php 
    foreach ($messages as $message) {
        $user = getUserData($message['sender']);
        $recipent = $message['recipient'];
        if ($user['user_id'] == $_SESSION['uid']) {
            $classval = 'router-user-photo';
            $alignmessage = 'message-right';
            $alignphoto = 'photo-right';
        } else {
            $classval = 'router-user-photo';
Example #8
0
						</div>

					</div>
				</div>
			</div>
			
			<div class="col-md-6 col-xs-12">
				<div class="panel panel-default">
					<div class="panel-heading"><strong class="panel-title">Товар</strong></div>
					<div class="panel-body">
						
						<div class="container-fluid">
							<div class="row" style="margin-bottom: 1em;">
								<div class="col-xs-4">Отправитель:</div>
								<div class="col-xs-8"><?php 
        echo getUserNameById($v->shipper_id);
        ?>
 &nbsp;&nbsp;<a href="<?php 
        echo $cfg['options']['siteurl'];
        ?>
/newchat/<?php 
        echo $v->shipper_id;
        ?>
/new"><i class="fa fa-envelope"></i></a></div>
							</div>
							<div class="row" style="margin-bottom: 1em;">
								<div class="col-xs-4">Товар:</div>
								<div class="col-xs-8"><?php 
        echo $v->item;
        ?>
</div>
Example #9
0
 /**
  * 导出料号与箱号关联报表
  */
 public function view_exportBoxInfo()
 {
     require_once WEB_PATH . 'lib/PHPExcel.php';
     $objPHPExcel = new PHPExcel();
     $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")->setLastModifiedBy("Maarten Balliauw")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', '备货单号Shipment ID');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B1', '箱号CTN NO.');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C1', '料号SKU');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('D1', '每箱个数');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('E1', '优先上架Priority for Putaway');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('F1', '纸箱长度L(cm)');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('G1', '纸箱宽度W(cm)');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('H1', '纸箱高度H(cm)');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('I1', '体积CBM');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('J1', '每箱净重N.W(kg)');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('K1', '每箱毛重G.W(kg)');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('L1', '中文描述Goods Desc(CN)');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('M1', '英文描述 Goods Desc');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('N1', '材质Material');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('O1', '单价U/P(RMB)');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('P1', '总价TTL(RMB)');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('Q1', '单价U/P(USD)');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('R1', '总价TTL(USD)');
     $serOrderSn = isset($_GET['orderSn']) ? $_GET['orderSn'] : '';
     $serStatus = isset($_GET['status']) ? $_GET['status'] : '';
     $serSku = isset($_GET['sku']) ? $_GET['sku'] : '';
     $serStartTime = isset($_GET['startTime']) ? $_GET['startTime'] : '';
     $serEndTime = isset($_GET['endTime']) ? $_GET['endTime'] : '';
     $condition = '';
     if (!empty($serOrderSn)) {
         $condition .= " AND a.replenshId = '{$serOrderSn}'";
     }
     if (!empty($serSku)) {
         $condition .= " AND b.sku = '{$serSku}'";
     }
     if (!empty($serStatus)) {
         $condition .= " AND a.status = '{$serStatus}'";
     }
     if (!empty($serStartTime) && $serEndTime >= $serStartTime) {
         $serstart = strpos($serStartTime, ':') !== false ? strtotime($serStartTime) : strtotime($serStartTime . " 00:00:00");
         $serend = strpos($serEndTime, ':') !== false ? strtotime($serEndTime) : strtotime($serEndTime . " 23:59:59");
         $condition .= " AND a.addtime BETWEEN '{$serstart}' AND '{$serend}'";
     }
     $boxModel = new BoxManageModel();
     $rtnData = $boxModel->getListBoxInfo($condition);
     if (!empty($rtnData)) {
         $row = 2;
         foreach ($rtnData as $k => $v) {
             $orderSn = $v['replenshId'];
             $boxId = $v['boxid'];
             $length = $v['length'];
             $width = $v['width'];
             $high = $v['high'];
             $volume = round($v['volume'] / 1000000, 3);
             $grossWeight = $v['grossWeight'];
             $netWeight = $v['netWeight'];
             $addtime = date('Y-m-d', $v['addtime']);
             $status = $v['status'];
             $userName = getUserNameById($v['adduser']);
             $sku = $v['sku'];
             $num = $v['num'];
             $skuBase = $boxModel->getSkuBaseInfo($sku);
             $skuName = $skuBase['goodsName'];
             $skuPrice = $skuBase['goodsCost'];
             $totalRmb = $skuPrice * $num;
             switch ($status) {
                 case '1':
                     $stu = '已配货';
                     break;
                 case '2':
                     $stu = '已复核';
                     break;
                 case '3':
                     $stu = '已装柜';
                     break;
                 case '4':
                     $stu = '海外已收货';
                     break;
                 default:
                     $stu = '';
                     break;
             }
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A' . $row, $orderSn);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B' . $row, $boxId);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C' . $row, $sku);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('D' . $row, $num);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('E' . $row, '');
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('F' . $row, $length);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('G' . $row, $width);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('H' . $row, $high);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('I' . $row, $volume);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('J' . $row, $netWeight);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('K' . $row, $grossWeight);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('L' . $row, $skuName);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('M' . $row, '');
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('O' . $row, $skuPrice);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('P' . $row, $totalRmb);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('Q' . $row, '');
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('R' . $row, '');
             $row++;
         }
     }
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('A')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('B')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('C')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('D')->setWidth(10);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('E')->setWidth(30);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('F')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('G')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('H')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('I')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('J')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('K')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('L')->setWidth(30);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('M')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('N')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('O')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('P')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('Q')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('R')->setWidth(20);
     $title = "装柜清单" . date('Y-m-d');
     $titlename = $title . ".xls";
     $objPHPExcel->getActiveSheet()->setTitle($title);
     $objPHPExcel->setActiveSheetIndex(0);
     header('Content-Type: application/vnd.ms-excel');
     header("Content-Disposition: attachment;filename={$titlename}");
     header('Cache-Control: max-age=0');
     $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
     $objWriter->save('php://output');
 }
Example #10
0
				</div>
			<?php 
        }
        ?>
			<div class="col-md-2 col-xs-12">
				Чат с <?php 
        if ($v[0]->from_id == $user['id']) {
            $chatwith = $v[0]->to_id;
        } else {
            $chatwith = $v[0]->from_id;
        }
        ?>
				<?php 
        echo getUserIconById($chatwith);
        echo " ";
        echo getUserNameById($chatwith);
        ?>
			</div>
			<div class="col-md-7 col-xs-12"><?php 
        echo preg_replace("/[\n|\r|\r\n|\n\r]+/", "<br><br>", $v[0]->text);
        ?>
</div>
			<div class="col-md-2 col-xs-12 text-right"><small class="text-muted"><?php 
        echo $v[0]->time;
        ?>
</small></div>

		</div>
	</a>
	<hr style="margin: 0;">
	<?php 
Example #11
0
 /**
  * WhGoodsAssignAct::export_data()
  * 导出调拨数据 
  * @return void
  */
 public function export_data()
 {
     $ids = trim($_GET['ids']);
     if ($ids) {
         $assignList = WhGoodsAssignModel::getAssignList(" and a.id in ({$ids})", '', '', 'a.id');
         $assign_status = C('assign_status');
         //print_r($assign_status);exit;
         $name = 'assignList' . date('Y-m-d') . ".xls";
         //$name   =   iconv('UTF-8', 'gb2312//ignore', $name);
         $excel = new ExportDataExcel('browser', $name);
         $excel->initialize();
         $tharr = array("调拨单号", "SKU", "产品名称", "转出仓库", "转入仓库", "需求数量", "配货数量", '出库复核数量', '接收数量', '生成人员', '生成时间', '调拨单状态', '状态变更时间');
         $excel->addRow($tharr);
         if (!empty($assignList)) {
             foreach ($assignList as $assign) {
                 $outStore = WarehouseManagementModel::warehouseManagementModelList(" where id = {$assign['outStoreId']}");
                 $outStore = $outStore[0]['whName'];
                 $inStore = WarehouseManagementModel::warehouseManagementModelList(" where id = {$assign['inStoreId']}");
                 $inStore = $inStore[0]['whName'];
                 $maker = getUserNameById($assign['createUid']);
                 $make_date = date('Y-m-d H:i:s', $assign['createTime']);
                 $state_date = date('Y-m-d H:i:s', $assign['statusTime']);
                 $status = $assign_status[$assign['status']];
                 $details = WhGoodsAssignModel::getsAssignListDetail($assign['id']);
                 foreach ($details as $k => $val) {
                     $tdarr = array($k == 0 ? $assign['assignNumber'] : '', $val['sku'], $val['goodsName'], $outStore, $inStore, $val['num'], $val['assignNum'], $val['outCheckNum'], $val['inCheckNum'], $k == 0 ? $maker : '', $k == 0 ? $make_date : '', $k == 0 ? $status : '', $k == 0 ? $state_date : '');
                     //print_r($tdarr);exit;
                     $excel->addRow($tdarr);
                 }
             }
         }
         $excel->finalize();
         exit;
     }
 }
Example #12
0
function getEmpathizerUserNameByDbToken($iDbTokenSg)
{
    global $wpdb;
    $tTableNameSg = getCallRecordTableName();
    $tDbTokenColNameSg = DatabaseAttributes::database_token;
    $tEmpathizerColumnSg = DatabaseAttributes::empathizer_id;
    $tQuerySg = "SELECT {$tEmpathizerColumnSg} FROM {$tTableNameSg} WHERE {$tDbTokenColNameSg}='{$iDbTokenSg}'";
    $tCallRecordsItemsMix = $wpdb->get_results($tQuerySg, ARRAY_N);
    $userId = $tCallRecordsItemsMix[0][0];
    $rEmailSg = getUserNameById($userId);
    return $rEmailSg;
}
Example #13
0
	
	<?php 
foreach ($chat as $v) {
    ?>
		<div class="row <?php 
    if ($v->is_read == 0) {
        echo 'bg-unread';
    }
    ?>
" style="padding:1em;">

			<div class="col-md-2 col-xs-12">
				<?php 
    echo getUserIconById($v->from_id);
    echo " ";
    echo getUserNameById($v->from_id);
    ?>
			</div>
			<div class="col-md-7 col-xs-12"><?php 
    echo preg_replace("/[\n|\r|\r\n|\n\r]+/", "<br><Br>", $v->text);
    ?>
</div>
			<div class="col-md-2 col-xs-12 text-right"><small class="text-muted"><?php 
    echo $v->time;
    ?>
</small></div>
			
		</div>
	<hr style="margin:0;">
	<?php 
}
Example #14
0
"></ul>
                        </div>

                        <div style="width:296px;float:right;margin-left:-5px;">
                            <ul class="rater-users raterusers-<?php 
        echo $project['project_id'];
        ?>
" data-id="<?php 
        echo $project['project_id'];
        ?>
">
                                <!--                --><?php 
        //$raters = getRatersForProject($project_id);
        if ($raters) {
            foreach ($raters as $rater) {
                echo '<div class="rater-users-list" data-id="' . $rater['rater_id'] . '" user-id="' . $rater['user_id'] . '"><span class="remove-rater" data-id="' . $rater['rater_id'] . '" user-id="' . $rater['user_id'] . '">X</span><a href="' . SITE_URL . '/user.php?uid=' . $rater['user_id'] . '"><li class="rater-name">' . getUserNameById($rater['user_id']) . '</li></a></div>';
            }
        }
        ?>
                            </ul>
                            <div class="success-message"></div>
                        </div>

                    </div> <!-- project-rater-area -->
                </td>
                <td>
                    <?php 
        // $rate = getAdminRatedStatus($project['project_id'], $_SESSION['uid']);
        $value = getAdminRateForProject($project['project_id'], $_SESSION['uid']);
        if ($project['seed_rating'] == 0) {
            $seed = 'N/A';
Example #15
0
                            <input type="text" id="route-search" placeholder="Type Your Router Name"
                                   data-id="<?php 
        echo $_SESSION['uid'];
        ?>
"/>
                            <input type="hidden" id="route-button" value="Search"/>
                            <ul id="route-result"></ul>
                        </div>

                        <div style="width:296px;float:right;margin-left:-20px;cursor: pointer;">
                            <ul class="routed-users">
                                <?php 
        $routers = getRoutersForProject($project['project_id'], $_SESSION['uid']);
        if ($routers) {
            foreach ($routers as $router) {
                echo '<div class="routed-users-list" data-id="' . $router['router_id'] . '" user-id="' . $router['routed_to'] . '"><span class="unroute" data-id="' . $router['router_id'] . '" user-id="' . $router['routed_to'] . '">X</span><a href="' . SITE_URL . '/user.php?uid=' . $router['routed_to'] . '"><li class="routed-name">' . getUserNameById($router['routed_to']) . '</li></a></div>';
            }
        }
        //
        ?>
                            </ul>
                            <div class="success-message"></div>
                        </div>
                        <!--                        <div class="routers-set">-->

                        <!--                        </div> <!-- routers-set -->
                    </div> <!-- route-area -->


                           <!-- report area -->
                    <div class="report-area">
Example #16
0
 public function view_getWhIoRecordsList()
 {
     $type = isset($_GET['type']) ? $_GET['type'] : '';
     $status = isset($_GET['status']) ? $_GET['status'] : '';
     $ioType = isset($_GET['ioType']) ? $_GET['ioType'] : '';
     if (intval($ioType) != 1 && intval($ioType) != 2) {
         //1为出库,2为入库
         $this->smarty->assign('$toptitle', '出入库记录列表');
         $this->smarty->assign('status', '参数错误');
         $this->smarty->assign('whIoRecordsList', null);
         //循环列表
         $this->smarty->display("whIoRecords.htm");
     } else {
         $ioType = intval($ioType);
         $whIoRecordsAct = new WhIoRecordsAct();
         $where = "WHERE ioType='{$ioType}' ";
         if ($type == 'search') {
             $id = isset($_GET['id']) ? post_check($_GET['id']) : '';
             $ordersn = isset($_GET['ordersn']) ? post_check($_GET['ordersn']) : '';
             $ioTypeId = isset($_GET['ioTypeId']) ? post_check($_GET['ioTypeId']) : '';
             $sku = isset($_GET['sku']) ? post_check($_GET['sku']) : '';
             $purchaseId = isset($_GET['purchaseId']) ? post_check($_GET['purchaseId']) : '';
             $userId = isset($_GET['userId']) ? post_check($_GET['userId']) : '';
             $positionId = isset($_GET['position']) ? post_check($_GET['position']) : '';
             $cStartTime = isset($_GET['cStartTime']) ? post_check($_GET['cStartTime']) : '';
             $cEndTime = isset($_GET['cEndTime']) ? post_check($_GET['cEndTime']) : '';
             if (!empty($id)) {
                 $where .= "AND id='{$id}' ";
             }
             if (!empty($ordersn)) {
                 $where .= "AND ordersn='{$ordersn}' ";
             }
             if (!empty($ioTypeId)) {
                 $where .= "AND ioTypeId='{$ioTypeId}' ";
             }
             if (!empty($sku)) {
                 $where .= "AND sku='{$sku}' ";
             }
             if (!empty($purchaseId)) {
                 $purchaseId = getUserIdByName($purchaseId);
                 $where .= "AND purchaseId='{$purchaseId}' ";
             }
             if (!empty($userId)) {
                 $userId = getUserIdByName($userId);
                 $where .= "AND userId='{$userId}' ";
             }
             if ($positionId) {
                 $positionId = WhPositionDistributionModel::get_position_info('id', '', $positionId);
                 $positionId = empty($positionId) ? '-1' : $positionId[0]['id'];
                 $where .= "AND positionId = '{$positionId}' ";
             }
             if (!empty($cStartTime)) {
                 $startTime = strtotime($cStartTime . '00:00:00');
                 $where .= "AND createdTime >='{$startTime}' ";
             }
             if (!empty($cEndTime)) {
                 $endTime = strtotime($cEndTime . '23:59:59');
                 $where .= "AND createdTime <='{$endTime}' ";
             }
         }
         $total = $whIoRecordsAct->act_getTNameCount('wh_iorecords', $where);
         $num = 100;
         //每页显示的个数
         $page = new Page($total, $num, '', 'CN');
         $where .= "ORDER BY createdTime DESC " . $page->limit;
         $whIoRecordsList = $whIoRecordsAct->act_getTNameList('wh_iorecords', '*', $where);
         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));
         }
         $toptitle = '出库记录列表';
         $ioSearchName = '出库类型';
         $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '库存信息'), array('url' => '', 'title' => '出库记录列表'));
         $this->smarty->assign('toplevel', 0);
         $this->smarty->assign('secondlevel', '34');
         $ioTypeList = WhIoStoreModel::getIoTypeListByioType(0);
         if ($ioType == 2) {
             $toptitle = '入库记录列表';
             $ioSearchName = '入库类型';
             $this->smarty->assign('secondlevel', 35);
             $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '库存信息'), array('url' => '', 'title' => '入库记录列表'));
             $ioTypeList = WhIoStoreModel::getIoTypeListByioType(1);
         }
         $this->smarty->assign('toptitle', $toptitle);
         $this->smarty->assign('ioSearchName', $ioSearchName);
         $this->smarty->assign('ioTypeList', $ioTypeList);
         $this->smarty->assign('navlist', $navlist);
         $this->smarty->assign('show_page', $show_page);
         $this->smarty->assign('status', $status);
         $usermodel = UserModel::getInstance();
         foreach ($whIoRecordsList as $key => $val) {
             $whIoRecordsList[$key]['ioTypeName'] = WhIoStoreModel::getIoTypeNameById($val['ioTypeId']);
             $whIoRecordsList[$key]['whName'] = WhIoStoreModel::getWhNameById($val['storeId']);
             $purchase_user_info = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id='{$val['purchaseId']}'", '', 'limit 1');
             $whIoRecordsList[$key]['purchaseName'] = $purchase_user_info[0]['global_user_name'];
             //$user_info 		   					   = $usermodel->getGlobalUserLists('global_user_name',"where a.global_user_id='{$val['userId']}'",'','limit 1');
             //$whIoRecordsList[$key]['userName']	   = $user_info[0]['global_user_name'];
             $whIoRecordsList[$key]['userName'] = getUserNameById($val['userId']);
             $position_info = whShelfModel::selectPosition("where id={$val['positionId']}");
             $whIoRecordsList[$key]['pName'] = $position_info[0]['pName'];
         }
         $this->smarty->assign('whIoRecordsList', $whIoRecordsList ? $whIoRecordsList : null);
         //循环列表
         $this->smarty->display("whIoRecords.htm");
     }
 }
Example #17
0
				<?php 
        // тут все фотки и лейблы
        if ($user['rankname'] == 'admin') {
            ?>
					<div class="panel panel-default">
						<div class="panel-heading"><strong class="panel-title">Загрузки</strong></div>
						<div class="panel-body">
							
							<?php 
            $qUploads = $db->query("SELECT * FROM `uploads` WHERE `pkg_id` = " . $v->id . " ORDER BY `time` DESC");
            if (isset($qUploads[0])) {
                foreach ($qUploads as $vUploads) {
                    ?>
										<div class="row" style="margin-bottom: 1em;">
											<div class="col-xs-4"><?php 
                    echo getUserNameById($vUploads->user_id);
                    ?>
</div>
											<div class="col-xs-8">
												<?php 
                    if (preg_match("/\\.pdf\$/is", $vUploads->filename)) {
                        echo "<a href='" . $cfg['options']['siteurl'] . '/upload/' . $vUploads->filename . "'>PDF файл</a><br>";
                    } else {
                        echo "<img src='" . $cfg['options']['siteurl'] . '/upload/' . $vUploads->filename . "' height=120>" . "<br>";
                    }
                    echo $vUploads->time;
                    ?>
											</div>
										</div>
							<hr>
										
    function content_53185b7c9df157_47226703($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_date_format')) {
            include 'E:\\erpNew\\wh.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);
        ?>

<?php 
        echo $_smarty_tpl->getSubTemplate('whNav.htm', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<script type="text/javascript" src="./js/whIoStore.js"></script>
<script type="text/javascript" src="./js/fancybox.js"></script>
<script type="text/javascript" src="./js/My97DatePicker/WdatePicker.js"></script>
            <div class="servar wh-servar">
    				<span>
                        <input id="ioType" type="hidden" value="<?php 
        echo $_smarty_tpl->tpl_vars['ioType']->value;
        ?>
"/>
                        <!-- TODO: <input id="userId" type="hidden" value="<?php 
        echo $_SESSION['userId'];
        ?>
"/> -->
    					<label for="ordersn">单据编码:</label>
    					<input name="ordersn" id="ordersn" value="<?php 
        echo $_smarty_tpl->tpl_vars['g_ordersn']->value;
        ?>
"/>
                        &nbsp;|&nbsp;
                        <label for="ioStatus">状态:</label>
                        <select name="ioStatus" id="ioStatus">
                            <option value='1' <?php 
        if ($_GET['iostatus'] == 1) {
            ?>
selected="selected"<?php 
        }
        ?>
>待审核</option>
                            <option value='2' <?php 
        if ($_GET['iostatus'] == 2) {
            ?>
selected="selected"<?php 
        }
        ?>
>审核通过</option>
                            <option value='3' <?php 
        if ($_GET['iostatus'] == 3) {
            ?>
selected="selected"<?php 
        }
        ?>
>审核不通过</option>
                        </select>
                        &nbsp;|&nbsp;
                        <label for="invoiceTypeId"><?php 
        echo $_smarty_tpl->tpl_vars['ioSearchName']->value;
        ?>
:</label>
                        <select name="invoiceTypeId" id="invoiceTypeId">
                            <option value='0' <?php 
        if ($_GET['select'] == 0) {
            ?>
selected="selected"<?php 
        }
        ?>
>请选择</option>
                            <?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['invoiceTypeList']->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;
            ?>
                            <option value='<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
' <?php 
            if ($_GET['invoicetypeid'] == $_smarty_tpl->tpl_vars['value']->value['id']) {
                ?>
selected="selected"<?php 
            }
            ?>
><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['invoiceName'];
            ?>
</option>
                            <?php 
        }
        ?>
                        </select>
                        &nbsp;|&nbsp;
                        <label for="cStartTime">创建时间:</label>
                        <input onclick="WdatePicker()" id='cStartTime' name="cStartTime" value='<?php 
        echo $_smarty_tpl->tpl_vars['g_cStartTime']->value;
        ?>
'/>
                        &nbsp;至&nbsp;
                        <input onclick="WdatePicker()" id='cEndTime' name="cEndTime" value='<?php 
        echo $_smarty_tpl->tpl_vars['g_cEndTime']->value;
        ?>
' />
                        &nbsp;|&nbsp;
						<button id="search">搜索</button>
    				</span>
                    &nbsp;&nbsp;
                    <span style="color: red;"><?php 
        echo $_smarty_tpl->tpl_vars['status']->value;
        ?>
</span>
            </div>
            <div class="align-main main order-main products-main">
            	<?php 
        $_smarty_tpl->tpl_vars['InStoreList'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['InStoreList']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['InStoreLists']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['InStoreList']->key => $_smarty_tpl->tpl_vars['InStoreList']->value) {
            $_smarty_tpl->tpl_vars['InStoreList']->_loop = true;
            ?>
                <table cellspacing="0" width="100%" class="products-action">
                    <tr class="title">
                        <td colspan="5">
                            <span>单号:<?php 
            echo $_smarty_tpl->tpl_vars['InStoreList']->value['ordersn'];
            ?>
</span>
                            <span>类型:<?php 
            echo $_smarty_tpl->tpl_vars['InStoreList']->value['invoiceName'];
            ?>
</span>
                            <span>申请人:<?php 
            echo getUserNameById($_smarty_tpl->tpl_vars['InStoreList']->value['userId']);
            ?>
</span>
                            <span>状态:<?php 
            if ($_smarty_tpl->tpl_vars['InStoreList']->value['ioStatus'] == 1) {
                ?>
待审核<?php 
            }
            if ($_smarty_tpl->tpl_vars['InStoreList']->value['ioStatus'] == 2) {
                ?>
审核通过<?php 
            }
            if ($_smarty_tpl->tpl_vars['InStoreList']->value['ioStatus'] == 3) {
                ?>
审核不通过<?php 
            }
            ?>
</span>
                            <span>提交时间:<?php 
            echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['InStoreList']->value['createdTime'], "Y-m-d H:i");
            ?>
</span>
                            <span>付款方式:<?php 
            echo $_smarty_tpl->tpl_vars['InStoreList']->value['paymentMethods'];
            ?>
</span>
                            <span>仓库:<?php 
            echo $_smarty_tpl->tpl_vars['InStoreList']->value['whName'];
            ?>
</span>
							<span>备注:<?php 
            echo $_smarty_tpl->tpl_vars['InStoreList']->value['note'];
            ?>
</span>
                        </td>
                    </tr>
                    <?php 
            $_smarty_tpl->tpl_vars['detailList'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['detailList']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['InStoreList']->value['detail'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['detailList']->key => $_smarty_tpl->tpl_vars['detailList']->value) {
                $_smarty_tpl->tpl_vars['detailList']->_loop = true;
                ?>
                    <tr>
                        <td style="width:100px;" class="unpicurl">
							<a href="javascript:void(0)" id="imga-<?php 
                echo $_smarty_tpl->tpl_vars['detailList']->value['sku'];
                ?>
" class="fancybox">
								<img src="./images/ajax-loader.gif" name="skuimg" width="50" height="50" id="imgs-<?php 
                echo $_smarty_tpl->tpl_vars['detailList']->value['sku'];
                ?>
" spu="<?php 
                echo $_smarty_tpl->tpl_vars['detailList']->value['spu'];
                ?>
">
						   </a>
						</td>
                        <td width="30%"><?php 
                echo getSKUName($_smarty_tpl->tpl_vars['detailList']->value['sku']);
                ?>
</td>
                        <td><?php 
                echo $_smarty_tpl->tpl_vars['detailList']->value['sku'];
                ?>
</td>
                        <td>数量:<?php 
                echo $_smarty_tpl->tpl_vars['detailList']->value['amount'];
                ?>
</td>
                        <td>单价:<?php 
                echo $_smarty_tpl->tpl_vars['detailList']->value['cost'];
                ?>
 </td>
                    </tr>
                    <?php 
            }
            if (!$_smarty_tpl->tpl_vars['detailList']->_loop) {
                ?>
                    <tr>
                        <td colspan="5" style="width:100px;">
                        	无SKU数据
                        </td>
                    </tr>
                	<?php 
            }
            ?>
                    <tr>
                        <td colspan="5">
                            <table>
                                <tr>
                                	<?php 
            $_smarty_tpl->tpl_vars['auditlist'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['auditlist']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['InStoreList']->value['auditlist'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['auditlist']->key => $_smarty_tpl->tpl_vars['auditlist']->value) {
                $_smarty_tpl->tpl_vars['auditlist']->_loop = true;
                ?>
                                    <?php 
                if ($_smarty_tpl->tpl_vars['auditlist']->value['auditinfo']) {
                    ?>
                                    <td valign="middle" class="<?php 
                    if ($_smarty_tpl->tpl_vars['auditlist']->value['auditinfo']['auditStatus'] == 1) {
                        ?>
font-pass<?php 
                    }
                    if ($_smarty_tpl->tpl_vars['auditlist']->value['auditinfo']['auditStatus'] == 2) {
                        ?>
font-red<?php 
                    }
                    ?>
"><?php 
                    echo getUserNameById($_smarty_tpl->tpl_vars['auditlist']->value['auditinfo']['auditUser']);
                    ?>
</td>
                                    <td class="pass" style="width:120px;padding-bottom:40px;" valign="middle" align="center">
                                        <?php 
                    echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['auditlist']->value['auditinfo']['auditTime'], "Y-m-d H:i");
                    ?>

                                    </td>
                                    <?php 
                    if ($_smarty_tpl->tpl_vars['auditlist']->value['auditinfo']['auditStatus'] == 2) {
                        ?>
                                    <td valign="middle" class="unpassendding"></td>
                                    <?php 
                        break 1;
                        ?>
                                    <?php 
                    }
                    ?>
                                    <?php 
                } else {
                    ?>
                                    <td valign="middle">
                                        <ul>
                                        <?php 
                    $_smarty_tpl->tpl_vars['audituserlist'] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars['audituserlist']->_loop = false;
                    $_from = $_smarty_tpl->tpl_vars['auditlist']->value['audituserlist'];
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars['audituserlist']->key => $_smarty_tpl->tpl_vars['audituserlist']->value) {
                        $_smarty_tpl->tpl_vars['audituserlist']->_loop = true;
                        ?>
                                            <li class="font-unpass" ><?php 
                        echo getUserNameById($_smarty_tpl->tpl_vars['audituserlist']->value['auditorId']);
                        ?>
</li>
                                        <?php 
                    }
                    ?>
                                        </ul>
                                    </td>
                                    <td class="unpass" style="width:120px;padding-bottom:37px;" valign="middle" align="center">
                                    <?php 
                }
                ?>
                                    <?php 
            }
            ?>
                                    </td>
                                    <?php 
            if ($_smarty_tpl->tpl_vars['InStoreList']->value['ioStatus'] == 2) {
                ?>
                                    <td valign="middle" class="passendding">
									<?php 
            }
            ?>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <?php 
        }
        if (!$_smarty_tpl->tpl_vars['InStoreList']->_loop) {
            ?>
                	<div align="center">无数据</div>
                <?php 
        }
        ?>
</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() {
	var url  = "json.php?mod=common&act=getSkuImg";
	var skuArr	= $('img[name="skuimg"]'), imgurl="", spu="", sku="";
	$.each(skuArr,function(i,item){
		sku	= $(item).attr('id').substring(5);
		spu	= $(item).attr('spu');
		$.ajax({
			url: url,
			type: "POST",
			async: true,
			data	: {spu:spu,sku:sku},
			dataType: "jsonp",
			success: function(rtn){
							sku	= $(item).attr('id').substring(5);
							//console.log(rtn);
							if ($.trim(rtn.data)) {
								$("#imgs-"+sku).attr({"src":rtn.data,"width":"60px","height":"60px"});
							    $("#imga-"+sku).attr("href",rtn.data);
							} else {
								$("#imgs-"+sku).attr({"src":"./images/no_image.gif","width":"60px","height":"60px"});
							    $("#imga-"+sku).attr("href","./images/no_image.gif");
							}
				}	
			});
	});
});

</script><?php 
    }
Example #19
0
 public function view_invList()
 {
     $now_time = date("Y-m-d H:i:s", time());
     $state = isset($_GET['state']) ? post_check($_GET['state']) : '';
     $this->smarty->assign('state', $state);
     $reason = array();
     $invPeople = isset($_GET['invPeople']) ? $_GET['invPeople'] : '';
     $sku = isset($_GET['sku']) ? post_check($_GET['sku']) : '';
     $invType = isset($_GET['invType']) ? $_GET['invType'] : '';
     $auditStatus = isset($_GET['auditStatus']) ? $_GET['auditStatus'] : 3;
     $startdate = isset($_GET['startdate']) ? post_check($_GET['startdate']) : '';
     $enddate = isset($_GET['enddate']) ? post_check($_GET['enddate']) : '';
     $InventoryAct = new InventoryAct();
     $where = 'where storeId=1 ';
     if ($invPeople) {
         $where .= "and invPeople ='{$invPeople}' ";
         $this->smarty->assign('invPeople', $invPeople);
     }
     if ($sku) {
         $where .= "and sku ='{$sku}' ";
         $this->smarty->assign('sku', $sku);
     }
     if ($invType) {
         $where .= "and invType ='{$invType}' ";
         $this->smarty->assign('invType', $invType);
     }
     if ($auditStatus != 3) {
         $where .= "and auditStatus ='{$auditStatus}' ";
     }
     $this->smarty->assign('auditStatus', $auditStatus);
     if ($startdate) {
         $starttime = strtotime($startdate);
         $where .= "and invTime >='{$starttime}' ";
     } else {
         $startdate = $now_time;
     }
     $this->smarty->assign('startdate', $startdate);
     if ($enddate) {
         $endtime = strtotime($enddate);
         $where .= "and invTime <='{$endtime}' ";
     } else {
         $enddate = $now_time;
     }
     $this->smarty->assign('enddate', $enddate);
     $total = $InventoryAct->act_getInvNum($where);
     $num = 80;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= "order by sku, id " . $page->limit;
     $inventory_info = $InventoryAct->act_getInvRecordList('*', $where);
     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);
     //盘点原因
     if (!empty($inventory_info)) {
         foreach ($inventory_info as $key => $info) {
             $reason_info = InvReasonModel::getInvReasonList("reasonName", "where id='{$info['reasonId']}'");
             $reason[$info['id']] = $reason_info[0]['reasonName'];
             $sku_info = getSkuInfoBySku($info['sku']);
             $inventory_info[$key]['goodsCost'] = $sku_info['goodsCost'];
             $inventory_info[$key]['purchaseName'] = $sku_info['purchaseId'] ? getUserNameById($sku_info['purchaseId']) : '无';
             $inventory_info[$key]['remark'] = $info['remark'] ? $info['remark'] : '';
             //新增等待上架数量 add by Gary
             $tallyList = OmAvailableModel::getTNameList('wh_tallying_list', 'sum(ichibanNums) ichibanNums, sum(shelvesNums) shelvesNums', "where sku='{$info['sku']}' and tallyStatus=0 and is_delete = 0");
             $ichibanNums = intval($tallyList[0]['ichibanNums']);
             $shelvesNums = intval($tallyList[0]['shelvesNums']);
             $inventory_info[$key]['wait_whself'] = $ichibanNums - $shelvesNums;
         }
     }
     $usermodel = UserModel::getInstance();
     //盘点员
     $iqc_user = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job in(162,165)", '', '');
     $this->smarty->assign('iqc_user', $iqc_user);
     $this->smarty->assign('inventory_info', $inventory_info ? $inventory_info : array());
     $this->smarty->assign('reason', $reason);
     $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=invList', 'title' => '盘点列表'));
     $toplevel = 0;
     //一级菜单的序号  0 开始
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = 04;
     //当前的二级菜单
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toptitle', '盘点列表');
     $this->smarty->assign('curusername', $_SESSION['userName']);
     $this->smarty->display('inventoryInfo.htm');
 }
Example #20
0
function showJoinApprove()
{
    $leader_id = $_SESSION["user_id"];
    $leader_name = getUserNameById($leader_id);
    try {
        $pdo = new PDO("mysql:host=" . DBHOST . "; port=" . DBPORT . "; dbname=" . DBNAME, DBUSER, DBPASS);
        //$pdo = new PDO("mysql:host=localhost; dbname=pray","pray", "pray");
        $smt = $pdo->prepare("SELECT * FROM waitForJoinGroup, groups WHERE groups.leader_id={$leader_id} AND groups.group_id=waitForJoinGroup.group_id");
        if (!$smt->execute()) {
            print_r($smt->errorInfo());
        }
        // 取第一个记录进行处理
        if ($row = $smt->fetch()) {
            $user_id = $row["user_id"];
            $group_id = $row["group_id"];
            $user_name = getUserNameById($user_id);
            $group_name = $row["name"];
            $output = <<<HERE
                <header class="fixedHeader">
                    <div class="headerLeftButton">
                        <a href="groupList.php"><img border="0" src="images\\backButton.jpg" width="30" height="30"></a>
                    </div>
                    <div class="headerTitle">
                        join request
                    </div>
                </header>
                <section class="sectionWithFooter">
                    <br/>
                    <h1><mark>{$user_name}</mark> want to join group <mark>{$group_name}</mark>, do you accept?</h1>
                    <form method="post">
                        <input type="hidden" name="user_id" value={$user_id}/>
                        <input type="hidden" name="group_id" value={$group_id}/>
                        <button class="largeButton" name="isAccept" value=1>accept</button><br/>
                        <button class="mediumButton" name="isAccept" value=0>reject</button>
                    </form>
                </section>
                <footer class="fixedFooter">
                    <div class="footerTitle">user:&nbsp;{$leader_name}</div>
                </footer>
HERE;
            print $output;
        }
    } catch (Exception $ex) {
        echo 'ERROR: ' . $ex->getMessage();
    }
}
 function setNotificationDeatils($friends, $msg)
 {
     if (isset($_SESSION['user_id'])) {
         $user_id = $_SESSION['user_id'];
     } else {
         $user_id = 0;
     }
     $userdetails = getUserNameById($user_id);
     $conn = getDBConnection();
     try {
         $notify = mysql_query("select * from users where id in ({$friends})", $conn);
         if (mysql_num_rows($notify) > 0) {
             while ($row = mysql_fetch_array($notify)) {
                 $to = $row['push_notify_id'];
                 //registration ID of the device
                 $title = $userdetails[0];
                 $message = $msg;
                 $this->sendPushNotification($to, $title, $message);
             }
         }
         closeDBConnection($conn);
     } catch (Exception $ex) {
         echo $ex->getMessage();
     }
 }
Example #22
0
 public function act_export()
 {
     $checkUser = $_GET['checkUser'];
     $status = $_GET['status'];
     $sku = $_GET['sku'];
     $startdate = $_GET['startdate'];
     $enddate = $_GET['enddate'];
     if (empty($checkUser) && empty($status) && empty($sku) && empty($startdate) && empty($enddate)) {
         echo "请选择导出条件";
         exit;
     }
     if (!empty($checkUser)) {
         $where[] = "a.labelUserId='{$checkUser}'";
     }
     if (!empty($status)) {
         if ($status == 1) {
             $where[] = "a.labelUserId is NULL";
         }
         if ($status == 2) {
             $where[] = "a.labelUserId is not NULL";
         }
     }
     if (!empty($sku)) {
         $where[] = "b.sku = '{$sku}'";
     }
     if (!empty($startdate)) {
         $start = strtotime($startdate);
         $where[] = "a.labelTime >={$start}";
     }
     if (!empty($enddate)) {
         $end = strtotime($enddate);
         $where[] = "a.labelTime <={$end}";
     }
     $where = implode(" AND ", $where);
     $where = " where a.is_delete=0 and a.status=1 and " . $where . " order by a.id desc";
     $lists = PasteLabelModel::selectList($where);
     $excel = new ExportDataExcel('browser', "labelKpiExport" . date('Y-m-d') . ".xls");
     $excel->initialize();
     $tharr = array("贴标人", "贴标时间", "SKU", "数量", "分组号", "批次号");
     $excel->addRow($tharr);
     foreach ($lists as $list) {
         if (!empty($list['labelUserId'])) {
             $user = getUserNameById($list['labelUserId']);
             $time = date('Y-m-d H:i:s', $list['labelTime']);
         } else {
             $user = '';
             $time = '';
         }
         $sku = $list['sku'];
         $num = $list['labelNum'];
         $id = $list['id'];
         $batchNum = $list['batchNum'];
         $tdarr = array($user, $time, $sku, $num, $id, $batchNum);
         $excel->addRow($tdarr);
     }
     $excel->finalize();
     exit;
 }
Example #23
0
function declineRoute($routed_by, $user_id, $notify_id)
{
    global $db_con;
    $q = 'DELETE FROM `routers` WHERE `user_id` = ' . $user_id . ' AND `routed_by` = ' . $routed_by;
    $db_con->query($q);
    $q = 'DELETE FROM `notifications` WHERE `notify_id` = ' . $notify_id;
    $db_con->query($q);
    $author = getUserNameById($user_id);
    $text = $author . ' declined your route';
    addNotification($routed_by, $text, $user_id);
}
Example #24
0
 /**
  * 获取海外料号新品迁移记录信息返回更新到旧ERP系统海外采购人
  */
 public static function getOverSkuMoveLogInfo($page, $pagenum)
 {
     self::initDB();
     $rtnData = array();
     $rtnInfo = array();
     $start = ($page - 1) * 200;
     $pagenum = 200;
     $sql = "SELECT * FROM ow_new_sku_move ";
     $sql .= "limit {$start}, {$pagenum} ";
     $query = self::$dbConn->query($sql);
     $data = self::$dbConn->fetch_array_all($query);
     if (!empty($data)) {
         $rtnData = $data;
         $mark = 0;
         foreach ($rtnData as $k => $v) {
             $sku = $v['sku'];
             $purId = $v['cguserId'];
             $cguser = getUserNameById($purId);
             $rtnInfo[$mark]['sku'] = $sku;
             $rtnInfo[$mark]['cguser'] = $cguser;
             $mark++;
             $upd = "UPDATE pc_goods SET OverSeaSkuCharger = '{$purId}' WHERE sku = '{$sku}'";
             self::$dbConn->query($upd);
         }
     }
     return $rtnInfo;
 }
 * 日期:2014/01/16
 * 作者:管拥军
 * add cxy 
 * data 2014-8-20
 */
error_reporting(-1);
set_time_limit(0);
require_once WEB_PATH . "framework.php";
//Core::getInstance();
global $dbConn;
$userId = $_SESSION['userId'];
if (empty($userId)) {
    exit("{\"errCode\":\"-1\",\"errMsg\":\"登录超时\"}");
}
############### 基础信息配置 ######################
$truename = getUserNameById($userId);
//echo $truename;exit;
$orderid_arr = isset($_POST['ids']) ? trim($_POST['ids']) : '';
//print_r($orderid_arr);exit;
if (empty($orderid_arr)) {
    exit('{"errCode":"-1","errMsg":"没有选择需要导出的订单信息!"}');
}
$accouts = "'360beauty','365digital','befashion','befdi','befdimall','bestinthebox','betterdeals255','cafase88','charmday88','choiceroad','cndirect55','cndirect998','dealinthebox','digitalzone88','doeon','dresslink','easebon','easydeal365','easydealhere','easyshopping678','easytrade2099','elerose88','enicer','enjoy24hours','eshop2098','freemart21cn','futurestar99','happydeal88','ishop2099','itshotsale77','keyhere','niceforu365','niceinthebox','starangle88','sunwebhome','sunwebzone','tradekoo','voguebase55','wellchange','work4best','zealdora'";
$country = "United States";
//$author		= array('vipchen','guanyongjun','孙学轩','陈前');
$today = date('Y-m-d', time());
$stime = strtotime($today . "-1 day 00:00:01");
$etime = strtotime($today . " 23:59:59");
//$condition	= "1 AND ebay_id IN({$orderids}) AND ebay_carrier='UPS美国专线' ";
//$filename	= "ship_ups_us_".$truename."_".$today."_".time().".xml";
//$shipxml	= WEB_PATH."/html/temp/".$filename;
Example #26
0
function getLinkToUserProfile($id)
{
    global $user, $cfg;
    if ($user['rankname'] != 'admin' && $user['rankname'] != 'support' && $user['rankname'] != 'labler') {
        $out = getFullUserNameById($id);
    } else {
        if (getRankNameByUserId($id) == 'drop') {
            $note = getUserNote($id);
            $out = '<a href="' . $cfg['options']['siteurl'] . '/userInfo/' . $id . '"  data-title="' . $note . '" data-toggle="tooltip" data-placement="top">' . colorText(getFullUserNameById($id), getUserColor($id)) . '</a>';
        } else {
            $note = getUserNote($id);
            $out = '<a href="' . $cfg['options']['siteurl'] . '/userInfo/' . $id . '"  data-title="' . $note . '" data-toggle="tooltip" data-placement="top">' . colorText(getUserNameById($id), getUserColor($id)) . '</a>';
        }
    }
    return $out;
}
Example #27
0
    ?>
                            <form action="" method="post">
                                <div class="form-item no-height"><textarea name="footnote" id="footnote"
                                                                           maxlength="111"></textarea> <input
                                        type="submit" name="add_foonote" value="Add"></div>
                                <input type="hidden" name="investor_id" value="<?php 
    echo $investor['investor_id'];
    ?>
">
                            </form>
                        <?php 
}
$footnotes = getFootnotesForInvestor($investor['investor_id']);
if ($footnotes) {
    foreach ($footnotes as $ix => $notes) {
        echo '<a href="' . SITE_URL . '/user.php?uid=' . $notes['created_by'] . '"><p>' . getUserNameById($notes['created_by']) . '</a>' . ' : ' . $notes['text'] . '</p>';
    }
}
?>
                    </div> <!-- footnote content-block -->


        </div> <!-- main-content -->


    </div> <!-- account inner-page content -->

    <?php 
include DIR_INCLUDE . 'right_side.php';
?>
Example #28
0
 /**
  * whGoodsAssignView::view_editAssignList()
  * 调拨单修改界面
  * @return void
  */
 public function view_editAssignList()
 {
     self::bulidNav('修改调拨单', '修改调拨单', 51);
     $id = intval(trim($_GET['id'])) ? intval(trim($_GET['id'])) : 0;
     if ($id) {
         $where = 'where status = 1';
         $storeLists = WarehouseManagementModel::warehouseManagementModelList($where);
         //获取可用仓库列表
         $data = WhGoodsAssignModel::getAssignList(" and a.id={$id}", '', '', 'a.id');
         if (!empty($data)) {
             $res = $data[0];
             $detail = WhGoodsAssignModel::getsAssignListDetail($id);
             //调拨单明细
             $this->smarty->assign('detail', $detail);
             $this->smarty->assign('res', $res);
             $createUser = getUserNameById($res['createUid']);
             $this->smarty->assign('createUser', $createUser);
             //$user           =   array('name'=>$userName, 'uid'=>$_SESSION['userId']);
             $this->smarty->assign('storeLists', $storeLists);
             $this->smarty->display('editAssignList.htm');
         }
         //$userName       =   getUserNameById($_SESSION['userId']); //获取用户名
     }
 }
Example #29
0
 public function act_export()
 {
     $invPeople = isset($_GET['invPeople']) ? $_GET['invPeople'] : '';
     $sku = isset($_GET['sku']) ? post_check($_GET['sku']) : '';
     $invType = isset($_GET['invType']) ? $_GET['invType'] : '';
     $startdate = isset($_GET['startdate']) ? post_check($_GET['startdate']) : '';
     $enddate = isset($_GET['enddate']) ? post_check($_GET['enddate']) : '';
     $auditStatus = isset($_GET['auditStatus']) ? post_check($_GET['auditStatus']) : '';
     if (empty($invPeople) && empty($sku) && empty($invType) && empty($startdate) && empty($enddate) && empty($auditStatus)) {
         echo "请选择导出条件";
         exit;
     }
     $where = 'where storeId=1 ';
     if ($invPeople) {
         $where .= "and invPeople ='{$invPeople}' ";
     }
     if ($sku) {
         $where .= "and sku ='{$sku}' ";
     }
     if ($invType) {
         $where .= "and invType ='{$invType}' ";
     }
     if ($startdate) {
         $starttime = strtotime($startdate);
         $where .= "and invTime >='{$starttime}' ";
     }
     if ($enddate) {
         $endtime = strtotime($enddate);
         $where .= "and invTime <='{$endtime}' ";
     }
     if ($auditStatus != '' && $auditStatus != 3) {
         $where .= "and auditStatus = {$auditStatus}";
     }
     $lists = InvRecordModel::getInvRecordList('*', $where);
     $excel = new ExportDataExcel('browser', "Files_warehouse" . date('Y-m-d') . ".xls");
     $excel->initialize();
     $tharr = array("日期", "料号", "仓位", "系统数量", "盘点数量", "差异数量", "料号单价", "类型", "盘点原因", "盘点人", "采购员", "物料管理人", "状态", '备注信息');
     $excel->addRow($tharr);
     foreach ($lists as $list) {
         $time = date('Y-m-d', $list['invTime']);
         $sku = $list['sku'];
         $location = $list['location'];
         $systemNums = $list['systemNums'];
         $sku_info = getSkuInfoBySku($list['sku']);
         $goodsCost = $sku_info['goodsCost'];
         $invNums = $list['invNums'];
         if ($list['invType'] == 1) {
             $num = $list['adjustNums'];
             $type = "盘盈";
         } elseif ($list['invType'] == 2) {
             $num = '-' . $list['adjustNums'];
             $type = "盘亏";
         } else {
             $num = $list['adjustNums'];
             $type = "";
         }
         $remark = $list['remark'] ? $list['remark'] : '';
         $reason_info = InvReasonModel::getInvReasonList("reasonName", "where id='{$list['reasonId']}'");
         $reason = $reason_info[0]['reasonName'];
         $invPeople = getUserNameById($list['invPeople']);
         //$sku_info    = getSkuInfoBySku($list['sku']);
         $purchaseName = $sku_info['purchaseId'] ? getUserNameById($sku_info['purchaseId']) : '无';
         $menergeMan = '';
         $mark = '';
         if ($list['auditStatus'] == 0) {
             $mark = '未审核';
         } else {
             if ($list['auditStatus'] == 1) {
                 $mark = '通过';
             } else {
                 if ($list['auditStatus'] == 2) {
                     $mark = '拒绝';
                 }
             }
         }
         $tdarr = array($time, $sku, $location, $systemNums, $invNums, $num, $goodsCost, $type, $reason, $invPeople, $purchaseName, $menergeMan, $mark, $remark);
         $excel->addRow($tdarr);
     }
     $excel->finalize();
     exit;
 }
 public function outStock($sku, $num, $opuser, $orderid, &$isEnd, $waitScan, $orderSn)
 {
     $isLastOne = true;
     //是否为最后一个待配货sku
     $preGoods_Obj = new PreGoodsOrdderManageModel();
     $allSkuInfo = $preGoods_Obj->getSKUDetail($orderid);
     //订单的全部sku列表
     foreach ($allSkuInfo as $row) {
         //判断该料号配完以后是否可以终结该备货单
         if ($row['amount'] != $row['scantnum'] && $row['sku'] != $sku) {
             $isLastOne = FALSE;
         }
     }
     if ($waitScan != $num) {
         $isLastOne = FALSE;
     }
     $isEnd = $isLastOne;
     //$this->logRequest(" sku==> $sku 数量==> $num");                           //记录请求日志
     $paramArr['method'] = 'ow_pregood_changestock';
     //API名称
     $paramArr['sku'] = $sku;
     $paramArr['num'] = $num;
     $paramArr['orderSn'] = $orderSn;
     $paramArr['operUser'] = getUserNameById($opuser);
     $messageInfo = UserCacheModel::callOpenSystem2($paramArr);
     //先到老系统扣库存
     if (FALSE === $messageInfo) {
         //请求开发系统出错
         self::$errmsg = '请求开放系统出错!';
         return FALSE;
     }
     $code = isset($messageInfo['code']) ? trim($messageInfo['code']) : '';
     if ($code !== 'success') {
         //扣库存失败
         self::$errmsg = $messageInfo['msg'];
         return FALSE;
     }
     $sku = mysql_real_escape_string($sku);
     $this->dbConn->begin();
     $rcordInfo = $this->getSkuInboxRecords($sku);
     if (FALSE === $rcordInfo) {
         //还没有封箱库存记录 则新增一条记录
         $insertResult = $this->insertNewInboxRecords($sku, $num);
         if (FALSE === $insertResult) {
             //插入失败 回滚
             $this->dbConn->rollback();
             self::$errmsg = "新增封箱库存记录失败!";
             return FALSE;
         }
     } else {
         //追加库存
         $updateSql = "update wh_inboxStock set num=num+{$num} where sku='{$sku}'";
         $updateQuery = $this->dbConn->query($updateSql);
         if (FALSE === $updateQuery) {
             //更新封箱库存失败 回滚
             $this->dbConn->rollback();
             self::$errmsg = "更新封箱库存失败!";
             return FALSE;
         }
     }
     $time = time();
     $updateOrder = "\n                update wh_prepDetail set scantnum=scantnum+{$num}, scantime={$time}, scanuser='******' where \n                sku='{$sku}' and orderid='{$orderid}'\n            ";
     $upOrderQuery = $this->dbConn->query($updateOrder);
     //更新备货单的扫描数量
     if (FALSE === $upOrderQuery) {
         $this->dbConn->rollback();
         self::$errmsg = '更新备货单数据失败!';
         return FALSE;
     }
     if (TRUE === $isLastOne) {
         //配货完成 修改备货单状态
         $upStatusSql = "update wh_prepGoodsOrder set status=3 where id='{$orderid}'";
         $upStatusQuery = $this->dbConn->query($upStatusSql);
         if (FALSE === $upStatusQuery) {
             $this->dbConn->rollback();
             self::$errmsg = '更新备货单状态失败!';
             return FALSE;
         }
     }
     $originNum = isset($rcordInfo['num']) ? $rcordInfo['num'] : 0;
     $logSql = "insert into wh_skuscanLog (orderId, sku, scanNum, originNum, opuser, scanTime) values\n                    ({$orderid}, '{$sku}', '{$num}', '{$originNum}', '{$opuser}', '{$time}')\n                ";
     $logResult = $this->dbConn->query($logSql);
     //记录操作日志
     if (FALSE === $logResult) {
         //写日志失败 回滚
         $this->dbConn->rollback();
         self::$errmsg = '写入操作日志失败!';
         return FALSE;
     }
     $this->dbConn->commit();
     return TRUE;
 }