public function __construct() { $mod = trim($_GET['mod']); $act = trim($_GET['act']); if (C('IS_AUTH_ON') === true) { if (!AuthUser::checkLogin($mod, $act)) { if (!$_SESSION[C("USER_AUTH_ID")]) { echo '<script language="javascript"> self.location="index.php?mod=public&act=login"; </script>'; } elseif ($_SESSION[C("USER_AUTH_ID")]) { $data = array('data' => array('您尚未有此权限'), 'link' => $_SERVER['HTTP_REFERER']); goErrMsgPage($data); exit; } else { $data = array('data' => array('还未登陆!'), 'link' => 'index.php?mod=public&act=login'); goErrMsgPage($data); exit; } exit; } } self::$_username = isset($_SESSION['userName']) ? $_SESSION['userName'] : ""; self::$_userid = isset($_SESSION[C("USER_AUTH_ID")]) ? $_SESSION[C("USER_AUTH_ID")] : 0; self::$_companyid = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0; self::$_systemid = C('AUTH_SYSTEM_ID'); //初始化smarty require WEB_PATH . 'lib/template/smarty/Smarty.class.php'; $this->smarty = new Smarty(); $this->smarty->template_dir = WEB_PATH . 'html/template/v1/'; $this->smarty->compile_dir = WEB_PATH . 'smarty/templates_c/'; $this->smarty->config_dir = WEB_PATH . 'smarty/configs/'; $this->smarty->cache_dir = WEB_PATH . 'smarty/cache/'; $this->smarty->debugging = false; $this->smarty->caching = false; $this->smarty->cache_lifetime = 120; //初始化提交过来的变量(post and get) if (isset($_GET)) { foreach ($_GET as $gk => $gv) { $this->smarty->assign('g_' . $gk, $gv); } } if (isset($_POST)) { foreach ($_POST as $pk => $pv) { $this->smarty->assign('p_' . $pk, $pv); } } $this->smarty->assign('mod', $mod); //模块权限 $this->smarty->assign('act', $act); //操作权限 $this->smarty->assign('_username', self::$_username); $this->smarty->assign('_userid', self::$_userid); //初始化当前页码 $this->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1; $this->smarty->assign("page", $this->page); }
public function view_replyMessageForm() { $msgids = isset($_GET['msgids']) ? trim($_GET['msgids']) : ''; if ($msgids === '') { //没指定id $msgdata = array('data' => array('请指定要回复的message'), 'link' => 'index.php?mod=amazonMessagefilter&act=getMessageListByConditions'); goErrMsgPage($msgdata); exit; } /*----- 获得message信息 -----*/ $idar = explode(',', $msgids); $idar = array_map('intval', $idar); //一次打开的所有邮件的id集 $emails = array(); $ordernums = array(); $order_obj = new AmazonOrderModel(); $msg_obj = new amazonmessageModel(); $msg_list = $msg_obj->getMessageInfo($idar); foreach ($msg_list as &$entity) { $entity['sendtime'] = date('Y-m-d H:i:s', $entity['sendtime']); //$emails[$entity['id']] = $entity['sendid']; //$ordernums[$entity['id']] = $entity['ordernum']; //$BuyerandSeller = $order_obj->getAmazonBuyerandSeller($entity['ordernum'], $entity['sendid']); //$BuyerandSeller = isset($BuyerandSeller[0]) ? $BuyerandSeller[0] : $BuyerandSeller; if (file_exists($entity['messagepath'])) { //检测message文件是否存在 $entity['msgcontent'] = file_get_contents($entity['messagepath']); } else { $entity['msgcontent'] = "残念,暂时木有找到邮件本体!<br />邮件id: " . $entity['message_id'] . "<br />邮件发送时间: " . $entity['sendtime']; } } /*----- 获得message信息 -----*/ /*----- 获得模板信息 -----*/ $tpl_obj = new AmazonMessageTemplateModel(); $tpl_list = $tpl_obj->getTplList($_SESSION['globaluserid'], array('id', 'name', 'type', 'content')); // print_r($tpl_list);exit; $this->smarty->assign('tpllist', $tpl_list); /*----- 获得模板信息 -----*/ /*----- 获得文件夹分类列表 -----*/ $categorylist = new amazonmessagecategoryModel(); $cat_list = $categorylist->getAllCategoryInfoList(); $this->smarty->assign('catlist', $cat_list); /*----- 获得文件夹分类列表 -----*/ $this->smarty->assign('msglist', $msg_list); $this->smarty->assign('sec_menue', 5); $this->smarty->assign('toplevel', 0); $this->smarty->assign('toptitle', 'message回复'); $this->smarty->display('msgreplyAmazon.htm'); }
public function view_rollBackStock() { $orderid = isset($_GET['orderid']) ? intval($_GET['orderid']) : 0; if ($orderid < 1) { //传参不合法 $data = array('data' => array('参数不合法!'), 'link' => 'index.php?mod=unusualOrder&act=unusualOrderList'); goErrMsgPage($data); exit; } $po_obj = new PackingOrderModel(); $orderinfo = $po_obj->getOrderInfoById($orderid); if (empty($orderinfo)) { $data = array('data' => array('指定发货单不存在!'), 'link' => 'index.php?mod=unusualOrder&act=unusualOrderList'); goErrMsgPage($data); exit; } if ($orderinfo['orderStatus'] != PKS_UNUSUAL) { //该订单不在待复核状态 $data = array('data' => array('该订单不是异常订单!'), 'link' => 'index.php?mod=unusualOrder&act=unusualOrderList'); goErrMsgPage($data); exit; } $sod_obj = new ShipingOrderDetailModel(); $sku_havegot = $sod_obj->getSkuHavedone($orderid); //获得已经配货的sku列表 $rollbackresult = $sod_obj->rollBackStock($sku_havegot); if ($rollbackresult) { $data = array('data' => array('回滚成功!'), 'link' => 'index.php?mod=unusualOrder&act=unusualOrderList'); goOkMsgPage($data); exit; } else { $data = array('data' => array('该订单不是异常订单!'), 'link' => 'index.php?mod=dispatchBillQuery&act=showForm'); goErrMsgPage($data); exit; } }
public function view_replyMessageFormAliSite() { $msgids = isset($_GET['msgids']) ? trim($_GET['msgids']) : ''; if ($msgids === '') { //没指定id $msgdata = array('data' => array('请指定要回复的message'), 'link' => 'index.php?mod=messagefilter&act=getAliSiteList'); goErrMsgPage($msgdata); exit; } /*----- 获得message信息 -----*/ $idar = explode(',', $msgids); //数组 $idar = array_map('intval', $idar); //转换成 $msg_obj = new messageModel(); $msg_list = $msg_obj->getMessageInfoAliSite($idar); foreach ($msg_list as &$value) { $value['createtime'] = trunToLosangeles('Y-m-d H:i:s', $value['createtimestamp']); //echo $value['relationId']; $value['commnuni'] = $msg_obj->getRlatedSiteMessage($value['relationId']); $value['orderids'] = array(); $temparr = array(); $bigestid = 0; $idregion = array(); foreach ($value['commnuni'] as &$cval) { $cval['createtimestamp'] = trunToLosangeles('Y:m:d H:i:s', $cval['createtimestamp']); if (1 == $cval['role'] && !empty($cval['orderUrl']) && !empty($cval['orderId'])) { if (!in_array($cval['orderId'], $temparr)) { $value['orderids'][] = array('account' => $cval['receiverid'], 'orderid' => $cval['orderId']); $temparr[] = $cval['orderId']; } } if ($bigestid < $cval['message_id']) { $bigestid = $cval['message_id']; } if ($cval['role'] == 1) { $idar[] = $cval['id']; if ($cval['hasread'] == 0) { $idregion[] = $cval['message_id']; } } $cval['content'] = str_replace("\n", '</br>', $cval['content']); } // print_r($idregion); sort($idregion); if (count($idregion) > 0) { $refirst = $idregion[0]; $reend = $idregion[count($idregion) - 1]; $msg_obj->markAsReadByMsgId_site($idregion); //标记为已读状态 $msg_obj->markUser_site($idregion, $_SESSION['globaluserid']); //标记回复人id } else { $refirst = 0; $reend = 0; } $value['idregion_h'] = $refirst; $value['idregion_e'] = $reend; $value['bigestid'] = $bigestid; } //print_r($msg_list);exit; /*----- 获得message信息 -----*/ /*----- 获得模板信息 -----*/ $tpl_obj = new MessageTemplateModel(); $tpl_list = $tpl_obj->getTplList($_SESSION['globaluserid'], array('id', 'name', 'iscommon', 'incommonuse', 'content'), 2); $this->smarty->assign('tpllist', $tpl_list); /*----- 获得模板信息 -----*/ /*----- 获得文件夹分类列表 -----*/ $categorylist = new messagecategoryModel(); $cat_list = $categorylist->getAllCategoryInfoList(' and is_delete=0 ', 2); $this->smarty->assign('catlist', $cat_list); /*----- 获得文件夹分类列表 -----*/ // print_r($msg_list);exit; $this->smarty->assign('msglist', $msg_list); $this->smarty->assign('sec_menue', 4); $this->smarty->assign('toplevel', 0); $this->smarty->assign('toptitle', 'message回复'); $this->smarty->display('msgreplyalisite.htm'); }
public function view_printBoxPageLabel() { $orderId = isset($_GET['orderId']) ? trim($_GET['orderId']) : NULL; if (empty($orderId)) { goErrMsgPage(array('data' => array('缺少参数!'), 'link' => 'index.php?mod=OwBoxManage&act=boxManage')); exit; } $boxObj = new BoxManageModel(); $listData = $boxObj->getBoxData($orderId); //获取传递过来的箱号信息 $listDetail = array(); $idar = explode(",", $orderId); $idar = array_map('intval', $idar); foreach ($idar as $id) { $listDetail[$id] = $boxObj->getBoxSkuDetail($id); } $total = count($listData); include WEB_PATH . 'html/template/v1/printBoxPageLabel.htm'; }
private function editMsgCategoryDataSubmit() { $data['name'] = isset($_POST['catname']) ? trim($_POST['catname']) : ''; //名称 $data['rules'] = isset($_POST['alphabet']) ? $_POST['alphabet'] : array(); $data['account'] = isset($_POST['account']) ? trim($_POST['account']) : ''; //账号 $data['site'] = isset($_POST['site']) ? trim($_POST['site']) : ''; $data['gmail'] = isset($_POST['gmail']) ? trim($_POST['gmail']) : ''; $data['notes'] = isset($_POST['notes']) ? trim($_POST['notes']) : ''; //备注 extract($this->platformRelate($type)); //特定平台相关信息 $data['rules'] = array_intersect($data['rules'], generate_alphabet()); //计算交集 以确保规则正确 $data['rules'] = implode(',', $data['rules']); $data = array_map('mysql_real_escape_string', $data); $msgcat_obj = new amazonmessagecategoryModel(); $lpower_obj = new LocalPowerAmazonModel(); $global_obj = new GetLoacalUserModel(); //print_r($_SESSION); $creater = $global_obj->getRealNameByGlobalId($_SESSION['globaluserid']); $data['creater'] = $creater['global_user_name']; $data['createtime'] = time(); if ($data['account'] == -1) { //未分配账号 $promptdata = array('data' => array('请分配账号!'), 'link' => $gobackurl); goErrMsgPage($promptdata); } $cid = isset($_POST['cid']) ? trim($_POST['cid']) : 0; //这下面是判断是新增分类还是编辑分类,然后执行相应操作 if ($cid === 0) { //新增加分类 try { $result = $msgcat_obj->addNewCategory($data); } catch (Exception $e) { $promptdata = array('data' => array('新增分类失败!'), 'link' => $gobackurl); goErrMsgPage($promptdata); exit; } if (empty($result)) { //不存在的id $promptdata = array('data' => array('不合法的id!'), 'link' => $gobackurl); goErrMsgPage($promptdata); exit; } else { /*----- 将新增的分类的权限给创建者 -----*/ try { $new_cid = $msgcat_obj->getCategoryInfoByCatname($data['name']); $lpower_obj->updatePowerByAddClass($_SESSION['userId'], $new_cid['id']); } catch (Exception $e) { print_r($new_cid); /* $promptdata = array('data'=>array('权限更新失败!'), 'link'=>$gobackurl); goErrMsgPage($promptdata); */ exit; } } } else { //更新分类 /*----- 如果是更新 则需确保数据分类是否和操作的向对应 -----*/ $catinfo = $msgcat_obj->getCategoryInfoById($cid); if (empty($catinfo)) { //不存在的id $promptdata = array('data' => array('不合法的id!'), 'link' => $gobackurl); goErrMsgPage($promptdata); exit; } $result = $msgcat_obj->updateCategoryInfo($cid, $data); } if ($result) { $promptdata = array('data' => array('操作成功!'), 'link' => $gobackurl); goOkMsgPage($promptdata); exit; } else { $promptdata = array('data' => array('操作失败!'), 'link' => $gobackurl); goErrMsgPage($promptdata); exit; } }
public function view_printGroupOrder2() { $groupsn = isset($_GET['groupsn']) ? trim($_GET['groupsn']) : 0; if (empty($groupsn)) { echo "请指定配货清单!"; exit; } $group_list = OmAvailableModel::getTNameList("wh_shipping_order_group", "*", "where shipOrderGroup='{$groupsn}' order by id asc"); if (!$group_list) { echo "该配货清单不存在!"; exit; } $time = time(); $userName = $_SESSION['userName']; //更新今日清单打印表 OmAvailableModel::updateTNameRow("wh_shipping_order_group_print", "set status='1',orderPrintUser='******',orderPrintTime='{$time}'", "where shipOrderGroup='{$groupsn}'"); //获取订单对应的车号 $orderids = array(); foreach ($group_list as $group) { if (!isset($orderids[$group['shipOrderId']])) { $orderids[$group['shipOrderId']] = $group['carNumber']; } } $o_arr = array(); foreach ($orderids as $order => $car_number) { $o_arr[] = $order; } $oids = implode(',', $o_arr); $po_obj = new PackingOrderModel(); $ordersinfo = $po_obj->getaSetOfOrderInfo($oids); if (empty($ordersinfo)) { $data = array('data' => array('没有可打印内容!'), 'link' => 'index.php?mod=orderWaitforPrint&act=printList'); goErrMsgPage($data); exit; } $sod_obj = new ShipingOrderDetailModel(); $acc_id_arr = array(); foreach ($ordersinfo as &$orinfval) { $locationinfo = array(); $totalnum = 0; $package_type = ''; $iscard = ''; $skulisttemp = $sod_obj->getAllSkuListByOrderId($orinfval['id'], "order by pName,combineSku"); $totalnum = $skulisttemp['totalnum']; $locationinfo = $skulisttemp['skuinfo']; if (isset($locationinfo['notcombine']) && count($locationinfo['notcombine']['info']) == 1) { $package_type = $skulisttemp['packagetype']; } $iscard = printLabelModel::checkprintcard($orinfval['id']); $pmNameStr = CommonModel::getMaterInfoById($orinfval['pmId']); $orinfval['finalposition'] = $locationinfo; $totalStr = $totalnum . " " . $pmNameStr . " " . $orinfval['calcWeight'] . "KG"; if (!empty($package_type)) { $totalStr = $totalStr . " " . $package_type; } if (!empty($iscard)) { $totalStr = $totalStr . " " . $iscard; } $totalStr = $totalStr . " " . $orinfval['platformUsername']; $carrier = CommonModel::getShipingNameById($orinfval['transportId']); $orinfval['abbrshipname'] = CommonModel::getShipingAbbrNameById($orinfval['transportId']); $orinfval['totalStr'] = $totalStr; $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $orinfval['partionFromAddress'] = printLabelModel::getPartionFromAddress($orinfval['id'], $carrier, $orinfval['countryName']); if (!in_array($orinfval['accountId'], $acc_id_arr)) { array_push($acc_id_arr, $orinfval['accountId']); } } $salesaccountinfo = CommonModel::getAccountInfo($acc_id_arr); $this->smarty->assign('salesaccountinfo', $salesaccountinfo); $totalCount = count($ordersinfo); $this->smarty->assign('totalCount', $totalCount); $this->smarty->assign('orderids', $orderids); $this->smarty->assign('ordersinfo', $ordersinfo); $this->smarty->display('label50x100_22.htm'); }
public function view_submitEditData() { $tid = isset($_POST['tid']) ? intval($_POST['tid']) : 0; $name = isset($_POST['title']) ? trim($_POST['title']) : ''; $subject = isset($_POST['topic']) ? trim($_POST['topic']) : ''; $content = isset($_POST['content']) ? trim($_POST['content']) : ''; $countries = isset($_POST['country']) ? $_POST['country'] : false; $tpl_obj = new CommonModel('msg_ebaycstpl'); $tplRel_obj = new CommonModel('msg_ebaycsrel'); $tplInfo = $tpl_obj->findOne('*', " where id='{$tid}' "); if (empty($tplInfo)) { $msgdata = array('data' => array('不存在的模板!'), 'link' => 'index.php?mod=messageTemplate&act=showEbayTplList'); goErrMsgPage($msgdata); exit; } $tpl_obj->updateData(array('name' => $name, 'subject' => $subject, 'content' => $content, 'updateTime' => time()), " where id='{$tid}'"); $countries = CommonModel::transSafetySql($countries); $tplRel_obj->updateData(array('tplId' => 0), " where tplId='{$tid}'"); $contrySql = implode("', '", $countries); $tplRel_obj->updateData(array('tplId' => $tid), " where countryCode in ('{$contrySql}')"); $msgdata = array('data' => array('执行成功!'), 'link' => 'index.php?mod=messageTemplate&act=showEbayTplList'); goOkMsgPage($msgdata); exit; }
public function handleSubmitData() { extract($this->generateInfo()); $cids = isset($_POST['catids']) ? $_POST['catids'] : array(); $userid = isset($_POST['userid']) ? $_POST['userid'] : FALSE; if ($userid === FALSE) { $msgdata = array('data' => array('没指定用户!'), 'link' => $gobackurl); goErrMsgPage($msgdata); exit; } $msgcat_obj = new amazonmessagecategoryModel(); $catidlist = $msgcat_obj->getAllCategoryInfoList('', 'id'); $original = array(); foreach ($catidlist as $value) { $original[] = $value['id']; } $finalids = array_intersect($original, $cids); //保证提交的分类id都是该用户有拥有权限的分类id $powerlist = implode(',', $finalids); $lp_obj = new LocalPowerAmazonModel(); $upresult = $lp_obj->{$updatefunc}($userid, $powerlist); print_r($upresult); if ($upresult) { $msgdata = array('data' => array('成功!'), 'link' => $gobackurl); goOkMsgPage($msgdata); exit; } else { $msgdata = array('data' => array('失败!'), 'link' => $gobackurl); goErrMsgPage($msgdata); exit; } }
public function act_applyforB() { $pid = isset($_GET['pid']) ? trim($_GET['pid']) : 0; if ($pid == '') { self::$errCode = 0; self::$errMsg = '输入非法值!'; return; } $idar = explode(',', $pid); foreach ($idar as $key => $idval) { $idar[$key] = intval($idval); } $o_count = count($idar); $orderist = OrderPrintListModel::getPrintList('*', ' where id in (' . implode(',', $idar) . ') and status!=1001 and storeId=2'); $n_count = count($orderist); if ($o_count != $n_count) { self::$errCode = 0; self::$errMsg = '申请提货不能包含未打印地址条订单或包含A仓订单'; return; } $oidar = array(); //发货单id数组 foreach ($orderist as $orlval) { //验证合法性 if ($orlval['is_delete'] == 1) { $data = array('data' => array('包含已经删除单号!', '单号id为' . $orlval['id']), 'link' => 'index.php?mod=orderWaitforPrint&act=printList'); goErrMsgPage($data); exit; } $tempar = explode(',', $orlval['orderIds']); $oidar = array_merge($oidar, $tempar); } $po_obj = new PackingOrderModel(); $qresult = $po_obj->changeStatusToWaitGetGoodsB(implode(',', $oidar)); OrderPrintListModel::deleteAsetOfPrint(implode(',', $idar)); printLabelModel::inserRecords($oidar, $_SESSION['userId']); if ($qresult) { $time = time(); self::$errCode = 1; self::$errMsg = '申请成功'; return; } else { self::$errCode = 0; self::$errMsg = '失败'; return FALSE; } }
private function editMsgCategoryDataSubmit($type) { $data['name'] = isset($_POST['catname']) ? trim($_POST['catname']) : ''; //名称 $data['rules'] = isset($_POST['alphabet']) ? $_POST['alphabet'] : array(); $data['account'] = isset($_POST['account']) ? trim($_POST['account']) : ''; //账号 $data['notes'] = isset($_POST['notes']) ? trim($_POST['notes']) : ''; //备注 extract($this->platformRelate($type)); //特定平台相关信息 $data['rules'] = array_intersect($data['rules'], generate_alphabet()); //计算交集 以确保规则正确 $data['rules'] = implode(',', $data['rules']); $data['platform'] = $platformid; $data = array_map('mysql_real_escape_string', $data); $msgcat_obj = new messagecategoryModel(); if ($data['account'] == -1) { //未分配账号 $promptdata = array('data' => array('请分配账号!'), 'link' => $gobackurl); goErrMsgPage($promptdata); exit; } $cid = isset($_POST['cid']) ? trim($_POST['cid']) : 0; if ($cid === 0) { //新增加分类 $result = $msgcat_obj->addNewCategory($data); } else { //更新分类 /*----- 如果是更新 则需确保数据分类是否和操作的向对应 -----*/ $catinfo = $msgcat_obj->getCategoryInfoById($cid); if (empty($catinfo)) { //不存在的id $promptdata = array('data' => array('不合法的id!'), 'link' => $gobackurl); goErrMsgPage($promptdata); exit; } if ($catinfo['platform'] != $data['platform']) { //hack行为 $promptdata = array('data' => array('不合法的id!'), 'link' => $gobackurl); goErrMsgPage($promptdata); exit; } unset($data['platform']); //不运行更新所属平台 $result = $msgcat_obj->updateCategoryInfo($cid, $data); } if ($result) { $promptdata = array('data' => array('操作成功!'), 'link' => $gobackurl); goOkMsgPage($promptdata); exit; } else { $promptdata = array('data' => array('操作失败!'), 'link' => $gobackurl); goErrMsgPage($promptdata); exit; } }
private function printDispatchOrder($oids, $type) { $po_obj = new PackingOrderModel(); $ordersinfo = $po_obj->getaSetOfOrderInfo($oids); //echo "<pre>";print_r($ordersinfo);exit; if (empty($ordersinfo)) { $data = array('data' => array('没有可打印内容!'), 'link' => 'index.php?mod=orderWaitforPrint&act=printList'); goErrMsgPage($data); exit; } $sod_obj = new ShipingOrderDetailModel(); $acc_id_arr = array(); foreach ($ordersinfo as &$orinfval) { $locationinfo = array(); $totalnum = 0; $package_type = ''; $iscard = ''; $carrier = CommonModel::getShipingNameById($orinfval['transportId']); if ($type == 1 || $type == 6 || $type == 7) { //标签打印-50*100处理 if ($type == 7) { $tag = 0; } else { $tag = 1; } $skulisttemp = $sod_obj->getAllSkuListByOrderId($orinfval['id'], "order by pName,combineSku", $tag); $totalnum = $skulisttemp['totalnum']; $locationinfo = $skulisttemp['skuinfo']; if (isset($locationinfo['notcombine']) && count($locationinfo['notcombine']['info']) == 1) { $package_type = $skulisttemp['packagetype']; } $iscard = printLabelModel::checkprintcard($orinfval['id']); } elseif ($type == 8) { if ($carrier == 'EUB' || $carrier == 'Global Mail' || $carrier == '德国邮政') { $goods_title = array(); $skulisttemp = $sod_obj->getSkuListByOrderId($orinfval['id'], "order by pName"); $eubtotal = 0; $totalweight = 0; $detailcount = count($skulisttemp); $height = $detailcount > 1 ? intval(123 / $detailcount) : 123; foreach ($skulisttemp as &$tmval) { if ($carrier == 'EUB') { //EUB热敏打印处理 $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $materName = CommonModel::getMaterInfoById($sku_info['pmId']); //包材 list($goodsName) = strpos($sku_info['goodsName'], '--') !== false ? explode('--', $sku_info['goodsName']) : array($sku_info['goodsName']); $price = rand(300, 600) / 100; $eubtotal += $price; $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; $locationinfo['skuinfo'][] = array('sku' => $tmval['sku'], 'itemTitle' => $tmval['itemTitle'], 'goodsName' => $goodsName, 'isPacking' => $sku_info['isPacking'], 'materName' => $materName, 'pName' => $tmval['pName'], 'amount' => $tmval['amount'], 'price' => $price, 'weight' => $weight, 'height' => $height); $locationinfo['eubtotal'] = $eubtotal; $locationinfo['eubweight'] = $totalweight; } $zip = $orinfval['zipCode']; $zip0 = explode("-", $zip); if (count($zip0) >= 2) { $zip = $zip0[0]; $orinfval['zipCode'] = $zip; } $isd = intval(substr($zip, 0, 2)); if ($isd >= 0 && $isd <= 34) { $isd = '1'; } else { if ($isd >= 35 && $isd <= 74) { $isd = '3'; } else { if ($isd >= 75 && $isd <= 93) { $isd = '4'; } else { if ($isd >= 94 && $isd <= 99) { $isd = '2'; } else { $isd = '1'; } } } } $orinfval['isd'] = $isd; //回邮信息 $orinfval['pinfo'] = CommonModel::getEubAccounts($orinfval['accountId']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } else { if ($carrier == 'Global Mail' || $carrier == '德国邮政') { //Global Mail-100*100打印 $title_nums = 0; $title_nums = count($goods_title); if ($detailcount > 3 && $title_nums < 2) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } else { if ($detailcount <= 3 && $title_nums == 0) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } } $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; } $locationinfo[] = array('sku' => $tmval['sku'], 'isPacking' => $sku_info['isPacking'], 'pName' => $tmval['pName'], 'amount' => $tmval['amount']); //重量等级 if ($totalweight < 0.1) { $weightmark = 'P'; $ordershipfee = rand(100, 500) / 100; } else { if ($totalweight < 0.5) { $weightmark = 'G'; $ordershipfee = rand(501, 1000) / 100; } else { if ($totalweight < 2) { $weightmark = 'E'; $ordershipfee = rand(1001, 2000) / 100; } else { $weightmark = '超重'; } } } $orinfval['ordershipfee'] = number_format($ordershipfee / $detailcount, 2); $orinfval['titleinfo'] = implode('<br />', $goods_title); $orinfval['totalweight'] = $totalweight; $orinfval['weightmark'] = $weightmark; $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['appname'] = $salesaccountinfo['appname']; } else { $locationinfo[] = array('location' => $tmval['pName'], 'sku' => $tmval['sku'], 'amount' => $tmval['amount']); $goods_title[] = $tmval['itemTitle']; $orinfval['goods_title'] = $goods_title; } } $totalnum += $tmval['amount']; } } elseif ($carrier == '新加坡邮政') { $skulisttemp = $sod_obj->getAllSkuListByOrderId($orinfval['id'], "order by pName,combineSku", 0); $totalnum = $skulisttemp['totalnum']; $locationinfo = $skulisttemp['skuinfo']; if (isset($locationinfo['notcombine']) && count($locationinfo['notcombine']['info']) == 1) { $package_type = $skulisttemp['packagetype']; } $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } } else { $goods_title = array(); $skulisttemp = $sod_obj->getSkuListByOrderId($orinfval['id'], "order by pName"); $eubtotal = 0; $totalweight = 0; $detailcount = count($skulisttemp); $height = $detailcount > 1 ? intval(123 / $detailcount) : 123; foreach ($skulisttemp as &$tmval) { if ($type == 3) { //EUB热敏打印处理 $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $materName = CommonModel::getMaterInfoById($sku_info['pmId']); //包材 list($goodsName) = strpos($sku_info['goodsName'], '--') !== false ? explode('--', $sku_info['goodsName']) : array($sku_info['goodsName']); $price = rand(300, 600) / 100; $eubtotal += $price; $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; $locationinfo['skuinfo'][] = array('sku' => $tmval['sku'], 'itemTitle' => $tmval['itemTitle'], 'goodsName' => $goodsName, 'isPacking' => $sku_info['isPacking'], 'materName' => $materName, 'pName' => $tmval['pName'], 'amount' => $tmval['amount'], 'price' => $price, 'weight' => $weight, 'height' => $height); $locationinfo['eubtotal'] = $eubtotal; $locationinfo['eubweight'] = $totalweight; } } else { if ($type == 4 || $type == 5) { //Global Mail-100*100打印 $title_nums = 0; $title_nums = count($goods_title); if ($detailcount > 3 && $title_nums < 2) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } else { if ($detailcount <= 3 && $title_nums == 0) { $goods_title[] = !empty($tmval['itemTitle']) ? $title_nums + 1 . ' ' . $tmval['itemTitle'] : ''; } } $sku_info = printLabelModel::getSkuInfo($tmval['sku']); if (!empty($sku_info)) { $weight = $sku_info['goodsWeight'] * $tmval['amount']; $totalweight += $weight; } $locationinfo[] = array('sku' => $tmval['sku'], 'isPacking' => $sku_info['isPacking'], 'pName' => $tmval['pName'], 'amount' => $tmval['amount']); } else { $locationinfo[] = array('location' => $tmval['pName'], 'sku' => $tmval['sku'], 'amount' => $tmval['amount'], 'price' => $tmval['itemPrice'], 'itemTitle' => $tmval['itemTitle']); $goods_title[] = $tmval['itemTitle']; $orinfval['goods_title'] = $goods_title; } } $totalnum += $tmval['amount']; } } if ($type == 10) { $itemtitle = ""; foreach ($locationinfo as $key => $value) { $itemtitle .= $key + 1 . "、" . $value['itemTitle'] . "<br>"; } $orinfval['itemTitle'] = $itemtitle; $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $account = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['account'] = $account['account']; $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); } //$orinfval['total'] = $eubtotal; if ($type == 2 || $type == 33) { //快递A4打印需分割成小数组 $locationinfo = array_chunk($locationinfo, 2); $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['account'] = $salesaccountinfo['account']; $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['appname'] = $salesaccountinfo['appname']; $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); // print_r($orinfval); // exit; $pglist = array(); foreach ($ordersinfo as $order) { $pglist[] = $order['id']; } $olist = implode(",", $pglist); $this->smarty->assign('pglist', $olist); } if ($type == 3) { //EUB热敏打印 $zip = $orinfval['zipCode']; $zip0 = explode("-", $zip); if (count($zip0) >= 2) { $zip = $zip0[0]; $orinfval['zipCode'] = $zip; } $isd = intval(substr($zip, 0, 2)); if ($isd >= 0 && $isd <= 34) { $isd = '1'; } else { if ($isd >= 35 && $isd <= 74) { $isd = '3'; } else { if ($isd >= 75 && $isd <= 93) { $isd = '4'; } else { if ($isd >= 94 && $isd <= 99) { $isd = '2'; } else { $isd = '1'; } } } } $orinfval['isd'] = $isd; //回邮信息 $orinfval['pinfo'] = CommonModel::getEubAccounts($orinfval['accountId']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } if ($type == 7) { //新加坡热敏打印 $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); //跟踪号 $orinfval['tracknumber'] = printLabelModel::getTracknumber($orinfval['id']); } if ($type == 4 || $type == 5) { //Global Mail-100*100打印 //重量等级 if ($totalweight < 0.1) { $weightmark = 'P'; $ordershipfee = rand(100, 500) / 100; } else { if ($totalweight < 0.5) { $weightmark = 'G'; $ordershipfee = rand(501, 1000) / 100; } else { if ($totalweight < 2) { $weightmark = 'E'; $ordershipfee = rand(1001, 2000) / 100; } else { $weightmark = '超重'; } } } $orinfval['ordershipfee'] = number_format($ordershipfee / $detailcount, 2); $orinfval['titleinfo'] = implode('<br />', $goods_title); $orinfval['totalweight'] = $totalweight; $orinfval['weightmark'] = $weightmark; $salesaccountinfo = CommonModel::getAccountNameById($orinfval['accountId']); $orinfval['appname'] = $salesaccountinfo['appname']; } $pmNameStr = CommonModel::getMaterInfoById($orinfval['pmId']); $orinfval['pmNameStr'] = $pmNameStr; $orinfval['finalposition'] = $locationinfo; //$carrier = CommonModel::getShipingNameById($orinfval['transportId']); $orinfval['carrier'] = $carrier; $orinfval['totalnum'] = $totalnum; $orinfval['package_type'] = $package_type; if ($type == 1 || $type == 6) { //标签打印-50*100处理 $totalStr = $totalnum . " " . $pmNameStr . " " . $orinfval['calcWeight'] . "KG"; if (!empty($package_type)) { $totalStr = $totalStr . " " . $package_type; } if (!empty($iscard)) { $totalStr = $totalStr . " " . $iscard; } $totalStr = $totalStr . " " . $orinfval['platformUsername']; $orinfval['abbrshipname'] = CommonModel::getShipingAbbrNameById($orinfval['transportId']); //$orinfval['channelname'] = ShipingTypeModel::getChannelNameByIds($orinfval['transportId'], $orinfval['channelId']); //$orinfval['channelname'] = CommonModel::getChannelNameByIds($orinfval['transportId'], $orinfval['countryName']); $orinfval['totalStr'] = $totalStr; $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); $orinfval['countryZh'] = CommonModel::getCountryNameCn($orinfval['countryName']); $orinfval['partionFromAddress'] = printLabelModel::getPartionFromAddress($orinfval['id'], $carrier, $orinfval['countryName']); } if ($type == 9) { //部分包货打印-50*100处理 $countryZh = CommonModel::getCountryNameCn($orinfval['countryName']); $isLast = printLabelModel::adjustIsLast($orinfval['id']); //是否是最后一个配货单 $doneOrder = printLabelModel::getAllOriginOrderId($orinfval['id']); $streetInfo = "<br>" . $orinfval['username'] . "<br>" . $orinfval['street'] . "<br>" . $orinfval['state'] . "<br>" . $orinfval['zipCode'] . "<br>" . $orinfval['countryName'] . "(" . $countryZh . ")"; if (!empty($doneOrder)) { $doneStr = "<br>包含配货单单号:" . $doneOrder; } else { $doneStr = ''; } if ($isLast && empty($doneStr)) { $orinfval['packinglog'] = "第一个包裹,全部打印"; $orinfval['streetInfo'] = $streetInfo; } elseif ($isLast && !empty($doneStr)) { $orinfval['packinglog'] = "最后一个包裹,全部打印" . $doneStr; $orinfval['streetInfo'] = $streetInfo; } elseif (!$isLast && empty($doneStr)) { $orinfval['packinglog'] = "第一个包裹,部分打印"; $orinfval['streetInfo'] = ''; } else { $orinfval['packinglog'] = "分包裹,部分打印" . $doneStr; $orinfval['streetInfo'] = ''; } } if ($type == 31 || $type == 32 || $type == 311 || $type == 312) { $orinfval['notes'] = $po_obj->getOrderNotesInfo($orinfval['id']); $totalPrice = 0; foreach ($locationinfo as $info) { $totalPrice += $info['price'] * $info['amount']; } $orinfval['totalPrice'] = $totalPrice; } } /*if($_SESSION['userId']==253){ echo "<pre>";print_r($ordersinfo); echo $type; }*/ //print_r($ordersinfo);exit; $totalCount = count($ordersinfo); $this->smarty->assign('totalCount', $totalCount); $this->smarty->assign('ordersinfo', $ordersinfo); switch ($type) { case 1: //标签打印-50*100 $this->smarty->display('label50x100.htm'); break; case 6: //带留言标签打印-50*100 $this->smarty->display('label50x100_2.htm'); break; case 2: //快递A4打印 $this->smarty->display('expressA4.htm'); break; case 3: //国际EUB-热敏打印 $this->smarty->display('eubprint.htm'); break; case 4: //德国Global Mail-100*100打印 $this->smarty->display('globalmailgerman.htm'); break; case 5: //非德国Global Mail-100*100打印 $this->smarty->display('unglobalmail.htm'); break; case 7: //新加坡打印 $this->smarty->display('singporeprint.htm'); break; case 8: //新加坡/EUB/Global Mail $this->smarty->display('mixprint.htm'); break; case 9: //部分包货打印50*100 $this->smarty->display('bufen50x100.htm'); break; case 31: //Finejo快递-A4(横向打印) $this->smarty->display('printlabelA4ForFZ.htm'); break; case 32: //哲果发货清单-A4打印 $this->smarty->display('printlabelA4ForZG.htm'); break; case 311: //EB001快递-A4(横向打印) $this->smarty->display('printlabelA4ForEB1.htm'); break; case 312: //EB001发货清单-A4打印 $this->smarty->display('printlabelA4ForEB2.htm'); break; case 33: //快递A4打印 $this->smarty->display('expressA4UpsUs.htm'); break; case 10: //快递50*100热敏打印 $this->smarty->display('printLabelExpress.htm'); break; default: redirect_to("index.php?mod=dispatchBillQuery&act=showForm&storeId=1"); return false; } }
public function view_changePreOrderStatusPage() { $orderId = isset($_GET['orderid']) ? $_GET['orderid'] : FALSE; //订单号 if (empty($orderId)) { goErrMsgPage(array('data' => array('缺少订单号!'), 'link' => 'index.php?mod=owGoodsReplenishManage&act=preOrderList')); exit; } $pre_obj = new PreplenshOrderModel(); $orderInfo = $pre_obj->getPrePlenshOrderInfo($orderId); if (FALSE === $orderInfo) { goErrMsgPage(array('data' => array('不存在的单号!'), 'link' => 'index.php?mod=owGoodsReplenishManage&act=preOrderList')); exit; } $navlist = array(array('url' => '', 'title' => '海外仓补货'), array('url' => '', 'title' => '修改补货单状态')); $secondlevel = '214'; $this->smarty->assign('secondlevel', $secondlevel); $this->smarty->assign('orderInfo', $orderInfo); $this->smarty->assign('third', 4); $this->smarty->assign('navlist', $navlist); $this->smarty->display('changePreOrderStatuspage.htm'); }
public function view_formDataImport() { // $tir_obj = new TrackInfoRecordModel(); $ebay_id = $_POST['order'][1]; $tracking = $_POST['express'][1]; if (empty($ebay_id) && empty($tracking)) { $data = array("data" => array('发货单和跟踪号不能是空!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); } $where = "where id={$ebay_id}"; $order = orderPartionModel::selectOrder($where); if (!$order) { $data = array("data" => array('发货单不存在!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } if ($order[0]['orderStatus'] != PKS_PRINT_SHIPPING_INVOICE) { $data = array("data" => array($ebay_id . '此发货单状态不是在待打印面单状态!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } $array = array('shipOrderId' => $ebay_id, 'is_delete' => 0); //根据发货单号获取快递需要的箱子和跟踪号数量 $result_tracking_count = WhWaveTrackingBoxModel::select_by_shipOrderId($ebay_id); $count_binding = WhOrderTracknumberModel::count($array); //发货单已经绑定跟踪号的数量 if (empty($result_tracking_count)) { if ($count_binding > 0) { $data = array("data" => array($ebay_id . "该发货单已经绑定好跟踪号了!"), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } } else { $result_tracking_count = $result_tracking_count['trackingCount']; //发货单需要绑定跟踪号的数量 if ($result_tracking_count <= $count_binding) { $data = array("data" => array($ebay_id . "该发货单已经绑定好跟踪号了!"), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } } //查询扫描的跟踪号是否已经扫描过了的 $result_select = WhOrderTracknumberModel::select_ByTracknumber($tracking); if ($result_select) { $data = array("data" => array('该跟踪号已经绑定' . $result_select['shipOrderId'] . ',请检查!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } $data_insert = array('tracknumber' => $tracking, 'shipOrderId' => $ebay_id, 'createdTime' => time()); $array_count = array('shipOrderId' => $ebay_id, 'is_delete' => 0); //根据发货单号获取快递需要的箱子和跟踪号数量 $result_tracking_count = WhWaveTrackingBoxModel::select_by_shipOrderId($ebay_id); //说明该快递单只有一个箱子和一个跟踪号,所以不需要在wh_wave_tracking_box "快递单号的箱子与跟踪号数量表"添加记录 if (empty($result_tracking_count)) { $count_binding = WhOrderTracknumberModel::count($array_count); //发货单已经绑定跟踪号的数量 if ($count_binding > 0) { $data = array("data" => array('该发货单号已经绑定好跟踪号了,不在需要和这个跟踪号绑定!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } WhBaseModel::begin(); $result_insert = WhOrderTracknumberModel::insert($data_insert); if (!$result_insert) { WhBaseModel::rollback(); $data = array("data" => array('跟踪号绑定失败,请联系负责人!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } //更新发货表状态 $ostatus = WhWaveOrderPartionScanReviewModel::updateShippingOrderStatus($ebay_id, $status = PKS_WAITING_LOADING); if (!$ostatus) { WhBaseModel::rollback(); $data = array("data" => array('更新发货单状态失败,请联系负责人!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } WhPushModel::pushOrderStatus($ebay_id, 'PKS_WAITING_LOADING', $_SESSION['userId'], time()); //状态推送,需要改为待装车扫描(订单系统提供状态常量) WhBaseModel::commit(); $data = array("data" => array('绑定成功,请扫描另外一个发货单!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goOkMsgPage($data); } else { $result_tracking_count = $result_tracking_count['trackingCount']; //发货单需要绑定跟踪号的数量 $count_binding = WhOrderTracknumberModel::count($array_count); //发货单已经绑定跟踪号的数量 if ($result_tracking_count > $count_binding) { WhBaseModel::begin(); $result_insert = WhOrderTracknumberModel::insert($data_insert); if (!$result_insert) { WhBaseModel::rollback(); $data = array("data" => array('跟踪号绑定失败,请联系负责人!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } $num = $result_tracking_count - $count_binding - 1; if ($num == 0) { //更新发货表状态 $ostatus = WhWaveOrderPartionScanReviewModel::updateShippingOrderStatus($ebay_id, $status = PKS_WAITING_LOADING); if (!$ostatus) { WhBaseModel::rollback(); $data = array("data" => array('更新发货单状态失败,请联系负责人!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } WhPushModel::pushOrderStatus($ebay_id, ' ', $_SESSION['userId'], time()); //状态推送,需要改为待装车扫描(订单系统提供状态常量) WhBaseModel::commit(); $data = array("data" => array('绑定成功,该发货单不需要绑定跟踪号了!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); } else { WhBaseModel::commit(); $data = array("data" => array('绑定成功,该发货单还需要绑定' . $num . '个跟踪号!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goOkMsgPage($data); } } else { $data = array("data" => array('绑定失败,绑定的跟踪号已经够' . $result_tracking_count . '个,请扫描另外一个发货单!'), 'link' => 'index.php?mod=expressRecheck&act=trackNumberInput'); goErrMsgPage($data); exit; } } $navlist = array(array('url' => '', 'title' => '出库'), array('url' => 'index.php?mod=expressRecheck&act=ExpressList', 'title' => '快递待复核'), array('url' => '', 'title' => '快递待复核数据导入 ')); $this->smarty->assign('navlist', $navlist); $toptitle = '待复核'; // 顶部链接 $this->smarty->assign('toptitle', $toptitle); $toplevel = 2; // 顶层菜单 $this->smarty->assign('toplevel', $toplevel); $secondlevel = '28'; // 当前的二级菜单 $this->smarty->assign('secondlevel', $secondlevel); $this->smarty->assign('secnev', 3); // 二级导航 $this->smarty->assign('list', TrackInfoRecordModel::$data); $this->smarty->display('tracknumimport.htm'); }
public function view_alarmDataSubmit() { $account = isset($_POST['account']) ? trim($_POST['account']) : ''; $mode = isset($_POST['mode']) ? intval($_POST['mode']) : ''; $time = isset($_POST['pushtime']) ? trim($_POST['pushtime']) : ''; $days = isset($_POST['days']) ? $_POST['days'] : ''; // print_r($_POST);exit; if (empty($account)) { $msgdata = array('data' => array('缺少参数!'), 'link' => 'index.php?mod=localPower&act=mailPushSettingList'); goErrMsgPage($msgdata); exit; } $modeList = array(1, 2); if (!in_array($mode, $modeList)) { $msgdata = array('data' => array('错误的模式!'), 'link' => 'index.php?mod=localPower&act=mailPushSettingList'); goErrMsgPage($msgdata); exit; } $alrm_obj = new MailPushAlarmModel(); $setInt = $alrm_obj->culDaysSetting($days); // echo $setInt;exit; $data = array('mode' => $mode, 'time' => $time, 'days' => $setInt, 'account' => $account); $result = $alrm_obj->updateSettings($data); if (FALSE === $result) { $msgdata = array('data' => array(MailPushAlarmModel::$errMsg), 'link' => 'index.php?mod=localPower&act=mailPushSettingList'); goErrMsgPage($msgdata); exit; } else { $msgdata = array('data' => array('更新成功'), 'link' => 'index.php?mod=localPower&act=mailPushSettingList'); goOkMsgPage($msgdata); exit; } }
public function view_editeSubmit() { $recipient = isset($_POST['recipient']) ? trim($_POST['recipient']) : ''; //收件人 $recipient = mysql_real_escape_string($recipient); $email = isset($_POST['email']) ? trim($_POST['email']) : ''; //邮箱 $email = mysql_real_escape_string($email); $countryname = isset($_POST['countryname']) ? trim($_POST['countryname']) : ''; //国家 $countryname = mysql_real_escape_string($countryname); //echo $countryname;exit; $abbreviation = isset($_POST['abbreviation']) ? trim($_POST['abbreviation']) : ''; //国家简称 $abbreviation = mysql_real_escape_string($abbreviation); $state = isset($_POST['state']) ? trim($_POST['state']) : ''; //州/省 $state = mysql_real_escape_string($state); $city = isset($_POST['city']) ? trim($_POST['city']) : ''; //市 $city = mysql_real_escape_string($city); $street = isset($_POST['street']) ? trim($_POST['street']) : ''; //街道 $street = mysql_real_escape_string($street); $address2 = isset($_POST['address2']) ? trim($_POST['address2']) : ''; //地址二 $address2 = mysql_real_escape_string($address2); $address3 = isset($_POST['address3']) ? trim($_POST['address3']) : ''; //地址三 $address3 = mysql_real_escape_string($address3); $currency = isset($_POST['currency']) ? trim($_POST['currency']) : ''; //币种 $currency = mysql_real_escape_string($currency); $shipping = isset($_POST['shippingtype']) ? intval($_POST['shippingtype']) : 0; //运输方式id $sellaccount = isset($_POST['sellaccount']) ? trim($_POST['sellaccount']) : ''; //销售账号 $sellaccount = mysql_real_escape_string($sellaccount); //$channel = isset($_POST['channel']) ? intval($_POST['channelId']) : 0; //渠道id $calcWeight = isset($_POST['calcWeight']) ? floatval($_POST['calcWeight']) : 0; //估算重量 $calcShipping = isset($_POST['calcShipping']) ? floatval($_POST['calcShipping']) : 0; //计算运费 $actualweight = isset($_POST['actualweight']) ? floatval($_POST['actualweight']) : 0; //实际重量 $acturalfee = isset($_POST['acturalfee']) ? floatval($_POST['acturalfee']) : 0; //实际重量 $orderid = isset($_POST['orderid']) ? intval($_POST['orderid']) : 0; if ($orderid < 1) { //id不合法 $data = array('data' => '发货单号不正确!', 'link' => 'index.php?mod=dispatchBillQuery&act=showForm'); goErrMsgPage($data); exit; } $str = "\n username='******', email='{$email}', countryName='{$countryname}',countrySn='{$abbreviation}',\n state='{$state}', city='{$city}', street='{$street}', address2='{$address2}', address3='{$address3}',\n currency='{$currency}', transportId={$shipping}, account='{$sellaccount}', calcWeight='{$calcWeight}',\n calcShipping={$calcShipping}\n "; //echo $str;exit; $sod_obj = new ShipingOrderDetailModel(); $recordinfo = $sod_obj->getShippingOrderRecordsById($orderid); if (!empty($recordinfo)) { //更新记录信息 $str1 = " actualWeight={$actualweight} , actualShipping={$acturalfee}"; $ur = $sod_obj->updateRecords($str1, ' and shipOrderId=' . $orderid); if (!$ur) { //更新失败 $data = array('data' => array('更新失败!'), 'link' => 'index.php?mod=dispatchBillQuery&act=showForm'); goErrMsgPage($data); exit; } } $po_obj = new PackingOrderModel(); $upre = $po_obj->updateShipingorder($str, ' and id=' . $orderid); if ($upre) { //更新成功 $data = array('data' => array('更新成功!'), 'link' => 'index.php?mod=dispatchBillQuery&act=showForm'); goOkMsgPage($data); exit; } else { $data = array('data' => array('更新失败!'), 'link' => 'index.php?mod=dispatchBillQuery&act=showForm'); goErrMsgPage($data); exit; } }