当前位置: 首页>>代码示例>>PHP>>正文


PHP Application_Model_User::getEmployeeInfoById方法代码示例

本文整理汇总了PHP中Application_Model_User::getEmployeeInfoById方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_User::getEmployeeInfoById方法的具体用法?PHP Application_Model_User::getEmployeeInfoById怎么用?PHP Application_Model_User::getEmployeeInfoById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Application_Model_User的用法示例。


在下文中一共展示了Application_Model_User::getEmployeeInfoById方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: resetpwdAction

 public function resetpwdAction()
 {
     // 返回值数组
     $result = array('success' => true, 'info' => '密码重置成功!(初始密码:123456)');
     $request = $this->getRequest()->getParams();
     $user_id = isset($request['id']) ? $request['id'] : null;
     if ($user_id) {
         $user = new Application_Model_User();
         $employeeInfo = $user->getEmployeeInfoById($user_id);
         $pwd = md5($employeeInfo['number'] . '123456');
         try {
             $user->update(array('password' => $pwd), "id = " . $user_id);
         } catch (Exception $e) {
             $result['success'] = false;
             $result['info'] = $e->getMessage();
             echo Zend_Json::encode($result);
             exit;
         }
     } else {
         $result['success'] = false;
         $result['info'] = '用户ID不能为空!';
     }
     echo Zend_Json::encode($result);
     exit;
 }
开发者ID:xindalu,项目名称:evolve,代码行数:25,代码来源:AccountController.php

示例2: editpwdAction

 public function editpwdAction()
 {
     // 返回值数组
     $result = array('success' => true, 'info' => '修改密码成功');
     $user_session = new Zend_Session_Namespace('user');
     $user_id = $user_session->user_info['user_id'];
     $request = $this->getRequest()->getParams();
     $pwd0 = isset($request['pwd0']) ? $request['pwd0'] : null;
     $pwd1 = isset($request['pwd1']) ? $request['pwd1'] : null;
     $pwd2 = isset($request['pwd2']) ? $request['pwd2'] : null;
     if ($pwd0 && $pwd1 && $pwd2) {
         $user = new Application_Model_User();
         if ($user->checkUserPwdById($user_id, $pwd0)) {
             $employeeInfo = $user->getEmployeeInfoById($user_id);
             $pwd = md5($employeeInfo['number'] . $pwd1);
             try {
                 $user->update(array('password' => $pwd), "id = " . $user_id);
                 $computer_name = gethostbyaddr(getenv("REMOTE_ADDR"));
                 // 计算机名
                 $now = date('Y-m-d H:i:s');
                 $data = array('operate' => '修改密码', 'target' => 'UserAccount', 'computer_name' => $computer_name, 'ip' => $_SERVER['REMOTE_ADDR'], 'time' => $now);
                 $operate = new Application_Model_Log_Operate();
                 try {
                     $operate->insert($data);
                 } catch (Exception $e) {
                     $result['success'] = false;
                     $result['info'] = $e->getMessage();
                     echo Zend_Json::encode($result);
                     exit;
                 }
             } catch (Exception $e) {
                 $result['success'] = false;
                 $result['info'] = $e->getMessage();
                 echo Zend_Json::encode($result);
                 exit;
             }
         } else {
             $result['success'] = false;
             $result['info'] = '旧密码输入错误!';
         }
     } else {
         $result['success'] = false;
         $result['info'] = '新、旧密码不能为空!';
     }
     echo Zend_Json::encode($result);
     exit;
 }
开发者ID:xindalu,项目名称:evolve,代码行数:47,代码来源:AccountController.php

示例3: getReviewUserInfo

 public function getReviewUserInfo($type, $file_id)
 {
     $reviewerInfo = array();
     $sql = $this->select()->from($this, array('plan_user' => new Zend_Db_Expr("GROUP_CONCAT(plan_user SEPARATOR ',')")))->where("type = '" . $type . "' and file_id = " . $file_id)->group("file_id");
     if ($this->fetchAll($sql)->count() > 0) {
         $data = $this->fetchRow($sql)->toArray();
         $reviewers = array_unique(explode(',', $data['plan_user']));
         $user = new Application_Model_User();
         foreach ($reviewers as $r) {
             $userData = $user->fetchRow("employee_id = " . $r)->toArray();
             $user_id = $userData['id'];
             $userInfo = $user->getEmployeeInfoById($user_id);
             $user_email = $userInfo['email'];
             array_push($reviewerInfo, array('user_id' => $user_id, 'email' => $user_email));
         }
     }
     return $reviewerInfo;
 }
开发者ID:xindalu,项目名称:evolve,代码行数:18,代码来源:Review.php

示例4: getConflictMembers

 public function getConflictMembers($time_from, $time_to, $members, $id = null)
 {
     $conflictMembers = array();
     $membersArr = explode(',', $members);
     $cond = "state = 0\n                and ((time_from >= '" . $time_from . "' and time_from <= '" . $time_to . "')\n                or (time_to >= '" . $time_from . "' and time_to <= '" . $time_to . "')\n                or (time_from >= '" . $time_from . "' and time_to <= '" . $time_to . "'))";
     if ($id) {
         $cond .= " and id != " . $id;
     }
     $res = $this->fetchAll($cond);
     if ($res->count() > 0) {
         $user = new Application_Model_User();
         $data = $res->toArray();
         foreach ($data as $d) {
             $membersAddedArr = explode(',', $d['members']);
             foreach ($membersAddedArr as $m) {
                 if (in_array($m, $membersArr) && !in_array($m, $conflictMembers)) {
                     $memberInfo = $user->getEmployeeInfoById($m);
                     array_push($conflictMembers, $memberInfo['cname'] . ': ' . $d['time_from'] . ' - ' . $d['time_to']);
                 }
             }
         }
     }
     return $conflictMembers;
 }
开发者ID:xindalu,项目名称:evolve,代码行数:24,代码来源:Meeting.php

示例5: newAction

 public function newAction()
 {
     $result = array('success' => true, 'info' => '提交成功');
     $request = $this->getRequest()->getParams();
     $operate = isset($request['operate']) && $request['operate'] != '' ? $request['operate'] : null;
     $id = isset($request['id']) && $request['id'] != '' ? $request['id'] : null;
     $moderator = isset($request['moderator']) && $request['moderator'] != '' ? $request['moderator'] : null;
     $subject = isset($request['subject']) && $request['subject'] != '' ? $request['subject'] : null;
     $room_id = isset($request['room_id']) && $request['room_id'] != '' ? $request['room_id'] : null;
     $time_from = isset($request['time_from']) && $request['time_from'] != '' ? $request['time_from'] : null;
     $time_to = isset($request['time_to']) && $request['time_to'] != '' ? $request['time_to'] : null;
     $members = isset($request['members_id']) && $request['members_id'] != '' ? $request['members_id'] : null;
     $remark = isset($request['remark']) && $request['remark'] != '' ? $request['remark'] : null;
     if ($subject && $members && $operate && $moderator && $time_from && $time_to) {
         $meeting = new Res_Model_Meeting();
         $user = new Application_Model_User();
         if ($meeting->checkMeetingConflict($room_id, $time_from, $time_to, $id)) {
             $result['success'] = false;
             $result['info'] = '会议室预定冲突,请重新选择会议室!';
         } else {
             // 检查成员会议时间冲突
             $membersAdded = $meeting->getConflictMembers($time_from, $time_to, $members, $id);
             if (count($membersAdded) > 0) {
                 $result['success'] = false;
                 $result['info'] = '会议时间冲突!<br>' . implode('<br>', $membersAdded);
             } else {
                 $now = date('Y-m-d H:i:s');
                 $user_session = new Zend_Session_Namespace('user');
                 $user_id = $user_session->user_info['user_id'];
                 $membersArr = explode(',', $members);
                 $membersCnameArr = array();
                 $membersEnameArr = array();
                 foreach ($membersArr as $m) {
                     $memberInfo = $user->getEmployeeInfoById($m);
                     array_push($membersCnameArr, $memberInfo['cname']);
                     array_push($membersEnameArr, $memberInfo['ename']);
                 }
                 $data = array('state' => 0, 'room_id' => $room_id, 'subject' => $subject, 'moderator' => $moderator, 'time_from' => $time_from, 'time_to' => $time_to, 'members' => $members, 'members_cname' => implode(',', $membersCnameArr), 'members_ename' => implode(',', $membersEnameArr), 'remark' => $remark, 'update_user' => $user_id, 'update_time' => $now);
                 if ($operate == 'edit') {
                     $type = '更新';
                     $meeting->update($data, "id = " . $id);
                 } else {
                     $type = '新建';
                     $data['number'] = $meeting->getNewNum();
                     $data['create_user'] = $user_id;
                     $data['create_time'] = $now;
                     $id = $meeting->insert($data);
                 }
                 $meetingData = $meeting->getData(null, $id);
                 $mail = new Application_Model_Log_Mail();
                 $moderatorInfo = $user->getEmployeeInfoById($moderator);
                 $mailContent = '<div>会议预定 - ' . $type . ':</div>
                                 <div>
                                 <p><b>预订人:</b>' . $meetingData['updater'] . '</p>
                                 <p><b>会议室:</b>' . $meetingData['room_name'] . '</p>
                                 <p><b>主题:</b>' . $meetingData['subject'] . '</p>
                                 <p><b>时间:</b>' . $meetingData['time_from'] . ' - ' . $meetingData['time_to'] . '</p>
                                 <p><b>主持人:</b>' . $moderatorInfo['cname'] . '</p>
                                 <p><b>参会人员:</b>' . $meetingData['members_cname'] . '</p>
                                 <p><b>备注:</b>' . $meetingData['remark'] . '</p>
                                 </div>';
                 $memberArr = explode(',', $meetingData['members']);
                 array_push($memberArr, $moderator);
                 $toArr = array();
                 foreach ($memberArr as $m) {
                     $memberInfo = $user->getEmployeeInfoById($m);
                     $memberInfo = $user->getEmployeeInfoById($m);
                     array_push($toArr, $memberInfo['email']);
                 }
                 $mailData = array('type' => '消息', 'subject' => '会议预定', 'to' => implode(',', $toArr), 'cc' => $user_session->user_info['user_email'], 'user_id' => $meetingData['create_user'], 'content' => $mailContent, 'add_date' => $now);
                 try {
                     // 记录邮件日志并发送邮件
                     $mail->insert($mailData);
                     $mail->send($mail->insert($mailData));
                 } catch (Exception $e) {
                     $result['success'] = false;
                     $result['info'] = $e->getMessage();
                 }
             }
         }
     } else {
         $result['success'] = false;
         $result['info'] = '参数错误';
     }
     echo Zend_Json::encode($result);
     exit;
 }
开发者ID:xindalu,项目名称:evolve,代码行数:87,代码来源:MeetingController.php

示例6: reviewAction

 public function reviewAction()
 {
     // 返回值数组
     $result = array('success' => true, 'info' => '审核成功');
     $request = $this->getRequest()->getParams();
     $review_id = isset($request['review_id']) ? $request['review_id'] : null;
     //$review_type_id = isset($request['review_type_id']) ? $request['review_type_id'] : null;
     $review_operate = isset($request['review_operate']) ? $request['review_operate'] : null;
     $review_current_step = isset($request['review_current_step']) ? $request['review_current_step'] : null;
     // 当前阶段(review表ID)
     $review_last_step = isset($request['review_last_step']) ? $request['review_last_step'] : null;
     // 是否当前阶段为最后一阶段
     $review_to_finish = isset($request['review_to_finish']) ? $request['review_to_finish'] : null;
     // 是否批准后当前阶段结束
     $review_next_step = isset($request['review_next_step']) ? $request['review_next_step'] : null;
     // 下一阶段(review表ID)
     $review_remark = isset($request['review_remark']) ? $request['review_remark'] : null;
     $review_transfer_user = isset($request['review_transfer_user']) ? $request['review_transfer_user'] : null;
     //转审人
     $review_transfer = $request['review_transfer'] == 1 ? true : false;
     if ($review_id && $review_operate) {
         $transfer = new Erp_Model_Purchse_Transfer();
         $now = date('Y-m-d H:i:s');
         $user_session = new Zend_Session_Namespace('user');
         $user_id = $user_session->user_info['user_id'];
         $employee_id = $user_session->user_info['employee_id'];
         // 评审意见
         $review_info = '意见: ' . $review_remark;
         $req = new Erp_Model_Purchse_Req();
         $user = new Application_Model_User();
         $review = new Dcc_Model_Review();
         $employee = new Hra_Model_Employee();
         $reqData = $req->getData(null, $review_id);
         // 更新审核状态及审核意见
         if ($review_operate == 'transfer') {
             // 转审
             $review_info = $reqData['review_info'] . '<br>' . $now . ': ' . $user_session->user_info['user_name'] . ' [审核-转审] [' . $review_info . ']';
             $req->update(array('review_info' => $review_info), "id = " . $review_id);
             $reviewState = $review->fetchRow("type = 'purchse_req_add' and finish_flg = 0 and file_id = " . $review_id, "id")->toArray();
             // 转审对象
             $transferUserInfo = $user->getEmployeeInfoById($review_transfer_user);
             $reviewUsers = $reviewState['plan_user'];
             $reviewUserArr = explode(',', $reviewUsers);
             $reviewer = array();
             if ($reviewState['method'] == 2) {
                 // 任意: 直接替换审核人为转审对象
                 foreach ($reviewUserArr as $review_user) {
                     if ($review_user == $employee_id) {
                         array_push($reviewer, $transferUserInfo['id']);
                     }
                 }
             } else {
                 // 全部: 替换当前审核人为转审对象,其余审核人保留
                 foreach ($reviewUserArr as $review_user) {
                     if ($review_user == $employee_id) {
                         array_push($reviewer, $transferUserInfo['id']);
                     } else {
                         if (!in_array($review_user, $reviewer)) {
                             array_push($reviewer, $review_user);
                         }
                     }
                 }
             }
             $reviewerstr = implode(',', $reviewer);
             $review->update(array('plan_user' => $reviewerstr), "id = " . $reviewState['id']);
             // 发送邮件通知制单人
             $reviewResult = '<font style="color: #FF0000"><b>转审</b></font>';
             $mail = new Application_Model_Log_Mail();
             $to = $transferUserInfo['email'];
             $mailContent = '<div>采购申请审核:</div>
                             <div>
                             <p><b>审核人:</b>' . $user_session->user_info['user_name'] . '</p>
                             <p><b>审核结果:</b>' . $reviewResult . '</p>
                             <p><b>审核意见:</b>' . $review_remark . '</p>
                             <p><b>申请单号:</b>' . $reqData['number'] . '</p>
                             <p><b>申请部门:</b>' . $reqData['dept'] . '</p>
                             <p><b>申请人:</b>' . $reqData['apply_user_name'] . '</p>
                             <p><b>制单人:</b>' . $reqData['creater'] . '</p>
                             <p><b>类别:</b>' . $reqData['type'] . '</p>
                             <p><b>事由:</b>' . $reqData['reason'] . '</p>
                             <p><b>金额:</b><a style="color: #467500;font-weight: bold;">¥' . round($reqData['total'], 2) . '</a></p>
                             <p><b>备注:</b>' . $reqData['remark'] . '</p>
                             <p><b>制单时间:</b>' . $reqData['create_time'] . '</p>
                             <p><b>更新时间:</b>' . $reqData['update_time'] . '</p>
                             <hr>
                             <p><b>审核日志:</b></p><p>' . $reqData['review_info'] . '</p>
                             </div>';
             $mailData = array('type' => '消息', 'subject' => '采购申请-转审', 'to' => $to, 'cc' => $user_session->user_info['user_email'], 'user_id' => $user_session->user_info['user_id'], 'content' => $mailContent, 'add_date' => $now);
             try {
                 // 记录邮件日志并发送邮件
                 $mail->send($mail->insert($mailData));
             } catch (Exception $e) {
                 $result['success'] = false;
                 $result['info'] = $e->getMessage();
             }
         } else {
             if ($review_operate == 'no') {
                 // 更新采购申请状态
                 $review_info = $now . ': ' . $user_session->user_info['user_name'] . ' [审核-拒绝] [' . $review_info . ']';
                 $data = array('state' => 1, 'transfer_description' => null, 'review_info' => $reqData['review_info'] . '<br>' . $review_info);
//.........这里部分代码省略.........
开发者ID:xindalu,项目名称:evolve,代码行数:101,代码来源:ReqController.php

示例7: overtimeAction

 public function overtimeAction()
 {
     // 返回值数组
     $result = array('success' => true, 'info' => '提交成功');
     // 请求参数
     $request = $this->getRequest()->getParams();
     // 操作类型
     $operate = array('new' => '新建', 'edit' => '编辑', 'delete' => '删除');
     // 操作类别(新建、更新、删除)
     $operate_type = isset($request['operate']) ? $request['operate'] : '';
     $overtime = new Hra_Model_Attendance_Overtime();
     if ($operate_type == 'new_hra' || $operate_type == 'new' || $operate_type == 'edit') {
         $time_from = str_replace('T', ' ', $request['time_from']);
         $time_to = str_replace('T', ' ', $request['time_to']);
         if (date('Y-m', strtotime($time_from)) != date('Y-m', strtotime($time_to))) {
             $result['success'] = false;
             $request['info'] = '不允许跨月申请,请重新填写时间!';
             echo Zend_Json::encode($result);
             exit;
         }
         // 获取加班人员的用工形式(0:弹性,1:非弹性)
         $user = new Application_Model_User();
         $userInfo = $user->getEmployeeInfoById($request['apply_user']);
         $userType = $userInfo['employment_type'];
         $workday = new Hra_Model_Workday();
         // 获取请假区间包含的工作日天数
         $overtimeInfo = $workday->getOvertimeQtyByTimeRange($userType, $request['time_from'], $request['time_to']);
         $overtimeQty = $overtimeInfo['qty'];
         $overtimeQty_hours = $overtimeInfo['qty_hours'];
         /* echo $overtimeQty;
            exit; */
         // 加班类别按起始日期获取
         $overtimeType = $workday->getWorkdayType($userType, date('Y-m-d', strtotime($request['time_from'])));
         if ($overtimeType == 0) {
             $result['success'] = false;
             $request['info'] = '工作日设置错误,请检查工作日设置!';
             echo Zend_Json::encode($result);
             exit;
         }
         // 当编辑请假申请时,检查时间是否重叠需要过滤当前加班申请ID
         $filter_id = null;
         if ($operate_type == 'edit') {
             $filter_id = $request['id'];
         }
         // 检查加班时间范围是否正确
         if ($overtimeQty > 0) {
             // 检查加班时间范围是否跟已有申请(包括已审核和审核中的申请)重叠
             if ($overtime->checkTimeOverlap($request['apply_user'], $request['time_from'], $request['time_to'], $filter_id)) {
                 $result['success'] = false;
                 $result['info'] = '时间设置错误,加班时间重叠,请优先处理未审申请。';
             } else {
                 $now = date('Y-m-d H:i:s');
                 $user_session = new Zend_Session_Namespace('user');
                 $user_id = $user_session->user_info['user_id'];
                 // 当前申请为代申请时,获取申请人真实部门主管
                 if ($request['apply_user'] != $user_id) {
                     // 获取部门主管
                     $manager = $user->getManagerUser($request['apply_user']);
                     $request['review_user_1'] = $manager[0]['id'];
                 }
                 if ($request['review_user_1'] >= 0) {
                     $data = array('type' => $overtimeType, 'apply_user' => $request['apply_user'], 'review_user_1' => $request['review_user_1'], 'time_from' => $request['time_from'], 'time_to' => $request['time_to'], 'qty' => $overtimeQty, 'qty_hours' => $overtimeQty_hours, 'reason' => $request['reason'], 'remark' => $request['remark'], 'update_time' => $now, 'update_user' => $user_id);
                     /* echo '<pre>';
                        print_r($data);
                        exit; */
                     if ($operate_type == 'new_hra') {
                         // HRA手动添加
                         $data['state'] = 3;
                         $data['create_time'] = $now;
                         $data['create_user'] = $user_id;
                         $data['review_info'] = $now . ': ' . $user_session->user_info['user_name'] . ' [手动添加]';
                         try {
                             $overtime_id = $overtime->insert($data);
                             echo Zend_Json::encode($result);
                             exit;
                         } catch (Exception $e) {
                             $result['success'] = false;
                             $result['info'] = $e->getMessage();
                         }
                     } else {
                         if ($operate_type == 'new') {
                             $data['create_time'] = $now;
                             $data['create_user'] = $user_id;
                             $data['review_info'] = $now . ': ' . $user_session->user_info['user_name'] . ' [新建]';
                             try {
                                 $overtime_id = $overtime->insert($data);
                             } catch (Exception $e) {
                                 $result['success'] = false;
                                 $result['info'] = $e->getMessage();
                             }
                         } else {
                             $overtime_id = $request['id'];
                             $review_info = $now . ': ' . $user_session->user_info['user_name'] . ' [修改]';
                             $overtimeData = $overtime->getData(null, $overtime_id);
                             $data['review_info'] = $overtimeData['review_info'] . '<br>' . $review_info;
                             $data['state'] = 0;
                             $data['review_time_1'] = null;
                             //$data['review_time_2'] = null;
                             $data['release_time'] = null;
                             try {
//.........这里部分代码省略.........
开发者ID:xindalu,项目名称:evolve,代码行数:101,代码来源:AttendanceController.php

示例8: reviewAction

 public function reviewAction()
 {
     // 返回值数组
     $result = array('success' => true, 'info' => '审核成功');
     $request = $this->getRequest()->getParams();
     $review_id = isset($request['review_id']) ? $request['review_id'] : null;
     $review_operate = isset($request['review_operate']) ? $request['review_operate'] : null;
     $review_current_step = isset($request['review_current_step']) ? $request['review_current_step'] : null;
     // 当前阶段(review表ID)
     $review_last_step = isset($request['review_last_step']) ? $request['review_last_step'] : null;
     // 是否当前阶段为最后一阶段
     $review_to_finish = isset($request['review_to_finish']) ? $request['review_to_finish'] : null;
     // 是否批准后当前阶段结束
     $review_next_step = isset($request['review_next_step']) ? $request['review_next_step'] : null;
     // 下一阶段(review表ID)
     $review_remark = isset($request['review_remark']) ? $request['review_remark'] : null;
     $review_transfer_user = isset($request['review_transfer_user']) ? $request['review_transfer_user'] : null;
     //转审人
     if ($review_id && $review_operate) {
         $now = date('Y-m-d H:i:s');
         $user_session = new Zend_Session_Namespace('user');
         $user_id = $user_session->user_info['user_id'];
         $employee_id = $user_session->user_info['employee_id'];
         // 评审意见
         $review_info = '意见: ' . $review_remark;
         $price = new Erp_Model_Sale_Price();
         $user = new Application_Model_User();
         $review = new Dcc_Model_Review();
         $employee = new Hra_Model_Employee();
         $priceData = $price->getData(null, $review_id);
         // 更新审核状态及审核意见
         if ($review_operate == 'transfer') {
             // 转审
             $tmp = $priceData['review_info'] != '' ? $priceData['review_info'] . '<br>' : '';
             $review_info = $tmp . $now . ': ' . $user_session->user_info['user_name'] . ' [审核-转审] [' . $review_info . ']';
             $price->update(array('review_info' => $review_info), "id = " . $review_id);
             $reviewState = $review->fetchRow("type = 'sale_price_add' and finish_flg = 0 and file_id = " . $review_id, "id")->toArray();
             // 转审对象
             $transferUserInfo = $user->getEmployeeInfoById($review_transfer_user);
             $reviewUsers = $reviewState['plan_user'];
             $reviewUserArr = explode(',', $reviewUsers);
             $reviewer = array();
             if ($reviewState['method'] == 2) {
                 // 任意: 直接替换审核人为转审对象
                 foreach ($reviewUserArr as $review_user) {
                     if ($review_user == $employee_id) {
                         array_push($reviewer, $transferUserInfo['id']);
                     }
                 }
             } else {
                 // 全部: 替换当前审核人为转审对象,其余审核人保留
                 foreach ($reviewUserArr as $review_user) {
                     if ($review_user == $employee_id) {
                         array_push($reviewer, $transferUserInfo['id']);
                     } else {
                         if (!in_array($review_user, $reviewer)) {
                             array_push($reviewer, $review_user);
                         }
                     }
                 }
             }
             $reviewerstr = implode(',', $reviewer);
             $review->update(array('plan_user' => $reviewerstr), "id = " . $reviewState['id']);
             // 发送邮件通知制单人
             $reviewResult = '<font style="color: #FF0000"><b>转审</b></font>';
             $mail = new Application_Model_Log_Mail();
             $to = $transferUserInfo['email'];
             $mailContent = '<div>销售价格申请审核:</div>
                             <div>
                             <p><b>审核人:</b>' . $user_session->user_info['user_name'] . '</p>
                             <p><b>审核结果:</b>' . $reviewResult . '</p>
                             <p><b>审核意见:</b>' . $review_remark . '</p>
                             <p><b>申请单号:</b>' . $priceData['number'] . '</p>
                             <p><b>申请人:</b>' . $priceData['creater'] . '</p>
                             <p><b>描述:</b>' . $priceData['description'] . '</p>
                             <p><b>备注:</b>' . $priceData['remark'] . '</p>
                             <hr>
                             <p><b>审核日志:</b></p><p>' . $priceData['review_info'] . '</p>
                             </div>';
             $mailData = array('type' => '消息', 'subject' => '销售价格申请-转审', 'to' => $to, 'cc' => $user_session->user_info['user_email'], 'user_id' => $user_session->user_info['user_id'], 'content' => $mailContent, 'add_date' => $now);
             try {
                 // 记录邮件日志并发送邮件
                 $mail->send($mail->insert($mailData));
             } catch (Exception $e) {
                 $result['success'] = false;
                 $result['info'] = $e->getMessage();
             }
         } else {
             if ($review_operate == 'no') {
                 // 更新申请状态
                 $review_info = $now . ': ' . $user_session->user_info['user_name'] . ' [审核-拒绝] [' . $review_info . ']';
                 $tmp = $priceData['review_info'] != '' ? $priceData['review_info'] . '<br>' : '';
                 $data = array('state' => 1, 'review_info' => $tmp . $review_info);
                 $price->update($data, "id = " . $review_id);
                 // 删除当前申请的审核配置
                 $review->delete("type = 'sale_price_add' and file_id = " . $review_id);
                 // 发送邮件通知制单人
                 $reviewResult = '<font style="color: #FF0000"><b>拒绝</b></font>';
                 $mail = new Application_Model_Log_Mail();
                 $applyEmployeeData = $user->fetchRow("id = " . $priceData['create_user'])->toArray();
//.........这里部分代码省略.........
开发者ID:xindalu,项目名称:evolve,代码行数:101,代码来源:PriceController.php

示例9: savepasswordAction

 public function savepasswordAction()
 {
     // 返回值数组
     $result = array('success' => true, 'info' => '修改密码成功');
     $request = $this->getRequest()->getParams();
     $user_id = isset($request['user_id']) ? $request['user_id'] : null;
     $key = isset($request['key']) ? $request['key'] : null;
     $pwd = isset($request['pwd1']) ? $request['pwd1'] : null;
     // 检查输入
     if ($user_id && $pwd) {
         $user = new Application_Model_User();
         $employeeInfo = $user->getEmployeeInfoById($user_id);
         $pwd = md5($employeeInfo['number'] . $pwd);
         try {
             $user->update(array('password' => $pwd), "id = " . $user_id);
             // 当检查到key,更新重置密码邮件key
             if ($key) {
                 $mail = new Application_Model_Log_Mail();
                 try {
                     $mail->clearKey($key);
                 } catch (Exception $e) {
                     $result['success'] = false;
                     $result['info'] = $e->getMessage();
                     echo Zend_Json::encode($result);
                     exit;
                 }
             }
         } catch (Exception $e) {
             $result['success'] = false;
             $result['info'] = $e->getMessage();
             echo Zend_Json::encode($result);
             exit;
         }
     } else {
         $result['success'] = false;
         $result['info'] = '输入错误,请重新输入!';
     }
     echo Zend_Json::encode($result);
     exit;
 }
开发者ID:xindalu,项目名称:evolve,代码行数:40,代码来源:LoginController.php


注:本文中的Application_Model_User::getEmployeeInfoById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。