Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | <?php |
| 2 | /* |
||
| 3 | * Paging |
||
| 4 | */ |
||
| 5 | |||
| 6 | $iTotalRecords = 178; |
||
| 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("success" => "Pending"), |
||
| 20 | array("info" => "Closed"), |
||
| 21 | array("danger" => "On Hold"), |
||
| 22 | array("warning" => "Fraud") |
||
| 23 | ); |
||
| 24 | |||
| 25 | for($i = $iDisplayStart; $i < $end; $i++) { |
||
| 26 | $status = $status_list[rand(0, 2)]; |
||
| 27 | $id = ($i + 1); |
||
| 28 | $records["data"][] = array( |
||
| 29 | '<label class="mt-checkbox mt-checkbox-single mt-checkbox-outline"><input name="id[]" type="checkbox" class="checkboxes" value="'.$id.'"/><span></span></label>', |
||
| 30 | $id, |
||
| 31 | '12/09/2013', |
||
| 32 | 'Jhon Doe', |
||
| 33 | 'Jhon Doe', |
||
| 34 | '450.60$', |
||
| 35 | rand(1, 10), |
||
| 36 | '<span class="label label-sm label-'.(key($status)).'">'.(current($status)).'</span>', |
||
| 37 | '<a href="javascript:;" class="btn btn-sm btn-outline grey-salsa"><i class="fa fa-search"></i> View</a>', |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | |||
| 41 | if (isset($_REQUEST["customActionType"]) && $_REQUEST["customActionType"] == "group_action") { |
||
| 42 | $records["customActionStatus"] = "OK"; // pass custom message(useful for getting status of group actions) |
||
| 43 | $records["customActionMessage"] = "Group action successfully has been completed. Well done!"; // pass custom message(useful for getting status of group actions) |
||
| 44 | } |
||
| 45 | |||
| 46 | $records["draw"] = $sEcho; |
||
| 47 | $records["recordsTotal"] = $iTotalRecords; |
||
| 48 | $records["recordsFiltered"] = $iTotalRecords; |
||
| 49 | |||
| 50 | echo json_encode($records); |
||
| 51 | ?> |