Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | <?php |
| 2 | /* |
||
| 3 | * Paging |
||
| 4 | */ |
||
| 5 | |||
| 6 | $iTotalRecords = 0; |
||
| 7 | $iDisplayLength = intval($_REQUEST['length']); |
||
| 8 | $iDisplayLength = $iDisplayLength < 0 ? $iTotalRecords : $iDisplayLength; |
||
| 9 | $iDisplayStart = intval($_REQUEST['start']); |
||
| 10 | $sEcho = intval($_REQUEST['draw']); |
||
| 11 | |||
| 12 | $records = array(); |
||
| 13 | $records["data"] = array(); |
||
| 14 | |||
| 15 | $end = $iDisplayStart + $iDisplayLength; |
||
| 16 | $end = $end > $iTotalRecords ? $iTotalRecords : $end; |
||
| 17 | |||
| 18 | $status_list = array( |
||
| 19 | array("info" => "Pending"), |
||
| 20 | array("success" => "Paid"), |
||
| 21 | array("danger" => "Canceled") |
||
| 22 | ); |
||
| 23 | |||
| 24 | for($i = $iDisplayStart; $i < $end; $i++) { |
||
| 25 | $status = $status_list[rand(0, 2)]; |
||
| 26 | $id = ($i + 1); |
||
| 27 | $records["data"][] = array( |
||
| 28 | $id, |
||
| 29 | 'Test Customer', |
||
| 30 | '12/09/2013', |
||
| 31 | rand(3,10), |
||
| 32 | '<a href="javascript:;" class="btn btn-xs default btn-editable"><i class="fa fa-print"></i> Print</a>', |
||
| 33 | ); |
||
| 34 | } |
||
| 35 | |||
| 36 | if (isset($_REQUEST["customActionType"]) && $_REQUEST["customActionType"] == "group_action") { |
||
| 37 | $records["customActionStatus"] = "OK"; // pass custom message(useful for getting status of group actions) |
||
| 38 | $records["customActionMessage"] = "Group action successfully has been completed. Well done!"; // pass custom message(useful for getting status of group actions) |
||
| 39 | } |
||
| 40 | |||
| 41 | $records["draw"] = $sEcho; |
||
| 42 | $records["recordsTotal"] = $iTotalRecords; |
||
| 43 | $records["recordsFiltered"] = $iTotalRecords; |
||
| 44 | |||
| 45 | echo json_encode($records); |
||
| 46 | ?> |