diff --git a/products.php b/products.php
index 21285aab..7238da2d 100644
--- a/products.php
+++ b/products.php
@@ -62,6 +62,7 @@
+
diff --git a/vendors.php b/vendors.php
index 13491d5d..4cc3bd21 100644
--- a/vendors.php
+++ b/vendors.php
@@ -1,22 +1,78 @@
-
+
+ $url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
+
+ if(isset($_GET['p'])){
+ $p = intval($_GET['p']);
+ $record_from = (($p)-1)*10;
+ $record_to = 10;
+ }else{
+ $record_from = 0;
+ $record_to = 10;
+ $p = 1;
+ }
+
+ if(isset($_GET['q'])){
+ $q = $_GET['q'];
+ }else{
+ $q = "";
+ }
+
+ if(!empty($_GET['sb'])){
+ $sb = $_GET['sb'];
+ }else{
+ $sb = "vendor_name";
+ }
+
+ if(isset($_GET['o'])){
+ if($_GET['o'] == 'ASC'){
+ $o = "ASC";
+ $disp = "DESC";
+ }else{
+ $o = "DESC";
+ $disp = "ASC";
+ }
+ }else{
+ $o = "DESC";
+ $disp = "ASC";
+ }
+
+ $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM vendors WHERE client_id = 0
+ AND (vendor_name LIKE '%$q%' OR vendor_description LIKE '%$q%' OR vendor_account_number LIKE '%$q%')
+ ORDER BY $sb $o LIMIT $record_from, $record_to");
+
+ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
+ $total_found_rows = $num_rows[0];
+ $total_pages = ceil($total_found_rows / 10);
+
+ ?>
-