NoNZero vor 8 Jahren
Ursprung
Commit
6a5af3163b

Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 0
global/js/jquery.cookie.min.js


+ 1 - 0
index.php

@@ -4,6 +4,7 @@ include './protected/config/routes.conf.php';
 include './protected/config/db.conf.php';
 include './protected/config/acl.conf.php';
 include './protected/config/ver.conf.php';
+include './protected/config/sms.conf.php';
 #Just include this for production mode
 //include $config['BASE_PATH'].'deployment/deploy.php';
 include $config['BASE_PATH'] . 'Doo.php';

+ 14 - 0
protected/class/auth.php

@@ -67,6 +67,20 @@ class Auth
         return $_SESSION['uid'] = $uid;
     }
 
+    public function setVerifyMobile($array = array('mobile' => 0, 'code' => 0))
+    {
+        $_SESSION['verifymobile'] = $array;
+    }
+
+    public function getVerifyMobile()
+    {
+        if (isset($_SESSION['verifymobile']) && $_SESSION['verifymobile']) {
+            return $_SESSION['verifymobile'];
+        } else {
+            return FALSE;
+        }
+    }
+
     public function setUemail($uemail)
     {
         return $_SESSION['uemail'] = $uemail;

+ 58 - 34
protected/class/profile.php

@@ -2,53 +2,77 @@
 
 Doo::loadModel('uprofile');
 
-class Profile {
+class Profile
+{
 
     private $uprofile;
 
-    public function __construct() {
-	$this->uprofile = new Uprofile();
+    public function __construct()
+    {
+        $this->uprofile = new Uprofile();
     }
 
-    public function insertProfile($intp = array()) {
-	if (!isset($intp['userid']))
-	    return FALSE;
-	$this->uprofile->userid = filter_var($intp['userid'], FILTER_VALIDATE_INT);
-	$this->uprofile->name = filter_var($intp['realname'], FILTER_SANITIZE_STRING);
-	$this->uprofile->company = filter_var($intp['company'], FILTER_SANITIZE_STRING);
-	$this->uprofile->jobs = filter_var($intp['jobs'], FILTER_SANITIZE_STRING);
-	$this->uprofile->phone = filter_var($intp['phone'], FILTER_SANITIZE_STRING);
-	$this->uprofile->mobile = filter_var($intp['mobile'], FILTER_SANITIZE_STRING);
-	if (isset($intp['qq']))
-	    $this->uprofile->qq = filter_var($intp['qq'], FILTER_SANITIZE_STRING);
-	$this->uprofile->groups = 'vip';
-	return $this->uprofile->insert();
+    public function insertProfile($intp = array())
+    {
+        if (!isset($intp['userid']))
+            return FALSE;
+        $this->uprofile->userid = filter_var($intp['userid'], FILTER_VALIDATE_INT);
+        $this->uprofile->name = filter_var($intp['realname'], FILTER_SANITIZE_STRING);
+        $this->uprofile->company = filter_var($intp['company'], FILTER_SANITIZE_STRING);
+        $this->uprofile->jobs = filter_var($intp['jobs'], FILTER_SANITIZE_STRING);
+        $this->uprofile->phone = filter_var($intp['phone'], FILTER_SANITIZE_STRING);
+        $this->uprofile->mobile = filter_var($intp['mobile'], FILTER_SANITIZE_STRING);
+        if (isset($intp['qq']))
+            $this->uprofile->qq = filter_var($intp['qq'], FILTER_SANITIZE_STRING);
+        $this->uprofile->groups = 'vip';
+        return $this->uprofile->insert();
     }
 
-    public function getProWithUid($userid = 0) {
-	if (!isset($userid))
-	    return FALSE;
-	return $this->uprofile->getOne(array('where' => 'userid=?', 'param' => array($userid), 'asArray' => TRUE));
+    public function getProWithUid($userid = 0)
+    {
+        if (!isset($userid))
+            return FALSE;
+        return $this->uprofile->getOne(array('where' => 'userid=?', 'param' => array($userid), 'asArray' => TRUE));
     }
 
-    public function setAvatar($userid = 0, $avaurl) {
-	if (!isset($userid))
-	    return FALSE;
-	$this->uprofile->avatar = $avaurl;
-	return $this->uprofile->update(array('where' => 'userid=?', 'param' => array($userid)));
+    public function getVerifiedMobile($userid = 0)
+    {
+        if (!isset($userid))
+            return FALSE;
+        return $this->uprofile->getOne(array('where' => 'userid=? and isnotice=1', 'param' => array($userid), 'asArray' => TRUE));
     }
 
-    public function upProfile($userid, $proArray) {
-	$this->uprofile->name = $proArray['name'];
-	$this->uprofile->company = $proArray['company'];
-	$this->uprofile->jobs = $proArray['jobs'];
-	$this->uprofile->phone = $proArray['phone'];
-	$this->uprofile->mobile = $proArray['mobile'];
-	if (isset($proArray['qq']) && $proArray['qq'])
-	    $this->uprofile->qq = $proArray['qq'];
-	return $this->uprofile->update(array('where' => 'userid=?', 'param' => array($userid)));
+    public function setAvatar($userid = 0, $avaurl)
+    {
+        if (!isset($userid))
+            return FALSE;
+        $this->uprofile->avatar = $avaurl;
+        return $this->uprofile->update(array('where' => 'userid=?', 'param' => array($userid)));
     }
 
+    public function upProfile($userid, $proArray)
+    {
+        $this->uprofile->name = $proArray['name'];
+        $this->uprofile->company = $proArray['company'];
+        $this->uprofile->jobs = $proArray['jobs'];
+        $this->uprofile->phone = $proArray['phone'];
+        $this->uprofile->mobile = $proArray['mobile'];
+        if (isset($proArray['qq']) && $proArray['qq'])
+            $this->uprofile->qq = $proArray['qq'];
+        return $this->uprofile->update(array('where' => 'userid=?', 'param' => array($userid)));
+    }
+
+    public function updateMobile($userid, $mobile)
+    {
+        $this->uprofile->mobile = $mobile;
+        $this->uprofile->isnotice = 1;
+        return $this->uprofile->update(array('where' => 'userid=?', 'param' => array($userid)));
+    }
+
+    public function checkMobile($number)
+    {
+        return $this->uprofile->count(array('where' => 'mobile=?', 'param' => array($number), 'asArray' => TRUE));
+    }
 }
 
 ?>

+ 83 - 0
protected/class/sms.php

@@ -0,0 +1,83 @@
+<?php
+
+class Sms
+{
+    private $api_url, $auth_key, $errorMsg;
+
+    function __construct($api_url, $auth_key)
+    {
+        $this->api_url = $api_url;
+        $this->auth_key = $auth_key;
+    }
+
+    /**
+     * 实现短信验证码接口
+     *
+     */
+    public function sendSms($mobile, $code)
+    {
+        $send = array(
+            'apikey' => $this->auth_key,
+            'mobile' => $mobile,
+            'text' => $code
+        );
+        $data = http_build_query($send);
+        $res = json_decode($this->_httpClient($this->api_url, $data));
+        $resArr = $this->objectToArray($res);
+        if (!empty($resArr) && $resArr["code"] == 0) {
+            return true;
+        } else {
+            if (empty($this->errorMsg)) $this->errorMsg = isset($resArr["msg"]) ? $resArr["msg"] : '未知错误';
+            return false;
+        }
+    }
+
+    //对象转数组,使用get_object_vars返回对象属性组成的数组
+    function objectToArray($array)
+    {
+        if (is_object($array)) {
+            $array = (array)$array;
+        }
+        if (is_array($array)) {
+            foreach ($array as $key => $value) {
+                $array[$key] = $this->objectToArray($value);
+            }
+        }
+        return $array;
+    }
+
+    /**
+     * POST方式访问短信接口
+     * @param string $data
+     * @return mixed
+     */
+    private function _httpClient($api_url, $data)
+    {
+        try {
+            $ch = curl_init();
+            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept:text/plain;charset=utf-8', 'Content-Type:application/x-www-form-urlencoded', 'charset=utf-8'));
+            curl_setopt($ch, CURLOPT_URL, $api_url);
+            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+            curl_setopt($ch, CURLOPT_POST, 1);
+            curl_setopt($ch, CURLOPT_TIMEOUT, 10);
+            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+            curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+            $res = curl_exec($ch);
+            curl_close($ch);
+            return $res;
+        } catch (Exception $e) {
+            $this->errorMsg = $e->getMessage();
+            return false;
+        }
+    }
+
+    /**
+     * POST方式访问短信接口
+     * @param string $data
+     * @return mixed
+     */
+    public function getErrors()
+    {
+        return $this->errorMsg;
+    }
+}

+ 5 - 0
protected/config/routes.conf.php

@@ -33,6 +33,10 @@ $route['get']['/sproject/:pid/section/:pmid/detail'] = array('SProjectController
 $route['get']['/sproject/:pid/section/measure'] = array('SProjectController', 'proMeasure');
 // 登入登出API
 $route['*']['/user/profile'] = array('UserController', 'index');
+$route['*']['/user/profile/sms'] = array('UserController', 'sms');
+$route['*']['/user/profile/sms/edit'] = array('UserController', 'smsEdit');
+$route['*']['/user/profile/check/mobile'] = array('UserController', 'checkMobile');
+$route['*']['/user/profile/sms/send/verify'] = array('UserController', 'smsSend');
 $route['*']['/user/avatar'] = array('UserController', 'avatar');
 $route['*']['/user/repasswd'] = array('UserController', 'repasswd');
 // Client API
@@ -163,4 +167,5 @@ $route['*']['/manage/item/list/:pid/project'] = array('[admin]ItemController', '
 $route['*']['/manage/item/del/:pmid'] = array('[admin]ItemController', 'itemDel');
 $route['*']['/manage/restore/list'] = array('[admin]RestoreController', 'restoreList');
 $route['*']['/manage/sys/info'] = array('[admin]SysController', 'sysinfo');
+$route['*']['/manage/sys/sms/switch'] = array('[admin]SysController', 'smsSwitch');
 ?>

+ 5 - 0
protected/config/sms.conf.php

@@ -0,0 +1,5 @@
+<?php
+$config['SMS_URL'] = 'http://sms.haotingyun.com/v2/sms/single_send.json';
+$config['SMS_AUTHKEY'] = 'fb5ef483e44b9556512a9febef376051';
+$config['SMS_TIPS'] = array('AUDIT_NOTICE' => '【纵横通行账号】您的验证码是', 'END_MSG' => ',15分钟内有效。', 'AUDIT_NOTICE_AUDITOR' => ',已审批通过,请您继续审批。');
+

+ 42 - 19
protected/controller/ClientController.php

@@ -15,6 +15,8 @@ Doo::loadClass('measureauditact');
 Doo::loadClass('itemfile');
 Doo::loadModel('users');
 Doo::loadClass('itemmeasurenum');
+Doo::loadModelAt('aconfig', 'admin');
+Doo::loadClass('sms');
 
 /**
  * MainController
@@ -25,7 +27,7 @@ Doo::loadClass('itemmeasurenum');
 class ClientController extends DooController
 {
 
-    private $data, $client, $auth, $att, $file, $zip, $actmeasure, $contractact, $project, $profile, $numofperact, $measureauditact, $attfile, $users, $itemfile, $itemMeasureNum;
+    private $data, $client, $auth, $att, $file, $zip, $actmeasure, $contractact, $project, $profile, $numofperact, $measureauditact, $attfile, $users, $itemfile, $aconfig, $sms, $itemfile, $itemMeasureNum;
     private $statusArray = array('uncheck' => '1', 'checking' => '2', 'checked' => '3', 'checkno' => '4');
     private $fileTypeArray = array('台帐附件');
 
@@ -46,6 +48,8 @@ class ClientController extends DooController
         $this->users = new Users();
         $this->itemfile = new ItemFile();
         $this->itemMeasureNum = new ItemMeasureNumpofper();
+        $this->aconfig = new AConfig();
+        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
     }
 
     public function ClientSignin()
@@ -742,25 +746,32 @@ class ClientController extends DooController
                     if ($this->measureauditact->setStatusTo($auditArray['maid'], 3, $auditcontent)) {
                         // 更新下一个人的状态
                         $countAudit = count($auditUserArray);
-                        if ($auditArray['last'] == '1') {
+                        if ($auditArray['last'] == '1') {// 根据标志位判断是否为最后一个审核人{ 判断当前审核人是什么角色 } 利用post发送的UID 与 当前期数参与的所有人比较
                             $this->measureauditact->setStatusTo($auditUserArray[0]['maid'], 3);
                             $this->numofperact->updateAuditStatus($_POST['tenderid'], $_POST['phaseno'], 'checked', $iniTimes);
                             echo json_encode(array('status' => TRUE, 'msg' => ''), JSON_UNESCAPED_UNICODE);
                             die();
-                        } else {
-                            if (($countAudit == 2) && ($auditUserArray[0]['last'] == 1) && ($auditUserArray[1]['maid'] == $auditArray['maid'])) {
+                        } else {// 不是最后一个审核人根据不同审核人数量变更状态 {当前用户不是最后一个审核人}
+                            if (($countAudit == 2) && ($auditUserArray[0]['last'] == 1) && ($auditUserArray[1]['maid'] == $auditArray['maid'])) {// 如果审核人为两个,第一个是最后审核人角色,第二个为当前审核人,设置审核中状态 {就是当前用户POST UID}
                                 $this->measureauditact->updateMastatus($auditUserArray[0]['maid']);
                                 $this->numofperact->updateAuditStatus($_POST['tenderid'], $_POST['phaseno'], 'checking', $iniTimes);
                                 echo json_encode(array('status' => TRUE, 'msg' => ''), JSON_UNESCAPED_UNICODE);
                                 die();
                             }
-                            if (($countAudit > 2)) {
+                            if (($countAudit > 2)) {// 审核人总数大于2时,
                                 foreach ($auditUserArray as $k => $v) {
-                                    if ($v['maid'] == $auditArray['maid']) {
+                                    if ($v['maid'] == $auditArray['maid']) {// 找到当前用户
                                         if ($k == ($countAudit - 1)) {//如果是最后一个
                                             $this->measureauditact->updateMastatus($auditUserArray[0]['maid']);
                                         } else {
-                                            $this->measureauditact->updateMastatus($auditUserArray[$k + 1]['maid']);
+                                            $this->measureauditact->updateMastatus($auditUserArray[$k + 1]['maid']);//变更下一个状态
+                                            // SMS Start
+                                            $verifyUserArray = $this->profile->getVerifiedMobile($auditUserArray[$k + 1]['auditoruid']);
+                                            $pmnameArray = $this->actmeasure->getRowByPmid($auditUserArray[$k + 1]['pmid']);
+                                            if (isset($verifyUserArray) && ($verifyUserArray['mobile'])) {
+                                                $this->__auditNotice($verifyUserArray['mobile'], $pmnameArray["pmname"] . ',' . $verifyUserArray["name"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR"]);
+                                            }
+                                            // SMS End
                                         }
                                         $this->numofperact->updateAuditStatus($_POST['tenderid'], $_POST['phaseno'], 'checking', $iniTimes);
                                         echo json_encode(array('status' => TRUE, 'msg' => ''), JSON_UNESCAPED_UNICODE);
@@ -799,7 +810,7 @@ class ClientController extends DooController
             $MeasureArray = $this->actmeasure->getRowByPmid($this->params['tenderid']);
             if (isset($updateArray['filepath'])) {
                 $pathinfo = pathinfo($updateArray['filepath']);
-                $downfileurl[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . '/' . $pathinfo ['filename'] . '/ProjectFile.rmf', 'MD5_Jl' => $updateArray['filehashcode'], 'proName' => $projectArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $projectArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
+                $downfileurl[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . ' / ' . $pathinfo ['filename'] . ' / ProjectFile . rmf', 'MD5_Jl' => $updateArray['filehashcode'], 'proName' => $projectArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $projectArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
                 echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downfileurl), JSON_UNESCAPED_UNICODE);
                 die();
             } else {
@@ -860,7 +871,7 @@ class ClientController extends DooController
                 $attfileArray = $this->attfile->getLastData($value['stid']);
                 foreach ($attfileArray as $k => $v) {
                     $pathinfo = pathinfo($v['filepath']);
-                    $retArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . '/' . $pathinfo ['filename'] . '/ProjectFile.rmf', 'proName' => $proArray['pname'], 'stName' => $value['stname'], 'MD5_Jl' => $v['filehashcode']);
+                    $retArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . ' / ' . $pathinfo ['filename'] . ' / ProjectFile . rmf', 'proName' => $proArray['pname'], 'stName' => $value['stname'], 'MD5_Jl' => $v['filehashcode']);
                 }
             }
             echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $retArray), JSON_UNESCAPED_UNICODE);
@@ -874,7 +885,7 @@ class ClientController extends DooController
                     $attfileArray = $this->contractact->getRowByStid($attArray['stid']);
                     $pathinfo = pathinfo($attArray['filepath']);
                     if (isset($pathinfo['dirname']))
-                        $newattArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . '/' . $pathinfo ['filename'] . '/ProjectFile.rmf', 'proName' => $proArray['pname'], 'stName' => $attfileArray['stname'], 'MD5_Jl' => $attArray['filehashcode']);
+                        $newattArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo ['dirname'] . ' / ' . $pathinfo ['filename'] . ' / ProjectFile . rmf', 'proName' => $proArray['pname'], 'stName' => $attfileArray['stname'], 'MD5_Jl' => $attArray['filehashcode']);
                 }
                 echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $newattArray), JSON_UNESCAPED_UNICODE);
                 die();
@@ -895,7 +906,7 @@ class ClientController extends DooController
     function setCheckno()
     {
         if (isset($this->params['userid']) && isset($this->params['tenderid']) && isset($this->params['phaseno']) && isset($_POST['MD5_JL']) && isset($_POST['MD5_Zip'])) {
-            $auditcontent = iconv('GBK', 'UTF-8', $_POST['CheckerMemo']);
+            $auditcontent = iconv('GBK', 'UTF - 8', $_POST['CheckerMemo']);
             $auditArrayStatus = $this->measureauditact->getLastNewRowInfo($this->params['tenderid'], $this->params['phaseno'], $this->params['userid']);
             if (isset($auditArrayStatus ['mastatus']) && (($auditArrayStatus ['mastatus'] == 'checked') || ($auditArrayStatus ['mastatus'] == 'checkno'))) {
                 echo json_encode(array('status' => FALSE, 'msg' => '该标段已审批完毕。'), JSON_UNESCAPED_UNICODE);
@@ -921,7 +932,7 @@ class ClientController extends DooController
                     }
                     $res = $this->zip->open(Doo::conf()->SITE_PATH . $fp[0]['filepath']);
                     $extPath = pathinfo($fp[0]['filepath']);
-                    $extPathdir = Doo::conf()->SITE_PATH . $extPath ['dirname'] . '/' . $extPath['filename'];
+                    $extPathdir = Doo::conf()->SITE_PATH . $extPath ['dirname'] . ' / ' . $extPath['filename'];
                     if ($res === TRUE) {
                         if (!$this->dir_create($extPathdir)) {
                             return FALSE;
@@ -958,7 +969,7 @@ class ClientController extends DooController
     {
         // 插入上次期数相关审批人员
         // TODO:
-//	error_log(var_export($this->params, TRUE), 3, '/opt/html/jiliang_customedProduct/data/' . time());
+//	error_log(var_export($this->params, TRUE), 3, ' / opt / html / jiliang_customedProduct / data / ' . time());
 //	die;
         if (isset($this->params['tenderid']) && isset($this->params['phaseno'])) {
             $auditArray = $this->numofperact->getChecknoRow($this->params['tenderid'], $this->params['phaseno']);
@@ -986,7 +997,7 @@ class ClientController extends DooController
 //                $downArray = NULL;
 //                $pathinfo = pathinfo($urlinfoArray['filepath']);
 //                if (isset($pathinfo['dirname']))
-//                    $downArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo['dirname'] . '/' . $pathinfo['filename'] . '/ProjectFile.rmf', 'MD5_Jl' => $urlinfoArray['filehashcode'], 'proName' => $proArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $proArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
+//                    $downArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo['dirname'] . ' / ' . $pathinfo['filename'] . ' / ProjectFile . rmf', 'MD5_Jl' => $urlinfoArray['filehashcode'], 'proName' => $proArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $proArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
 //                echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downArray), JSON_UNESCAPED_UNICODE);
                 echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
                 die();
@@ -1017,7 +1028,7 @@ class ClientController extends DooController
                 $downArray = NULL;
                 $pathinfo = pathinfo($urlinfoArray['filepath']);
                 if (isset($pathinfo['dirname'])) {
-                    $downArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo['dirname'] . '/' . $pathinfo['filename'] . '/ProjectFile.rmf', 'MD5_Jl' => $urlinfoArray['filehashcode'], 'proName' => $proArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $proArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
+                    $downArray[] = array('downurl' => Doo::conf()->APP_URL . $pathinfo['dirname'] . ' / ' . $pathinfo['filename'] . ' / ProjectFile . rmf', 'MD5_Jl' => $urlinfoArray['filehashcode'], 'proName' => $proArray['pname'], 'stName' => $stArray['stname'], 'pnameid' => $proArray['pid'], 'ptypeid' => $stArray['stid'], 'BidName' => $MeasureArray['pmname']);
                     echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downArray), JSON_UNESCAPED_UNICODE);
                     die();
                 } else {
@@ -1056,7 +1067,7 @@ class ClientController extends DooController
     public function updateTenderName()
     {
         if (isset($this->params['BidID']) && isset($this->params['BidNewName'])) {
-            if ($this->actmeasure->updateName($this->params['BidID'], iconv('GBK', 'UTF-8', $this->params['BidNewName']))) {
+            if ($this->actmeasure->updateName($this->params['BidID'], iconv('GBK', 'UTF - 8', $this->params['BidNewName']))) {
                 echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
                 die();
             } else {
@@ -1231,6 +1242,18 @@ class ClientController extends DooController
         }
     }
 
+    /**
+     *   。
+     *   标段ID,期号
+     */
+    private function __auditNotice($mobile, $text)
+    {
+        $smsSwitch = $this->aconfig->getOne(array('select' => 'smsSwitch', 'asArray' => TRUE))['smsSwitch'];
+        if ($smsSwitch > 0)
+            return $this->sms->sendSms($mobile, $text);
+
+    }
+
     function upfile($fildname, $param = 'doc, docx, xls, xlsx, png, zip')
     {
         return $this->att->uploadMut($fildname, $param);
@@ -1328,9 +1351,9 @@ class ClientController extends DooController
 
     function dir_path($path)
     {
-        $path = str_replace('\\', '/', $path);
-        if (substr($path, -1) != '/')
-            $path = $path . '/';
+        $path = str_replace('\\', ' / ', $path);
+        if (substr($path, -1) != ' / ')
+            $path = $path . ' / ';
         return $path;
     }
 

+ 25 - 1
protected/controller/RProjectController.php

@@ -9,6 +9,8 @@ Doo::loadClass('measureauditact');
 Doo::loadClass('numofperact');
 Doo::loadClass('itemmeasurenum');
 Doo::loadClass('itemfile');
+Doo::loadModelAt('aconfig', 'admin');
+Doo::loadClass('sms');
 
 /**
  * MainController
@@ -19,7 +21,8 @@ Doo::loadClass('itemfile');
 class RProjectController extends DooController
 {
 
-    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '未审批', 'checking' => '审批中', 'checked' => '已审批', 'checkno' => '未通过'), $itemfile, $itemmeasurenum;
+
+    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '未审批', 'checking' => '审批中', 'checked' => '已审批', 'checkno' => '未通过'), $aconfig, $sms,$itemfile, $itemmeasurenum;
 
     public function __construct()
     {
@@ -33,6 +36,8 @@ class RProjectController extends DooController
         $this->numofperact = new NumofperAct();
         $this->itemfile = new ItemFile();
         $this->itemmeasurenum = new ItemMeasureNumpofper();
+        $this->aconfig = new AConfig();
+        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'r';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
@@ -454,6 +459,13 @@ class RProjectController extends DooController
                                     $this->measureauditact->updateMastatus($auditUserArray[0]['maid']);
                                 } else {
                                     $this->measureauditact->updateMastatus($auditUserArray[$k + 1]['maid']);
+                                    // SMS Start
+                                    $verifyUserArray = $this->profile->getVerifiedMobile($auditUserArray[$k + 1]['auditoruid']);
+                                    $pmnameArray = $this->actmeasure->getRowByPmid($auditUserArray[$k + 1]['pmid']);
+                                    if (isset($verifyUserArray) && ($verifyUserArray['mobile'])) {
+                                        $this->__auditNotice($verifyUserArray['mobile'], $pmnameArray["pmname"] . ',' . $verifyUserArray["name"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR"]);
+                                    }
+                                    // SMS End
                                 }
                                 $this->numofperact->updateAuditStatus($lastRowArray['pmid'], $lastRowArray['numpname'], 'checking', $maxTimes['times']);
                                 echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
@@ -514,6 +526,18 @@ class RProjectController extends DooController
         $this->data['mpid'] = $this->params['mpid'];
         $this->render('r-project-section-report', $this->data, TRUE);
     }
+
+    /**
+     *   。
+     *   标段ID,期号
+     */
+    private function __auditNotice($mobile, $text)
+    {
+        $smsSwitch = $this->aconfig->getOne(array('select' => 'smsSwitch', 'asArray' => TRUE))['smsSwitch'];
+        if ($smsSwitch > 0)
+            return $this->sms->sendSms($mobile, $text);
+
+    }
 }
 
 ?>

+ 142 - 29
protected/controller/UserController.php

@@ -1,5 +1,5 @@
 <?php
-
+ini_set('display_errors', 1);
 Doo::loadClass('auth');
 Doo::loadClass('attfile');
 Doo::loadClass('profile');
@@ -9,6 +9,9 @@ Doo::loadClass('actmeasure');
 Doo::loadClass('numofperact');
 Doo::loadClass('user');
 Doo::loadClass('PasswordHash');
+Doo::loadClass('sms');
+Doo::loadModelAt('aconfig', 'admin');
+Doo::loadClass('measureauditact');
 
 /* * proDetail
  * MainController
@@ -17,11 +20,13 @@ Doo::loadClass('PasswordHash');
  * @author darkredz
  */
 
-class UserController extends DooController {
+class UserController extends DooController
+{
 
-    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $user, $ph;
+    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $user, $ph, $sms, $aconfig;
 
-    public function beforeRun($resource, $action) {
+    public function beforeRun($resource, $action)
+    {
 //	$uGroups = $this->profile->getProWithUid($this->auth->getUid());
 //	$falg = Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
 //	if (!$falg)
@@ -31,12 +36,14 @@ class UserController extends DooController {
             $falg = Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
             if (!$falg)
                 return Doo::acl()->defaultFailedRoute;
-        }else {
+        } else {
             return Doo::acl()->defaultFailedRoute;
         }
     }
 
-    public function __construct() {
+    public function __construct()
+    {
+        $this->data['numofchecking'] = null;
         $this->auth = new Auth();
         $this->attfile = new attFile();
         $this->profile = new Profile();
@@ -46,26 +53,41 @@ class UserController extends DooController {
         $this->numofperact = new NumofperAct();
         $this->user = new User();
         $this->ph = new PasswordHash(8, FALSE);
+        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
+        $this->aconfig = new AConfig();
+        $this->measureauditact = new MeasureauditAct();
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'p';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
+        $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid());
+        if (isset($mpidArray[0]['pid'])) {
+            foreach ($mpidArray as $key => $value) {
+                // 审批操作按照时间排序多标段
+                $this->data['numofchecking'] += $this->measureauditact->getCountMyChecking($value['pid'], $this->auth->getUid());
+            }
+        }
+        if ($this->data['numofchecking'] == 0) {
+            $this->data['numofchecking'] = null;
+        }
     }
 
     /**
      *
      * @return type
      */
-    public function index() {
+    public function index()
+    {
         $this->data['uprofile'] = $this->profile->getProWithUid($this->auth->getUid());
         $this->data['uprofile']['email'] = $this->auth->getUemail();
-        if (isset($_POST['name']) && isset($_POST['company']) && isset($_POST['jobs']) && isset($_POST['phone']) && isset($_POST['mobile'])) {
+        if (isset($_POST['name']) && isset($_POST['company']) && isset($_POST['jobs']) && isset($_POST['phone'])) {
             $this->profile->upProfile($this->auth->getUid(), $_POST);
             return DOO::conf()->APP_URL . 'user/profile';
         }
         $this->render('edit-profile', $this->data, TRUE);
     }
 
-    public function avatar() {
+    public function avatar()
+    {
         // TODO:加入目录可否写入判断
         if (count($_FILES) == 3) {
             $result = array();
@@ -114,16 +136,18 @@ class UserController extends DooController {
      *  @access public
      * ************************************************************ */
 
-    function createRandomCode($length) {
+    function createRandomCode($length)
+    {
         $randomCode = "";
         $randomChars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
         for ($i = 0; $i < $length; $i++) {
-            $randomCode .= $randomChars { mt_rand(0, 35) };
+            $randomCode .= $randomChars{mt_rand(0, 35)};
         }
         return $randomCode;
     }
 
-    public function proSection() {
+    public function proSection()
+    {
         /**
          * 计量期数
          * 完成进度
@@ -156,7 +180,7 @@ class UserController extends DooController {
                 }
                 $biaoduantotalmoney += $value['contracttotal'];
                 $totalmoney = number_format($value['contracttotal'], 2, '.', ',');
-                $bdhtmlstr .='
+                $bdhtmlstr .= '
 				<thead>
 				    <tr><th class="taC"  width="225">标段名</th><th class="taC" width="140">计量期数</th><th width="115" class="taC">总价</th><th class="taC" width="">截止本期累计完成/本期完成/未完成</th></tr></thead>
 				<tbody>
@@ -210,7 +234,88 @@ class UserController extends DooController {
         $this->render('w-project-section', $this->data, TRUE);
     }
 
-    Function fNumber($number) {
+    /**
+     *
+     * @return type
+     */
+    public function sms()
+    {
+        if (isset($_POST['mobile']) && isset($_POST['verifycode'])) {
+            $vmArray = $this->auth->getVerifyMobile();
+            if (isset($vmArray) && $vmArray) {
+                if (md5($_POST['mobile'] . $_POST['verifycode']) == md5($vmArray['mobile'] . $vmArray['code'])) {
+                    $this->profile->updateMobile($this->auth->getUid(), $vmArray['mobile']);
+                    return Doo::conf()->APP_URL . 'user/profile/sms';
+                }
+            }
+        }
+        $this->data['uprofile'] = $this->profile->getProWithUid($this->auth->getUid());
+        $this->data['smsNoticeSwitch'] = $this->aconfig->getOne(array('select' => 'smsswitch', 'asArray' => TRUE))['smsswitch'];
+        $this->render('edit-profile-sms', $this->data, TRUE);
+    }
+
+    /**
+     *
+     * @return type
+     */
+    public function smsEdit()
+    {
+        if (isset($_POST['mobile']) && isset($_POST['verifycode'])) {
+            $vmArray = $this->auth->getVerifyMobile();
+            if (isset($vmArray) && $vmArray) {
+                if (md5($_POST['mobile'] . $_POST['verifycode']) == md5($vmArray['mobile'] . $vmArray['code'])) {
+                    $this->profile->updateMobile($this->auth->getUid(), $vmArray['mobile']);
+                    return Doo::conf()->APP_URL . 'user/profile/sms/edit';
+                }
+            }
+        }
+        $this->data['uprofile'] = $this->profile->getProWithUid($this->auth->getUid());
+        $this->render('edit-profile-sms-edit', $this->data, TRUE);
+    }
+
+    /**
+     *
+     * @return type
+     */
+    public function checkMobile()
+    {
+//        $this->data['uprofile']['email'] = $this->auth->getUemail();
+//        if (isset($_POST['name']) && isset($_POST['company']) && isset($_POST['jobs']) && isset($_POST['phone']) && isset($_POST['mobile'])) {
+//            $this->profile->upProfile($this->auth->getUid(), $_POST);
+//            return DOO::conf()->APP_URL . 'user/profile';
+//        }
+        die(json_encode(array('mobile' => (int)$this->profile->checkMobile($_POST['mobile']))));
+    }
+
+    /**
+     *
+     * @return type
+     */
+    public function mobileVerify()
+    {
+//        $this->data['uprofile']['email'] = $this->auth->getUemail();
+//        if (isset($_POST['name']) && isset($_POST['company']) && isset($_POST['jobs']) && isset($_POST['phone']) && isset($_POST['mobile'])) {
+//            $this->profile->upProfile($this->auth->getUid(), $_POST);
+//            return DOO::conf()->APP_URL . 'user/profile';
+//        }
+        die(json_encode(array('mobile' => (int)$this->profile->checkMobile($_POST['mobile']))));
+    }
+
+    /**
+     *
+     * @return type
+     */
+    public function smsSend()
+    {
+        $randNum = rand(1000, 9999);
+        $this->auth->setVerifyMobile(array('mobile' => $_POST['mobile'], 'code' => $randNum));
+        $res = $this->sms->sendSms($_POST['mobile'], Doo::conf()->SMS_TIPS['AUDIT_NOTICE'] . $randNum . Doo::conf()->SMS_TIPS['END_MSG']);
+        die(json_encode(array('verify' => $res)));
+    }
+
+
+    Function fNumber($number)
+    {
         if ($number == '')
             Return "-";
         $nlen = strlen($number);
@@ -226,7 +331,8 @@ class UserController extends DooController {
         Return $fNumber;
     }
 
-    private function getFav() {
+    private function getFav()
+    {
         $proArray = $this->project->getAll();
         $this->data['othrPro'] = [];
         foreach ($proArray as $key => $value) {
@@ -239,7 +345,8 @@ class UserController extends DooController {
         }
     }
 
-    public function proSectionMeasure() {
+    public function proSectionMeasure()
+    {
         //此处未做更改,JSON文件已经固定名称
         $jsonpath = pathinfo($this->attfile->getMaxRow()['filepath']);
         if (isset($jsonpath['dirname'])) {
@@ -254,7 +361,7 @@ class UserController extends DooController {
                 closedir($handle);
             }
             $this->data['proArray'] = $proArray['Bills'];
-        }else {
+        } else {
             $this->data['proArray'] = [];
         }
         $this->data['mpid'] = $this->params['mpid'];
@@ -262,7 +369,8 @@ class UserController extends DooController {
         $this->render('w-project-section-measure', $this->data, TRUE);
     }
 
-    public function substr_replace_cn($string, $repalce = '*', $start = 0, $len = 0) {
+    public function substr_replace_cn($string, $repalce = '*', $start = 0, $len = 0)
+    {
         $count = mb_strlen($string, 'UTF-8'); //此处传入编码,建议使用utf-8。此处编码要与下面mb_substr()所使用的一致
         if (!$count) {
             return $string;
@@ -281,12 +389,13 @@ class UserController extends DooController {
             } else {
                 $returnString .= $tmpString;
             }
-            $i ++;
+            $i++;
         }
         return $returnString;
     }
 
-    function unicode_encode($name) {//to Unicode
+    function unicode_encode($name)
+    {//to Unicode
         $name = iconv('UTF-8', 'UCS-2', $name);
         $len = strlen($name);
         $str = '';
@@ -303,7 +412,8 @@ class UserController extends DooController {
         return $str;
     }
 
-    function unicode_decode($name) {//Unicode to
+    function unicode_decode($name)
+    {//Unicode to
         $pattern = '/([\w]+)|(\\\u([\w]{4}))/i';
         preg_match_all($pattern, $name, $matches);
         if (!empty($matches)) {
@@ -324,7 +434,8 @@ class UserController extends DooController {
         return $name;
     }
 
-    public function proDetail() {
+    public function proDetail()
+    {
         // 面包屑导航项目
         $this->data['currproArray'] = $this->data['allproArray'] = NULL;
         $allproArray = $this->project->getAll();
@@ -377,7 +488,8 @@ class UserController extends DooController {
         $this->render('w-project-section-detail', $this->data, TRUE);
     }
 
-    public function welcome() {
+    public function welcome()
+    {
 //	if (!$this->auth->isLoggedIn())
 //	    return Doo::conf()->APP_URL;
         if ($this->profile->getProWithUid($this->auth->getUid())['userid'])
@@ -391,7 +503,8 @@ class UserController extends DooController {
         $this->render('welcome', $this->data);
     }
 
-    public function prolist() {
+    public function prolist()
+    {
 //	if (!$this->auth->isLoggedIn())
 //	    return Doo::conf()->APP_URL;
 //	$proArray = new stdClass();
@@ -406,19 +519,19 @@ class UserController extends DooController {
 //	    closedir($handle);
 //	}
 //	$this->data['proArray'] = null;
-        $this->render('s-project
-
-	', $this->data);
+        $this->render('s-project', $this->data);
     }
 
 // ajax提取密码名称
-    public function getAjaxSection() {
+    public function getAjaxSection()
+    {
         if (!$this->isAjax())
             return;
         echo json_encode($_POST);
     }
 
-    public function repasswd() {
+    public function repasswd()
+    {
         if (isset($_POST['oldpasswd']) && isset($_POST['newpasswd']) && isset($_POST['renewpasswd']) && ($_POST['newpasswd'] == $_POST['renewpasswd'])) {
             $userArray = $this->user->getRowUser($this->auth->getUid());
             if ($this->ph->CheckPassword($_POST['oldpasswd'], $userArray['upass'])) {

+ 7 - 4
protected/model/uprofile.php

@@ -5,7 +5,8 @@ Doo::loadCore('db/DooModel');
 /**
  * 用户表
  */
-class Uprofile extends DooModel {
+class Uprofile extends DooModel
+{
 
     public $userid;
     public $name;
@@ -16,12 +17,14 @@ class Uprofile extends DooModel {
     public $qq;
     public $groups;
     public $avatar;
+    public $isnotice;
     public $_table = 'jl_user_profiles';
     public $_primarykey = 'userid';
-    public $_fields = array('userid', 'name', 'company', 'jobs', 'phone', 'mobile', 'qq', 'groups','avatar');
+    public $_fields = array('userid', 'name', 'company', 'jobs', 'phone', 'mobile', 'qq', 'groups', 'avatar', 'isnotice');
 
-    public function __construct() {
-	parent::setupModel(__CLASS__);
+    public function __construct()
+    {
+        parent::setupModel(__CLASS__);
     }
 
 }

+ 28 - 5
protected/module/admin/controller/SysController.php

@@ -1,5 +1,5 @@
 <?php
-
+ini_set('display_errors', 1);
 session_start(); // starts new or resumes existing session
 Doo::loadModelAt('aconfig', 'admin');
 Doo::loadModelAt('auser', 'admin');
@@ -14,24 +14,28 @@ Doo::loadClass('mailer');
 // 列表停用 编辑 重置密码
 // 管理员权限管理
 // 管理员修改密码
-class SysController extends DooController {
+class SysController extends DooController
+{
 
     private $data, $aconfig, $auser, $profile, $ph, $userz, $mailer;
 
-    public function beforeRun($resource, $action) {
+    public function beforeRun($resource, $action)
+    {
         if (!isset($_SESSION['auid'])) {
             return Doo::conf()->APP_URL . 'manage';
         }
     }
 
-    public function __construct() {
+    public function __construct()
+    {
         $this->aconfig = new AConfig();
         $this->auser = new AUser();
         $this->mailer = new Mailer();
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
     }
 
-    function sysinfo() {
+    function sysinfo()
+    {
         if (isset($_POST['proname']) || isset($_POST['aemail'])) {
             if ($_POST['proname']) {
                 $this->aconfig->proname = $_POST['proname'];
@@ -57,4 +61,23 @@ class SysController extends DooController {
         $this->render('admin-sysinfo', $this->data, TRUE);
     }
 
+    function smsSwitch()
+    {
+        if (isset($_POST['switch'])) {
+            if ($_POST['switch'] == 'off') {
+                $this->aconfig->smsswitch = 0;
+                if ($this->aconfig->update(array('where' => "conid = 1")) > 0)
+                    exit(json_encode(array('switch' => 'off')));
+            }
+            if ($_POST['switch'] == 'on') {
+                $this->aconfig->smsswitch = 1;
+                if ($this->aconfig->update(array('where' => "conid = 1")) > 0)
+                    exit(json_encode(array('switch' => 'on')));
+            }
+        }
+        $this->data['smsSwitch'] = $this->aconfig->getOne(array('select' => 'smsswitch', 'asArray' => TRUE))['smsswitch'];
+        $this->data['menu'] = 4;
+        $this->render('admin-sms', $this->data, TRUE);
+    }
+
 }

+ 6 - 3
protected/module/admin/model/aconfig.php

@@ -5,15 +5,18 @@ Doo::loadCore('db/DooModel');
 /**
  * 用户表
  */
-class AConfig extends DooModel {
+class AConfig extends DooModel
+{
 
     public $conid;
     public $proname;
+    public $smsswitch;
     public $_table = 'jl_config';
     public $_primarykey = 'conid';
-    public $_fields = array('conid', 'proname');
+    public $_fields = array('conid', 'proname', 'smsswitch');
 
-    public function __construct() {
+    public function __construct()
+    {
         parent::setupModel(__CLASS__);
     }
 

+ 95 - 0
protected/module/admin/view/admin-sms.html

@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<html lang=zh-cn>
+<head>
+    <meta charset=utf-8>
+    <title>纵横计量支付系统</title>
+    <meta name=description content=计量支付>
+    <meta name=copyright content=smartcost.com.cn>
+    <link rel=stylesheet href={{rootUrl}}global/css/bootstrap.css>
+    <link rel=stylesheet href={{rootUrl}}global/css/style.css>
+    <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
+    <script src={{rootUrl}}global/js/bootstrap.js></script>
+    <script src={{rootUrl}}global/js/jl.js></script>
+</head>
+<body>
+<div class="wrapHeader">
+    <h1 class="mainLogo" title="纵横计量支付"></h1>
+    <div class="sysTools"><a title="返回首页" href="index.html"><i class="icon-circle-arrow-left icon-white"></i></a>&nbsp;&nbsp;&nbsp;<a
+            title="纵横官网" target="_blank" href="http://smartcost.com.cn"><i class="icon-home icon-white"></i></a></div>
+</div>
+<!-- include "top" -->
+<div class="warpAdmin">
+    <!-- include "menu" -->
+    <div class="adminContent">
+        <div class="adminMain">
+            <form class="form-horizontal">
+                <fieldset>
+                    <legend>短信通知</legend>
+                    <div id="switchon" class="control-group <!-- if {{smsSwitch}}=='1' --> hide <!-- endif -->">
+                        <label class="control-label">开启短信通知功能</label>
+                        <div class="controls">
+                            <div class="btn-group">
+                                <input type="button" class="btn" id="smsOn" title="开启短信通知" value="开启"/>
+                                <button class="btn btn-danger disabled" disabled="disabled">已关闭</button>
+                            </div>
+                        </div>
+                    </div>
+                    <div id="switchoff" class="control-group <!-- if {{smsSwitch}}=='0' --> hide <!-- endif -->">
+                        <label class="control-label">开启短信通知功能</label>
+                        <div class="controls">
+                            <div class="btn-group">
+                                <button class="btn btn-success  disabled" disabled="disabled">已开启</button>
+                                <input type="button" class="btn" id="smsOff" title="关闭短信通知" value="关闭"/>
+                            </div>
+                        </div>
+                    </div>
+                    <div id="alert-open" class="alert alert-info hide">
+                        初次开启,所有用户都必须进行手机验证才能正常接收短信通知。
+                    </div>
+                    <div id="alert-close" class="alert alert-error hide">
+                        短信通知已关闭,所有用户都将不会再接收短信通知。
+                    </div>
+                </fieldset>
+            </form>
+        </div>
+    </div>
+</div>
+<script type="text/javascript">autoFlashHeight();</script>
+<script type="text/javascript">
+    $(document).ready(function () {
+        $("#smsOff").click(function () {
+            $.ajax({
+                type: "POST",
+                dataType: "json",
+                cache: false,
+                data: {"switch": 'off'},
+                url: "{{rootUrl}}manage/sys/sms/switch"
+            }).done(function (data) {
+                if (data['switch'] == 'off') {
+                    $("#switchoff").fadeOut();
+                    $("#switchon").fadeIn();
+                    $("#alert-open").fadeOut();
+                    $("#alert-close").fadeIn();
+                }
+            });
+        });
+        $("#smsOn").click(function () {
+            $.ajax({
+                type: "POST",
+                dataType: "json",
+                cache: false,
+                data: {"switch": 'on'},
+                url: "{{rootUrl}}manage/sys/sms/switch",
+            }).done(function (data) {
+                if (data['switch'] == 'on') {
+                    $("#switchon").fadeOut();
+                    $("#switchoff").fadeIn();
+                    $("#alert-close").fadeOut();
+                    $("#alert-open").fadeIn();
+                }
+            });
+        });
+    });
+
+</script>
+</body>

Datei-Diff unterdrückt, da er zu groß ist
+ 90 - 81
protected/module/admin/view/admin-userlist.html


+ 1 - 0
protected/module/admin/view/menu.html

@@ -1,6 +1,7 @@
 <div class="adminSidebar fL">
     <ul>
         <li><a href="{{rootUrl}}manage/sys/info"<!-- if {{menu}}=='1' --> class="now" <!-- endif -->>系统信息</a></li>
+        <li><a href="{{rootUrl}}manage/sys/sms/switch"<!-- if {{menu}}=='4' --> class="now" <!-- endif -->>短信通知</a></li>
         <li><a href="{{rootUrl}}manage/user/list"<!-- if {{menu}}=='2' --> class="now" <!-- endif -->>用户列表</a></li>
         <li><a href="{{rootUrl}}manage/user/add"<!-- if {{menu}}=='3' --> class="now" <!-- endif -->>添加用户</a></li>
     </ul>

+ 75 - 80
protected/view/edit-profile-avtra.html

@@ -1,89 +1,84 @@
 <!DOCTYPE html>
 <html lang=zh-cn>
-    <head>
-	<meta charset=utf-8>
-	<title>纵横计量支付系统</title>
-	<meta name=description content=计量支付>
-	<meta name=copyright content=smartcost.com.cn>
-		<meta name="viewport" content="width=device-width,initial-scale=1.0">
-	<link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
-	<link rel=stylesheet href={{rootUrl}}global/css/style.css>
-	<script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
-	<script src={{rootUrl}}global/js/bootstrap.js></script>
-	<script src={{rootUrl}}global/js/jl.js></script>
-    </head>
-    <body>
-	<!-- include "top" -->
-	<div class="wrapContent">
-	    <!-- include "left" -->
-	    <div class="mainContainer">
-		<!--内容-->
-		<div class="mainContent">
-		    <div class="title clearfix">
-			<div class="fR">
-			    <button class="btn btn-link" type="button"><i class="icon-question-sign"></i>&nbsp;帮助</button>
-			</div>
-		    </div>
-		    <div class="form">
-			<legend>修改头像</legend>
-			<div class="clearfix">
-			    <p id="swfContainer">
-				本组件需要安装Flash Player后才可使用,请从<a href="http://www.adobe.com/go/getflashplayer">这里</a>下载安装。
-			    </p>
-			</div>
-		    </div>
-		</div>
-		<!--内容-->
-	    </div>
-	</div>
-	<script type="text/javascript">autoFlashHeight();</script>
-	<script type="text/javascript" src="{{rootUrl}}global/avaup/scripts/swfobject.js"></script>
-        <script type="text/javascript" src="{{rootUrl}}global/avaup/scripts/fullAvatarEditor.js"></script>
-	<script type="text/javascript">
-swfobject.addDomLoadEvent(function () {
-    var swf = new fullAvatarEditor("swfContainer", {
-	id: 'swf',
-	upload_url: '{{rootUrl}}user/avatar',
-	src_upload: 2,
-	    avatar_sizes : '100*100|96*96|48*48',
-    avatar_sizes_desc : '100*100像素|96*96像素|48*48像素',
-    }, function (msg) {
-	switch (msg.code)
-	{
-	    case 1 :
+<head>
+    <meta charset=utf-8>
+    <title>纵横计量支付系统</title>
+    <meta name=description content=计量支付>
+    <meta name=copyright content=smartcost.com.cn>
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
+    <link rel=stylesheet href={{rootUrl}}global/css/style.css>
+    <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
+    <script src={{rootUrl}}global/js/bootstrap.js></script>
+    <script src={{rootUrl}}global/js/jl.js></script>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+    <!-- include "left" -->
+    <div class="mainContainer">
+        <!--内容-->
+        <div class="mainContent">
+            <div class="title clearfix">
+                <div class="fR">
+                    <button class="btn btn-link" type="button"><i class="icon-question-sign"></i>&nbsp;帮助</button>
+                </div>
+            </div>
+            <div class="form">
+                <legend>修改头像</legend>
+                <div class="clearfix">
+                    <p id="swfContainer">
+                        本组件需要安装Flash Player后才可使用,请从<a href="http://www.adobe.com/go/getflashplayer">这里</a>下载安装。
+                    </p>
+                </div>
+            </div>
+        </div>
+        <!--内容-->
+    </div>
+</div>
+<script type="text/javascript">autoFlashHeight();</script>
+<script type="text/javascript" src="{{rootUrl}}global/avaup/scripts/swfobject.js"></script>
+<script type="text/javascript" src="{{rootUrl}}global/avaup/scripts/fullAvatarEditor.js"></script>
+<script type="text/javascript">
+    swfobject.addDomLoadEvent(function () {
+        var swf = new fullAvatarEditor("swfContainer", {
+                    id: 'swf',
+                    upload_url: '{{rootUrl}}user/avatar',
+                    src_upload: 2,
+                    avatar_sizes: '100*100|96*96|48*48',
+                    avatar_sizes_desc: '100*100像素|96*96像素|48*48像素',
+                }, function (msg) {
+                    switch (msg.code) {
+                        case 1 :
 //		alert("页面成功加载了组件!");
-		break;
-	    case 2 :
+                            break;
+                        case 2 :
 //		alert("已成功加载默认指定的图片到编辑面板。");
-		break;
-	    case 3 :
-		if (msg.type == 0)
-		{
+                            break;
+                        case 3 :
+                            if (msg.type == 0) {
 //		    alert("摄像头已准备就绪且用户已允许使用。");
-		}
-		else if (msg.type == 1)
-		{
+                            }
+                            else if (msg.type == 1) {
 //		    alert("摄像头已准备就绪但用户未允许使用!");
-		}
-		else
-		{
+                            }
+                            else {
 //		    alert("摄像头被占用!");
-		}
-		break;
-	    case 5 :
-		if (msg.type == 0)
-		{
-		    windows.location.href = '/user/profile';
+                            }
+                            break;
+                        case 5 :
+                            if (msg.type == 0) {
+                                windows.location.href = '/user/profile';
 
-		}
-		break;
-	}
-    }
-    );
-    document.getElementById("upload").onclick = function () {
-	swf.call("upload");
-    };
-});
-        </script>
-    </body>
+                            }
+                            break;
+                    }
+                }
+        );
+        document.getElementById("upload").onclick = function () {
+            swf.call("upload");
+        };
+    });
+</script>
+</body>
 </html>

+ 169 - 0
protected/view/edit-profile-sms-edit.html

@@ -0,0 +1,169 @@
+<!DOCTYPE html>
+<html lang=zh-cn>
+<head>
+    <meta charset=utf-8>
+    <title>纵横计量支付系统</title>
+    <meta name=description content=计量支付>
+    <meta name=copyright content=smartcost.com.cn>
+    <link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
+    <link rel=stylesheet href={{rootUrl}}global/css/style.css>
+    <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
+    <script src={{rootUrl}}global/js/bootstrap.js></script>
+    <script src={{rootUrl}}global/js/jl.js></script>
+    <script src={{rootUrl}}global/js/jquery.cookie.min.js></script>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+    <!-- include "left" -->
+    <div class="mainContainer">
+        <!--内容-->
+        <div class="mainContent">
+            <div class="title clearfix">
+                <div class="fR">
+                    <button class="btn btn-link" type="button"><i class="icon-question-sign"></i>&nbsp;帮助</button>
+                </div>
+            </div>
+            <div class="form">
+                <form class="form-horizontal">
+                    <legend>短信通知-修改手机</legend>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">当前手机</label>
+                        <div class="controls">
+                            <input type="text" placeholder="{{uprofile.mobile}}" disabled="">
+                        </div>
+                    </div>
+                    <div id="input_error" class="control-group">
+                        <label class="control-label" for="inputEmail">新手机</label>
+                        <div class="controls">
+                            <input id="mobile" name="mobile" type="text" placeholder="输入您的新手机号码"><span id="help-inline"
+                                                                                                       class="help-inline hide"></span>
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">短信校验码</label>
+                        <div class="controls">
+                            <input type="text" id="verifycode" name="verifycode" placeholder="输入验证码" maxlength="11"
+                                   class="span2">
+                            <!--<button class="btn">获取验证码</button>-->
+                            <!--<button class="btn" disabled>重新获取 60s</button>-->
+                            <input type="button" class="btn" id="getting" value="获取验证码">
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label"></label>
+                        <div class="controls">
+                            <i class="icon-ok icon-white"></i><input type="button" id="addMobile"
+                                                                     class="btn btn-primary" value="确定修改"/>
+                        </div>
+                    </div>
+                    </fieldset>
+                </form>
+            </div>
+        </div>
+        <!--内容-->
+    </div>
+</div>
+<script type="text/javascript">autoFlashHeight();</script>
+<script type="text/javascript">
+    $(document).ready(function () {
+        $("#mobile").blur(function () {
+            $.ajax({
+                type: "POST",
+                dataType: "json",
+                cache: false,
+                data: {"mobile": $(this).val()},
+                url: "{{rootUrl}}user/profile/check/mobile",
+            }).done(function (data) {
+                if (data['mobile'] > 0) {
+                    $("#input_error").addClass('error');
+                    $("#help-inline").html('手机号码已被使用');
+                    $("#help-inline").show();
+                } else {
+                    $("#input_error").removeClass('error');
+                    $("#help-inline").hide();
+                }
+            });
+        });
+
+
+        /*仿刷新:检测是否存在cookie*/
+        if ($.cookie("sms")) {
+            var count = $.cookie("sms");
+            var btn = $('#getting');
+            btn.val('重新获取 ' + count + 's').attr('disabled', true).css('cursor', 'not-allowed');
+            var resend = setInterval(function () {
+                count--;
+                if (count > 0) {
+                    btn.val('重新获取 ' + count + 's').attr('disabled', true).css('cursor', 'not-allowed');
+                    $.cookie("sms", count, {path: '/', expires: (1 / 86400) * count});
+                } else {
+                    clearInterval(resend);
+                    btn.val("获取验证码").removeClass('disabled').removeAttr('disabled style');
+                }
+            }, 1000);
+        }
+
+        /*点击改变按钮状态,已经简略掉ajax发送短信验证的代码*/
+        $('#getting').click(function () {
+            var btn = $(this);
+            if ($("#mobile").val() == '') {
+                $("#input_error").addClass('error');
+                $("#help-inline").html('手机号码不能为空');
+                $("#help-inline").show();
+                return false;
+            }
+            $.ajax({
+                type: "POST",
+                dataType: "json",
+                cache: false,
+                data: {"mobile": $("#mobile").val()},
+                url: "{{rootUrl}}user/profile/check/mobile",
+            }).done(function (data) {
+                if (data['mobile'] > 0) {
+                    $("#input_error").addClass('error');
+                    $("#help-inline").html('手机号码已被使用');
+                    $("#help-inline").show();
+                    return false;
+                } else {
+                    $("#input_error").removeClass('error');
+                    $("#help-inline").hide();
+                    $.ajax({
+                        type: "POST",
+                        dataType: "json",
+                        cache: false,
+                        data: {"mobile": $("#mobile").val()},
+                        url: "{{rootUrl}}user/profile/sms/send/verify",
+                    }).done(function (data) {
+                    });
+                    var count = 60;
+                    var resend = setInterval(function () {
+                        count--;
+                        if (count > 0) {
+                            btn.val('重新获取 ' + count + 's');
+                            $.cookie("sms", count, {path: '/', expires: (1 / 86400) * count});
+                        } else {
+                            clearInterval(resend);
+                            btn.val("获取验证码").removeAttr('disabled style');
+                        }
+                    }, 1000);
+                    btn.attr('disabled', true).css('cursor', 'not-allowed');
+                }
+            });
+        });
+
+        /*点击改变按钮状态,已经简略掉ajax发送短信验证的代码*/
+        $('#addMobile').click(function () {
+            $.ajax({
+                type: "POST",
+                dataType: "json",
+                cache: false,
+                data: {"mobile": $("#mobile").val(), "verifycode": $("#verifycode").val()},
+                url: "{{rootUrl}}user/profile/sms/edit",
+            }).done(function (data) {
+                window.location.reload(true);
+            });
+        });
+    });
+</script>
+</body>

+ 197 - 0
protected/view/edit-profile-sms.html

@@ -0,0 +1,197 @@
+<!DOCTYPE html>
+<html lang=zh-cn>
+<head>
+    <meta charset=utf-8>
+    <title>纵横计量支付系统</title>
+    <meta name=description content=计量支付>
+    <meta name=copyright content=smartcost.com.cn>
+    <link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
+    <link rel=stylesheet href={{rootUrl}}global/css/style.css>
+    <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
+    <script src={{rootUrl}}global/js/bootstrap.js></script>
+    <script src={{rootUrl}}global/js/jl.js></script>
+    <script src={{rootUrl}}global/js/jquery.cookie.min.js></script>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+    <!-- include "left" -->
+    <div class="mainContainer">
+        <!--内容-->
+        <div class="mainContent">
+            <div class="title clearfix">
+                <div class="fR">
+                    <button class="btn btn-link" type="button"><i class="icon-question-sign"></i>&nbsp;帮助</button>
+                </div>
+            </div>
+            <div class="form">
+                <form class="form-horizontal">
+                    <legend>短信通知</legend>
+                    <!-- if {{smsNoticeSwitch}} < 1 -->
+                    <!--管理员关闭功能-->
+                    <div class="alert alert-error">
+                        短信通知功能已被关闭。
+                    </div>
+                    <!--管理员关闭功能-->
+                    <!-- else -->
+                    <!-- if {{uprofile.isnotice}} < 1 -->
+                    <!--初次使用-->
+                    <div class="alert alert-info">
+                        初次使用,请先添加用于接收通知的手机号码。
+                    </div>
+                    <div id="input_error" class="control-group">
+                        <label class="control-label" for="inputEmail">添加手机</label>
+                        <div class="controls">
+                            <input id="mobile" name="mobile" type="text" placeholder="输入您的新手机号码"><span id="help-inline"
+                                                                                                       class="help-inline hide"></span>
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">短信校验码</label>
+                        <div class="controls">
+                            <input type="text" id="verifycode" name="verifycode" placeholder="输入验证码" maxlength="11"
+                                   class="span2">
+                            <!--<button class="btn">获取验证码</button>-->
+                            <!--<button class="btn" disabled>重新获取 60s</button>-->
+                            <input type="button" class="btn" id="getting" value="获取验证码">
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label"></label>
+                        <div class="controls">
+                            <i class="icon-ok icon-white"></i><input type="button" id="addMobile"
+                                                                     class="btn btn-primary" value="确定添加"/>
+                        </div>
+                    </div>
+                    <!--初次使用-->
+                    <!-- else -->
+                    <!--正常使用-->
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">接收手机</label>
+                        <div class="controls">
+                            <input type="text" value="{{uprofile.mobile}}" disabled="">&nbsp;<a
+                                href="{{rootUrl}}user/profile/sms/edit">修改手机</a>
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">通知类型</label>
+                        <div class="controls">
+                            <label class="checkbox inline">
+                                <input type="checkbox" checked value="option1" disabled> 到我审批
+                            </label>
+                        </div>
+                    </div>
+                    <!--正常使用-->
+                    <!-- endif -->
+                    <!-- endif -->
+                    </fieldset>
+                </form>
+            </div>
+        </div>
+        <!--内容-->
+    </div>
+</div>
+<script type="text/javascript">autoFlashHeight();</script>
+<script type="text/javascript">
+    $(document).ready(function () {
+        $("#mobile").blur(function () {
+            $.ajax({
+                type: "POST",
+                dataType: "json",
+                cache: false,
+                data: {"mobile": $(this).val()},
+                url: "{{rootUrl}}user/profile/check/mobile",
+            }).done(function (data) {
+                if (data['mobile'] > 0) {
+                    $("#input_error").addClass('error');
+                    $("#help-inline").html('手机号码已被使用');
+                    $("#help-inline").show();
+                } else {
+                    $("#input_error").removeClass('error');
+                    $("#help-inline").hide();
+                }
+            });
+        });
+
+
+        /*仿刷新:检测是否存在cookie*/
+        if ($.cookie("sms")) {
+            var count = $.cookie("sms");
+            var btn = $('#getting');
+            btn.val('重新获取 ' + count + 's').attr('disabled', true).css('cursor', 'not-allowed');
+            var resend = setInterval(function () {
+                count--;
+                if (count > 0) {
+                    btn.val('重新获取 ' + count + 's').attr('disabled', true).css('cursor', 'not-allowed');
+                    $.cookie("sms", count, {path: '/', expires: (1 / 86400) * count});
+                } else {
+                    clearInterval(resend);
+                    btn.val("获取验证码").removeClass('disabled').removeAttr('disabled style');
+                }
+            }, 1000);
+        }
+
+        /*点击改变按钮状态,已经简略掉ajax发送短信验证的代码*/
+        $('#getting').click(function () {
+            var btn = $(this);
+            if ($("#mobile").val() == '') {
+                $("#input_error").addClass('error');
+                $("#help-inline").html('手机号码不能为空');
+                $("#help-inline").show();
+                return false;
+            }
+            $.ajax({
+                type: "POST",
+                dataType: "json",
+                cache: false,
+                data: {"mobile": $("#mobile").val()},
+                url: "{{rootUrl}}user/profile/check/mobile",
+            }).done(function (data) {
+                if (data['mobile'] > 0) {
+                    $("#input_error").addClass('error');
+                    $("#help-inline").html('手机号码已被使用');
+                    $("#help-inline").show();
+                    return false;
+                } else {
+                    $("#input_error").removeClass('error');
+                    $("#help-inline").hide();
+                    $.ajax({
+                        type: "POST",
+                        dataType: "json",
+                        cache: false,
+                        data: {"mobile": $("#mobile").val()},
+                        url: "{{rootUrl}}user/profile/sms/send/verify",
+                    }).done(function (data) {
+                    });
+                    var count = 60;
+                    var resend = setInterval(function () {
+                        count--;
+                        if (count > 0) {
+                            btn.val('重新获取 ' + count + 's');
+                            $.cookie("sms", count, {path: '/', expires: (1 / 86400) * count});
+                        } else {
+                            clearInterval(resend);
+                            btn.val("获取验证码").removeAttr('disabled style');
+                        }
+                    }, 1000);
+                    btn.attr('disabled', true).css('cursor', 'not-allowed');
+                }
+            });
+        });
+
+        /*点击改变按钮状态,已经简略掉ajax发送短信验证的代码*/
+        $('#addMobile').click(function () {
+            $.ajax({
+                type: "POST",
+                dataType: "json",
+                cache: false,
+                data: {"mobile": $("#mobile").val(), "verifycode": $("#verifycode").val()},
+                url: "{{rootUrl}}user/profile/sms",
+            }).done(function (data) {
+//                window.location.href = "{{rootUrl}}user/profile/sms";
+                window.location.reload();
+            });
+        });
+    });
+</script>
+</body>

+ 94 - 91
protected/view/edit-profile.html

@@ -1,94 +1,97 @@
 <!DOCTYPE html>
 <html lang=zh-cn>
-    <head>
-	<meta charset=utf-8>
-	<title>纵横计量支付系统</title>
-	<meta name=description content=计量支付>
-	<meta name=copyright content=smartcost.com.cn>
-		<meta name="viewport" content="width=device-width,initial-scale=1.0">
-	<link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
-	<link rel=stylesheet href={{rootUrl}}global/css/style.css>
-	<script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
-	<script src={{rootUrl}}global/js/bootstrap.js></script>
-	<script src={{rootUrl}}global/js/jl.js></script>
-    </head>
-    <body>
-	<!-- include "top" -->
-	<div class="wrapContent">
-	    <!-- include "left" -->
-	    <div class="mainContainer">
-		<!--内容-->
-		<div class="mainContent">
-		    <div class="title clearfix">
-			<div class="fR">
-			    <button class="btn btn-link" type="button"><i class="icon-question-sign"></i>&nbsp;帮助</button>
-			</div>
-		    </div>
-		    <div class="form">
-			<form class="form-horizontal" action="{{rootUrl}}user/profile" method="post">
-			    <legend>编辑个人信息</legend>
-			    <div class="control-group">
-				<label class="control-label" for="inputEmail">头像</label>
-				<div class="controls">
-				    <img src="{{rootUrl}}{{user.avatar}}"> <a href="{{rootUrl}}user/avatar">更换</a>
-				</div>
-			    </div>
-			    <div class="control-group">
-				<label class="control-label" for="inputEmail">邮箱(登录账号)</label>
-				<div class="controls">
-				    <input type="text" value="{{uprofile.email}}" disabled="">&nbsp;<a href="{{rootUrl}}user/repasswd">修改密码</a>
-				</div>
-			    </div>
-			    <div class="control-group">
-				<label class="control-label" for="inputEmail">姓名</label>
-				<div class="controls">
-				    <input type="text" name="name" value="{{uprofile.name}}" placeholder="输入您的姓名">
-				</div>
-			    </div>
-			    <div class="control-group">
-				<label class="control-label" for="inputEmail">单位(公司)名称</label>
-				<div class="controls">
-				    <input type="text" name="company" value="{{uprofile.company}}" placeholder="输入您的单位或者公司名称" >
-				</div>
-			    </div>
-			    <div class="control-group">
-				<label class="control-label" for="inputEmail">职位</label>
-				<div class="controls">
-				    <input type="text" name="jobs" value="{{uprofile.jobs}}" placeholder="输入您的职位">
-				</div>
-			    </div>
-			    <div class="control-group">
-				<label class="control-label" for="inputEmail">联系电话</label>
-				<div class="controls">
-				    <div class="input-prepend">
-					<span class="add-on">固话</span>
-					<input type="text" name="phone" value="{{uprofile.phone}}" placeholder="格式:0000-00000000" style="width:167px">
-				    </div>
-				    <div class="input-prepend">
-					<span class="add-on">手机</span>
-					<input type="text" name="mobile" value="{{uprofile.mobile}}" placeholder="输入11位手机号码"  class="span2">
-				    </div>
-				</div>
-			    </div>
-			    <div class="control-group">
-				<label class="control-label" for="inputEmail">QQ</label>
-				<div class="controls">
-				    <input type="text" name="qq" value="{{uprofile.qq}}" placeholder="输入您的QQ号码">
-				</div>
-			    </div>
-			    <div class="control-group">
-				<label class="control-label"></label>
-				<div class="controls">
-				    <input type="submit" class="btn btn-primary" value="确定提交"><i class="icon-ok icon-white"></i>&nbsp;</input>
-				</div>
-			    </div>
-			    </fieldset>
-			</form>
-		    </div>
-		</div>
-		<!--内容-->
-	    </div>
-	</div>
-	<script type="text/javascript">autoFlashHeight();</script>
-    </body>
+<head>
+    <meta charset=utf-8>
+    <title>纵横计量支付系统</title>
+    <meta name=description content=计量支付>
+    <meta name=copyright content=smartcost.com.cn>
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
+    <link rel=stylesheet href={{rootUrl}}global/css/style.css>
+    <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
+    <script src={{rootUrl}}global/js/bootstrap.js></script>
+    <script src={{rootUrl}}global/js/jl.js></script>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+    <!-- include "left" -->
+    <div class="mainContainer">
+        <!--内容-->
+        <div class="mainContent">
+            <div class="title clearfix">
+                <div class="fR">
+                    <button class="btn btn-link" type="button"><i class="icon-question-sign"></i>&nbsp;帮助</button>
+                </div>
+            </div>
+            <div class="form">
+                <form class="form-horizontal" action="{{rootUrl}}user/profile" method="post">
+                    <legend>编辑个人信息</legend>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">头像</label>
+                        <div class="controls">
+                            <img src="{{rootUrl}}{{user.avatar}}"> <a href="{{rootUrl}}user/avatar">更换</a>
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">邮箱(登录账号)</label>
+                        <div class="controls">
+                            <input type="text" value="{{uprofile.email}}" disabled="">&nbsp;<a
+                                href="{{rootUrl}}user/repasswd">修改密码</a>
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">姓名</label>
+                        <div class="controls">
+                            <input type="text" name="name" value="{{uprofile.name}}" placeholder="输入您的姓名">
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">单位(公司)名称</label>
+                        <div class="controls">
+                            <input type="text" name="company" value="{{uprofile.company}}" placeholder="输入您的单位或者公司名称">
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">职位</label>
+                        <div class="controls">
+                            <input type="text" name="jobs" value="{{uprofile.jobs}}" placeholder="输入您的职位">
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">联系电话</label>
+                        <div class="controls">
+                            <div class="input-prepend">
+                                <span class="add-on">固话</span>
+                                <input type="text" name="phone" value="{{uprofile.phone}}"
+                                       placeholder="格式:0000-00000000" style="width:167px">
+                            </div>
+                            <div class="input-prepend">
+                                <span class="add-on">手机</span>
+                                <input type="text" disabled="disabled" value="{{uprofile.mobile}}" placeholder="输入11位手机号码"
+                                       class="span2">
+                            </div>
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label" for="inputEmail">QQ</label>
+                        <div class="controls">
+                            <input type="text" name="qq" value="{{uprofile.qq}}" placeholder="输入您的QQ号码">
+                        </div>
+                    </div>
+                    <div class="control-group">
+                        <label class="control-label"></label>
+                        <div class="controls">
+                            <input type="submit" class="btn btn-primary" value="确定提交"><i class="icon-ok icon-white"></i>&nbsp;</input>
+                        </div>
+                    </div>
+                    </fieldset>
+                </form>
+            </div>
+        </div>
+        <!--内容-->
+    </div>
+</div>
+<script type="text/javascript">autoFlashHeight();</script>
+</body>
 </html>

+ 13 - 11
protected/view/top.html

@@ -1,16 +1,18 @@
 <div class="wrapHeader">
     <h1 title="纵横计量支付" class="mainLogo"></h1>
     <div class="userInfo"><img src="{{rootUrl}}{{user.avatar}}" class="fR">
-	<div class="btn-group">
-	    <button data-toggle="dropdown" class="btn dropdown-toggle">{{user.name}}&nbsp;<span class="caret"></span></button>
-	    <ul class="dropdown-menu">
-		<li><a href="{{rootUrl}}user/profile">个人信息</a></li>
-		<li class="hide"><a href="#"><span data-icon="r" aria-hidden="true"></span>&nbsp;工作组</a></li>
-		<li class="hide"><a href="#"><span data-icon="B" aria-hidden="true"></span>&nbsp;我的任务</a></li>
-		<li class="divider"></li>
-		<li class="hide"><a href="#">帮助中心</a></li>
-		<li><a href="{{rootUrl}}signout">退出</a></li>
-	    </ul>
-	</div>
+        <div class="btn-group">
+            <button data-toggle="dropdown" class="btn dropdown-toggle">{{user.name}}&nbsp;<span class="caret"></span>
+            </button>
+            <ul class="dropdown-menu">
+                <li><a href="{{rootUrl}}user/profile">个人信息</a></li>
+                <li><a href="{{rootUrl}}user/profile/sms">短信通知</a></li>
+                <li class="hide"><a href="#"><span data-icon="r" aria-hidden="true"></span>&nbsp;工作组</a></li>
+                <li class="hide"><a href="#"><span data-icon="B" aria-hidden="true"></span>&nbsp;我的任务</a></li>
+                <li class="divider"></li>
+                <li class="hide"><a href="#">帮助中心</a></li>
+                <li><a href="{{rootUrl}}signout">退出</a></li>
+            </ul>
+        </div>
     </div>
 </div>

+ 2 - 0
短信提醒.sql

@@ -0,0 +1,2 @@
+ALTER TABLE  `jl_config` ADD  `smsswitch` TINYINT NOT NULL DEFAULT  '1';
+ALTER TABLE  `jl_user_profiles` ADD  `isnotice` TINYINT NOT NULL DEFAULT  '0';