init
Showing
1 changed file
with
13 additions
and
9 deletions
| 1 | <?php | 1 | <?php |
| 2 | defined('BASEPATH') OR exit('No direct script access allowed'); | 2 | defined('BASEPATH') OR exit('No direct script access allowed'); |
| 3 | 3 | ||
| 4 | class Work extends CI_Controller { | 4 | class Work extends CI_Controller |
| 5 | { | ||
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| 7 | * 控制台默认页面 | 8 | * 控制台默认页面 |
| 8 | */ | 9 | */ |
| 9 | public function index($state = null) | 10 | public function index($state = null) |
| 10 | { | 11 | { |
| 11 | switch($state) { | 12 | switch ($state) { |
| 12 | case 1: | 13 | case 1: |
| 13 | $this->load->view('work/待审核'); | 14 | $this->load->view('work/待审核'); |
| 14 | break; | 15 | break; |
| ... | @@ -93,7 +94,7 @@ class Work extends CI_Controller { | ... | @@ -93,7 +94,7 @@ class Work extends CI_Controller { |
| 93 | 94 | ||
| 94 | public function check($state = null) | 95 | public function check($state = null) |
| 95 | { | 96 | { |
| 96 | switch($state) { | 97 | switch ($state) { |
| 97 | case 1: | 98 | case 1: |
| 98 | $this->load->view('work/审批/资料清单'); | 99 | $this->load->view('work/审批/资料清单'); |
| 99 | break; | 100 | break; |
| ... | @@ -203,17 +204,20 @@ class Work extends CI_Controller { | ... | @@ -203,17 +204,20 @@ class Work extends CI_Controller { |
| 203 | 204 | ||
| 204 | public function data() | 205 | public function data() |
| 205 | { | 206 | { |
| 206 | $data['draw'] = $_GET['draw']++; | 207 | $draw = $_GET['draw']; |
| 207 | $data['recordsTotal'] = 57; | 208 | $data['recordsTotal'] = 57; |
| 208 | $data['recordsFiltered'] = 57; | 209 | $data['recordsFiltered'] = 57; |
| 209 | $data['data'] = array(); | 210 | $data['data'] = array(); |
| 210 | for ($i = 0; $i < 57; $i++) { | 211 | for ($i = 0; $i < 57; $i++) { |
| 211 | $arr = array( | 212 | if ($i >= ($draw - 1) && $i < $draw * 10){ |
| 212 | 'id'=>$i, | 213 | $arr = array( |
| 213 | 'name'=>'小明'.$i | 214 | 'id' => $i, |
| 214 | ); | 215 | 'name' => '小明' . $i |
| 215 | $data['data'][] = $arr; | 216 | ); |
| 217 | $data['data'][] = $arr; | ||
| 218 | } | ||
| 216 | } | 219 | } |
| 220 | $data['draw'] = $draw + 1; | ||
| 217 | $this->output->set_content_type('application/json')->set_output(json_encode($data)); | 221 | $this->output->set_content_type('application/json')->set_output(json_encode($data)); |
| 218 | } | 222 | } |
| 219 | } | 223 | } | ... | ... |
-
Please register or sign in to post a comment