Subversion Repositories Integrator Subversion

Rev

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
  $iTotalRecords = 120;
9
  $iDisplayLength = intval($_REQUEST['length']);
10
  $iDisplayLength = $iDisplayLength < 0 ? $iTotalRecords : $iDisplayLength;
11
  $iDisplayStart = intval($_REQUEST['start']);
12
  $sEcho = intval($_REQUEST['draw']);
13
 
14
  $records = array();
15
  $records["data"] = array();
16
 
17
  $end = $iDisplayStart + $iDisplayLength;
18
  $end = $end > $iTotalRecords ? $iTotalRecords : $end;
19
 
20
  $status_list = array(
21
    array("info" => "Pending"),
22
    array("success" => "Notified"),
23
    array("danger" => "Failed")
24
  );
25
 
26
  for($i = $iDisplayStart; $i < $end; $i++) {
27
    $status = $status_list[rand(0, 2)];
28
    $records["data"][] = array(
29
      '12/09/2013 09:20:45',
30
      'Shipment #1231231232 has been created',    
31
      '<span class="label label-sm label-'.(key($status)).'">'.(current($status)).' <i class="fa fa-check"></i></span>',
32
      '<a href="#" class="btn btn-sm btn-default btn-editable"><i class="fa fa-search"></i> View</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
  // check http://datatables.net/usage/server-side for more info about ajax datatable
46
 
47
  echo json_encode($records);
48
?>