Example #1
0
 public function getPostData()
 {
     $postObj = simplexml_load_string($GLOBALS["HTTP_RAW_POST_DATA"], 'SimpleXMLElement', LIBXML_NOCDATA);
     $post_data['FromUserName'] = str_inmysql($postObj->FromUserName);
     $post_data['ToUserName'] = str_inmysql($postObj->ToUserName);
     $post_data['FromMsgType'] = str_inmysql($postObj->MsgType);
     $post_data['Keyword'] = trim(str_inmysql($postObj->Content, '1'));
     $post_data['CreateTime'] = str_inmysql($postObj->CreateTime);
     $post_data['Location_X'] = str_inmysql($postObj->Location_X);
     $post_data['Location_Y'] = str_inmysql($postObj->Location_Y);
     $post_data['Label'] = str_inmysql($postObj->Label);
     $post_data['Event'] = str_inmysql($postObj->Event);
     $post_data['EventKey'] = str_inmysql($postObj->EventKey);
     $post_data['PicUrl'] = str_inmysql($postObj->PicUrl);
     $post_data['Recognition'] = str_inmysql($postObj->Recognition);
     if ($post_data['Event'] == 'CLICK') {
         $post_data['Keyword'] = str_inmysql($post_data['EventKey']);
     }
     //服务号用户自动上传地理位置的处理
     if (strtolower($postObj->Event) == 'location') {
         $memberLocationModel = new Model_Subtable('member_location');
         $memberLocationRow = $memberLocationModel->where("fromuser='******'")->dataRow();
         if ($memberLocationRow) {
             $locationArr['info'][id] = $memberLocationRow['id'];
         }
         $locationArr['info'][fromuser] = $postObj->FromUserName;
         $locationArr['info'][latitude] = $postObj->Latitude;
         $locationArr['info'][longitude] = $postObj->Longitude;
         $locationArr['info'][precision] = $postObj->Precision;
         $locationArr['info'][addtime] = $postObj->CreateTime;
         $memberLocationModel->add($locationArr);
     }
     return $post_data;
 }
Example #2
0
 public function getText()
 {
     $infocommonModel = new Model_InfoCommon();
     $filter['where'] = " id='{$this->info_id}' and customer_id='{$this->customer_id}' and state='1' ";
     $sql = $infocommonModel->select($filter, 'info_intro');
     $inforesult = $infocommonModel->fetchRow($sql);
     $sql = "update info_common set push_num=push_num+1 where id='{$this->info_id}' and customer_id='{$this->customer_id}' limit 1";
     $infocommonModel->query($sql);
     $data['msgtype'] = 'text';
     if ($this->info_id == 183) {
         //记得打开公众号接受消息
         $userModel = new Model_Subtable('sub_user');
         $scoreModel = new Model_SubScore('sub_score');
         $qdScore = $scoreModel->qd();
         $uRow = $userModel->where("fromuser='******'")->dataRow();
         $time = time();
         $startTime = strtotime(date('Y-m-d', $time) . ' 00:00:00');
         //今天0点的时间戳
         if ($uRow['qd_time'] > $startTime) {
             $data['content'] = '已签到';
         } else {
             if ($uRow) {
                 //签到获取积分
                 $data1['info'][id] = $uRow['id'];
                 $data1['info'][score] = $qdScore + $uRow['score'];
                 $data1['info'][score_all] = $qdScore + $uRow['score_all'];
                 $data1['info'][qd_time] = $time;
                 $userModel->add($data1);
                 $data['content'] = '签到成功';
             } else {
                 $data['content'] = '您还未注册';
             }
         }
     } else {
         $data['content'] = $inforesult['info_intro'];
     }
     //file_put_contents('a.txt',$data['content']);
     return $data;
 }
Example #3
0
}
//详情
if ($_REQUEST['a'] == 'detail') {
    $m = new Model_Subtable('sub_shop_odetail');
    $id = (int) $_GET['id'];
    $vo = $model->find($id);
    //收货人信息
    $pmodel = new Model_Subtable('s_province');
    $cmodel = new Model_Subtable('s_city');
    $dmodel = new Model_Subtable('s_district');
    $shipRow = $shipModel->find($vo['shipid']);
    $prow = $pmodel->where("ProvinceID=" . $shipRow['pid'])->dataRow();
    $shipRow['pname'] = $prow['ProvinceName'];
    $crow = $cmodel->where("CityID=" . $shipRow['cid'])->dataRow();
    $shipRow['cname'] = $crow['CityName'];
    $drow = $dmodel->where("DistrictID=" . $shipRow['did'])->dataRow();
    $shipRow['dname'] = $drow['DistrictName'];
    $smarty->assign('shipRow', $shipRow);
    if ($id) {
        $smarty->assign('vo', $vo);
        $detailList = $m->where(" oid={$id} ")->dataArr();
        foreach ($detailList as $key => $value) {
            $detailList[$key] = unserialize($value['goods_row']);
            $detailList[$key]['oid'] = $value['oid'];
            $detailList[$key]['num'] = $value['num'];
            $detailList[$key]['money'] = $value['money'];
            $detailList[$key]['name'] = cut_str(deletehtml($detailList[$key]['name']), 10);
        }
        $smarty->assign('detailList', $detailList);
    }
    $smarty->setTpl('shop/templates/order_add.html')->display();
Example #4
0
<?php

/**
 *任务分拨
 */
$model = new Model_Subtable('sub_task');
//每日的职位列表
if ($_REQUEST['a'] == 'task_index') {
    $assignModel = D('sub_assign');
    if ($_GET['date']) {
        $date = $_GET['date'];
    } else {
        $date = date('Y-m-d');
    }
    $listArr = $model->where("left(addtime,10) = '{$date}'")->order('id desc')->dataArr();
    foreach ($listArr as $key => $value) {
        $listArr[$key]['title'] = cut_str(deletehtml($value['title']), 15);
        //是否分拨
        $assignRow = $assignModel->where("tid='" . $value['id'] . "'")->dataRow();
        if ($assignRow) {
            $listArr[$key]['is_fb'] = 1;
        }
        //区经理是否审核
        $listArr[$key]['is_qujingli'] = $assignRow['is_qujingli'];
        //督导是否全部提报
        $assignRow1 = $assignModel->where("tid='" . $value['id'] . "' and isnull(final_pic)")->dataRow();
        if ($assignRow && empty($assignRow1)) {
            $listArr[$key]['is_dudao'] = 1;
        }
    }
    $smarty->assign('list', $listArr);
Example #5
0
    }
    $smarty->assign('list', $listArr);
    $smarty->assign('page', $model->pager($data['pager']));
    $smarty->setTpl('task/templates/task_sign.html')->display();
    die;
}
//城市级联
if ($_REQUEST['a'] == 'get_citys') {
    $cmodel = new Model_Subtable('s_city');
    $carr = $cmodel->where("ProvinceID=" . $_GET['pid'])->dataArr();
    echo json_encode($carr);
    die;
}
if ($_REQUEST['a'] == 'get_districts') {
    $dmodel = new Model_Subtable('s_district');
    $darr = $dmodel->where("CityID=" . $_GET['cid'])->order('DistrictId asc')->dataArr();
    echo json_encode($darr);
    die;
}
//触发删除前天之前message表中数据
$rand_num = rand(1, 6);
if ($rand_num == 3) {
    $model->query("delete from message where create_date < '" . date('Y-m-d H:i:s', time() - 3600 * 24 * 2) . "'");
}
//数据列表
$signModel = new Model_Subtable('sub_sign');
$condition = array();
if ($_GET['keywords']) {
    $condition[] = " title like '%" . common_pg('keywords') . "%' ";
}
if ($condition) {
Example #6
0
                }
                //序号处理
                $listArr[$key]['xuhao'] = $key + 1;
            }
        }
        $smarty->assign('list', $listArr);
        $smarty->setLayout('')->setTpl('mobile/templates/sign_qd.html')->display();
        die;
    }
}
if ($_REQUEST['a'] == 'sign_qd_ajax') {
    $signModel = new Model_Subtable('sub_sign');
    $pageSize = 30;
    $p = $_GET['p'];
    $limitStr = ($p - 1) * $pageSize . ',' . $pageSize;
    $listArr = $signModel->where("is_valid=1 and tid=" . $_GET['tid'])->order('distance asc')->limit($limitStr)->dataArr();
    if ($listArr) {
        foreach ($listArr as $key => $value) {
            //从快照中获取用户信息
            $value['user_json'] ? $uRow = unserialize($value['user_json']) : ($uRow = $userModel->find($value['uid']));
            $listArr[$key]['username'] = $uRow['username'];
            $listArr[$key]['nickname'] = $uRow['nickname'];
            $uRow['sex'] == 1 ? $listArr[$key]['sex'] = '男' : ($listArr[$key]['sex'] = '女');
            //是否可看手机号
            if ($userRow['is_see'] == 0) {
                $listArr[$key]['username'] = substr($uRow['username'], 0, 3) . '***' . substr($uRow['username'], -4);
            }
            //序号处理
            $listArr[$key]['xuhao'] = ($p - 1) * $pageSize + $key + 1;
        }
        echo json_encode($listArr);
Example #7
0
<?php

//判断登录
if (empty($_SESSION['tyuser'])) {
    header("Location:./login.php");
    die;
} else {
    $userModel = new Model_Subtable('sub_user');
    $userRow = $userModel->find($_SESSION['tyuser']['id']);
    $smarty->assign('userRow', $userRow);
}
$memberModel = new Model_Subtable('member');
$picUserRow = $memberModel->where("fromuser='******'tyuser']['fromuser'] . "'")->dataRow();
if ($picUserRow) {
    $_SESSION['picuser'] = $picUserRow;
}
$_SESSION['picuser']['fromuser'] = $userRow['fromuser'];
if ($userRow['nicheng']) {
    $_SESSION['picuser']['nickname'] = $userRow['nicheng'];
}
if ($userRow['head_pic']) {
    $_SESSION['picuser']['headimgurl'] = '../data/image_c/' . $userRow['head_pic'];
}
Example #8
0
$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(20);
$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(20);
$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(15);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A2', '提交人姓名/性别/电话')->setCellValue('B2', '商家名称')->setCellValue('C2', '联系人姓名')->setCellValue('D2', '联系人电话')->setCellValue('E2', '勾选项')->setCellValue('F2', '提交时间');
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('A2')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('C2')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('D2')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('E2')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('F2')->getFont()->setBold(true);
//数据库操作
include_once "../../includes/config.inc.php";
$submitModel = new Model_Subtable('sub_job_submit');
$id = (int) $_GET['id'];
$listArr = $submitModel->where(" jid='{$id}' ")->order('id desc')->dataArr();
if (!$listArr) {
    die('无数据');
}
$userModel = new Model_Subtable('sub_user');
foreach ($listArr as $key => $value) {
    $userRow = $userModel->find($value['uid']);
    $listArr[$key]['uname'] = $userRow['nickname'];
    $listArr[$key]['uphone'] = $userRow['username'];
    $userRow['sex'] == 1 ? $listArr[$key]['usex'] = '男' : ($listArr[$key]['usex'] = '女');
}
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', '提报列表' . date('Y-m-d H:i:s'));
foreach ($listArr as $lk => $lv) {
    $lj = $lk + 3;
    $objPHPExcel->getActiveSheet()->setCellValue('A' . $lj, $lv['uname'] . '/' . $lv['usex'] . '/' . $lv['uphone'])->setCellValue('B' . $lj, $lv['name'])->setCellValue('C' . $lj, $lv['carnum'] . ' ')->setCellValue('D' . $lj, $lv['phone'])->setCellValue('E' . $lj, $lv['license'])->setCellValue('F' . $lj, substr($lv['addtime'], 0, 10));
}
Example #9
0
} elseif ($_GET['is_see'] == '2') {
    $condition[] = " is_see=0 ";
}
if ($condition) {
    $filter['where'] = implode(' and ', $condition);
}
//人数统计
$res1 = $model->field('count(*) as countnum')->where($filter['where'])->dataRow();
$smarty->assign('countnum', $res1['countnum']);
$filter['order'] = " id desc ";
$data = $model->paginate($filter, '*', common_pg('p'), 10);
$listArr = $data['data'];
$memberModel = new Model_Member();
foreach ($listArr as $key => $value) {
    //微信头像
    $listArr[$key]['headPic'] = $memberModel->getPic($value['fromuser']);
    //所属区
    $drow = $dmodel->where("DistrictID='" . $value['did'] . "'")->dataRow();
    $listArr[$key]['district'] = $drow['DistrictName'];
}
$smarty->assign('list', $listArr);
$smarty->assign('page', $model->pager($data['pager']));
//苏州下的区
$smarty->assign('darr', $dmodel->where("CityID=78")->order('DistrictID asc')->dataArr());
//本日平台活跃量
$now_date = date('Y-m-d');
//$now_date='2015-05-21';
$arr = D('message')->field('id,fromuser')->where("left(create_date,10) = '" . $now_date . "' group by fromuser")->dataArr();
$activenum = count($arr);
$smarty->assign('activenum', $activenum);
$smarty->setTpl('user/templates/index.html')->display();
Example #10
0
<?php

include_once "../includes/config.inc.php";
//if(!strpos($_SERVER['HTTP_USER_AGENT'],'MicroMessenger')) die("请在微信浏览器中打开");//判断是否微信打开
$model = new Model_Subtable('sub_user');
//注册
if ($_REQUEST['a'] == 'do') {
    $data = $_POST;
    //手机验证码核对
    if ($data['code'] != $_SESSION['mobile_code'] or empty($data['code'])) {
        echo 'codeerr';
        die;
    }
    $row = $model->where("username='******'username'] . "'")->dataRow();
    //数据修改
    $info['num']['id'] = $row['id'];
    $info['info']['pass'] = md5($data['pass']);
    if ($info['num']['id'] && $info['info']['pass']) {
        $res = $model->add($info);
    } else {
        $res = 0;
    }
    if ($res) {
        $_SESSION['mobile'] = '';
        $_SESSION['mobile_code'] = '';
    }
    echo $res;
    die;
}
//防止恶意请求的随机码
$_SESSION['send_code'] = code_random(6, 1);
Example #11
0
		if($id){
			$smarty->assign('vo',$model->find($id));
		}
		$smarty->setTpl('news/templates/add.html')->display();die();
	}
}
//数据删除
if($_REQUEST['a']=='del'){
	$res=$model->del($_POST['id']);
	echo json_encode($res);die();
} */
//数据列表
$condition = array();
if ($_GET['keywords']) {
    $condition[] = " name like '%" . common_pg('keywords') . "%' ";
}
if ($condition) {
    $filter['where'] = implode('and', $condition);
}
$filter['order'] = " id desc ";
$data = $model->paginate($filter, '*', common_pg('p'), 10);
$listArr = $data['data'];
foreach ($listArr as $key => $value) {
    //$listArr[$key]['title']=cut_str(deletehtml($value['title']),20);
    $memRow = $memberModel->where("fromuser='******'fromuser'] . "'")->dataRow();
    $listArr[$key]['nickname'] = $memRow['nickname'];
    $listArr[$key]['pic'] = $memRow['headimgurl'];
}
$smarty->assign('list', $listArr);
$smarty->assign('page', $model->pager($data['pager']));
$smarty->setTpl('member/templates/ext_index.html')->display();
Example #12
0
$customer_id = 1378;
$model = new Model_Subtable('sub_user');
//中间跳转页
if ($_REQUEST['a'] == 'mid_reg') {
    $smarty->setLayout('')->setTpl('mobile/templates/mid_reg.html')->display();
    die;
}
//注册
if ($_REQUEST['a'] == 'doregister') {
    $data = $_POST;
    if ($data['username'] == $data['tjr_phone']) {
        echo 'cf';
        die;
    }
    //openid查重
    $userRow = $model->where("fromuser='******'fromuser'] . "'")->dataRow();
    if ($userRow) {
        echo 'wx_exist';
        die;
    }
    //填写的推荐人是否存在
    if ($data['tjr_phone']) {
        $userRow = $model->where("username='******'tjr_phone'] . "'")->dataRow();
        $userRow1 = $model->where("agent_num='" . $data['tjr_phone'] . "'")->dataRow();
        if (empty($userRow) && empty($userRow1)) {
            echo 'no_tjr';
            die;
        } elseif ($userRow) {
            $tjr_uid = $userRow['id'];
        } elseif ($userRow1) {
            $my_num = $data['tjr_phone'];
Example #13
0
    $smarty->assign('list', $list);
    $smarty->setLayout('')->setTpl('mobile/templates/yimiao_lp_history.html')->display();
    die;
}
//10000查看每日的领取记录
if ($_REQUEST['a'] == 'lp_day') {
    if ($_GET['date']) {
        $date = $_GET['date'];
    } else {
        $date = date('Y-m-d');
    }
    $where = "left(addtime,10) = '{$date}'";
    $signModel = new Model_Subtable('sub_yimiao_sign');
    $hptModel = D('sub_job_hospital');
    $userModel = D('sub_user');
    $list = $signModel->where($where)->order('id desc')->dataArr();
    foreach ($list as $k => $v) {
        $hptRow = $hptModel->find($v['hpt_id']);
        $list[$k]['hpt_name'] = $hptRow['name'];
        $uRow = $userModel->find($v['uid']);
        $list[$k]['nickname'] = $uRow['nickname'];
        $list[$k]['username'] = $uRow['username'];
    }
    $smarty->assign('date', $date);
    $smarty->assign('list', $list);
    $smarty->setLayout('')->setTpl('mobile/templates/yimiao_lp_day.html')->display();
    die;
}
//删除疫苗领取记录
if ($_REQUEST['a'] == 'del_yimiao_sign') {
    D('sub_yimiao_sign')->del((int) $_GET['id']);
Example #14
0
<?php

//后台管理员管理
include_once "../../includes/config.inc.php";
//登录页面显示
if ($_REQUEST['a'] == 'login') {
    $smarty->setLayout('layout_nologin.html')->setTpl('suser/templates/login.html')->display();
    die;
}
$model = new Model_Subtable('sub_suser');
//登录验证
if ($_REQUEST['a'] == 'doLogin') {
    $name = str_inmysql($_POST['name']);
    $pass = md5($_POST['pass']);
    $res = $model->where(" `name`='" . $name . "' and `pass`='" . $pass . "'")->dataRow();
    if ($res) {
        $_SESSION['suser'] = $res;
        $_SESSION['customer_id'] = 1378;
        echo 'success';
        die;
    }
    die;
}
//注销
if ($_REQUEST['a'] == 'logout') {
    $_SESSION['suser'] = null;
    $_SESSION['customer_id'] = null;
    echo '<script type="text/javascript">window.location.href="/home/suser/index.php?a=login"</script>';
    die;
}
//判断是否登录
Example #15
0
<?php

include_once "../includes/config.inc.php";
if (!strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')) {
    die("请在微信浏览器中打开");
}
//判断是否微信打开
//微信用户标识
include_once "get_openid.php";
$model = new Model_Subtable('sub_user');
$scoreModel = new Model_SubScore('sub_score');
$qdScore = $scoreModel->qd();
$uRow = $model->where("fromuser='******'")->dataRow();
$time = time();
$startTime = strtotime(date('Y-m-d', $time) . ' 00:00:00');
//今天0点的时间戳
if ($uRow['qd_time'] > $startTime) {
    die('<script type="text/javascript">alert("请勿重复签到,请关闭网页")</script>');
} else {
    if ($uRow) {
        //签到获取积分
        $data1['info'][id] = $uRow['id'];
        $data1['info'][score] = $qdScore + $uRow['score'];
        $data1['info'][score_all] = $qdScore + $uRow['score_all'];
        $data1['info'][qd_time] = time();
        $model->add($data1);
        die('<script type="text/javascript">alert("签到成功,请关闭网页")</script>');
    } else {
        die('<script type="text/javascript">alert("您还未注册,请关闭网页")</script>');
    }
}
Example #16
0
    die;
}
//取消任务
if ($_REQUEST['a'] == 'cancel_sign') {
    $jobsignModel = new Model_Subtable('sub_jobsign');
    $submitModel = new Model_Subtable('sub_job_submit');
    $jid = (int) $_GET['jid'];
    $jobsignModel->query("delete from sub_jobsign where jid='{$jid}' and uid='" . $_SESSION['tyuser']['id'] . "'");
    //写取消日志
    $signcancelModel = new Model_Subtable('sub_jobsign_cancel');
    $data = array();
    $data['info']['jid'] = $jid;
    $data['info']['uid'] = $_SESSION['tyuser']['id'];
    $signcancelModel->add($data);
    //领取数-1
    $jobsignModel->query("update sub_job set num=num-1 where id='" . $jid . "'");
    die('suc');
}
//任务提报
if ($_REQUEST['a'] == 'signadd') {
    $submitModel = new Model_Subtable('sub_job_submit');
    $data = $_POST;
    //查重
    $phoneRow = $submitModel->where("phone='" . $data['str']['phone'] . "'")->dataRow();
    if ($phoneRow) {
        die('cf');
    }
    $data['info']['uid'] = $_SESSION['tyuser']['id'];
    $res = $submitModel->add($data);
    $res ? die('suc') : die('err');
}
Example #17
0
            die;
        } else {
            echo json_encode('err');
            die;
        }
    } else {
        $smarty->assign('list', $listArr);
        $smarty->setLayout('')->setTpl('mobile/templates/task_index.html')->display();
        die;
    }
}
if ($_REQUEST['a'] == 'ajax_reply') {
    $replyModel = new Model_Subtable('sub_reply');
    $pageSize = 5;
    //页大小
    $p = (int) $_GET['p'] < 1 ? 1 : (int) $_GET['p'];
    //当前页数
    $limitStr = ($p - 1) * $pageSize . ',' . $pageSize;
    $listArr = $replyModel->where("tid=" . (int) $_GET['tid'])->order('id desc')->limit($limitStr)->dataArr();
    /* foreach($listArr as $key=>$value){
    		//$listArr[$key]['title']=cut_str(deletehtml($value['title']),5);
    		$listArr[$key]['addtime']=substr($value['addtime'],0,16);
    	} */
    if ($listArr) {
        echo json_encode($listArr);
        die;
    } else {
        echo json_encode('err');
        die;
    }
}
Example #18
0
    } else {
        $smarty->assign('list', $listArr);
        $smarty->setLayout('')->setTpl('mobile/templates/caiwu_task_index.html')->display();
        die;
    }
}
//结算页面
if ($_REQUEST['a'] == 'sign_js') {
    $signModel = new Model_Subtable('sub_sign');
    $logModel = new Model_Subtable('sub_money_log');
    if (method_is('post')) {
        $data = $_POST;
        $taskRow = $model->field('id,pay_type,is_js,work_time')->where("id=" . $data['tid'])->dataRow();
        //1现金日结,用户金额不增加
        if ($taskRow['pay_type'] == 1 && $taskRow['is_js'] == 0) {
            $listArr = $signModel->where("is_valid=1 and is_qd=1 and is_js=1 and tid=" . $data['tid'])->dataArr();
            foreach ($listArr as $k => $v) {
                //写金额日志
                $logData = array();
                $logData['info']['type'] = 7;
                //现金日结
                $logData['info']['uid'] = $v['uid'];
                $logData['info']['money'] = $v['fact_money'];
                $logData['info']['desc'] = $v['tid'];
                $logData['info']['work_date'] = substr($taskRow['work_time'], 0, 10);
                $logModel->add($logData);
            }
        }
        //2转账日结,用户金额增加
        if ($taskRow['pay_type'] == 2 && $taskRow['is_js'] == 0) {
            $listArr = $signModel->where("is_valid=1 and is_qd=1 and is_js=1 and tid=" . $data['tid'])->dataArr();
Example #19
0
<?php

$model = new Model_Subtable('sub_card');
if ($_REQUEST['a'] == 'index') {
    $current_time = time();
    $uid = $userRow['id'];
    $list = $model->where("uid='{$uid}' and out_time > " . $current_time)->dataArr();
    $num1 = 0;
    $num2 = 0;
    $num3 = 0;
    foreach ($list as $v) {
        if ($v['type'] == 1) {
            $num1++;
        } elseif ($v['type'] == 2) {
            $num2++;
        } elseif ($v['type'] == 3) {
            $num3++;
        }
    }
    $smarty->assign('num1', $num1);
    $smarty->assign('num2', $num2);
    $smarty->assign('num3', $num3);
    //禁闭期内的记录
    $banModel = D('ban');
    if ($userRow['cardnum']) {
        $where_str = "end_time > '" . date('Y-m-d', $current_time) . "' and (username='******'username'] . "' or cardnum='" . $userRow['cardnum'] . "')";
    } else {
        $where_str = "end_time > '" . date('Y-m-d', $current_time) . "' and username='******'username'] . "'";
    }
    $banList = $banModel->where($where_str)->dataArr();
    if ($banList) {
Example #20
0
<?php

include_once "../../includes/config.inc.php";
$model = new Model_Subtable('sub_sign');
$userModel = new Model_Subtable('sub_user');
if ($_REQUEST['a'] == 'send') {
    $name = $_GET['name'];
    $phone = $_GET['phone'];
    $tid = $_GET['tid'];
    //职位信息
    $taskModel = D('sub_task');
    $taskRow = $taskModel->find($tid);
    $post_data = "你好" . $name . "(手机尾号为" . substr($phone, -4) . "),你已成功报名" . $taskRow['title'] . ",请于" . $taskRow['jihe_time'] . "到" . $taskRow['jihe_address'] . "集合!";
    send_phone_msg($phone, $post_data);
    die;
}
$listArr = $model->where("tid='{$_GET['tid']}' and is_valid=1")->dataArr();
foreach ($listArr as $key => $value) {
    $uRow = $userModel->field('id,username,nickname')->where("id='{$value['uid']}'")->dataRow();
    $listArr[$key] = $uRow;
    $listArr[$key]['xuhao'] = $key + 1;
}
$smarty->assign('list', $listArr);
$smarty->assign('tid', $_GET['tid']);
$smarty->setTpl('task/templates/send_phone_msg.html')->display();