Manage.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. namespace Content\Lib;
  3. use Dever;
  4. class Manage
  5. {
  6. public function showPic($id)
  7. {
  8. $info = Dever::db('content/pic')->find($id);
  9. if ($info && $info['pic']) {
  10. $table[] = '<img src="'.$info['pic'].'" width="150" />';
  11. return Dever::table($table);
  12. }
  13. return '';
  14. }
  15. public function upPic($id, $name, $data)
  16. {
  17. $type = Dever::param('type', $data);
  18. $act_id = Dever::param('act_id', $data);
  19. $pic = Dever::param('pic', $data);
  20. if ($pic) {
  21. if (is_string($pic)) {
  22. $pic = explode(',', $pic);
  23. }
  24. $insert['type'] = $type;
  25. $insert['act_id'] = $act_id;
  26. foreach($pic as $k => $v) {
  27. $insert['pic'] = $v;
  28. Dever::load('content/pic')->insert($insert);
  29. }
  30. }
  31. }
  32. public function baoming()
  33. {
  34. $id = Dever::input('baoming_id');
  35. $order_db = Dever::db('content/baoming');
  36. $order = $order_db->one($id);
  37. $order['config'] = $order_db->config['set'];
  38. $content = array();
  39. $content[0][] = array('当前状态', Dever::status($order['config']['status'], $order['status']));
  40. $content[0][] = array('报名时间', date('Y-m-d H:i', $order['cdate']));
  41. if (isset($order['audit_admin']) && $order['audit_admin']) {
  42. $admin = Dever::db('manage/admin')->find($order['audit_admin']);
  43. $content[1][] = array
  44. (
  45. array('审核人', $admin['username']),
  46. array('审核状态', Dever::status($order['config']['audit'], $order['audit'])),
  47. array('审核备注', $order['audit_desc']),
  48. );
  49. }
  50. $result = array();
  51. $result['基本信息'] = array
  52. (
  53. 'type' => 'info',
  54. 'content' => $content,
  55. );
  56. $head = array
  57. (
  58. 'name' => '基本信息',
  59. 'btn' => $this->show_button($order, $order_table),
  60. );
  61. $html = Dever::show($head, $result);
  62. return $html;
  63. }
  64. # 显示按钮
  65. private function show_button($order, $order_table)
  66. {
  67. $button = array();
  68. if ($order['status'] == 1) {
  69. list($project, $table) = explode('/', $order_table);
  70. $url = Dever::url('project/database/update?project='.$project.'&table='.$table.'&where_id='.$order['id'].'&col=audit,audit_desc', 'manage');
  71. $button[] = array
  72. (
  73. 'type' => 'edit',
  74. 'link' => $url,
  75. 'name' => '审核',
  76. );
  77. }
  78. return $button;
  79. }
  80. }