phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] property/inc/class.solookup.inc.php, 1.1.1.3


From: nomail
Subject: [Phpgroupware-cvs] property/inc/class.solookup.inc.php, 1.1.1.3
Date: Sun, 30 May 2004 21:10:31 +0200

Update of /property/inc
Modified Files:
        Branch: 
          class.solookup.inc.php

date: 2004/05/30 19:10:31;  author: sigurdne;  state: Exp;  lines: +65 -0

Log Message:
no message
=====================================================================
Index: property/inc/class.solookup.inc.php
diff -u property/inc/class.solookup.inc.php:1.1.1.2 
property/inc/class.solookup.inc.php:1.1.1.3
--- property/inc/class.solookup.inc.php:1.1.1.2 Tue May 18 17:53:52 2004
+++ property/inc/class.solookup.inc.php Sun May 30 19:10:31 2004
@@ -86,6 +86,71 @@
 
                        while ($this->db->next_record())
                        {
+                               $contact[] = array
+                               (
+                                       'id'    => $this->db->f('id'),
+                                       'org_name'      => 
$this->db->f('org_name'),
+                                       );
+                       }
+//_debug_array($vendor);
+
+                       return $contact;
+               }
+
+               function read_vendor($data)
+               {
+                       if(is_array($data))
+                       {
+                               if ($data['start'])
+                               {
+                                       $start=$data['start'];
+                               }
+                               else
+                               {
+                                       $start=0;
+                               }
+                               $filter = 
(isset($data['filter'])?$data['filter']:'none');
+                               $query = 
(isset($data['query'])?$data['query']:'');
+                               $sort = 
(isset($data['sort'])?$data['sort']:'DESC');
+                               $order = 
(isset($data['order'])?$data['order']:'');
+                               $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
+                       }
+
+
+                       if ($order)
+                       {
+                               $ordermethod = " order by $order $sort";
+                       }
+                       else
+                       {
+                               $ordermethod = ' order by org_name DESC';
+                       }
+
+
+                       $where= 'WHERE';
+
+                       if ($cat_id > 0)
+                       {
+                               $filtermethod .= " $where member_of LIKE 
'%,$cat_id,%' ";
+                               $where= 'AND';
+                       }
+
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " $where (id LIKE '%$query%' or 
org_name LIKE '%$query%')";
+                       }
+
+                       $sql = "SELECT id,org_name FROM fm_vendor $filtermethod 
$querymethod";
+
+                       $this->db2->query($sql,__LINE__,__FILE__);
+                       $this->total_records = $this->db2->num_rows();
+                       $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
+
+                       while ($this->db->next_record())
+                       {
                                $vendor[] = array
                                (
                                        'id'    => $this->db->f('id'),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]