将值班系统和value系统。。从123搬迁到144

feature/pay
cyc 6 years ago
parent 83460c7eea
commit 72ab473a8b

@ -0,0 +1,714 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Index extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('ding_value_model');
}
public function test_cookie(){
//https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=dingoagxeeheunc0p95eu8&response_type=code&scope=snsapi_login&state=STATE&redirect_uri=http://www.mycht.cn/webht.php/apps/dingmail/index/test_cookie
}
public function index($unionid = null,$type = null){
if($this->session->userdata('dingding_user_info') === false){
$this->session->set_userdata('unionid', $unionid);
$this->session->set_userdata('type',$type);
$this->load->view('login');
}else{
if($unionid != null && $type != null){
$user_info = $this->session->userdata('dingding_user_info');
$data['type'] = $type;
$data['user'] = $user_info->ddu_Name;
$data['user_unionid'] = $user_info->ddu_Unionid;
if($this->ding_value_model->get_dingding_user($unionid) == null){
echo '该用户还未登录过,请告知他登录后才能对他点赞或拍砖!<br>';
echo '有问题请联系CYC!';
exit;
}
$data['comment_name'] = $this->ding_value_model->get_dingding_user($unionid)->ddu_Name;
$data['comment_unionid'] = $unionid;
$data['content'] = $type;
$data['mail_identify'] = $this->ding_value_model->get_dingding_user($unionid)->ddu_Sn.'_'.time();
$data['createtime'] = time();
if($data['user'] == $data['comment_name']){
echo '<script>alert("不能对自己点赞或拍砖!")</script>';
$this->index($unionid);
}else{
$obj = $this->ding_value_model->get_user_time($data['comment_unionid'],$data['user_unionid']);
$last_time = $obj->ddv_Createtime;
$time_diff = ($data['createtime'] - $last_time) / 3600;
if($time_diff > 3){
$flag = $this->ding_value_model->add_value($data);
if(!$flag){
exit($type.'失败');
}else{
redirect(site_url('apps/dingmail/index/index/'.$unionid));
}
}else{
echo '<script>alert("不能频繁对一个人点赞或拍砖!")</script>';
$this->index($unionid);
}
}
}else{
if($unionid == null){
$unionid = $this->session->userdata('dingding_user_info')->ddu_Unionid;
}
$mdata['user'] = $this->ding_value_model->get_dingding_user($unionid);
$mdata['user_unionid'] = $unionid;
$mdata['like_count'] = $this->ding_value_model->count_like($unionid);
$mdata['unlike_count'] = $this->ding_value_model->count_unlike($unionid);
$mdata['whos_like'] = $this->ding_value_model->whos_like($unionid);
$mdata['whos_unlike'] = $this->ding_value_model->whos_unlike($unionid);
$mdata['all_comment'] = $this->ding_value_model->all_comment($unionid);
//print_r($this->session->userdata('dingding_user_info'));
$this->load->view('user',$mdata);
}
}
}
//value邮件页面
public function mail_index(){
if($this->session->userdata('dingding_user_info') === false){
$this->load->view('login');
}else{
//print_r($this->session->userdata('dingding_user_info'));
$this->load->view('mail');
}
}
//发送邮件
public function send_mail(){
if(!$this->input->post('emaillist')){
echo -1;
return;
}
$user_info = $this->session->userdata('dingding_user_info');
$data['mail_content'] = htmlspecialchars($this->input->post('emailcontent'));
$data['mail_fromuser'] = $user_info->ddu_Name;
$data['mail_subject'] = $this->input->post('mail_subject');
$data['mail_touser'] = $this->input->post('emaillist');
$data['mail_ccuser'] = $this->input->post('cs_emaillist');
$data['mail_value_key'] = $this->input->post('whm_value_key');
$data['mail_createtime'] = time();
$data['mail_identify'] = $user_info->ddu_Sn . '_' . time();
$ddm_id = $this->ding_value_model->add_mail($data);
//邮件所有人如果是value邮件则属于被value的人如果不是则属于发邮件的人
if ($this->input->post('whum_value_user')) {
$value_user_array = explode(';', $this->input->post('whum_value_user'));
foreach ($value_user_array as $vu) {
if (!empty($vu)) {
$vudata['value_user_name'] = $vu;
$vudata['value_user_identify'] = $data['mail_identify'];
$vudata['value_user_createtime'] = $data['mail_createtime'];
$ddum_id = $this->ding_value_model->add_value_user($vudata);
}
}
} else {
$vudata['value_user_name'] = $user_info->ddu_Name;
$vudata['value_user_identify'] = $data['mail_identify'];
$vudata['value_user_createtime'] = $data['mail_createtime'];
$ddum_id = $this->ding_value_model->add_value_user($vudata);
}
//收件人
$tostring = '';
$tolist_array = array();
$nowlist_array = explode(';', $this->input->post('emaillist'));
foreach ($nowlist_array as $v) {
if($v != null){
$tostring .= "'".$v."'".',';
}
}
$tostring = substr($tostring,0,-1);
if(!empty($tostring)){
$tolist_array = $this->ding_value_model->all_email($tostring);
}else{
$tolist_array = null;
}
//抄送
$ccstring = '';
$cclist_array = array();
$ccmail_array = explode(';', $this->input->post('cs_emaillist'));
foreach ($ccmail_array as $c) {
if($c != null){
$ccstring .= "'".$c."'".',';
}
}
$ccstring = substr($ccstring,0,-1);
if(!empty($ccstring)){
$cclist_array = $this->ding_value_model->all_email($ccstring);
}else{
$cclist_array = null;
}
$mailheader = '<p style="font-size:20px">FROM:'.$user_info->ddu_Name.'</p><br>';
$mailbody = '<div style="overflow:hidden">
<a style="height:auto;text-decoration: none;" href="http://' . $_SERVER['HTTP_HOST'] . '/webht.php/apps/dingmail/index/like/' . $data['mail_identify'] . '/like" >
<img src="http://' . $_SERVER['HTTP_HOST'] . '/css/images/like.png" />
</a>
<a style="height:auto;text-decoration: none;" href="http://' . $_SERVER['HTTP_HOST'] . '/webht.php/apps/dingmail/index/like/' . $data['mail_identify'] . '/unlike" >
<img src="http://' . $_SERVER['HTTP_HOST'] . '/css/images/unlike.png" />
</a>
</div>';
$fromuser = $user_info->ddu_Name;
$subject = $this->input->post('mail_subject');
//是否为value邮件如果不是value邮件不在邮件下放置点赞按钮
if($this->input->post('whum_value_user')){
$body = $mailheader.$this->input->post('emailcontent').$mailbody;
}else{
$body = $mailheader.$this->input->post('emailcontent');
}
if (!$this->do_sendmail($fromuser, $tolist_array, $cclist_array, $subject, $body)) {
$result = 0; //"邮件发送有误: " . $mail->ErrorInfo;
} else {
//是value邮件的话默认发送人点赞
if ($this->input->post('whum_value_user')) {
$obj = explode(';', $this->input->post('whum_value_user'));
foreach(array_filter($obj) as $value){
$data['comment_name'] = $value;
$data['comment_unionid'] = $this->ding_value_model->get_dingding_unionid($data['comment_name'])->ddu_Unionid;
$data['type'] = 'like';
$data['mail_identify'] = $data['mail_identify'];
$data['user'] = $user_info->ddu_Name;
$data['user_unionid'] = $user_info->ddu_Unionid;
$data['content'] = $this->ding_value_model->get_mail($data['mail_identify'])->ddm_Content;
$data['createtime'] = time();
$whc_id = $this->ding_value_model->add_value($data);
}
}
$result = 1;
}
echo $result;
return;
}
//执行邮件发送功能
public function do_sendmail($fromuser, $tolist_array, $cclist_array, $subject, $mailbody) {
$this->load->library('Phpmailer_lib');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'smtp.mxhichina.com';//smtp.sendgrid.net
$mail->Port = 25;
$mail->SMTPAuth = true;
$mail->Username = 'admin@hainatravel.com';
$mail->Password = "Hainatravel123";//Hainatravel1234
$mail->SMTPSecure = 'tls';
$mail->CharSet = "utf-8";
$mail->Encoding = "base64";
$mail->IsHTML(true);
$mail->FromName = $fromuser; //收件人昵称
$mail->From = 'admin@hainatravel.com'; //发件人
//$mail->setFrom('zm198311@yahoo.com.cn', $fromuser);
if($tolist_array != null){
foreach ($tolist_array as $v) {
$mail->AddAddress($v->ddu_Email); //收件人
}
}
if($cclist_array != null){
foreach ($cclist_array as $c) {
$mail->addCC($c->ddu_Email); //抄送
}
}
$mail->Subject = $subject; //邮件主题
$mail->Body = $mailbody; //邮件内容
if (!$mail->Send()) {
$result = $mail->ErrorInfo;
echo "邮件发送有误: " . $mail->ErrorInfo;
} else {
$result = true;
}
return $result;
}
//钉邮群体点赞功能
public function like($identify = null,$type = null){
if($this->session->userdata('dingding_user_info') === false){
$this->session->set_userdata('identify',$identify);
$this->session->set_userdata('mail_type',$type);
$this->load->view('login');
}else{
$user_info = $this->session->userdata('dingding_user_info');
if(!empty($user_info)){
$data['user'] = $user_info->ddu_Name;
if(($type == 'like' || $type == 'unlike') && $identify){
$data['type'] = $type;
$data['mail_identify'] = $identify;
$data['user_unionid'] = $user_info->ddu_Unionid;
$has_like = $this->ding_value_model->is_liked($data);
if(!$has_like){
$data['createtime'] = time();
$data['content'] = $this->ding_value_model->get_mail($data['mail_identify'])->ddm_Content;
$data['comment_name'] = 'value邮件';
$data['comment_unionid'] = $this->ding_value_model->get_mail($identify)->ddm_Sn;
//对邮件点赞
$whc_id = $this->ding_value_model->add_value($data);
}
//对value对象点赞
$valuedata['type'] = $type;
$valuedata['mail_identify'] = $identify;
$valuedata['user'] = $user_info->ddu_Name;
$valuedata['user_unionid'] = $user_info->ddu_Unionid;
$valuedata['createtime'] = time();
$valuedata['content'] = $this->ding_value_model->get_mail($identify)->ddm_Content;
$obj = $this->ding_value_model->get_value($identify,$valuedata['user_unionid']);
if(!empty($obj)){
//这里没有判空
foreach($obj as $value){
$valuedata['comment_name'] = $value->ddum_Name;
$valuedata['comment_unionid'] = $value->ddu_Unionid;
$obj = $this->ding_value_model->get_user_time($valuedata['comment_unionid'],$valuedata['user_unionid'],$identify);
if($obj){
$last_time = $obj->ddv_Createtime;
}else{
$last_time = 0;
}
$time_diff = ($valuedata['createtime'] - $last_time) / 3600;
if($time_diff > 100000){
$flag = $this->ding_value_model->add_value($valuedata);
if(!$flag){
continue;
}
}else{
echo '<script>alert("你已经对这封邮件的value对象点过赞或拍砖了")</script>';
}
}
//sleep(3);
//redirect(site_url('apps/dingmail/index/like/'.$identify));
}
}
}
$tpldata['value_mail'] = $this->ding_value_model->get_mail($identify);
$tpldata['whos_like'] = $this->ding_value_model->value_whos_like($identify);
$tpldata['whos_unlike'] = $this->ding_value_model->value_whos_unlike($identify);
$this->load->view('like',$tpldata);
}
}
//增加评论
public function add_comment(){
$data = array();
if($this->input->post('hidden_name')){
$data['user'] = '猜猜我是谁';
$data['user_unionid'] = 'xxxxxxx';
$data['type'] = 'hidden_comment';
}else{
$data['user'] = $this->session->userdata('dingding_user_info')->ddu_Name;
$data['user_unionid'] = $this->session->userdata('dingding_user_info')->ddu_Unionid;
$data['type'] = 'comment';
}
$data['comment_name'] = $this->input->post('user_name');
$data['comment_unionid'] = $this->input->post('user_unionid');
$data['content'] = str_replace(PHP_EOL, '', $this->input->post('comment'));
$data['createtime'] = time();
$data['mail_identify'] = $this->input->post('user_sn').'_'.$data['createtime'];
$obj = $this->ding_value_model->get_last_comment($data['comment_name'],$data['comment_unionid']);
if(empty($obj)){
$time = 0;
}else{
$time = $obj[0]->ddv_Createtime;
}
$tolist_array = $this->ding_value_model->all_email("'".$data['comment_name']."'");
$difftime = time() - $time;
if($difftime / 3600 > 24){
$this->do_sendmail($data['user'], $tolist_array, null, '今天有人评论你了哟!', '快去看看吧http://www.mycht.cn/webht.php/apps/dingmail/index/index/'.$data['comment_unionid']);
}
$comment_id = $this->ding_value_model->add_value($data);
echo $comment_id;
}
public function test(){
$this->ding_value_model->test();
}
//点赞排行榜
public function rank_person() {
if($this->session->userdata('dingding_user_info') === false){
$this->load->view('login');
}else{
$data = array();
$user_info = $this->session->userdata('dingding_user_info');
if (!empty($user_info)) {
$data['uname'] = $user_info->ddu_Name;
}
//$data['current_user'] = $current_user;
//周榜
$monday = strtotime('this week');
$sunday = strtotime('last day this week +7 day');
$data['rank_week'] = $this->ding_value_model->get_person_rank($monday, $sunday);
//月榜
$from_date = strtotime(date('Y-m-01', time()));
$firstday = date('Y-m-01', time());
$to_date = strtotime("$firstday +1 month -1 day");
$data['rank_month'] = $this->ding_value_model->get_person_rank($from_date, $to_date);
//年榜
$year_start = strtotime(date('Y-01-01', time()));
//echo strtotime(date('2017-12-31', time()));
//$year_start = strtotime(date('2016-01-01'));
$year_end = strtotime(date('Y-12-31', time()));
//$year_end = strtotime(date('2016-12-31'));
$data['rank_year'] = $this->ding_value_model->get_person_rank($year_start, $year_end);
//总榜
//$data['rank_all']=$this->Outlook_model->get_person_rank();
//每条价值观对应获得最多的人
/* ycc暂时不需要了
$rank=array();
$value_array=array('team','chengxin','customer','discovery','system');
foreach ($value_array as $value) {
$rank[$value]=$this->Outlook_model->value_key_rank($value);
for ($i=1; $i < 5; $i++) {
$value_key=$value.$i;
$rank[$value_key]=$this->Outlook_model->value_key_rank($value_key);
}
}
$data['rank']=$rank;
*/
$this->load->view('rank_person',$data);
}
}
//钉钉扫码登录
public function auth_login(){
//获取code
$code = $_REQUEST['code'];
//请求access_token,并且打印出来
$url = 'https://oapi.dingtalk.com/sns/gettoken?appid=dingoagxeeheunc0p95eu8&appsecret=R3fhIY1zWw5wJZNWeszXg0VNpxzU5i95T4tUuboTQBEWAaQyg3mGC-ssskeyt9DY';
$access_token = json_decode($this->get_http($url,$data = '',$method = 'GET'));
//请求接口获取persistent_code
$url_info = 'https://oapi.dingtalk.com/sns/get_persistent_code?access_token='.$access_token->access_token;
$tmp_auth_code = '{"tmp_auth_code":"'.$code.'"}';
$info = json_decode($this->get_http($url_info,$data = $tmp_auth_code,$method = 'POST'));
//请求sns_token
$url_sns = 'https://oapi.dingtalk.com/sns/get_sns_token?access_token='.$access_token->access_token;
$sns_code = '{"openid":"'.$info->openid.'","persistent_code":"'.$info->persistent_code.'"}';
$sns_token = json_decode($this->get_http($url_sns,$sns_code,$method = 'POST'));
//获取个人信息
$url_person = 'https://oapi.dingtalk.com/sns/getuserinfo?sns_token='.$sns_token->sns_token;
$person = json_decode($this->get_http($url_person,$data = '',$method = 'GET'));
$unionid = $person->user_info->unionid;
$username = $person->user_info->nick;
$check_login = $this->ding_value_model->get_dingding_user($unionid);
if(!$check_login){
$data = $this->get_user_info($unionid);
$flag = $this->ding_value_model->add_dingding_user($data['ddu_Name'],$data['ddu_Unionid'],$data['ddu_Mobile'],$data['ddu_Email'],$data['ddu_Position'],$data['ddu_Avatar'],$data['ddu_Datetime']);
if(!$flag){
exit('新增用户失败!');
}else{
$user_info = $this->ding_value_model->get_dingding_user($data['ddu_Unionid']);
$this->session->set_userdata('dingding_user_info',$user_info);
if($this->session->userdata('unionid') && $this->session->userdata('type')){
redirect(site_url('apps/dingmail/index/index/'.$this->session->userdata('unionid').'/'.$this->session->userdata('type')));
}elseif($this->session->userdata('identify') && $this->session->userdata('mail_type')){
redirect(site_url('apps/dingmail/index/like/'.$this->session->userdata('identify').'/'.$this->session->userdata('mail_type')));
}else{
redirect(site_url('apps/dingmail/index/index/'.$user_info->ddu_Unionid));
}
}
}
$now_time = time();
if($check_login->ddu_Datetime == null){
$check_login->ddu_Datetime = 0;
}
$last_time = $check_login->ddu_Datetime;
$time_diff = ($now_time - $last_time) / 86400;
if($time_diff > 30){
$data= $this->get_user_info($unionid);
$this->ding_value_model->update_dingding_user($data['ddu_Name'],$data['ddu_Unionid'],$data['ddu_Mobile'],$data['ddu_Email'],$data['ddu_Position'],$data['ddu_Avatar'],$data['ddu_Datetime']);
$check_login = $this->ding_value_model->get_dingding_user($unionid);
}
$this->session->set_userdata('dingding_user_info', $check_login);
if($this->session->userdata('unionid') && $this->session->userdata('type')){
redirect(site_url('apps/dingmail/index/index/'.$this->session->userdata('unionid').'/'.$this->session->userdata('type')));
}elseif($this->session->userdata('identify') && $this->session->userdata('mail_type')){
redirect(site_url('apps/dingmail/index/like/'.$this->session->userdata('identify').'/'.$this->session->userdata('mail_type')));
}else{
redirect(site_url('apps/dingmail/index/index/'.$check_login->ddu_Unionid));
}
}
//通过钉钉获取用户详细信息
public function get_user_info($unionid){
//公司的access_token.
//unionid是通过扫码获取到
//获取公司access_token用access_token和unionid获取userid利用userid获取成员详细信息。
$url_access_token = 'https://oapi.dingtalk.com/gettoken?corpid=ding48bce8fd3957c96b&corpsecret=4I_TlkOUtWQ60tUYX_447WXM5mNX41q_Q03xtZJgvBOzMPzGbNKZZz_Bsv-0B9I1';
$company_info = json_decode($this->get_http($url_access_token,$data='',$method='GET'));
$url_unionid = 'https://oapi.dingtalk.com/user/getUseridByUnionid?access_token='.$company_info->access_token.'&unionid='.$unionid;
$userid = json_decode($this->get_http($url_unionid,$data='',$method='GET'));
$url_userid = 'https://oapi.dingtalk.com/user/get?access_token='.$company_info->access_token.'&userid='.$userid->userid;
$person_details = json_decode($this->get_http($url_userid,$data='',$method='GET'));
$data['ddu_Name'] = $person_details->name;
$data['ddu_Unionid'] = $person_details->unionid;
$data['ddu_Mobile'] = $person_details->mobile;
$data['ddu_Email'] = $person_details->orgEmail;
$data['ddu_Position'] = $person_details->position;
$data['ddu_Avatar'] = $person_details->avatar;
$data['ddu_Datetime'] = time();
return $data;
}
//发送请求
public function get_http($url, $data = '', $method = 'GET') {
$curl = curl_init(); // 启动一个CURL会话
curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转
curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer
if ($method == 'POST' && !empty($data)) {
curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求
curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
}
curl_setopt($curl, CURLOPT_TIMEOUT, 45); // 设置超时限制防止死循环
curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回
$tmpInfo = curl_exec($curl); // 执行操作
$errno = curl_errno($curl);
if ($errno !== 0) {
return false;
echo $errno . curl_error($curl); //记录错误日志
}
curl_close($curl); //关闭CURL会话
return $tmpInfo; //返回数据
}
//自动提示
public function get_user_list(){
$q = $this->input->get('q');
$str_array = explode(';', $q);
$q = end($str_array);
if (!$q)
return;
$showcount = 1;
$tmp = $this->ding_value_model->all_email();
foreach ($tmp as $value) {
if ($showcount > 8)
break;
if (strstr($value->ddu_Name, $q)) {
echo $value->ddu_Name . ';' . "\n";
$showcount++;
}
}
}
//检测是否有value
public function check_value_user() {
$value_user_array = explode(';', $this->input->post('value_user'));
foreach ($value_user_array as $vu) {
if (!empty($vu)) {
$result = $this->ding_value_model->has_user($vu);
if (empty($result)) {
echo 0;
return;
}
}
}
echo 1;
return;
}
//退出
public function logout(){
$this->session->unset_userdata('dingding_user_info');
$this->session->unset_userdata('unionid');
$this->session->unset_userdata('type');
$this->session->unset_userdata('identify');
$this->session->unset_userdata('mail_type');
$this->input->set_cookie('userdata', '', '');
redirect(site_url('apps/dingmail/index/index/'));
}
public function valuemail_list(){
header("Content-type:text/html;charset=utf-8");
$data = $this->ding_value_model->get_valuemail_list();
for($i=0;$i<count($data);$i++){
echo '<h2>时间:'.date('y-m-d',$data[$i]->ddm_Createtime).'</h2><br>';
echo '<h2>标题:</h2>'.$data[$i]->ddm_Subject.'<br>';
echo '<h2>value邮件内容</h2>'.htmlspecialchars_decode($data[$i]->ddm_Content).'<br>';
echo '<hr/>';
}
}
//查询那条value使用的次数最多
public function count_valueitems(){
//获取所有的item条目
$obj = $this->ding_value_model->get_allvalueitems();
//定义变量存储数据
$data = array();
$data['team1_cn'] = '心存谦卑,发现并欣赏他人的长处';
$data['team2_cn'] = '人比事更重要,爱能包容一切过错';
$data['team3_cn'] = '相信一群平凡的人,能组成一个不平凡的团队';
$data['team4_cn'] = '人人平等,在爱里说诚实话';
$data['team1_num'] = 0;$data['team2_num'] = 0;$data['team3_num'] = 0;$data['team4_num'] = 0;
$data['chengxin1_cn'] = '行真善美,恨不义财';
$data['chengxin2_cn'] = '诚实可信,说到做到,不隐藏真相';
$data['chengxin3_cn'] = '做人一诺千金,做事全力以赴';
$data['chengxin4_cn'] = '勇于承担责任使你更优秀';
$data['chengxin1_num'] = 0;$data['chengxin2_num'] = 0;$data['chengxin3_num'] = 0;$data['chengxin4_num'] = 0;
$data['customer1_cn'] = '穿客户的鞋,客户是我们最好的老师';
$data['customer2_cn'] = '细节展现专业,多走一里路';
$data['customer3_cn'] = '客户的独特性就是我们存在的理由';
$data['customer4_cn'] = '不让一点瑕疵破坏客人一生中唯一的旅程,一眚能掩大德';
$data['customer1_num'] = 0;$data['customer2_num'] = 0;$data['customer3_num'] = 0;$data['customer4_num'] = 0;
$data['discovery1_cn'] = '好奇心,好头脑风暴';
$data['discovery2_cn'] = '第一个行动的,失败了也光荣;行动太迟,正确的决策也可能变成错误';
$data['discovery3_cn'] = '以往的成功经验未必是今天问题的解决方案';
$data['discovery4_cn'] = 'Do Without自己创造条件达到目标';
$data['discovery1_num'] = 0;$data['discovery2_num'] = 0;$data['discovery3_num'] = 0;$data['discovery4_num'] = 0;
foreach ($obj as $item){
$items = explode(',',$item->ddm_value_key);
foreach($items as $value){
if(!empty($value)){
switch ($value){
case 'team1':
$data['team1_num']++;
break;
case 'team2':
$data['team2_num']++;
break;
case 'team3':
$data['team3_num']++;
break;
case 'team4':
$data['team4_num']++;
break;
case 'chengxin1':
$data['chengxin1_num']++;
break;
case 'chengxin2':
$data['chengxin2_num']++;
break;
case 'chengxin3':
$data['chengxin3_num']++;
break;
case 'chengxin4':
$data['chengxin4_num']++;
break;
case 'customer1':
$data['customer1_num']++;
break;
case 'customer2':
$data['customer2_num']++;
break;
case 'customer3':
$data['customer3_num']++;
break;
case 'customer4':
$data['customer4_num']++;
break;
case 'discovery1':
$data['discovery1_num']++;
break;
case 'discovery2':
$data['discovery2_num']++;
break;
case 'discovery3':
$data['discovery3_num']++;
break;
case 'discovery4':
$data['discovery4_num']++;
break;
}
}
}
}
//输出内容
echo '使用条目:'.$data['team1_cn'].' | 使用次数:'.$data['team1_num'].'<br>';
echo '使用条目:'.$data['team2_cn'].' | 使用次数:'.$data['team2_num'].'<br>';
echo '使用条目:'.$data['team3_cn'].' | 使用次数:'.$data['team3_num'].'<br>';
echo '使用条目:'.$data['team4_cn'].' | 使用次数:'.$data['team4_num'].'<br>';
echo '使用条目:'.$data['chengxin1_cn'].' | 使用次数:'.$data['chengxin1_num'].'<br>';
echo '使用条目:'.$data['chengxin2_cn'].' | 使用次数:'.$data['chengxin2_num'].'<br>';
echo '使用条目:'.$data['chengxin3_cn'].' | 使用次数:'.$data['chengxin3_num'].'<br>';
echo '使用条目:'.$data['chengxin4_cn'].' | 使用次数:'.$data['chengxin4_num'].'<br>';
echo '使用条目:'.$data['customer1_cn'].' | 使用次数:'.$data['customer1_num'].'<br>';
echo '使用条目:'.$data['customer2_cn'].' | 使用次数:'.$data['customer2_num'].'<br>';
echo '使用条目:'.$data['customer3_cn'].' | 使用次数:'.$data['customer3_num'].'<br>';
echo '使用条目:'.$data['customer4_cn'].' | 使用次数:'.$data['customer4_num'].'<br>';
echo '使用条目:'.$data['discovery1_cn'].' | 使用次数:'.$data['discovery1_num'].'<br>';
echo '使用条目:'.$data['discovery2_cn'].' | 使用次数:'.$data['discovery2_num'].'<br>';
echo '使用条目:'.$data['discovery3_cn'].' | 使用次数:'.$data['discovery3_num'].'<br>';
echo '使用条目:'.$data['discovery4_cn'].' | 使用次数:'.$data['discovery4_num'].'<br>';
}
public function ajax_get_data(){
header("Content-Type: text/html;charset=utf-8");
$from_time = $this->input->get_post('from_time');
$to_time = $this->input->get_post('to_time');
$type = $this->input->get_post('type');
if($type == 'week'){
$from_time = strtotime($from_time);
$to_time = strtotime($to_time);
}else if($type == 'month'){
$firstday = $from_time;
$from_time = strtotime($from_time);
$to_time = strtotime("$firstday +1 month -1 day");
}else if($type == 'year'){
$from_time = strtotime($from_time);
$to_time = strtotime($to_time);
}
$rank_data = $this->ding_value_model->get_person_rank($from_time, $to_time);
$return_html = '';
foreach($rank_data as $key=>$value){
$return_html .= '<li class="col-xs-24 nopadding">';
$num = $key+1;
$return_html .= '<span class="text-danger'.$num.'">No.'.$num.'</span> ';
$return_html .= '<span><a href="'.site_url('apps/dingmail/index/index/'.$value->ddv_Comment_Unionid).'">'.$value->ddv_Comment_Name.'</a></span>';
$return_html .= '<span class="badge pull-right">'.$value->like_count.' like</span></li>';
}
print_r($return_html);
}
public function delete_value($sn=null){
if(empty($sn)){
exit('传参错误');
}else{
$this->ding_value_model->delete_value($sn);
}
}
}
?>

@ -0,0 +1,334 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class ding_value_model extends CI_Model {
function __construct(){
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
}
//扫码获取相应人的信息
function get_dingding_user($unionid){
$sql = "select
*
from
Dingding_User
where
ddu_Unionid = ?";
$query = $this->HT->query($sql, array($unionid));
if ($query->num_rows() > 0){
$row = $query->row();
return $row;
}
else{
return FALSE;
}
}
//根据姓名获取唯一unionid
public function get_dingding_unionid($name){
$sql = "select ddu_Unionid from Dingding_User where ddu_Name = ?";
$query = $this->HT->query($sql, array($name));
if ($query->num_rows() > 0){
$row = $query->row();
return $row;
}
else{
return FALSE;
}
}
//添加用户
function add_dingding_user($name,$unionid,$mobile,$email,$position,$avatar,$time){
$sql = "INSERT INTO Dingding_User (ddu_Name,ddu_Unionid,ddu_Mobile,ddu_Email,ddu_Position,ddu_Avatar,ddu_Datetime) VALUES (N?,?,?,?,N?,?,?)";
$query = $this->HT->query($sql,array($name,$unionid,$mobile,$email,$position,$avatar,$time));
if ($query){
return TRUE;
}else{
return FALSE;
}
}
//添加value事件
function add_value($data){
$sql = "INSERT INTO Dingding_Value (ddv_Type,ddv_Name,ddv_User_Unionid,ddv_Comment_Name,ddv_Comment_Unionid,ddv_Content,ddv_Identify,ddv_Createtime) VALUES (?,N?,?,N?,?,N?,?,?)";
$query = $this->HT->query($sql,array($data['type'],$data['user'],$data['user_unionid'],$data['comment_name'],$data['comment_unionid'],$data['content'],$data['mail_identify'],$data['createtime']));
if($query){
return TRUE;
}else{
return FALSE;
}
}
//统计like人数
function count_like($unionid){
$year_start = strtotime(date('Y-01-01', time()));
$year_end = strtotime(date('Y-12-31', time()));
$sql = "SELECT COUNT(*) AS count FROM Dingding_Value WHERE ddv_Comment_Unionid = ? AND ddv_Type = 'like' AND ddv_Type = 'like' and ddv_Createtime > '{$year_start}' and ddv_Createtime < '{$year_end}'";
$query = $this->HT->query($sql,$unionid);
$row = $query->row();
return $row;
}
//获取like的人是那些
function whos_like($unionid){
$year_start = strtotime(date('Y-01-01', time()));
$year_end = strtotime(date('Y-12-31', time()));
$sql = "SELECT ddv_Name FROM Dingding_Value WHERE ddv_Comment_Unionid = ? AND ddv_Type = 'like' and ddv_Createtime > '{$year_start}' and ddv_Createtime < '{$year_end}' ORDER BY ddv_Sn DESC";
$query = $this->HT->query($sql,$unionid);
$row = $query->result();
return $row;
}
//获取value点赞的人
function value_whos_like($identify){
$sql = "SELECT ddv_Name FROM Dingding_Value WHERE ddv_Identify = ? and ddv_Type = 'like' and ddv_Comment_Name = 'value邮件' ORDER BY ddv_Createtime DESC";
$query = $this->HT->query($sql,$identify);
$row = $query->result();
return $row;
}
//获取value拍砖的人
function value_whos_unlike($identify){
$sql = "SELECT ddv_Name FROM Dingding_Value WHERE ddv_Identify = ? and ddv_Type = 'unlike' and ddv_Comment_Name = 'value邮件' ORDER BY ddv_Createtime DESC";
$query = $this->HT->query($sql,$identify);
$row = $query->result();
return $row;
}
//根据Identify获取value邮件
function get_mail($identify){
$sql = "SELECT * FROM Dingding_Mail where ddm_Identify = ?";
$query = $this->HT->query($sql, array($identify));
if ($query->num_rows() > 0){
$row = $query->row();
return $row;
}
else{
return FALSE;
}
}
//根据Identify获取value邮件中value的人
function get_value($identify,$user_unionid){
$sql = "select * from Dingding_user_mail left join Dingding_User on(ddum_Name = ddu_Name) where ddum_Identify = ? and ddu_Unionid != '$user_unionid'";
$query = $this->HT->query($sql, array($identify));
if ($query->num_rows() > 0){
$row = $query->result();
return $row;
}
else{
return FALSE;
}
}
//统计unlike人数
function count_unlike($unionid){
$year_start = strtotime(date('Y-01-01', time()));
$year_end = strtotime(date('Y-12-31', time()));
$sql = "SELECT COUNT(*) AS count FROM Dingding_Value WHERE ddv_Comment_Unionid = ? AND ddv_Type = 'unlike' and ddv_Createtime > '{$year_start}' and ddv_Createtime < '{$year_end}'";
$query = $this->HT->query($sql,$unionid);
$row = $query->row();
return $row;
}
//获取unlike的人是那些
function whos_unlike($unionid){
$year_start = strtotime(date('Y-01-01', time()));
$year_end = strtotime(date('Y-12-31', time()));
$sql = "SELECT ddv_Name FROM Dingding_Value WHERE ddv_Comment_Unionid = ? AND ddv_Type = 'unlike' and ddv_Createtime > '{$year_start}' and ddv_Createtime < '{$year_end}' ORDER BY ddv_Sn DESC";
$query = $this->HT->query($sql,$unionid);
$row = $query->result();
return $row;
}
//获取所有点评了的人的列表
function all_comment($unionid){
$year_start = strtotime(date('Y-01-01', time()));
$year_end = strtotime(date('Y-12-31', time()));
$sql = "SELECT *
FROM Dingding_Value
left join Dingding_User on ddu_Unionid = ddv_User_Unionid
left join Dingding_Mail on ddv_Identify = ddm_Identify
where ddv_Comment_Unionid = '$unionid'
and ddv_Createtime > '{$year_start}' and ddv_Createtime < '{$year_end}'
ORDER BY ddv_Sn DESC";
$query = $this->HT->query($sql,$unionid);
$row = $query->result();
return $row;
}
/*
//获取所有点评了的人的列表
function all_comment($unionid){
$sql = "SELECT * FROM Dingding_Value WHERE ddv_Comment_Unionid = ? ORDER BY ddv_Sn DESC";
$query = $this->HT->query($sql,$unionid);
$row = $query->result();
return $row;
}
*/
//获取所有员工的姓名以及邮箱(钉钉邮箱)
function all_email($data = null){
if($data){
$where = "where ddu_Name in ($data)";
}else{
$where = '';
}
$sql = "SELECT ddu_Name,ddu_Email FROM Dingding_User ".$where;
$query = $this->HT->query($sql);
$row = $query->result();
return $row;
}
//根据名字确定是否存在
public function has_user($user_name){
$sql="SELECT * FROM Dingding_User WHERE ddu_Name='$user_name' ";
$query = $this->HT->query($sql);
return $query->result();
}
//新增value邮件
public function add_mail($data){
$sql="INSERT INTO Dingding_Mail(
ddm_subject,
ddm_content,
ddm_touser,
ddm_ccuser,
ddm_fromuser,
ddm_value_key,
ddm_identify,
ddm_createtime
)
VALUES (N?,N?,N?,N?,N?,?,?,?)";
$this->HT->query($sql, array($data['mail_subject'],$data['mail_content'],$data['mail_touser'],$data['mail_ccuser'],$data['mail_fromuser'],$data['mail_value_key'],$data['mail_identify'],$data['mail_createtime']));
return $this->HT->last_id('Dingding_Mail');
}
//新增value的名单
public function add_value_user($data){
$sql="INSERT INTO Dingding_User_Mail (
ddum_name,
ddum_identify,
ddum_createtime)
VALUES (?,?,?)";
$this->HT->query($sql, array($data['value_user_name'],$data['value_user_identify'],$data['value_user_createtime']));
return $this->HT->last_id('webht_user_mail');
}
//检测是否已经点赞(仅用于value邮件点赞)
public function is_liked($data){
$sql = "select * from Dingding_Value where ddv_Identify = ? and ddv_User_Unionid = ? and ddv_Comment_Name = 'value邮件'";
$query = $this->HT->query($sql,array($data['mail_identify'],$data['user_unionid']));
if($query->num_rows() >= 1){
return true;
}else{
return false;
}
}
//获取用户最新一次被点赞的时间以及人
public function get_user_time($unionid,$user_unionid,$identify=false){
if($identify){
$where = "and ddv_identify = '$identify'";
}else{
$where = "";
}
$sql = "select ddv_Name,ddv_Createtime from Dingding_Value where ddv_Comment_Unionid = '$unionid' and ddv_User_Unionid = '$user_unionid'$where order by ddv_Createtime desc";
$query = $this->HT->query($sql);
if($query){
return $query->row();
}else{
return false;
}
}
//获取最新一次被评论的时间
public function get_last_comment($comment_name,$comment_unionid){
$sql = "select
top 1 *
from
Dingding_Value
where
ddv_Comment_Name = '$comment_name'
and
ddv_Comment_Unionid = '$comment_unionid'
and
ddv_Type in ('comment','hidden_comment')
order by
ddv_Createtime desc";
$query = $this->HT->query($sql);
$result=$query->result();
return $result;
}
//获取点赞排行榜
public function get_person_rank($from_date=false,$to_date=false){
$datesql="";
if ($from_date) {
$datesql=" AND ddv_Createtime BETWEEN '$from_date' AND '$to_date' ";
}
$sql="SELECT TOP 15
ddv_Comment_Name,
ddv_Comment_Unionid,
COUNT(ddv_Comment_Name) as like_count
FROM Dingding_Value
WHERE ddv_Type='like' AND ddv_Comment_Name != 'value邮件'
$datesql
GROUP BY ddv_Comment_Name,ddv_Comment_Unionid
ORDER BY like_count DESC";
$query = $this->HT->query($sql);
$result=$query->result();
return $result;
}
//更新用户信息
function update_dingding_user($name,$unionid,$mobile,$email,$position,$avatar,$time){
$sql = "UPDATE Dingding_User SET
ddu_Name = '$name',
ddu_Mobile = '$mobile',
ddu_Email = '$email',
ddu_Position = '$position',
ddu_Avatar = '$avatar',
ddu_Datetime = '$time'
WHERE ddu_Unionid = '$unionid'";
$query = $this->HT->query($sql);
if ($query){
return true;
}else{
return FALSE;
}
}
//获取value邮件列表
public function get_valuemail_list(){
$year = strtotime(date('Y-01-01'));
$sql = "select * from Dingding_Mail where ddm_Createtime > '$year' order by ddm_Createtime desc ";
$query = $this->HT->query($sql);
return $query->result();
}
//获取所有value邮件所用的价值观
public function get_allvalueitems(){
$sql = "select ddm_value_key from Dingding_Mail where ddm_value_key != ''";
$query = $this->HT->query($sql);
return $query->result();
}
public function delete_value($sn){
$sql = "DELETE FROM Dingding_Value WHERE ddv_Sn = '{$sn}'";
$query = $this->HT->query($sql);
}
public function test(){
$sql = "delete from Dingding_Value where ddv_Sn = '9125'";
$query = $this->HT->query($sql);
}
}

@ -0,0 +1,212 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HT在线平台</title>
<!-- <link href="/css/webht/bootstrap.min.css" rel="stylesheet">
<link href="/css/webht/webht.css?v=1" rel="stylesheet">-->
<link href="/min?f=/css/webht/bootstrap.min.css,/css/webht/webht.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!--
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/webht.js?v=1"></script>
-->
<script src="/min?f=/js/jquery.min.js,/js/bootstrap.min.js,/js/webht.js,/js/jquery.suggest.js"></script>
<link rel="shortcut icon" href="/css/images/webht.jpg">
</head>
<body>
<nav class="navbar navbar-inverse navbar-red">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo site_url('');?>"><span class="icon-home"></span> 中华游在线</a>
<a class="navbar-brand visible-xs-block"><?php if(isset($navtitle)) echo $navtitle;?></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="<?php echo site_url('apps/dingmail/index/mail_index');?>">Value发送</a></li>
<li><a href="<?php echo site_url('apps/dingmail/index/index/'.$this->session->userdata('dingding_user_info')->ddu_Unionid);?>">个人中心</a></li>
<li><a href="<?php echo site_url('apps/dingmail/index/rank_person');?>">排行榜</a></li>
</ul>
</div>
</div><!-- /.container-fluid -->
</nav>
<div class="container" style="max-width:1200px;">
<div class="row">
<div class="col-xs-24 btn-lg"></div>
<div class="col-sm-7 col-xs-24 pull-right" style="font: 14px 'Arial','Microsoft YaHei';line-height:25px;">
<div class="panel">
<div class="panel-body">
<legend>
<span class="text-primary glyphicon glyphicon-thumbs-up" style="font-size:20px;"></span>
<span style="font-size:15px;">他们都觉得很赞!</span>
</legend>
<?php foreach ($whos_like as $l) { ?>
<span><?php echo $l->ddv_Name; ?>; </span>
<?php } ?>
<div class="clearfix"></div>
</div>
</div>
<div class="panel">
<div class="panel-body">
<legend>
<span class="text-danger glyphicon glyphicon-thumbs-down" style="font-size:20px;"></span>
<span style="font-size:15px;">他们拍砖了!</span>
</legend>
<?php foreach ($whos_unlike as $ul) { ?>
<span><?php echo $ul->ddv_Name; ?>; </span>
<?php } ?>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="col-sm-17 col-xs-24">
<div class="col-xs-24" style="padding-bottom:30px;background:#fff;">
<h3 style="font-size:20px;margin-bottom:30px;"><?php echo $value_mail->ddm_Subject;?></h3>
<div class="col-xs-24 nopadding"><?php echo htmlspecialchars_decode($value_mail->ddm_Content); ?></div>
<!--
<div class="col-xs-24 nopadding">
<a name="gotocomment" id="gotocomment" ></a>
<form id="from-add-comment" method="post" action="<?php echo site_url('apps/outlook/index/add_comment');?>" style="background:#f5f5f5;padding:0px 15px 15px 15px;margin-top:50px;">
<div class="col-xs-24 btn-lg"></div>
<div class="col-xs-24 nopadding">
<textarea class="form-control" rows="3" name="comment" id="comment-textarea"></textarea>
</div>
<div class="col-xs-24 btn-sm"></div>
<div class="col-xs-24 nopadding">
<input type="hidden" name="whc_whm_identify" value="<?php echo $whc_whm_identify;?>">
<button type="button" id="btn-add-comment" class="btn btn-danger pull-right">确 定</button>
</div>
<div class="clearfix"></div>
</form>
</div>
-->
</div>
<?php if (!empty($list)) { ?>
<div class="col-xs-24" style="margin-top:20px;margin-bottom:50px;padding-bottom:20px;font: 14px 'Arial','Microsoft YaHei';line-height:23px;background:#fff;">
<?php foreach ($list as $key => $c) { ?>
<div class="col-xs-24" style="padding:12px 0 10px 0;">
<p class="text-primary"><a href="<?php $usermail=explode('@', $c->whu_email);echo site_url('apps/outlook/index/space/'.$usermail[0]); ?>"><?php echo $c->whu_uname; ?></a></p>
<p><?php echo $c->whc_content; ?></p>
<p>
<span class="text-muted"><?php echo date('Y-m-d H:i:s',$c->whc_createtime); ?></span>
<span class="pull-right"><a href="#gotocomment" class="re_comment" data-uname="<?php echo $c->whu_uname; ?>">回复</a></span>
</p>
</div>
<legend class="col-xs-24"></legend>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="media">
<div class="media-left">
<div>
<span id="msgclass" class="glyphicon glyphicon-ok text-success" aria-hidden="true" style="font-size:85px;"> </span>
<a class="btn btn-sm btn-danger" onclick="ajax_link($(this));" href="javascript:void(0);" data-href="<?php echo site_url('apps/outlook/index/delete_comment/'.$whc_whm_identify.'/'.$type); ?>">撤销操作</a>
</div>
</div>
<div class="media-body" style="font-size:32px;">
<div class="col-xs-24 btn-lg"><p></p></div>
<span id="msgbox" class="text-success">你已经成功的狠狠<?php if($type=='like'){echo '赞';}else{echo '踩';} ?>了TA一下</span>
<p style="font-size:14px;color:#888;padding-left:5px;padding-top:18px;"><em class="text-danger" id="seconed_box">15</em> 秒钟内可以撤销刚才的操作</p>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var type="<?php echo $type;?>";
var comment_url="<?php echo site_url('apps/outlook/index/like/'.$whc_whm_identify.'/comment');?>";
if (type=='like' || type=='unlike') {
$('#myModal').modal('show');
var timer=$("#seconed_box").text();
if (timer>=0) {
setInterval(function(){
var newtimer=--timer;
$("#seconed_box").text(newtimer);
},1000);
};
setTimeout("$('#myModal').modal('hide')",15000);
};
$(".re_comment").click(function () {
$("textarea").text('@'+$(this).attr('data-uname')+' ');
$("textarea").focus();
});
$("#btn-add-comment").click(function() {
if ($("#comment-textarea").val().replace(/(^\s*)|(\s*$)/g,'')=="") {
$("#msgclass").removeClass('glyphicon-ok text-success');
$("#msgclass").addClass('glyphicon-remove text-danger');
$("#msgbox").removeClass('text-success');
$("#msgbox").addClass('text-danger');
$("#msgbox").text('评论内容不能为空!');
$('#myModal').modal('show');
setTimeout(function() {
$('#myModal').modal('hide');
},5000);
return false;
};
var url = $("form#from-add-comment").attr('action');
var data= $("form#from-add-comment").serialize();
$.post(url,data,function(result){
if (result) {
$("#msgclass").removeClass('glyphicon-remove text-danger');
$("#msgclass").addClass('glyphicon-ok text-success');
$("#msgbox").removeClass('text-danger');
$("#msgbox").addClass('text-success');
$("#msgbox").text('评论成功!');
$('#myModal').modal('show');
setTimeout(function() {
$('#myModal').modal('hide');
location.href=comment_url;
},1500);
}else{
$("#msgclass").removeClass('glyphicon-ok text-success');
$("#msgclass").addClass('glyphicon-remove text-danger');
$("#msgbox").removeClass('text-success');
$("#msgbox").addClass('text-danger');
$("#msgbox").text('评论发布失败!');
$('#myModal').modal('show');
setTimeout(function() {
$('#myModal').modal('hide');
},5000);
}
});
});
</script>
</body>
</html>

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>value系统登录</title>
<link href="http://data.chtcdn.com/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="http://data.chtcdn.com/js/poshytip/tip-yellow/tip-yellow.css" type="text/css" />
<link rel="stylesheet" href="http://data.chtcdn.com/js/modaldialog/css/jquery.modaldialog.css" type="text/css" />
<link rel="stylesheet" href="http://data.chtcdn.com/js/kindeditor/themes/default/default.css" type="text/css" media="screen" />
<script type="text/javascript" src="http://data.chtcdn.com/js/jquery.js"></script>
<script type="text/javascript" src="http://data.chtcdn.com/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://data.chtcdn.com/js/poshytip/jquery.poshytip.min.js"></script>
<script type="text/javascript" src="http://data.chtcdn.com/js/jquery.form.min.js"></script>
<script type="text/javascript" src="http://data.chtcdn.com/js/modaldialog/jquery.modaldialog.js"></script>
<script type="text/javascript" src="http://data.chtcdn.com/js/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript" src="http://data.chtcdn.com/js/basic.js"></script>
<script src="https://g.alicdn.com/dingding/dinglogin/0.0.2/ddLogin.js"></script>
<script type="text/javascript" src="/dinglogin/dingmail.js"></script>
<link rel="stylesheet" href="/dinglogin/dingding.css">
<!--
<link rel="stylesheet" href="/min/?f=/bootstrap/css/bootstrap.min.css,/js/poshytip/tip-yellow/tip-yellow.css,/js/modaldialog/css/jquery.modaldialog.css,/js/kindeditor/themes/default/default.css" type="text/css" />
<script type="text/javascript" src="/min/?f=/js/jquery.js,/bootstrap/js/bootstrap.min.js,/js/poshytip/jquery.poshytip.min.js,/js/jquery.form.min.js,/js/modaldialog/jquery.modaldialog.js,/js/kindeditor/kindeditor-min.js,/js/basic.js"></script>
-->
<link rel="shortcut icon" href="http://data.chtcdn.com/bootstrap/img/glyphicons_290_skull.png">
</head>
<body>
<div class="row-fluid">
<div class="span3"></div>
<div class="span6">
<form action="<?php echo site_url('login/check') ?>" class="form-horizontal" name="form_login" id="form_login" method="post">
<legend>
<p>Welcome</p>
<div class="login_header">
<div class="login_type login_type_active">钉钉扫码登录</div>
<div class="login_type"><a href="https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=dingoagxeeheunc0p95eu8&response_type=code&scope=snsapi_login&state=STATE&redirect_uri=http://www.mycht.cn/webht.php/apps/dingmail/index/auth_login">钉钉账号密码登录</a></div>
</div>
</legend>
<div class="ding_login">
<div id="login_container"></div>
</div>
</form>
<div class="alert alert-error">
<h4>IE6 isn't allowed!</h4>
Please use Google Chrome, Firefox, Safair, or IE7+.
</div>
</div>
<div class="span3"></div>
</div>
</body>
</html>

@ -0,0 +1,552 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HT在线平台</title>
<!-- <link href="/css/webht/bootstrap.min.css" rel="stylesheet">
<link href="/css/webht/webht.css?v=1" rel="stylesheet">-->
<script src="/min?f=/js/jquery.min.js,/js/bootstrap.min.js,/js/webht.js,/js/jquery.suggest.js"></script>
<link href="/min?f=/css/webht/bootstrap.min.css,/css/webht/webht.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="/css/webht/jquery.suggest.css" />
<script src="/js/TQEditor/TQEditor.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/jquery.suggest.js"></script>
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!--
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/webht.js?v=1"></script>
-->
<link rel="shortcut icon" href="/css/images/webht.jpg">
</head>
<body>
<nav class="navbar navbar-inverse navbar-red">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo site_url('');?>"><span class="icon-home"></span> 中华游在线</a>
<a class="navbar-brand visible-xs-block"><?php if(isset($navtitle)) echo $navtitle;?></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="<?php echo site_url('apps/dingmail/index/mail_index');?>">Value发送</a></li>
<li><a href="<?php echo site_url('apps/dingmail/index/index/'.$this->session->userdata('dingding_user_info')->ddu_Unionid);?>">个人中心</a></li>
<li><a href="<?php echo site_url('apps/dingmail/index/rank_person');?>">排行榜</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="<?php echo site_url('apps/dingmail/index/logout');?>">退出</a></li>
</ul>
</div>
</div><!-- /.container-fluid -->
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-xs-24" style="padding:15px; padding-right:30px;">
<form id="form-send-mail" method="post" action="<?php echo site_url('apps/dingmail/index/send_mail');?>">
<div class="media" style="overflow:visible;">
<div class="media-left">
<button type="button" id="btn-send-mail" class="media-object btn btn-default" style="width:80px;height:80px;" data-loading-text="正在发送" onclick="$(this).button('loading');"><span class="icon-newspaper" style="font-size:32px;"></span><br>发送(S)</button>
</div>
<div class="media-body" style="overflow:visible;">
<div class="input-group" id="auto-complete">
<span class="input-group-btn">
<button class="btn btn-default" type="button" disabled="disabled">收件人(O)...</button>
</span>
<input type="text" class="form-control" id="emaillist" name="emaillist" value="G-海纳公告;">
</div>
<div class="col-xs-24 btn-sm"></div>
<div class="form-group input-group" id="auto-complete2">
<span class="input-group-btn">
<button class="btn btn-default" type="button" disabled="disabled">抄 送(C)...</button>
</span>
<input type="text" class="form-control" id="cs_emaillist" name="cs_emaillist">
</div>
</div>
</div>
<div class="form-group input-group">
<div class="input-group-btn">
<button type="button" class="btn btn-default" style="width:92px;" data-toggle="modal" data-target="#myModal" data-backdrop="static">价值观 <span class="caret"> </span></button>
<button type="button" class="btn btn-default" style="width:100px;cursor:default;background:#fff !important;" disabled="disabled">主 题</button>
</div>
<input type="text" class="form-control" name="mail_subject" id="mail-subject" autocomplete="off">
</div>
<textarea class="form-control" id="emailcontent" rows="36" name="emailcontent"></textarea>
<input type="hidden" id="whm_value_key" name="whm_value_key">
<input type="hidden" id="whum_value_user" name="whum_value_user">
</form>
</div>
</div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" style="margin-top:5px;">
<div class="modal-content">
<div class="modal-header">
<div class="" id="auto-complete3">
<input type="text" class="form-control" name="value_user" id="value_user" placeholder="value人员名单,输入名字,然后在下拉提示框里选择完整的名单">
</div>
</div>
<div class="modal-body" style="padding-top:0;">
<div class="col-xs-12" style="padding-left:0;">
<h4>团队协作:</h4>
<div class="checkbox">
<label>
<input class="team_checkbox" type="checkbox" data-checked="false" value="team1">
1.心存谦卑,发现并欣赏他人的长处
</label>
</div>
<div class="checkbox">
<label>
<input class="team_checkbox" type="checkbox" data-checked="false" value="team2">
2.人比事更重要,爱能包容一切过错
</label>
</div>
<div class="checkbox">
<label>
<input class="team_checkbox" type="checkbox" data-checked="false" value="team3">
3.相信一群平凡的人,能组成一个不平凡的团队
</label>
</div>
<div class="checkbox">
<label>
<input class="team_checkbox" type="checkbox" data-checked="false" value="team4">
4.人人平等,在爱里说诚实话
</label>
</div>
</div>
<div class="col-xs-12">
<h4>诚信负责:</h4>
<div class="checkbox">
<label>
<input class="chengxin_checkbox" type="checkbox" data-checked="false" value="chengxin1">
1.行真善美,恨不义财
</label>
</div>
<div class="checkbox">
<label>
<input class="chengxin_checkbox" type="checkbox" data-checked="false" value="chengxin2">
2.诚实可信,说到做到,不隐藏真相
</label>
</div>
<div class="checkbox">
<label>
<input class="chengxin_checkbox" type="checkbox" data-checked="false" value="chengxin3">
3.做人一诺千金,做事全力以赴
</label>
</div>
<div class="checkbox">
<label>
<input class="chengxin_checkbox" type="checkbox" data-checked="false" value="chengxin4">
4.勇于承担责任使你更优秀
</label>
</div>
</div>
<div class="col-xs-24 clearfix"></div>
<div class="col-xs-12" style="padding-left:0;">
<h4>客户满意: </h4>
<div class="checkbox">
<label>
<input class="customer_checkbox" type="checkbox" data-checked="false" value="customer1">
1.穿客户的鞋,客户是我们最好的老师
</label>
</div>
<div class="checkbox">
<label>
<input class="customer_checkbox" type="checkbox" data-checked="false" value="customer2">
2.细节展现专业,多走一里路
</label>
</div>
<div class="checkbox">
<label>
<input class="customer_checkbox" type="checkbox" data-checked="false" value="customer3">
3.客户的独特性就是我们存在的理由
</label>
</div>
<div class="checkbox">
<label>
<input class="customer_checkbox" type="checkbox" data-checked="false" value="customer4">
4.不让一点瑕疵破坏客人一生中唯一的旅程,一眚能掩大德
</label>
</div>
</div>
<div class="col-xs-12">
<h4>发现创新: </h4>
<div class="checkbox">
<label>
<input class="discovery_checkbox" type="checkbox" data-checked="false" value="discovery1">
1.好奇心,好头脑风暴
</label>
</div>
<div class="checkbox">
<label>
<input class="discovery_checkbox" type="checkbox" data-checked="false" value="discovery2">
2.第一个行动的,失败了也光荣;行动太迟,正确的决策也可能变成错误
</label>
</div>
<div class="checkbox">
<label>
<input class="discovery_checkbox" type="checkbox" data-checked="false" value="discovery3">
3.以往的成功经验未必是今天问题的解决方案
</label>
</div>
<div class="checkbox">
<label>
<input class="discovery_checkbox" type="checkbox" data-checked="false" value="discovery4">
4.Do Without自己创造条件达到目标
</label>
</div>
</div>
<div class="col-xs-24" style="padding-left:0;">
<h4>系统思维:</h4>
<div class="checkbox">
<label>
<input class="system_checkbox" type="checkbox" data-checked="false" value="system1">
1.Why goes before How, 先明确目的和意义,再决定步骤和方法
</label>
</div>
<div class="checkbox">
<label>
<input class="system_checkbox" type="checkbox" data-checked="false" value="system2">
2.举一反三,不头痛医头、脚痛医脚,从根部解决问题
</label>
</div>
<div class="checkbox">
<label>
<input class="system_checkbox" type="checkbox" data-checked="false" value="system3">
3.让我们走过的弯路,成为他人成功的捷径;让我们走过的捷径,成为后人永远的祝福
</label>
</div>
<div class="checkbox">
<label>
<input class="system_checkbox" type="checkbox" data-checked="false" value="system4">
4.复杂的事情简单做,简单的事情认真重复做,重复的事情创造性地做,代码可以做的事情就不要人来做
</label>
</div>
</div>
<div class="col-xs-24" style="padding-left:0;">
<h4>
<label>
<input type="checkbox" data-checked="false" value="special" id="special_checkbox" onclick="$('#special_value_input').toggle();">
其他价值观
</label>
</h4>
<input class="form-control" id="special_value_input" name="special_text" style="display:none;">
</div>
<div class="clearfix"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="btn-value">确 定</button>
<button type="button" class="btn btn-default" id="btn-value-remove" data-dismiss="modal" style="margin-left:5px;">取消</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="media">
<div class="media-left">
<div>
<span id="msgclass" class="glyphicon glyphicon-ok text-success" aria-hidden="true" style="font-size:85px;"> </span>
</div>
</div>
<div class="media-body" style="font-size:32px;">
<div class="col-xs-24 btn-lg"><p></p></div>
<span id="msgbox" class="text-success">发送成功!</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="myModal-img" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">插入图片</h4>
</div>
<div class="modal-body">
<form action="<?php echo site_url('apps/outlook/index/upload_photos');?>"
method="post"
target="ifm1"
class="form-inline form_upload_photos"
enctype="multipart/form-data">
<div class="col-xs-24 btn-lg"></div>
<div class="form-group">
<label for="宽度">图片</label>
<input class="form-control" type="file" name="Profile_file" id="Profile_file" />
</div>
<div class="col-xs-24 btn-lg"></div>
<div class="clearfix"></div>
<div class="form-group">
<label for="宽度">宽度</label>
<input type="text" class="form-control" id="upload_photo_width" value="500">
</div>
<div class="form-group">
<label for="高度">高度</label>
<input type="text" class="form-control" id="upload_photo_height" value="auto">
</div>
<div class="col-xs-24 btn-lg"></div>
<div class="clearfix"></div>
</form>
<div id="upload_status1">
<iframe class="ifm1 hide" name="ifm1"></iframe>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger pull-right editor_img_upload">确 定</button>
</div>
</div>
</div>
</div>
<script type="text/javascript" defer="true">
var $img_modal=$('#myModal-img');
var doname="<?php echo $_SERVER['HTTP_HOST']; ?>";
var TQE=new tqEditor('emailcontent',
{
toolbar:['mode','paragraph','fontname','fontsize','forecolor','backcolor','bold','italic','underline','strikethrough','removeformat','|','justifyleft','justifycenter','justifyright','unorderedlist','orderedlist','iodent','outdent','indent','|','inserthorizontalrule','createlink','unlink','inserttable','|','insertimage','insertface'],
toolbarRight:['fullscreen'],
imageUploadUrl:'./upload.php',
linkUploadUrl:'./upload.php',
faceurl:'http://'+doname+'/js/TQEditor/face'
});
$(".editor_img_upload").click(function(){
$(".form_upload_photos").submit();
$img_modal.modal('hide');
});
function get_photo_url(text){
var width=$("#upload_photo_width").val();
var height=$("#upload_photo_height").val();
var upload_html='<img src="'+text+'" width="'+width+'" height="'+height+'">';
TQE.insertHtml(upload_html);
}
$(document).ready(function()
{
//自动提示
var auto_complete_url="<?php echo site_url('apps/dingmail/index/get_user_list'); ?>";
$("#emaillist").suggest(auto_complete_url,{
container: '#auto-complete',
onSelect: function() {},
selectClass: '',
matchClass: 'active',
resultsClass: 'list-unstyled'
});
$("#cs_emaillist").suggest(auto_complete_url,{
container: '#auto-complete2',
onSelect: function() {},
selectClass: '',
matchClass: 'active',
resultsClass: 'list-unstyled'
});
$("#value_user").suggest(auto_complete_url,{
container: '#auto-complete3',
onSelect: function() {},
selectClass: '',
matchClass: 'active',
resultsClass: 'list-unstyled'
});
$("input:checkbox").click(function() {
if ($(this).attr('data-checked')=="false") {
$(this).attr('data-checked','true');
}else{
$(this).attr('data-checked','false');
}
});
$("#btn-value").click(function() {
if ($("#value_user").val()=='') {
alert('请输入要VALUE的人员名单');
return false;
};
var checkurl="<?php echo site_url('apps/dingmail/index/check_value_user'); ?>";
var flag=true;
var checkuserdata={"value_user":$("#value_user").val()};
$.ajax({
type:'post',
url:checkurl,
data:checkuserdata,
async:false,
success:function(response){
if (response==0) {
flag=false;
}
},
});
if (!flag) {
alert('输入的value人员名字不够完整请从下拉提示框里选择名单');
return false;
};
var subject='';
var whm_value_key='';
var teamstr='[团队协作]:';
var teamflag=false;
$(".team_checkbox").each(function(){
if ($(this).attr('data-checked')=="true") {
teamstr+=$.trim($(this).parent("label").text())+'';
whm_value_key+=$(this).val()+',';
teamflag=true;
}
});
if(teamflag) subject+=teamstr;
var chengxinstr='[诚信负责]:';
var chengxinflag=false;
$(".chengxin_checkbox").each(function(){
if ($(this).attr('data-checked')=="true") {
chengxinstr+=$.trim($(this).parent("label").text())+'';
whm_value_key+=$(this).val()+',';
chengxinflag=true;
}
});
if(chengxinflag) subject+=chengxinstr;
var customerstr='[客户满意]:';
var customerflag=false;
$(".customer_checkbox").each(function(){
if ($(this).attr('data-checked')=="true") {
customerstr+=$.trim($(this).parent("label").text())+'';
whm_value_key+=$(this).val()+',';
customerflag=true;
}
});
if(customerflag) subject+=customerstr;
var discoverystr='[发现创新]:';
var discoveryflag=false;
$(".discovery_checkbox").each(function(){
if ($(this).attr('data-checked')=="true") {
discoverystr+=$.trim($(this).parent("label").text())+'';
whm_value_key+=$(this).val()+',';
discoveryflag=true;
}
});
if(discoveryflag) subject+=discoverystr;
var systemstr='[系统思维]:';
var systemflag=false;
$(".system_checkbox").each(function(){
if ($(this).attr('data-checked')=="true") {
systemstr+=$.trim($(this).parent("label").text())+'';
whm_value_key+=$(this).val()+',';
systemflag=true;
}
});
if(systemflag) subject+=systemstr;
var specialstr='[其他价值观]:';
var specialflag=false;
if ($("#special_checkbox").attr('data-checked')=="true") {
specialstr+=$("#special_value_input").val()+'';
whm_value_key+=$("#special_checkbox").val()+',';
specialflag=true;
};
if(specialflag) subject+=specialstr;
if (whm_value_key=='') {
alert('请选择要VALUE的条目类型');
return false;
};
if($("#value_user").val()) subject=$("#value_user").val()+subject;
if (subject!=='') subject='values+'+subject;
$("#mail-subject").val(subject);
$("#whm_value_key").val(whm_value_key);
$("#whum_value_user").val($("#value_user").val());
$('#myModal').modal('hide');
/* $("input:checkbox").attr('data-checked','false');
$("input:checkbox").removeAttr("checked");
$("#value_user").val('');
*/ });
//取消设置,所有选项清零
$("#btn-value-remove").click(function () {
$("input:checkbox").attr('data-checked','false');
$("input:checkbox").removeAttr("checked");
$("#value_user").val('');
});
$("#btn-send-mail").click(function () {
if ($("#emailcontent").val().replace(/(^\s*)|(\s*$)/g,'')=="") {
$("#msgclass").removeClass('glyphicon-ok text-success');
$("#msgclass").addClass('glyphicon-remove text-danger');
$("#msgbox").removeClass('text-success');
$("#msgbox").addClass('text-danger');
$("#msgbox").text('邮件内容不能为空!');
$('#myModal2').modal('show');
var that=$(this);
setTimeout(function() {
$('#myModal2').modal('hide');
that.button('reset');
},3000);
return false;
};
var url = $("form#form-send-mail").attr('action');
var data= $("form#form-send-mail").serialize();
$.post(url,data,function(result){
if (result==1) {
$("#msgclass").removeClass('glyphicon-remove text-danger');
$("#msgclass").addClass('glyphicon-ok text-success');
$("#msgbox").removeClass('text-danger');
$("#msgbox").addClass('text-success');
$("#msgbox").text('发送成功!');
$('#myModal2').modal('show');
setTimeout(function() {
$('#myModal2').modal('hide');
location.href=location.href;
},1500);
}else{
$("#msgclass").removeClass('glyphicon-ok text-success');
$("#msgclass").addClass('glyphicon-remove text-danger');
$("#msgbox").removeClass('text-success');
$("#msgbox").addClass('text-danger');
if (result==-1) {
$("#msgbox").text('请输入收件人名字!');
}else{
$("#msgbox").text('发送失败!');
/*
setTimeout(function() {
$('#myModal2').modal('hide');
location.href=location.href;
},1500);
*/
}
$('#myModal2').modal('show');
setTimeout(function() {
$('#myModal2').modal('hide');
},5000);
}
});
})
});
</script>
</body>
</html>

@ -0,0 +1,251 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HT在线平台</title>
<!-- <link href="/css/webht/bootstrap.min.css" rel="stylesheet">
<link href="/css/webht/webht.css?v=1" rel="stylesheet">-->
<link href="/min?f=/css/webht/bootstrap.min.css,/css/webht/webht.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!--
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/webht.js?v=1"></script>
-->
<script src="/min?f=/js/jquery.min.js,/js/bootstrap.min.js,/js/webht.js,/js/jquery.suggest.js"></script>
<script src="/js/jquery-ui.min.js?v=1"></script>
<link href="/css/webht/jquery-ui-1.10.0.custom.css" rel="stylesheet">
<link rel="shortcut icon" href="/css/images/webht.jpg">
</head>
<body>
<nav class="navbar navbar-inverse navbar-red">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo site_url('');?>"><span class="icon-home"></span> 中华游在线</a>
<a class="navbar-brand visible-xs-block"><?php if(isset($navtitle)) echo $navtitle;?></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="<?php echo site_url('apps/dingmail/index/mail_index');?>">Value发送</a></li>
<li><a href="<?php echo site_url('apps/dingmail/index/index/'.$this->session->userdata('dingding_user_info')->ddu_Unionid);?>">个人中心</a></li>
<li><a href="<?php echo site_url('apps/dingmail/index/rank_person');?>">排行榜</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="<?php echo site_url('apps/dingmail/index/logout');?>">退出</a></li>
</ul>
</div>
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<div class="row">
<div class="col-xs-24 btn-lg"></div>
<div class="col-xs-24">
<h3>个人获赞排行榜</h3>
</div>
<div class="col-xs-8">
<div class="col-xs-24 bg-white min-height-500">
<div class="row" style="border-bottom:1px solid #e5e5e5;margin-bottom:20px;">
<div class="col-xs-4"><p style="font-size:15px;color:#333;padding-top:8px;">周榜</p></div>
<div class="col-xs-10"><input class="form-control" placeholder="起始时间" id="from_time" value=""/></div>
<div class="col-xs-10"><input class="form-control" placeholder="截止时间" id="to_time" value=""/></div>
</div>
<ul class="nav rank_ul" id="week_data">
<?php foreach ($rank_week as $key_rw => $rw) { ?>
<li class="col-xs-24 nopadding">
<span class="text-danger<?php echo $key_rw+1; ?>">No.<?php echo $key_rw+1; ?></span>
<span>
<a href="<?php echo site_url('apps/dingmail/index/index/'.$rw->ddv_Comment_Unionid); ?>">
<?php echo $rw->ddv_Comment_Name; ?>
</a>
</span>
<span class="badge pull-right"><?php echo $rw->like_count;?> like</span>
</li>
<?php } ?>
<?php if(empty($rank_week)) { ?><p>暂无数据</p><?php } ?>
</ul>
</div>
</div>
<div class="col-xs-8">
<div class="col-xs-24 bg-white min-height-500">
<div class="row" style="border-bottom:1px solid #e5e5e5;margin-bottom:20px;">
<div class="col-xs-4"><p style="font-size:15px;color:#333;padding-top:8px;">月榜</p></div>
<div class="col-xs-10">
<select class="form-control" id="month_time">
<option select="selected" value="null">选择月份</option>
<option value="1">一月</option>
<option value="2">二月</option>
<option value="3">三月</option>
<option value="4">四月</option>
<option value="5">五月</option>
<option value="6">六月</option>
<option value="7">七月</option>
<option value="8">八月</option>
<option value="9">九月</option>
<option value="10">十月</option>
<option value="11">十一月</option>
<option value="12">十二月</option>
</select>
</div>
<div class="col-xs-10">
<select class="form-control" id="month_year_time">
<!--<option select="selected" value="null">选择年份</option>-->
<?php
for($i=2017; $i<=date('Y'); $i++){
if($i == date('Y')){
echo '<option value="'.$i.'" selected="selected">'.$i.'</option>';
}else{
echo '<option value="'.$i.'">'.$i.'</option>';
}
}
?>
</select>
</div>
</div>
<ul class="nav rank_ul" id="month_data">
<?php foreach ($rank_month as $key_rm => $rm) { ?>
<li class="col-xs-24 nopadding">
<span class="text-danger<?php echo $key_rm+1; ?>">No.<?php echo $key_rm+1; ?></span>
<span>
<a href="<?php echo site_url('apps/dingmail/index/index/'.$rm->ddv_Comment_Unionid); ?>">
<?php echo $rm->ddv_Comment_Name; ?>
</a>
</span>
<span class="badge pull-right"><?php echo $rm->like_count;?> like</span>
</li>
<?php } ?>
<?php if(empty($rank_month)) { ?><p>暂无数据</p><?php } ?>
</ul>
</div>
</div>
<div class="col-xs-8">
<div class="col-xs-24 bg-white min-height-500">
<div class="row" style="border-bottom:1px solid #e5e5e5;margin-bottom:20px;">
<div class="col-xs-6"><p style="font-size:15px;color:#333;padding-top:8px;">年榜</p></div>
<div class="col-xs-18">
<select class="form-control" id="year_time">
<?php
for($i=2017; $i<=date('Y'); $i++){
if($i == date('Y')){
echo '<option value="'.$i.'" selected="selected">'.$i.'</option>';
}else{
echo '<option value="'.$i.'">'.$i.'</option>';
}
}
?>
</select>
</div>
</div>
<ul class="nav rank_ul" id="year_data">
<?php foreach ($rank_year as $key_ry => $ry) { ?>
<li class="col-xs-24 nopadding">
<span class="text-danger<?php echo $key_ry+1; ?>">No.<?php echo $key_ry+1; ?></span>
<span>
<a href="<?php echo site_url('apps/dingmail/index/index/'.$ry->ddv_Comment_Unionid); ?>">
<?php echo $ry->ddv_Comment_Name; ?>
</a>
</span>
<span class="badge pull-right"><?php echo $ry->like_count;?> like</span>
</li>
<?php } ?>
<?php if(empty($rank_year)) { ?><p>暂无数据</p><?php } ?>
</ul>
</div>
</div>
</div>
</div>
</body>
<script>
$(function(){
//日期选择
$('#from_time,#to_time').datepicker({
});
//周榜触发事件
var from_time = '';
var to_time = '';
var month_time = '';
var year_time = '';
var type = '';
var month_year_time = '';
$('#from_time,#to_time').change(function(){
from_time = $('#from_time').val();
to_time = $('#to_time').val();
if(from_time != '' && to_time != ''){
type = 'week';
ajax_gethtml(from_time,to_time,type);
}
});
//月榜触发事件
$('#month_time').change(function(){
month_time = $('#month_time').val();
month_year_time = $('#month_year_time').val();
if(month_time != null){
type = 'month';
if(month_year_time == 'null'){
var myDate = new Date();
from_time = myDate.getFullYear()+'-'+month_time+'-01';
}else{
from_time = month_year_time+'-'+month_time+'-01';
}
to_time = '';
ajax_gethtml(from_time,to_time,type);
}
});
$('#month_year_time').change(function(){
month_time = $('#month_time').val();
month_year_time = $('#month_year_time').val();
if(month_time != 'null'){
type = 'month';
from_time = month_year_time+'-'+month_time+'-01';
to_time = '';
ajax_gethtml(from_time,to_time,type);
}
});
//年榜触发事件
$('#year_time').change(function(){
year_time = $('#year_time').val();
if(year_time != null){
type = 'year';
from_time = year_time+'-01-01';
to_time = year_time+'-12-31';
ajax_gethtml(from_time,to_time,type);
}
});
});
function ajax_gethtml(from_time,to_time,type){
$.ajax({
url:'http://www.mycht.cn/webht.php/apps/dingmail/index/ajax_get_data/?from_time='+from_time+'&to_time='+to_time+'&type='+type,
type:'get',
success:function(data){
$('#'+type+'_data').html(data);
}
});
}
</script>
</html>

@ -0,0 +1,258 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HT在线平台</title>
<!-- <link href="/css/webht/bootstrap.min.css" rel="stylesheet">
<link href="/css/webht/webht.css?v=1" rel="stylesheet">-->
<link href="/min?f=/css/webht/bootstrap.min.css,/css/webht/webht.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!--
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/webht.js?v=1"></script>
-->
<script src="/min?f=/js/jquery.min.js,/js/bootstrap.min.js,/js/webht.js,/js/jquery.suggest.js"></script>
<link rel="shortcut icon" href="/css/images/webht.jpg">
</head>
<body>
<nav class="navbar navbar-inverse navbar-red">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo site_url('');?>"><span class="icon-home"></span> 中华游在线</a>
<a class="navbar-brand visible-xs-block"><?php if(isset($navtitle)) echo $navtitle;?></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="<?php echo site_url('apps/dingmail/index/mail_index');?>">Value发送</a></li>
<li><a href="<?php echo site_url('apps/dingmail/index/index/'.$this->session->userdata('dingding_user_info')->ddu_Unionid);?>">个人中心</a></li>
<li><a href="<?php echo site_url('apps/dingmail/index/rank_person');?>">排行榜</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="<?php echo site_url('apps/dingmail/index/logout');?>">退出</a></li>
</ul>
</div>
</div><!-- /.container-fluid -->
</nav>
<div class="container" style="max-width:1200px;">
<div class="row">
<div class="col-sm-7 col-xs-24 pull-right" style="font: 14px 'Arial','Microsoft YaHei';line-height:25px;">
<div class="panel" style="margin-top:15px;">
<div class="panel-body nopadding">
<div class="row">
<div class="col-xs-10">
<?php if(!empty($user->ddu_Avatar)){?>
<img class="img-responsive" src="<?php echo $user->ddu_Avatar?>"/>
<?php }else{?>
请退出后再次扫码登录,将展示你的钉钉头像
<?php }?>
</div>
<div class="col-xs-14">
<p></p><h4 class="text-center strong"><?php echo $user->ddu_Name?></h4><p></p>
<div class="col-xs-12 text-center text-muted" style="border-left:1px solid #ddd;">
<a href="<?php echo site_url('apps/dingmail/index/index/'.$user_unionid.'/like');?>">
<strong><?php echo $like_count->count;?></strong><br>
<span></span>
</a>
</div>
<div class="col-xs-12 text-center text-muted" style="border-left:1px solid #ddd;">
<a href="<?php echo site_url('apps/dingmail/index/index/'.$user_unionid.'/unlike');?>">
<strong><?php echo $unlike_count->count;?></strong><br>
<span>板砖</span>
</a>
</div>
<p></p>
<div class="col-xs-24 btn-sm"></div>
</div>
</div>
</div>
</div>
<div class="panel">
<div class="panel-body">
<legend>
<span class="text-primary glyphicon glyphicon-thumbs-up" style="font-size:20px;"></span>
<span style="font-size:15px;">他们都觉得很赞!</span>
</legend>
<?php foreach($whos_like as $obj){?>
<span><?php echo $obj->ddv_Name; ?>; </span>
<?php } ?>
<div class="clearfix"></div>
</div>
</div>
<div class="panel">
<div class="panel-body">
<legend>
<span class="text-danger glyphicon glyphicon-thumbs-down" style="font-size:20px;"></span>
<span style="font-size:15px;">他们拍砖了!</span>
</legend>
<?php foreach($whos_unlike as $obj){?>
<span><?php echo $obj->ddv_Name; ?>; </span>
<?php } ?>
<div class="clearfix"></div>
</div>
</div>
<?php if($this->session->userdata('dingding_user_info')->ddu_Name == $user->ddu_Name ){ ?>
<div class="panel">
<div class="panel-body">
<legend>
<span class="text-danger glyphicon glyphicon-leaf" style="font-size:20px;"></span>
<span style="font-size:15px;">个人邮件签名设置!</span>
</legend>
<div class="col-xs-24 nopadding" style="height:70px;background:none;">
<a href="http://www.mycht.cn/webht.php/apps/dingmail/index/mail_index">
<img src="http://www.mycht.cn/css/images/+valuemail.png">
</a>
<a href="http://www.mycht.cn/webht.php/apps/dingmail/index/index/<?php echo $this->session->userdata('dingding_user_info')->ddu_Unionid?>/like">
<img src="http://www.mycht.cn/css/images/+like.png">
</a>
<a href="http://www.mycht.cn/webht.php/apps/dingmail/index/index/<?php echo $this->session->userdata('dingding_user_info')->ddu_Unionid?>/unlike">
<img src="http://www.mycht.cn/css/images/+unlike.png">
</a>
</div>
<div class="clearfix">
<p>钉邮签名没有更新成功的同学请看这里:</p>
<p>拖动鼠标选中上方的三个按钮(在<span class="text-danger">按钮下方</span>鼠标左键三击试试)然后按下Ctrl+C键进行复制到自己的outlook签名里即可。</p><p>温馨提示:不能直接用鼠标右键功能进行复制</p>
</div>
</div>
</div>
<?php }else{ ?>
<div></div>
<?php }?>
</div>
<div class="col-sm-17 col-xs-24">
<a name="gotocomment" id="gotocomment"></a>
<form id="from-add-comment" method="post" action="<?php echo site_url('apps/dingmail/index/add_comment');?>" style="background:#fff;padding:0 15px 15px 15px;margin-top:15px;">
<div class="col-xs-24 btn-lg"></div>
<p class="col-xs-24 nopadding"><em class="text-primary strong">大家好,我是<?php echo $user->ddu_Name; ?>,欢迎留言......</em></p>
<div class="col-xs-24 nopadding">
<textarea class="form-control" rows="3" name="comment" id="comment-textarea"></textarea>
</div>
<div class="col-xs-24 btn-sm"></div>
<div class="col-xs-24 nopadding">
<input type="hidden" name="user_unionid" value="<?php echo $user_unionid;?>">
<input type="hidden" name="user_sn" value="<?php echo $user->ddu_Sn;?>">
<input type="hidden" name="user_name" value="<?php echo $user->ddu_Name;?>">
<div class="pull-right">
<label style="padding:0 10px 0 0"><input type="checkbox" name="hidden_name" value="hidden_name"/><span style="padding-left:10px">匿名发送</span></label>
<button type="button" id="btn-add-comment" class="btn btn-danger">确 定</button>
</div>
</div>
<div class="clearfix"></div>
</form>
<div class="col-xs-24 nopadding" style="margin-top:20px;margin-bottom:50px;font: 14px 'Arial','Microsoft YaHei';line-height:23px;">
<?php foreach($all_comment as $key=>$value){?>
<div class="col-xs-24" style="border-bottom:1px solid #ededed;padding:15px 20px;background:#fff;">
<p class="text-primary">
<?php if($value->ddu_Avatar){?>
<img style="width:30px;display:inline;border-radius:50%;margin-right:15px;" class="img-responsive" src="<?php echo $value->ddu_Avatar?>"/>
<?php }?>
<?php if($value->ddv_Type == 'hidden_comment'){
echo $value->ddv_Name;
}else{?>
<a href="http://www.mycht.cn/webht.php/apps/dingmail/index/index/<?php echo $value->ddv_User_Unionid?>"><?php echo $value->ddv_Name?></a>
<?php }?>
</p>
<?php if($value->ddv_Content == 'like' || $value->ddv_Content == 'unlike' ){ ?>
<p>对你点了一个<?php echo $value->ddv_Content?></p>
<?php }else if($value->ddv_Type == 'comment' || $value->ddv_Type == 'hidden_comment'){?>
<p><?php echo $value->ddv_Content?></p>
<?php }else{ ?>
<p><?php echo $value->ddv_Type.'+1'.'<br>';echo $value->ddm_Subject; ?></p><a href="http://www.mycht.cn/webht.php/apps/dingmail/index/like/<?php echo $value->ddv_Identify?>/comment">查看更多</a>
<?php }?>
<p>
<span class="text-muted"><?php echo date('m-d-y H:i:s',$value->ddv_Createtime)?></span>
</p>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="media">
<div class="media-left">
<div>
<span id="msgclass" class="glyphicon glyphicon-ok text-success" aria-hidden="true" style="font-size:85px;"> </span>
</div>
</div>
<div class="media-body" style="font-size:32px;">
<div class="col-xs-24 btn-lg"><p></p></div>
<span id="msgbox" class="text-success"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
var comment_url="<?php echo site_url('apps/dingmail/index/index/'.$user_unionid);?>";
$("#btn-add-comment").click(function() {
if ($("#comment-textarea").val().replace(/(^\s*)|(\s*$)/g,'')=="") {
$("#msgclass").removeClass('glyphicon-ok text-success');
$("#msgclass").addClass('glyphicon-remove text-danger');
$("#msgbox").removeClass('text-success');
$("#msgbox").addClass('text-danger');
$("#msgbox").text('评论内容不能为空!');
$('#myModal').modal('show');
setTimeout(function() {
$('#myModal').modal('hide');
},5000);
return false;
};
var url = $("form#from-add-comment").attr('action');
var data= $("form#from-add-comment").serialize();
console.log(data);
$.post(url,data,function(result){
if (result) {
$("#msgclass").removeClass('glyphicon-remove text-danger');
$("#msgclass").addClass('glyphicon-ok text-success');
$("#msgbox").removeClass('text-danger');
$("#msgbox").addClass('text-success');
$("#msgbox").text('评论成功!');
$('#myModal').modal('show');
setTimeout(function() {
$('#myModal').modal('hide');
location.href=comment_url;
},1500);
}else{
$("#msgclass").removeClass('glyphicon-ok text-success');
$("#msgclass").addClass('glyphicon-remove text-danger');
$("#msgbox").removeClass('text-success');
$("#msgbox").addClass('text-danger');
$("#msgbox").text('评论发布失败!');
$('#myModal').modal('show');
setTimeout(function() {
$('#myModal').modal('hide');
},5000);
}
});
});
</script>
</html>

@ -15,7 +15,11 @@ class Index extends CI_Controller
$this->permission->is_admin(false);
$this->load->model('workflow_model');
}
public function test(){
$this->workflow_model->delete_test();
}
//首页
public function index()
{
@ -24,6 +28,7 @@ class Index extends CI_Controller
}
$data=array();
$typelist=$this->workflow_model->get_type_list('all');
//print_r($typelist);
$data['typelist']=array();
foreach ($typelist as $t) {
$data['typelist'][$t->wt_parentid][]=$t;
@ -62,7 +67,12 @@ class Index extends CI_Controller
//添加一个具体事务到数据库
public function do_add_work()
{
{
$this->load->model('operator_model');
$current_user=$this->input->post('wf_user');
$tmp = $this->operator_model->get_user_by_name($current_user);
//判断是不是补填的值班记录
if ($this->input->post('mail_title')=='值班记录') {
//本月和上个月的值班表(有可能本月初和上月尾是连着的假期)
@ -73,27 +83,32 @@ class Index extends CI_Controller
$data['flow_data'][]=$this->workflow_model->get_work_flow_data($v->wf_sn);
}
//节假日列表
$needdate_list=array();
$needdate_list=$myrota=array();
foreach ($data['flow_data'] as $f) {
foreach ($f as $d) {
$wfd_key_arr=explode('_', $d->wfd_key);
//值班日期是周末的日期集合
if ($wfd_key_arr[0]=='weekend' && $d->wfd_value==1) {
$wfd_key_arr[1]=strlen($wfd_key_arr[1])==7?substr($wfd_key_arr[1], 0,-1).'0'.substr($wfd_key_arr[1],-1):$wfd_key_arr[1];
$needdate_list[]=$wfd_key_arr[1];
}
//当前用户的值班日期集合
$name_string=str_replace('惠毅', '惠毅;惠 毅', $d->wfd_value);
if (!empty($d->wfd_value) && stripos($name_string, $tmp['OPI_Name'])!==false && isset($wfd_key_arr[2]) && is_numeric($wfd_key_arr[2])) {
$need_date=strlen($wfd_key_arr[2])==7?substr($wfd_key_arr[2], 0,-1).'0'.substr($wfd_key_arr[2],-1):$wfd_key_arr[2];
$myrota[]=date('Ymd',strtotime($need_date));
}
}
}
$needdate_list=array_intersect($needdate_list,$myrota);
$zhiban_date=date('Ymd',strtotime($this->input->post('wf_time')));
if (!in_array($zhiban_date, $needdate_list)) {
echo json_encode(array('status'=>'no','msg'=>'请把左上角的日期改为你值班当天的日期'));
return true;
if (empty($needdate_list) or !in_array($zhiban_date, $needdate_list)) {
//echo json_encode(array('status'=>'no','msg'=>'值班日期与值班表不符,更换了值班的同学请更改值班表'));
//return true;
}
}
//保存任务
$this->load->model('operator_model');
$current_user=$this->input->post('wf_user');
$tmp = $this->operator_model->get_user_by_name($current_user);
$wf_user=$tmp['OPI_SN'];
$wf_time=strtotime($this->input->post('wf_time'));
$group_admin=explode('@', $this->input->post('wf_wt_sn'));
@ -108,10 +123,13 @@ class Index extends CI_Controller
if ($wfd_key=='emailcontent') {
$wfd_value=htmlspecialchars($wfd_value);
}
$col_val.="('".trim($wfd_key)."','".$wfd_value."',".$wfd_wf_sn."),";
// $col_val.="('".trim($wfd_key)."','".$wfd_value."',".$wfd_wf_sn."),";
$col_val.="('".trim($wfd_key)."','".chop($wfd_value)."',".$wfd_wf_sn."),";//csk 2016-9-22 去掉末尾的换行和空格
$mail_data[$wfd_key]=$wfd_value;
$mail_data['flow_data'][$wfd_key]=$wfd_value;
$mail_data['flow_data'][$wfd_key]=chop($wfd_value);//csk 2016-9-22 去掉末尾的换行和空格
}
$apply_user=$this->input->post('apply_user');
if (empty($apply_user)) {
$col_val.="('apply_user','".$current_user."',".$wfd_wf_sn."),";
@ -123,7 +141,6 @@ class Index extends CI_Controller
//添加审核人
$typeinfo=$this->workflow_model->get_type_list(0,$wf_wt_sn);
$verify_tolist_array=$this->get_verify_admin_list($wfd_wf_sn,$group_admin[1],$typeinfo[0]->wt_linear);
//抄送邮件给指定人员
if ($wfd_wf_sn && $wfd_sn) {
$data['userdata']=$this->session->userdata('admin_chtcdn');
@ -177,6 +194,7 @@ class Index extends CI_Controller
}
$data['userdata']=$this->session->userdata('admin_chtcdn');
//print_r($data['userdata']);
//事务申请人信息
$userdata=$this->session->userdata('admin_chtcdn');
$flow=$this->workflow_model->get_work_list($userdata['OPI_SN'],$wv_status,$wf_sn);
@ -189,6 +207,7 @@ class Index extends CI_Controller
$data[$d->wfd_key]=$d->wfd_value;
$data['flow_data'][$d->wfd_key]=$d->wfd_value;
}
//print_r($data);
$form=$data['flow']->wt_form;
$data['wf_sn']=$wf_sn;
@ -201,12 +220,16 @@ class Index extends CI_Controller
//当前用户是否审核人员 0否 1是
$verify_user=$this->workflow_model->get_verify($wf_sn,0,false,50);
$data['is_verify_user']=0;
foreach ($verify_user as $vu) {
// var_dump($data['userdata']);die;
if(!empty($data['userdata']['whu_uid'])){//csk2016-11-29
foreach ($verify_user as $vu) {
if ($data['userdata']['whu_uid']==$vu->wv_admin) {
$data['is_verify_user']=1;
break;
}
}
}
//用于做导航激活状态
$data['nav_type']=$nav_type;
if ($nav_type=='userlist') {
@ -222,6 +245,7 @@ class Index extends CI_Controller
}
$data['wv_status']=$wv_status;
$data['form']=$this->load->view("form/$form",$data,true);
//print_r($data);
$this->load->view('n-header', $data);
$this->load->view('w-nav');
$this->load->view('w-left');
@ -313,7 +337,7 @@ class Index extends CI_Controller
$namestrings=str_replace('', ';', $namestrings);
$namestrings=str_replace('', '(', $namestrings);
$namestrings=str_replace('', ');', $namestrings);
$namestrings=str_replace('惠毅', '惠 毅', $namestrings);
//$namestrings=str_replace('惠毅', '惠 毅', $namestrings);
$namestrings=str_replace("\n", ";", $namestrings);
$namestrings=str_replace("\r", ";", $namestrings);
$namestrings_arr=explode(';', $namestrings);
@ -336,9 +360,6 @@ class Index extends CI_Controller
}
if (isset($atd_sn_arr[0]->ATT_SN) && isset($epy_sn_arr[0]->EPY_ID)) {
$jabtime=7;
if ($workdata[0]->OPI_Name=='周玲霞') {
$jabtime=3.5;
}
//如果有自定义的考勤时间则使用自定义的数据
$kaoqin_time=$this->input->post('kaoqin_time')?$this->input->post('kaoqin_time'):'';
$kaoqin_time=trim($kaoqin_time);
@ -467,6 +488,7 @@ class Index extends CI_Controller
return $verify_tolist_array;
}
//
public function other_verify($wf_sn,$wv_status=0)
{
//获取当前值班名单
@ -542,9 +564,9 @@ class Index extends CI_Controller
array_multisort($datetemp3, SORT_ASC, $js_uname_list);
$data['en_uname_list']=$en_uname_list;
$data['sw_uname_list']=$sw_uname_list;
$data['jd_uname_list']=$jd_uname_list;
$data['js_uname_list']=$js_uname_list;
$data['sw_uname_list']=array();//$sw_uname_list;
$data['jd_uname_list']=array();//$jd_uname_list;
$data['js_uname_list']=array();//$js_uname_list;
$data['wf_sn']=$wf_sn;
$data['nav_type']='rata_list';
@ -624,6 +646,7 @@ class Index extends CI_Controller
//分页
$page_flag=true;
$list=$this->workflow_model->get_work_list($userdata['whu_uid'],$wv_status,false,$page_flag,false);
//print_r($list);
$pages['total']=count($list);//数据总条数
$pages['pageSize']= 30;//每页展示数量
$pages['url'] = site_url("apps/workflow/index/unverify/$wv_status/");//页码链接
@ -638,18 +661,34 @@ class Index extends CI_Controller
}
$datalist=$this->workflow_model->get_work_list_by_sn($task_id_str);
$worklist=array();
$wf_sn_str='0';
foreach ($datalist as $wlist) {
$worklist[$wlist->wf_sn]=$wlist;
$wf_sn_str.=','.$wlist->wf_sn;
}
$data['list']=$worklist;
$flow_data=$this->workflow_model->get_work_flow_data($wf_sn_str);
$f_datas=array();
foreach ($flow_data as $k => $f) {
$f_datas[$f->wfd_wf_sn][$f->wfd_key]=$f->wfd_value;
}
$data['f_datas']=$f_datas;
$data['nav_type']='verify';
$data['left_nav']=$wv_status==0?'unverify':'verify';
$data['wv_status']=$wv_status;
//print_r($data);
if ($wv_status==1) {
$data['nav_type']='verifyed';
}
// var_dump($data["list"]);
// foreach ($data["list"] as $key => $v) {
// echo $v->wf_status;
// echo $v->isverify;
// echo "<br>";
// }
$this->load->view('n-header', $data);
$this->load->view('w-nav');
$this->load->view('w-left');
@ -847,10 +886,11 @@ class Index extends CI_Controller
$data['rolelist']=$this->workflow_model->get_department_list(2);
//用户列表
$data['userlist']=$this->workflow_model->get_user_list();
if ($whu_uid!==false) {
$data['userinfo']=$this->workflow_model->get_user_list($whu_uid);
$data['userinfo']=$data['userinfo'][0];
$data['userrole']=array_filter(explode(',', $data['userinfo']->role));
$data['userinfo']=$data['userinfo'][0];
$data['userrole']=array_filter(explode(',', $data['userinfo']->role));
}
$this->load->view('n-header', $data);
$this->load->view('w-nav');
@ -863,6 +903,7 @@ class Index extends CI_Controller
//员工资料更新
public function user_edit()
{
$type=$this->input->post('type');
$whu_role=$this->input->post('userrole');
$whu_uname=$this->input->post('whu_uname');
$whu_email=$this->input->post('whu_email');
@ -870,11 +911,19 @@ class Index extends CI_Controller
$department=$this->input->post('department');
$role=!empty($whu_role)?implode(',',$this->input->post('userrole')):NULL;
$whu_uid=$this->input->post('whu_uid');
$result=$this->workflow_model->update_webuser($whu_uname,$whu_email,$whu_ip,$department,$role,$whu_uid);
if($type == 'add'){
$result = $result=$this->workflow_model->add_webuser($whu_uname,$whu_email,$whu_ip,$department,$role,$whu_uid);
}else if($type == 'delete'){
$result=$this->workflow_model->delete_webuser($whu_uname,$whu_uid);
}else if($type == 'update'){
$result=$this->workflow_model->update_webuser($whu_uname,$whu_email,$whu_ip,$department,$role,$whu_uid);
}
if ($result) {
echo json_encode(array('status'=>'ok','msg'=>'保存成功!'));
echo json_encode(array('status'=>'ok','msg'=>'操作成功!'));
}else{
echo json_encode(array('status'=>'no','msg'=>'保存失败!'));
echo json_encode(array('status'=>'no','msg'=>'操作失败!'));
}
}
@ -1001,8 +1050,8 @@ class Index extends CI_Controller
//发送邮件
$mail_tpl='rota.php';
$subject='电子商务部'.date('n',$wf_time).'月值班安排';
$html='各位同事,<br>以下是电子商务部'.date('Y',$wf_time).'年'.date('n',$wf_time).'月值班安排,请大家<span style="color:red;">做好提醒</span>,按相关值班规定值班。<br>为方便统计加班小时数,请记得到<span style="color:red;">值班记录系统</span>填写值班记录,自行调班的同事请记得到<span style="color:red;">值班记录系统</span>里面更改。<br>谢谢!';
$subject='海纳国旅'.date('n',$wf_time).'月值班安排';
$html='各位同事,<br>以下是海纳国旅'.date('Y',$wf_time).'年'.date('n',$wf_time).'月值班安排,请大家<span style="color:red;">做好提醒</span>,按相关值班规定值班。<br>为方便统计加班小时数,请记得到<span style="color:red;">值班记录系统</span>填写值班记录,自行调班的同事请记得到<span style="color:red;">值班记录系统</span>里面更改。<br>谢谢!';
$mailbody=$html.'<br><br>'.$this->load->view("mail_tpl/$mail_tpl",$mail_data,true);
//发送人信息
@ -1032,13 +1081,16 @@ class Index extends CI_Controller
if ($this->workflow_model->delete_wfd($wf_sn)) {
$col_val='';
foreach ($this->input->post() as $wfd_key => $wfd_value) {
$col_val.="('".trim($wfd_key)."','".$wfd_value."',".$wf_sn."),";
// $col_val.="('".trim($wfd_key)."','".$wfd_value."',".$wf_sn."),";
$col_val.="('".trim($wfd_key)."','".chop($wfd_value)."',".$wf_sn."),";//csk 2016-9-22 去掉末尾的换行和空格
}
$apply_user=$this->input->post('apply_user');
if (empty($apply_user)) {
$col_val.="('apply_user','".$current_user."',".$wf_sn."),";
}
$col_val=substr($col_val, 0, -1);
$wfd_sn=$this->workflow_model->add_work_data($col_val);
}
@ -1053,6 +1105,7 @@ class Index extends CI_Controller
if ($this->session->userdata('verify_referer')) {
$verify_referer_url=$this->session->userdata('verify_referer');
}
echo json_encode(array('status'=>'ok_go','msg'=>'更新成功!','url'=>$verify_referer_url));
}
@ -1413,5 +1466,6 @@ class Index extends CI_Controller
}
$this->load->view('index/print_text', $data);
}
}

@ -100,7 +100,7 @@ class Workflow_model extends CI_Model {
}
public function get_work_list($wv_admin,$wv_status,$wf_sn=false,$page_flag=false,$wv_actived=-1)
{
{//
$map=" AND wt_form!='rota.php' AND (wv_admin=258 or wv_admin='$wv_admin')";
if (!$wv_actived) {
$map.=" AND wv_actived!=-1 ";
@ -117,7 +117,7 @@ class Workflow_model extends CI_Model {
left join work_type on wf_wt_sn=wt_sn
left join OperatorInfo on wf_user=OPI_SN
WHERE wv_status=? $map
ORDER BY wf_time desc";
ORDER BY wf_time desc";
$query = $this->HT->query($sql, array($wv_status));
$result=$query->result();
return $result;
@ -411,6 +411,34 @@ class Workflow_model extends CI_Model {
$query = $this->HT->query($sql,array($whu_uname,$whu_email,$whu_ip,$department,$role,$whu_uid));
return $query;
}
public function add_webuser($whu_uname,$whu_email,$whu_ip,$department,$role)
{
$status = 1;
$sql="INSERT INTO webht_user
(whu_uname,
whu_email,
whu_ip,
whu_status,
department,
role)
VALUES
(?,?,?,?,?,?)";
$query = $this->HT->query($sql,array($whu_uname,$whu_email,$whu_ip,$status,$department,$role));
return $query;
}
public function delete_webuser($whu_uname,$whu_uid)
{
$sql="DELETE FROM
webht_user
WHERE
whu_uname=?
and
whu_uid=?";
$query = $this->HT->query($sql,array($whu_uname,$whu_uid));
return $query;
}
public function delete_wt($wt_sn,$wt_isdelete=1)
{
@ -437,5 +465,10 @@ class Workflow_model extends CI_Model {
$query=$this->HT->query($sql, array($wv_wf_sn));
return $query;
}
public function delete_test(){
$sql = "delete from work_flow_data where wfd_key like '%201905%'";
$query=$this->HT->query($sql);
}
}

@ -5,7 +5,7 @@
<form class="form-add-watch col-xs-24 nopadding" method="post" style="" action="<?php echo site_url('apps/workflow/index/do_add_work'); ?>">
<?php
$year=isset($wf_time)?date('Y',strtotime($wf_time)):date('Y');
$year=isset($wf_time)?date('Y',strtotime($wf_time)):date('Y',strtotime("+1 month"));
$month=isset($wf_time)?date('m',strtotime($wf_time)):date('m',strtotime("+1 month"));
$month_n=isset($wf_time)?date('n',strtotime($wf_time)):date('n',strtotime("+1 month"));
$days=cal_days_in_month(CAL_GREGORIAN,$month,$year);
@ -39,20 +39,25 @@
<th width="120">CH销售</th>
<th width="60">CT</th>
<th width="60">商务</th>
<th width="60">德语</th>
<th colspan="2">国际</th>
<th width="80">技术</th>
<th width="70">计调</th>
<th width="70">APP</th>
<th width="70">目的地</th>
<th width="70">亚洲事业部</th>
</tr>
<tr class="rotatable_bg">
<th colspan="2">值班时间</th>
<th>12点-13点</th>
<th colspan="2">9:30-12:00,13:00-17:00</th>
<th colspan="2">10:00-16:00</th>
<th colspan="1">10:00-16:00</th>
<th width="60">到办公室</th>
<th width="120">VPN</th>
<th>技术远程值班</th>
<th>无团电话值班</th>
<th>VPN(8:30-23:00)</th>
<th>VPN(8:30-23:00)</th>
<th>VPN(8:30-23:00)</th>
</tr>
<?php for ($i=1; $i <= $days; $i++) { ?>
<?php
@ -63,17 +68,19 @@
$ch_uname=$flow_data['ch_uname_'.$ymd];
$ct_uname=$flow_data['ct_uname_'.$ymd];
$sw_uname=$flow_data['sw_uname_'.$ymd];
$de_uname=$flow_data['de_uname_'.$ymd];
$eu_uname=$flow_data['eu_uname_'.$ymd];
$vpn_uname=$flow_data['vpn_uname_'.$ymd];
$js_uname=$flow_data['js_uname_'.$ymd];
$jd_uname=$flow_data['jd_uname_'.$ymd];
$app_uname=isset($flow_data['app_uname_'.$ymd])?$flow_data['app_uname_'.$ymd]:'';
$trippest_uname=isset($flow_data['trippest_uname_'.$ymd])?$flow_data['trippest_uname_'.$ymd]:'';
$ah_uname=isset($flow_data['ah_uname_'.$ymd])?$flow_data['ah_uname_'.$ymd]:'';
isset($flow_data['weekend_'.$ymd])? $weekend=$flow_data['weekend_'.$ymd]:$weekend=0;
}
?>
<tr class="rota_tr_box <?php if((!isset($wf_sn) && ($week_no==0 || $week_no==6)) || (isset($weekend) && $weekend==1)) echo 'rotatable_bg'; ?>">
<td>
<input class="<?php if($userdata['whu_isadmin']!=1) echo 'hidden'; ?>" type="checkbox" name="weekend_<?php echo $year.$month.$i;?>" value="1" <?php if(isset($weekend) && $weekend==1) echo 'checked'; ?>>
<input class="<?php if(@$userdata['whu_isadmin']!=1) echo 'hidden'; ?>" type="checkbox" name="weekend_<?php echo $year.$month.$i;?>" value="1" <?php if(isset($weekend) && $weekend==1) echo 'checked'; ?>>
<?php echo $weekarray[$week_no]; ?>
</td>
<td><?php echo $month_n.'月'.$i."日"; ?></td>
@ -89,9 +96,6 @@
<td>
<textarea title="双击我进行修改" class="form-control" name="sw_uname_<?php echo $year.$month.$i;?>" <?php if(isset($wf_sn) && $userdata['whu_isadmin']!=1 && stripos($sw_uname, $userdata['OPI_Name'])===false) echo 'readonly';?>><?php if(isset($sw_uname))echo $sw_uname; ?></textarea>
</td>
<td>
<textarea title="双击我进行修改" class="form-control" name="de_uname_<?php echo $year.$month.$i;?>" <?php if(isset($wf_sn) && $userdata['whu_isadmin']!=1 && stripos($de_uname, $userdata['OPI_Name'])===false) echo 'readonly';?>><?php if(isset($de_uname))echo $de_uname; ?></textarea>
</td>
<td>
<textarea title="双击我进行修改" class="form-control" name="eu_uname_<?php echo $year.$month.$i;?>" <?php if(isset($wf_sn) && $userdata['whu_isadmin']!=1 && stripos($eu_uname, $userdata['OPI_Name'])===false) echo 'readonly';?>><?php if(isset($eu_uname))echo $eu_uname; ?></textarea>
</td>
@ -104,6 +108,15 @@
<td>
<textarea title="双击我进行修改" class="form-control" name="jd_uname_<?php echo $year.$month.$i;?>" <?php if(isset($wf_sn) && $userdata['whu_isadmin']!=1 && stripos($jd_uname, $userdata['OPI_Name'])===false) echo 'readonly';?>><?php if(isset($jd_uname))echo $jd_uname; ?></textarea>
</td>
<td>
<textarea title="双击我进行修改" class="form-control" name="app_uname_<?php echo $year.$month.$i;?>" <?php if(isset($wf_sn) && $userdata['whu_isadmin']!=1 && stripos($app_uname, $userdata['OPI_Name'])===false) echo 'readonly';?>><?php if(isset($app_uname))echo $app_uname; ?></textarea>
</td>
<td>
<textarea title="双击我进行修改" class="form-control" name="trippest_uname_<?php echo $year.$month.$i;?>" <?php if(isset($wf_sn) && $userdata['whu_isadmin']!=1 && stripos($trippest_uname, $userdata['OPI_Name'])===false) echo 'readonly';?>><?php if(isset($trippest_uname))echo $trippest_uname; ?></textarea>
</td>
<td>
<textarea title="双击我进行修改" class="form-control" name="ah_uname_<?php echo $year.$month.$i;?>" <?php if(isset($wf_sn) && $userdata['whu_isadmin']!=1 && stripos($ah_uname, $userdata['OPI_Name'])===false) echo 'readonly';?>><?php if(isset($ah_uname))echo $ah_uname; ?></textarea>
</td>
</tr>
<?php } ?>
</table>

@ -5,7 +5,8 @@
<th>提交时间</th>
<th>状态</th>
<th>操作</th>
<th class="<?php $userdata=$this->session->userdata('admin_chtcdn'); if ($userdata['whu_isadmin']!=1) echo 'hidden'; ?>">其他</th>
<th>其他</th>
<?php $userdata=$this->session->userdata('admin_chtcdn'); ?>
</tr>
<?php foreach ($list as $key => $v) { ?>
<tr>
@ -23,7 +24,11 @@
<a href="javascript:void(0);" class="ajax-link" data-href="<?php echo site_url('apps/workflow/index/dalete_work_flow/'.$v->wf_sn); ?>">删除</a>
<?php } ?>
</td>
<td class="<?php if ($userdata['whu_isadmin']!=1) echo 'hidden'; ?>"><a href="<?php echo site_url('apps/workflow/index/other_verify/'.$v->wf_sn.'/'.$v->wf_status); ?>">不用发邮件记录考勤的员工</a></td>
<td>
<?php if ($userdata['whu_isadmin']==1) { ?>
<a href="<?php echo site_url('apps/workflow/index/other_verify/'.$v->wf_sn); ?>">中午值班审核</a>
<?php } ?>
</td>
</tr>
<?php } ?>
</tbody>

@ -6,9 +6,14 @@
<th>状态</th>
<th>操作</th>
</tr>
<?php foreach ($list as $key => $v) { ?>
<?php $i=1;foreach ($list as $key => $v) { ?>
<tr>
<td class="hidden-xs" scope="row"><?php echo ($key+1); ?></td>
<td class="hidden-xs" scope="row">
<?php if($left_nav && $left_nav!='userlist'){ ?>
<input type="checkbox" class="work_flow_item" data-key="<?php echo $i; ?>" data-wfsn="<?php echo $v->wf_sn; ?>" data-mailtitle="<?php echo $f_datas[$v->wf_sn]['mail_title']; ?>" data-kaoqintime="<?php if($v->wt_userdefined==1) echo isset($f_datas[$v->wf_sn]['rest_days'])?$f_datas[$v->wf_sn]['rest_days']*7+$f_datas[$v->wf_sn]['rest_days2']:''; ?>">
<?php } ?>
<?php echo ($i++); ?>
</td>
<td><?php echo $v->wt_name.'('.$v->OPI_Name.')'; ?></td>
<td><?php echo date('Y-m-d H:i:s',$v->wf_time); ?></td>
<td><?php $status=$v->wf_status==0? ($v->isverify!=1?'还没处理':'处理中'):'已审核';echo $status; ?></td>
@ -20,6 +25,15 @@
</td>
</tr>
<?php } ?>
<tr>
<td colspan="5">
<label style="padding-right:20px;"><input type="checkbox" id="checkall_item"> 全选</label>
<?php $userdata=$this->session->userdata('admin_chtcdn'); if (isset($left_nav) && $left_nav=='unverify' && ($userdata['OPI_Name']=='侯敏' || $userdata['OPI_Name']=='王婷' )) { ?>
<a class="btn btn-default verify_all_item" href="javascript:void(0);" data-status="0" data-lastkey="0">批量审核</a>
<a class="btn btn-default verify_all_item" href="javascript:void(0);" data-status="1" data-lastkey="0">审核不通过</a>
<?php } ?>
</td>
</tr>
</tbody>
</table>
@ -29,4 +43,52 @@
<?php echo $pageinfo['htmls']; ?>
</ul>
</nav>
</div>
</div>
<script>
$("#checkall_item").click(function(){
if ($(this).attr("checked")) {
$(".work_flow_item").attr("checked",'checked');
}else{
$(".work_flow_item").removeAttr("checked");
}
});
var selected_item=0;
$(".verify_all_item").click(function(event) {
$(this).text('正在处理,请耐心等待...');
var $that=$(this);
$(".work_flow_item").each(function(){
if ($(this).attr("checked")) {
selected_item=$(this).attr('data-key');
};
});
$that.attr("data-lastkey",selected_item);
$(".work_flow_item").each(function(){
if ($(this).attr("checked")) {
var wv_wf_sn=$(this).attr('data-wfsn');
var wv_comment='';
var mail_title=$(this).attr('data-mailtitle');
var kaoqin_time=$(this).attr('data-kaoqintime');
if (kaoqin_time=='') {
var data={"wv_wf_sn":wv_wf_sn,"wv_comment":wv_comment,"mail_title":mail_title};
}else{
var data={"wv_wf_sn":wv_wf_sn,"wv_comment":wv_comment,"mail_title":mail_title,"kaoqin_time":kaoqin_time};
}
var wv_status=$that.attr('data-status');
var url="<?php echo site_url('apps/workflow/index/do_verify'); ?>"+'/'+wv_status;
var $this=$(this);
$.post(url,data,function(res){
if ($that.attr("data-lastkey")==$this.attr('data-key')) {
$that.text('已处理完成');
};
});
};
});
});
</script>

@ -20,7 +20,14 @@
<div class="col-xs-19">
<div class="col-xs-24 btn-lg"></div>
<legend>员工资料编辑</legend>
<form class="form-horizontal form_user_edit" method="post" action="<?php echo site_url('apps/workflow/index/user_edit'); ?>">
<ul class="nav nav-tabs" role="tablist" style="margin-bottom:40px">
<li role="presentation" class="active"><a href="#add" aria-controls="add" role="tab" data-toggle="tab" onclick="location.href='<?php echo site_url('apps/workflow/index/user_manage')?>'">新增</a></li>
<li role="presentation"><a href="#delete" aria-controls="delete" role="tab" data-toggle="tab">删除</a></li>
<li role="presentation"><a href="#update" aria-controls="update" role="tab" data-toggle="tab">修改</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="add">
<form class="form-horizontal form_user_add" method="post" action="<?php echo site_url('apps/workflow/index/user_edit'); ?>">
<div class="form-group">
<label class="col-sm-4 control-label">姓名</label>
<div class="col-sm-10">
@ -63,16 +70,117 @@
<div class="form-group">
<div class="btn-group col-sm-offset-4 col-xs-5">
<input type="hidden" name="whu_uid" value="<?php if(isset($userinfo)) echo $userinfo->whu_uid; ?>">
<button type="button" class="btn btn-danger" onclick="ajaxSubmit('.form_user_edit');">保存</button>
<button class="btn dropdown-toggle btn-danger col-xs-5" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="javascript:void(0);" onclick="alert('现在还不能删人')">删除</a></li>
</ul>
<input type="hidden" name="type" value="add">
<button type="button" class="btn btn-danger" onclick="ajaxSubmit('.form_user_add');">保存</button>
</div>
</div>
</form>
</div>
<div role="tabpanel" class="tab-pane" id="delete">
<form class="form-horizontal form_user_delete" method="post" action="<?php echo site_url('apps/workflow/index/user_edit'); ?>">
<div class="form-group">
<label class="col-sm-4 control-label">姓名</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="whu_uname" value="<?php if(isset($userinfo)) echo $userinfo->whu_uname; ?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Email</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="whu_email" value="<?php if(isset($userinfo)) echo $userinfo->whu_email; ?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">IP地址</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="whu_ip" value="<?php if(isset($userinfo)) echo $userinfo->whu_ip; ?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">事业部</label>
<div class="col-sm-10">
<select class="form-control" name="department">
<?php foreach ($typelist as $type) { ?>
<option value="<?php echo $type->wt_sn; ?>" <?php if(isset($userinfo) && $type->wt_sn==$userinfo->department) echo 'selected'; ?>><?php echo $type->wt_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">职务</label>
<div class="col-sm-20">
<div class="checkbox">
<?php foreach ($rolelist as $role) { ?>
<label><input type="checkbox" name="userrole[]" value="<?php echo $role->wt_sn; ?>" <?php if(isset($userrole) && in_array($role->wt_sn, $userrole)) echo 'checked'; ?>> <?php echo $role->wt_name; ?></label>
<?php } ?>
</div>
</div>
</div>
<div class="form-group">
<div class="btn-group col-sm-offset-4 col-xs-5">
<input type="hidden" name="whu_uid" value="<?php if(isset($userinfo)) echo $userinfo->whu_uid; ?>">
<input type="hidden" name="type" value="delete">
<button type="button" class="btn btn-danger" onclick="ajaxSubmit('.form_user_delete');">删除</button>
</div>
</div>
</form></div>
<div role="tabpanel" class="tab-pane" id="update">
<form class="form-horizontal form_user_update" method="post" action="<?php echo site_url('apps/workflow/index/user_edit'); ?>">
<div class="form-group">
<label class="col-sm-4 control-label">姓名</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="whu_uname" value="<?php if(isset($userinfo)) echo $userinfo->whu_uname; ?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Email</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="whu_email" value="<?php if(isset($userinfo)) echo $userinfo->whu_email; ?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">IP地址</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="whu_ip" value="<?php if(isset($userinfo)) echo $userinfo->whu_ip; ?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">事业部</label>
<div class="col-sm-10">
<select class="form-control" name="department">
<?php foreach ($typelist as $type) { ?>
<option value="<?php echo $type->wt_sn; ?>" <?php if(isset($userinfo) && $type->wt_sn==$userinfo->department) echo 'selected'; ?>><?php echo $type->wt_name; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">职务</label>
<div class="col-sm-20">
<div class="checkbox">
<?php foreach ($rolelist as $role) { ?>
<label><input type="checkbox" name="userrole[]" value="<?php echo $role->wt_sn; ?>" <?php if(isset($userrole) && in_array($role->wt_sn, $userrole)) echo 'checked'; ?>> <?php echo $role->wt_name; ?></label>
<?php } ?>
</div>
</div>
</div>
<div class="form-group">
<div class="btn-group col-sm-offset-4 col-xs-5">
<input type="hidden" name="whu_uid" value="<?php if(isset($userinfo)) echo $userinfo->whu_uid; ?>">
<input type="hidden" name="type" value="update">
<button type="button" class="btn btn-danger" onclick="ajaxSubmit('.form_user_update');">修改</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>

@ -31,9 +31,11 @@
</form>
<?php } ?>
<div class="col-xs-24 btn-sm"></div>
<?php if (empty($verify_data) && ($nav_type=='userlist' || $nav_type=='rata_list')) { ?>
<?php if (empty($verify_data) && ($nav_type=='userlist' || $nav_type=='rata_list')) {
if($userdata['whu_isadmin'] == '1'){
?>
<button type="button" class="btn btn-block btn-default" onclick="$('.form-add-watch').attr('action','<?php echo site_url('apps/workflow/index/update_work'); ?>');ajaxSubmit('.form-add-watch');">保存修改</button>
<?php } ?>
<?php } }?>
<?php } ?>
<?php if($userdata['whu_isadmin']==1 && $left_nav=='rata_list'){ ?>
<button class="btn btn-block btn-default" onclick="$('.form-add-watch').attr('action','<?php echo site_url("apps/workflow/index/send_rota_mail"); ?>');ajaxSubmit('.form-add-watch');">发送邮件</button>

@ -23,6 +23,7 @@ table th,table td{padding: 5px;font-size: 12px;text-align: center;vertical-align
<th style="border-bottom:1px solid #aaa;border-left:1px solid #aaa;" colspan="2">国际</th>
<th style="border-bottom:1px solid #aaa;border-left:1px solid #aaa;" width="100">技术</th>
<th style="border-bottom:1px solid #aaa;border-left:1px solid #aaa;" width="80">计调</th>
<th style="border-bottom:1px solid #aaa;border-left:1px solid #aaa;" width="80">APP</th>
</tr>
<tr class="rotatable_bg">
<th style="border-bottom:1px solid #aaa;border-left:1px solid #aaa;" height="35" colspan="2">值班时间</th>
@ -33,6 +34,7 @@ table th,table td{padding: 5px;font-size: 12px;text-align: center;vertical-align
<th style="border-bottom:1px solid #aaa;border-left:1px solid #aaa;" width="150">VPN</th>
<th style="border-bottom:1px solid #aaa;border-left:1px solid #aaa;" width="100">技术远程值班</th>
<th style="border-bottom:1px solid #aaa;border-left:1px solid #aaa;" width="80">无团电话值班</th>
<th style="border-bottom:1px solid #aaa;border-left:1px solid #aaa;" width="80">VPN(8:30-23:00)</th>
</tr>
<?php for ($i=1; $i <= $days; $i++) { ?>
<?php
@ -48,6 +50,7 @@ table th,table td{padding: 5px;font-size: 12px;text-align: center;vertical-align
$vpn_uname=$flow_data['vpn_uname_'.$ymd];
$js_uname=$flow_data['js_uname_'.$ymd];
$jd_uname=$flow_data['jd_uname_'.$ymd];
$app_uname=isset($flow_data['app_uname_'.$ymd])?$flow_data['app_uname_'.$ymd]:'';
isset($flow_data['weekend_'.$ymd])? $weekend=$flow_data['weekend_'.$ymd]:$weekend=0;
}
?>
@ -63,6 +66,7 @@ table th,table td{padding: 5px;font-size: 12px;text-align: center;vertical-align
<td style="border-left:1px solid #aaa;border-bottom:1px solid #aaa;"></p><?php if(isset($vpn_uname))echo $vpn_uname;?></p></td>
<td style="border-left:1px solid #aaa;border-bottom:1px solid #aaa;"></p><?php if(isset($js_uname))echo $js_uname; ?></p></td>
<td style="border-left:1px solid #aaa;border-bottom:1px solid #aaa;"></p><?php if(isset($jd_uname))echo $jd_uname; ?></p></td>
<td style="border-left:1px solid #aaa;border-bottom:1px solid #aaa;"></p><?php if(isset($app_uname))echo $app_uname; ?></p></td>
</tr>
<?php } ?>
</table>

@ -8,7 +8,10 @@
<li><a class="hidden-xs <?php if(isset($left_nav) && $left_nav=='unverify') echo 'active';?>" href="<?php echo site_url('apps/workflow/index/unverify'); ?>"><span class="glyphicon glyphicon-edit"></span>待审核事务</a></li>
<li><a class="hidden-xs <?php if(isset($left_nav) && $left_nav=='verify') echo 'active';?>" href="<?php echo site_url('apps/workflow/index/unverify/1'); ?>"><span class="glyphicon glyphicon-saved"></span>已审核事务</a></li>
<li><a class="hidden-xs <?php if(isset($left_nav) && $left_nav=='rata_list') echo 'active';?>" href="<?php echo site_url('apps/workflow/index/rata_list'); ?>"><span class="glyphicon glyphicon-edit"></span>中华游值班表</a></li>
<?php $userdata=$this->session->userdata('admin_chtcdn'); if ($userdata['whu_isadmin']==1) { ?>
<?php
$userdata=$this->session->userdata('admin_chtcdn');
if ( !empty($userdata['whu_isadmin']) && $userdata['whu_isadmin']==1) {
?>
<li><a class="hidden-xs <?php if(isset($left_nav) && $left_nav=='type_list') echo 'active';?>" href="<?php echo site_url('apps/workflow/index/work_type_list'); ?>"><span class="glyphicon glyphicon-th"></span>管理事务类型</a></li>
<li><a class="load-modal hidden-xs" href="javascript:void(0);" data-href="<?php echo site_url('apps/workflow/index/add_work_type'); ?>" data-modal="bs-worktype-modal-lg"><span class="glyphicon glyphicon-plus"></span>添加事务类型</a></li>
<li><a class="hidden-xs" href="<?php echo site_url('apps/workflow/index/add_partment_type'); ?>" ><span class="glyphicon glyphicon-plus"></span>事业部分组</a></li>

Loading…
Cancel
Save