meetingModel.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. class flow_meetingClassModel extends flowModel
  3. {
  4. public $hyarra, $hyarrb, $dbobj, $reatearr;
  5. public function initModel()
  6. {
  7. $this->hyarra = array('正常','会议中','结束','取消');
  8. $this->hyarrb = array('green','blue','#ff6600','#888888');
  9. $this->dbobj = c('date');
  10. $this->reatearr = array(
  11. 'd' => '每天',
  12. 'w1' => '每周一',
  13. 'w2' => '每周二',
  14. 'w3' => '每周三',
  15. 'w4' => '每周四',
  16. 'w5' => '每周五',
  17. 'w6' => '每周六',
  18. 'w7' => '每周日',
  19. 'm' => '每月',
  20. 'y' => '每年',
  21. );
  22. }
  23. // 初始化单据可替换其他属性,$lx,0默认,1详情展示,2列表显示,3打印页,4外部详情页
  24. public function flowrsreplace($rs, $lx=0)
  25. {
  26. $zt = $rs['state'];
  27. $nzt = $zt;
  28. $time = time();
  29. $stime = strtotime($rs['meeting_time']);
  30. if($zt < 2){
  31. if($stime>$time){
  32. // 开始时间大于当前时间,认为会议开始
  33. $nzt = 0;
  34. } if ($nzt != 2 || $nzt != 3) {
  35. // 状态不是取消、结束,则赋值“正常”
  36. $nzt = 1;
  37. }
  38. }
  39. // 更新数据状态
  40. if($zt != $nzt){
  41. $this->update('state='.$nzt.'', $rs['id']);
  42. $zt = $nzt;
  43. }
  44. // 将id转换为文字
  45. $rs['state'] = $this->getstatezt($zt);
  46. return $rs;
  47. }
  48. public function getstatezt($zt)
  49. {
  50. return '<font color="'.$this->hyarrb[$zt].'">'.$this->hyarra[$zt].'</font>';
  51. }
  52. // $ors当前单据操作信息,$crs提交过来的信息
  53. public function flowoptmenu($ors, $crs)
  54. {
  55. if ($ors['num'] == 'delnoup') {
  56. }
  57. return null;
  58. }
  59. //删除单据时调用
  60. public function flowdeletebill($sm) {
  61. // m('meet_sys')->deleteMeetingRoom($this->rs);
  62. }
  63. //流程全部完成后调用
  64. public function flowcheckfinsh($sm) {
  65. }
  66. //提交时调用
  67. protected function flowsubmit($na, $sm) {
  68. if ($this->id == null) {
  69. return ;
  70. }
  71. }
  72. }