Esempio n. 1
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     $id = $request->id;
     if (empty($id)) {
         header("Location: " . SP_URL_HOME);
         exit;
     }
     $data = Sp_Account_Attendee::getAttendeeBySn($id);
     if (empty($data)) {
         header("Location: " . SP_URL_HOME);
         exit;
     }
     if ($request->type == 'code') {
         include LIB_ROOT . 'third/phpqrcode/qrlib.php';
         $errorCorrectionLevel = "L";
         $matrixPointSize = "6";
         QRcode::png($id, false, $errorCorrectionLevel, $matrixPointSize);
     } else {
         $active = Sp_Active_Active::getActiveById($data['activeId']);
         if (empty($active)) {
             $this->show404();
         }
         $data['sn'] = $this->formatSn($data['signId']);
         $view = new Sp_View();
         $view->assign('data', $data);
         $view->assign('active', $active);
         $view->display("attendee/code.html");
     }
 }
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $user = Sp_Account_User::current();
         $nowtime = time();
         // 当前页数
         $nowPage = $request->page;
         empty($nowPage) && ($nowPage = 1);
         $limitRow = ($nowPage - 1) * self::PAGE_SIZE;
         // 分页数据
         $array = Sp_Active_Active::getListByUser($user->id, "a.isdel = 0 and a.activit_end < {$nowtime}", $limitRow, self::PAGE_SIZE);
         // 分页
         $pageString = Sp_Active_Active::getPageString($user->id, $nowPage, self::PAGE_SIZE, "isdel = 0 and activit_end < {$nowtime}");
         $data = array();
         if (is_array($array)) {
             $data['status'] = '0';
             $data['data'] = $array;
             $data['msg'] = '';
             $data['nowtime'] = $nowtime;
             $data['pageString'] = $pageString;
         } else {
             $data['status'] = '-1';
             $data['data'] = array();
             $data['msg'] = '';
         }
         return $data;
     }
 }
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $arrary = array();
         $id = $request->id;
         if (!is_numeric($id) || $id < 1) {
             return array('status' => '-5', 'msg' => '参数错误');
         }
         $pageConfig = $_POST['pageConfig'];
         $pageItem = $_POST['pageItem'];
         $letter = array();
         $letter['pageConfig'] = $pageConfig;
         $letter['pageItem'] = $pageItem;
         Sp_Letter_Letter::save($id, $letter);
         return array('status' => 0, 'msg' => '保存成功');
     } else {
         $id = $request->id;
         if (!is_numeric($id) || $id < 1) {
             $this->show404();
         }
         $letter = Sp_Letter_Letter::getLetterById($id);
         if (empty($letter)) {
             $this->show404();
         }
         $active = Sp_Active_Active::getActiveById($letter['active_id'], $user->id);
         if (empty($active)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign("id", $id);
         $view->assign("active", $active);
         $view->display("active/lettereditor.html");
     }
 }
Esempio n. 4
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $user = Sp_Account_User::current();
         $aid = $request->id;
         if (!is_numeric($aid)) {
             $data = array();
             $data['status'] = '-1';
             $data['msg'] = '提交数据有误';
             return $data;
         }
         // 当前页数
         $nowPage = $request->page;
         empty($nowPage) && ($nowPage = 1);
         $limitRow = ($nowPage - 1) * self::PAGE_SIZE;
         // 分页数据
         $array = Sp_Letter_Letter::getListByUser($user->id, $aid, $limitRow, self::PAGE_SIZE);
         $total = Sp_Letter_Letter::getTotalByUser($user->id, $aid);
         if (is_array($array) && count($array)) {
             $cry = new Util_Crypt3Des();
             foreach ($array as $key => $value) {
                 $id = $cry->encrypt($value['id']);
                 $id = base64_encode($id);
                 $array[$key]['sid'] = $id;
             }
         }
         // 分页
         $pager = new Util_Pager($total, $nowPage, self::PAGE_SIZE);
         $pageString = $pager->renderNav(true);
         $data = array();
         if (is_array($array)) {
             $data['status'] = '0';
             $data['data'] = $array;
             $data['msg'] = '';
             $data['pageString'] = $pageString;
             $data['nowtime'] = time();
         } else {
             $data['status'] = '-1';
             $data['data'] = array();
             $data['msg'] = '';
         }
         return $data;
     } else {
         $aid = $request->id;
         if (!is_numeric($aid)) {
             $this->show404();
         }
         $user = Sp_Account_User::current();
         $active = Sp_Active_Active::getActiveById($aid, $user->id);
         if (empty($active)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign('active', $active);
         $view->assign('select', 'letter');
         $view->display("letter/index.html");
     }
 }
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $pkid = $request->pkid;
         if (!is_numeric($pkid)) {
             return array('status' => '-1', 'msg' => '参数错误');
         }
         $rs = Sp_Active_Active::delByPrimarykey($pkid);
         return array('status' => '0', 'msg' => '删除成功');
     }
 }
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $id = $request->id;
         $aid = $request->aid;
         if (!is_numeric($id) || !is_numeric($aid)) {
             return array('status' => '-1', 'msg' => '参数错误');
         }
         $user = Sp_Account_User::current();
         $active = Sp_Active_Active::getActiveById($aid, $user->id);
         if (is_array($active) && count($active) > 1) {
             $at = Sp_Account_Attendee::getAttendeeById($id);
             if ($at['activeId'] == $aid && $at['status'] == 0 && ($at['checkStatus'] == 0 || $at['checkStatus'] == 1)) {
                 $row = Sp_Sendmsg::getSmsByPhone($at['phone'], 'attendee');
                 if (is_array($row) && count($row) < 3) {
                     $nowDate = date("Y-m-d", time());
                     $msgDate = date("Y-m-d", $row['crttime']);
                     if ($nowDate == $msgDate) {
                         return array('status' => '-126', 'msg' => '该电子票已在当天发送过,不能重复发送。', 'data' => $shortArr);
                     }
                 }
                 $code = $this->getSignIdCode($at);
                 if (false == $code) {
                     return array('status' => '-1', 'msg' => '生成电子票失败');
                 }
                 $url = SP_URL_HOME . "attendee/code/" . $code . ".html";
                 $shortArr = Util_ShortUrl::shortSina($url);
                 if ($shortArr === FALSE) {
                     return array('status' => '-1', 'msg' => '生成电子票失败');
                 } else {
                     $content = $at['name'] . "你好:你已报名成功" . $active['title'] . ",会议时间:" . date("Y-m-d H:i", $active['activit_start']) . " ~ " . date("Y-m-d H:i", $active['activit_start']) . ",会议地点:" . $active['address'] . "。您的电子票为" . $shortArr['url_short'] . ",签到码为" . $code . ",请保留此短信至会议结束。";
                     $sms = array();
                     $sms['username'] = $at['phone'];
                     $sms['content'] = $content;
                     $sms['type'] = 'attendee';
                     $sms['user_id'] = $user->id;
                     Sp_Sendmsg::send($sms);
                     if ($at['checkStatus'] == 0) {
                         Sp_Account_Attendee::success($id);
                     }
                     return array('status' => '0', 'msg' => '发送成功');
                 }
             } else {
                 return array('status' => '-1', 'msg' => '数据有误');
             }
         } else {
             return array('status' => '-1', 'msg' => '数据有误');
         }
     }
 }
Esempio n. 7
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     /*$total = 90;
     $page = 8;
     $size = 10; 
     $pager = new Util_Pager($total, $page, $size, "?page=%d&activeId=19");
     $offset = $pager->getOffset();
     $pager->setTotal($total);
     echo $pager->renderNav();*/
     $model = new Sp_Account_Attendee();
     $activeId = $request->activeId;
     $header = $model->GetTableHeaderByActiveId($activeId);
     if (false == $header) {
         $showHeader = $this->headers;
     } else {
         $showHeader = $this->getShowHeader($header);
         $showHeader = $model->getColumnFormArr($showHeader, 'title', 'field');
     }
     $columns = array_keys($showHeader);
     array_push($columns, 'id');
     $columns[] = 'status';
     $columns[] = 'checkStatus';
     $dataProvide = $model->AttendeeList($activeId, $columns);
     if ($request->format == 'json') {
         $arrary = array();
         return $array;
     } else {
         /*$user = Sp_Account_User::current();
         		$user = Sp_Account_User::load($user->id);*/
         $aid = $request->activeId;
         if (!is_numeric($aid)) {
             $this->show404();
         }
         $user = Sp_Account_User::current();
         $active = Sp_Active_Active::getActiveById($aid, $user->id);
         if (empty($active)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign('active', $active);
         $view->assign('data', $dataProvide[1]);
         $view->assign('page', $dataProvide[0]);
         $view->assign('header', $showHeader);
         $view->assign('headerSet', json_encode($header));
         $view->assign('activeId', $activeId);
         $view->assign('uploadInfo', $uploadInfo);
         $view->display("attendee/index.html");
     }
 }
Esempio n. 8
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $id = $request->id;
         if (!is_numeric($id)) {
             return array('status' => '-1', 'msg' => '参数错误');
         }
         $letter = Sp_Letter_Letter::getLetterById($id);
         if (is_array($letter) && count($letter) > 0) {
             $letter['pageConfig'] = json_decode($letter['pageConfig'], TRUE);
             $letter['pageItem'] = json_decode($letter['pageItem'], TRUE);
         }
         if (!empty($letter)) {
             $active = Sp_Active_Active::getActiveById($letter['active_id']);
             if (empty($active)) {
                 return array('status' => '-1', 'msg' => '数据有误');
             }
         }
         return array('status' => '0', 'msg' => '获取成功', 'data' => $letter);
     } else {
         $jssdk = new Util_Jssdk("wx91f7f41fce0885bc", "YjlcfXNkdBYjlcfXNkdBYjlcfXNkdBYj");
         $signPackage = $jssdk->GetSignPackage();
         $id = $request->id;
         $id = base64_decode($id);
         $cry = new Util_Crypt3Des();
         $id = $cry->decrypt($id);
         if (!is_numeric($id)) {
             $this->show404();
         }
         $letter = Sp_Letter_Letter::getLetterById($id);
         if (empty($letter)) {
             $this->show404();
         }
         $active = Sp_Active_Active::getActiveById($letter['active_id']);
         if (empty($active)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign("letter", $letter);
         $view->assign('active', $active);
         $view->assign('signPackage', $signPackage);
         $view->display("letter/show.html");
     }
 }
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         return array();
     } else {
         $id = $request->id;
         if (empty($id) || !is_numeric($id)) {
             $this->show404();
         }
         $user = Sp_Account_User::current();
         $active = Sp_Active_Active::getActiveById($id, $user->id);
         if (empty($active)) {
             $this->show404();
         }
         $view = new Sp_View();
         $view->assign("active", $active);
         $view->display("active/createsuccess.html");
     }
 }
Esempio n. 10
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $id = $request->id;
         $aid = $request->aid;
         if (!is_numeric($id) || !is_numeric($aid)) {
             return array('status' => '-1', 'msg' => '参数错误');
         }
         $user = Sp_Account_User::current();
         $active = Sp_Active_Active::getActiveById($aid, $user->id);
         if (is_array($active) && count($active) > 1) {
             $at = Sp_Account_Attendee::getAttendeeById($id);
             if ($at['activeId'] == $aid && $at['checkStatus'] == 0) {
                 $rs = Sp_Account_Attendee::refuse($id);
                 return array('status' => '0', 'msg' => '拒绝成功');
             } else {
                 return array('status' => '-1', 'msg' => '数据有误');
             }
         } else {
             return array('status' => '-1', 'msg' => '数据有误');
         }
     }
 }
Esempio n. 11
0
 /**
  * function description
  *
  * @param
  * @return void
  */
 public function execute($request)
 {
     if ($request->format == 'json') {
         $id = $request->id;
         $activit_end = $request->activit_end;
         //活动结束时间
         $activit_start = $request->activit_start;
         //活动开始时间
         $address = $request->address;
         //详细地址
         $arrea = $request->arrea;
         //区域
         $city = $request->city;
         //城市
         $enroll_end = $request->enroll_end;
         $enroll_start = $request->enroll_start;
         $is_audit = $request->is_audit;
         $is_enroll = $request->is_enroll;
         //是否需要审核
         $province = $request->province;
         //省份
         $title = $request->title;
         //标题
         $thumbnail = $request->thumbnail;
         $enroll_num = $request->enroll_num;
         if (!is_numeric($id) || empty($title) || empty($activit_end) || empty($activit_end) || empty($address) || empty($province) || empty($city)) {
             return array('status' => '-5', 'msg' => '参数错误');
         }
         if (!empty($is_enroll) && (empty($is_audit) || empty($enroll_start) || empty($enroll_end))) {
             return array('status' => '-5', 'msg' => '完善活动时间选项');
         }
         if (strtotime($activit_end) < strtotime($activit_start)) {
             return array('status' => '-5', 'msg' => '举办结束日期不能小于开始日期');
         }
         $user = Sp_Account_User::current();
         $active = array();
         $active['activit_end'] = strtotime($activit_end);
         $active['activit_start'] = strtotime($activit_start);
         $active['address'] = $address;
         $active['arrea'] = empty($arrea) ? 0 : $arrea;
         $active['city'] = $city;
         $active['province'] = $province;
         $active['title'] = $title;
         $active['user_id'] = $user->id;
         $active['thumbnail'] = $thumbnail;
         if (!empty($is_audit)) {
             if (strtotime($enroll_end) < strtotime($enroll_start)) {
                 return array('status' => '-5', 'msg' => '报名结束日期不能小于开始日期');
             }
             if (!is_numeric($enroll_num)) {
                 return array('status' => '-5', 'msg' => '人数不能为空');
             }
             $active['is_audit'] = 1;
             $active['is_enroll'] = 1;
             $active['enroll_start'] = strtotime($enroll_start);
             $active['enroll_end'] = strtotime($enroll_end);
             $active['enroll_num'] = $enroll_num;
         } else {
             $active['is_audit'] = 0;
             $active['is_enroll'] = 0;
             $active['enroll_start'] = 0;
             $active['enroll_end'] = 0;
             $active['enroll_num'] = 0;
         }
         $user = Sp_Account_User::current();
         $ret = Sp_Active_Active::updateById($id, $active, $user->id);
         return array('status' => '0', 'msg' => '修改成功');
         // if($ret){
         //
         // }else{
         // return array('status'=>'-1','msg'=>'修改失败');
         // }
     } else {
         $aid = $request->id;
         if (!is_numeric($aid)) {
             $this->show404();
         }
         $user = Sp_Account_User::current();
         $active = Sp_Active_Active::getActiveById($aid, $user->id);
         if (empty($active)) {
             $this->show404();
         }
         $province = Sp_City_City::getProvince();
         $city = Sp_City_City::getChlidById($active['province']);
         $arrea = Sp_City_City::getChlidById($active['city']);
         $view = new Sp_View();
         $uploadInfo = Util_FileUpload::getUpfileKey('huitong');
         $view->assign('province', $province);
         $view->assign('city', $city);
         $view->assign('arrea', $arrea);
         $view->assign('uploadInfo', $uploadInfo);
         $view->assign('option', 'edit');
         $view->assign('active', $active);
         $view->display("active/create.html");
     }
 }
Esempio n. 12
0
/*
 * editor by carten
 */
define('ROOT_PATH', __DIR__ . '/../../../');
include_once ROOT_PATH . 'config/init.php';
define('PAGE_SIZE', 5);
$jsonParam = array();
$request = Request::current();
$id = $request->id;
if (is_numeric($id) && $id > 0) {
    // 当前页数
    $nowPage = $request->page;
    empty($nowPage) && ($nowPage = 1);
    $limitRow = ($nowPage - 1) * PAGE_SIZE;
    // 分页数据
    $array = Sp_Active_Active::getListByUser($id, "a.isdel = 0", $limitRow, PAGE_SIZE);
    if (is_array($array) && count($array) > 0) {
        foreach ($array as $key => $value) {
            $array[$key]['activit_start'] = !empty($value['activit_start']) ? date("Y-m-d H:i", $value['activit_start']) : "";
            $array[$key]['activit_end'] = !empty($value['activit_end']) ? date("Y-m-d H:i", $value['activit_end']) : "";
            $array[$key]['enroll_start'] = !empty($value['enroll_start']) ? date("Y-m-d H:i", $value['enroll_start']) : "";
            $array[$key]['enroll_end'] = !empty($value['enroll_end']) ? date("Y-m-d H:i", $value['enroll_end']) : "";
            $array[$key]['thumbnail'] = !empty($value['thumbnail']) ? SP_URL_UPLOAD . $value['thumbnail'] . "!w420h336" : "http://m.eventool.cn/img/" . "nopic.jpg";
            $array[$key]['crttime'] = !empty($value['crttime']) ? date("Y-m-d H:i:s", $value['crttime']) : "";
        }
    }
    $jsonParam = array("code" => "200", "msg" => "成功", "data" => is_array($array) && count($array) > 0 ? $array : array());
} else {
    $jsonParam = array("code" => "400", "msg" => "缺少参数");
}
header('Content-type: application/json;charset=utf-8');