Example #1
0
 function index($ctx)
 {
     $page = $_GET['page'] ? intval($_GET['page']) : 0;
     $size = $_GET['size'] ? intval($_GET['size']) : 15;
     $name = $_GET['name'];
     $ctx->page = $page;
     $ctx->size = $size;
     $where = 1;
     $where .= " and status = '" . Contract::STATUS_NEW . "'";
     if ($name) {
         $name = htmlspecialchars($name);
         $where .= " and name like '%{$name}%'";
     }
     $ctx->ds = Contract::paginate($page, $size, $where);
     $ctx->name = $name;
 }