RestoreController.php 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. session_start(); // starts new or resumes existing session
  3. Doo::loadModelAt('auser', 'admin');
  4. Doo::loadModelAt('ausers', 'admin');
  5. Doo::loadModelAt('ameasure', 'admin');
  6. Doo::loadModelAt('fileup', 'admin');
  7. Doo::loadModelAt('measureaudit', 'admin');
  8. Doo::loadModelAt('numofper', 'admin');
  9. Doo::loadModel('users');
  10. Doo::loadClass('profile');
  11. Doo::loadClass('PasswordHash');
  12. Doo::loadClass('mailer');
  13. /*
  14. * To change this license header, choose License Headers in Project Properties.
  15. * To change this template file, choose Tools | Templates
  16. * and open the template in the editor.
  17. */
  18. // 列表停用 编辑 重置密码
  19. // 管理员权限管理
  20. // 管理员修改密码
  21. class RestoreController extends DooController {
  22. private $data, $users, $user, $profile, $ph, $userz, $mailer;
  23. public function beforeRun($resource, $action) {
  24. if (!isset($_SESSION['auid'])) {
  25. return Doo::conf()->APP_URL . 'manage';
  26. }
  27. }
  28. public function __construct() {
  29. $this->users = new AUsers();
  30. $this->user = new AUser();
  31. $this->userz = new Users();
  32. $this->profile = new Profile();
  33. $this->mailer = new Mailer();
  34. $this->ph = new PasswordHash(8, FALSE);
  35. $this->am = new Ameasure();
  36. $this->ama = new AmeasureAudit();
  37. $this->af = new Afileup();
  38. $this->an = new Anumofper();
  39. $this->data['rootUrl'] = Doo::conf()->APP_URL;
  40. }
  41. function restoreList() {
  42. $mArray = $this->am->getRowAll();
  43. $this->data['userlist'] = $mArray;
  44. $this->render('admin-restore', $this->data, TRUE);
  45. }
  46. function restoreRedo() {
  47. /**
  48. * 存在最新的审批人员列表与最新一期的提交数据不匹配 与其数不匹配问题 (添加判断机制)
  49. * 最新一次不显示单选按钮
  50. * 接口是否也可以更改为当期数数据存在的情况下才显示最新的审批人列表 显示当前期最新的审批人员列表可以这么改
  51. * 更新全部参与项目是否可以这么修改?哦,应该可以上述问题修改之后,那就可以按照如果不存在这一期数据就返回上一期或者次数数据
  52. */
  53. $measureArray = $this->am->getOne(array('where' => 'pmid=?', 'param' => array($this->params['pmid']), 'asArray' => TRUE));
  54. $numofperArray = $this->an->find(array('where' => 'pmid=?', 'param' => array($this->params['pmid']), 'groupby' => 'numpname', 'asArray' => TRUE));
  55. foreach ($numofperArray as $key => $value) {
  56. $tmp = $this->getMaxRowStatus($value['pmid'], $value['numpname']);
  57. $dd = $this->ama->find(array('where' => 'pmid=? and numpname=? and times=?', 'param' => array($value['pmid'], $value['numpname'], $tmp['times']), 'asArray' => TRUE));
  58. }
  59. var_dump($dd);
  60. $this->data['measurearray'] = $measureArray;
  61. $this->data['numofperArray'] = $numofperArray;
  62. $this->render('admin-restore-list', $this->data, TRUE);
  63. }
  64. public function getMaxRowStatus($pmid, $numpname) {
  65. return $this->an->getOne(array('where' => 'pmid=? and numpname=?', 'param' => array($pmid, $numpname), 'desc' => 'times', 'asArray' => TRUE));
  66. }
  67. }