Exemplo n.º 1
0
 /**
  * the getList method is used to 
  * pupolate the listing table 
  */
 public function getList($id = "", $pg)
 {
     $purl = array();
     if (isset($_GET['url'])) {
         $purl = $_GET['url'];
         $purl = rtrim($purl);
         $purl = explode('/', $_GET['url']);
     } else {
         $purl = null;
     }
     if (!isset($purl['2'])) {
         $pn = 1;
     } else {
         $pn = $purl['2'];
     }
     global $database;
     $resultEmployee = $database->db_query("SELECT * FROM vendors");
     $pagin = new Pagination();
     //create the pagination object;
     $pagin->nr = $database->dbNumRows($resultEmployee);
     $pagin->itemsPerPage = 20;
     $myitems = Vendor::find_by_sql("SELECT * FROM vendors " . $pagin->pgLimit($pn));
     $index_array = array("vendors" => $myitems, "mypagin" => $pagin->render($pg));
     return $index_array;
     return $index_array;
 }
Exemplo n.º 2
0
 /**
  * this  get an auto complete 
  * method on vendor for the purchase
  * or orther form
  */
 public function vendID_AutoComplete($id = "")
 {
     return Vendor::find_by_sql("SELECT * FROM vendors WHERE vend_id LIKE '%" . $_POST['input'] . "%'");
 }