<?php
defined('IN_IA') or exit('Access Denied');
global $_GPC, $_W;
load()->func('communication');
$sql ="SELECT * FROM".tablename("evzg_express_member")."WHERE openid='{$_W['openid']}' AND 	uniacid='{$_W['uniacid']}'";
$member = pdo_fetch($sql);
$rootset = getSetting();
$op = !empty($_GPC['op']) ? $_GPC['op']:'display';
if(empty($rootset['status'])){
    message("请在快递轨迹查询尚未开启","","error");
}
if(empty($member['mobile'])){
    message("请先绑定手机号",$this->createMobileUrl('member',array('op'=>'addmobile')),"error");
}
$expressn = $_GPC['expressn'];
if(!empty($expressn)){
  $result = pdo_fetch("SELECT * FROM".tablename("evzg_express_expressorder")."WHERE openid='{$_W['openid']}' AND expresssn='{$expressn}'");
   if(empty($result)){
       message("亲的快递单号有误","","error");
   }
   $data = getEvgLink($result['expresssn'],$result['expresscode']);
   //var_dump($data);die();
}
include $this->template('expressline');