Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | <?php |
| 2 | /* |
||
| 3 | * Paging |
||
| 4 | */ |
||
| 5 | |||
| 6 | //var_dump($_POST["selected"]); |
||
| 7 | |||
| 8 | |||
| 9 | $iTotalRecords = 23; |
||
| 10 | $iDisplayLength = intval($_REQUEST['length']); |
||
| 11 | $iDisplayLength = $iDisplayLength < 0 ? $iTotalRecords : $iDisplayLength; |
||
| 12 | $iDisplayStart = intval($_REQUEST['start']); |
||
| 13 | $sEcho = intval($_REQUEST['draw']); |
||
| 14 | |||
| 15 | $records = array(); |
||
| 16 | $records["data"] = array(); |
||
| 17 | |||
| 18 | $end = $iDisplayStart + $iDisplayLength; |
||
| 19 | $end = $end > $iTotalRecords ? $iTotalRecords : $end; |
||
| 20 | |||
| 21 | $status_list = array( |
||
| 22 | array("info" => "Pending"), |
||
| 23 | array("success" => "Paid"), |
||
| 24 | array("danger" => "Canceled") |
||
| 25 | ); |
||
| 26 | |||
| 27 | for($i = $iDisplayStart; $i < $end; $i++) { |
||
| 28 | $status = $status_list[rand(0, 2)]; |
||
| 29 | $id = ($i + 1); |
||
| 30 | $records["data"][] = array( |
||
| 31 | '<input type="checkbox" name="id[]" value="'.$id.'">', |
||
| 32 | $id, |
||
| 33 | 'Test Customer', |
||
| 34 | '12/09/2013', |
||
| 35 | '234$', |
||
| 36 | '<span class="label label-sm label-'.(key($status)).'">'.(current($status)).'</span>', |
||
| 37 | '<a href="javascript:;" class="btn btn-xs default btn-editable"><i class="fa fa-print"></i> Print</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 | ?> |