phpgroupware-cvs
[Top][All Lists]
Advanced

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

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


From: nomail
Subject: [Phpgroupware-cvs] property/class.solookup.php, 1.1.1.3
Date: Fri, 21 May 2004 15:49:26 -0000

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

date: 2004/04/23 21:26:33;  author: sigurdne;  state: Exp;  lines: +330 -330

Log Message:
no message
=====================================================================
Index: property/class.solookup.php
diff -u property/class.solookup.php:1.1.1.2 property/class.solookup.php:1.1.1.3
--- property/class.solookup.php:1.1.1.2 Fri Apr 23 20:25:52 2004
+++ property/class.solookup.php Fri Apr 23 21:26:33 2004
@@ -1,330 +1,330 @@
-<?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * This program is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU General Public License as published by the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-
-       class property_solookup
-       {
-               var $grants;
-
-               function property_solookup()
-               {
-                       $this->currentapp       = 'property'; 
//$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->db               = $GLOBALS['phpgw']->db;
-                       $this->db2              = $this->db;
-                       $this->account  = $GLOBALS['phpgw_data']['user']['id'];
-                       $this->socommon         = 
CreateObject($this->currentapp.'_socommon');
-
-                       $this->join                     = $this->socommon->join;
-
-
-               }
-
-               function read_addressbook($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 cat_id 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 phpgw_addressbook 
$filtermethod $querymethod";
-
-                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
-                       $this->total_records = $dbresult2->_numOfRows;
-                       $maxmatchs = 15;
-                       $dbresult = $GLOBALS['phpgw']->db->SelectLimit($sql . 
$ordermethod,$maxmatchs,$start);
-
-                       while (!$dbresult->EOF)
-                       {
-                               $vendor[] = array
-                               (
-                                       'id'    => $dbresult->fields['id'],
-                                       'org_name'      => 
$dbresult->fields['org_name'],
-                                       );
-                               $dbresult->MoveNext();
-                       }
-//html_print_r($vendor);
-
-                       return $vendor;
-               }
-
-
-               function read_b_account($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 id DESC';
-                       }
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " where (id LIKE '%$query%' or 
descr LIKE '%$query%')";
-                       }
-
-                       $sql = "SELECT * FROM fm_b_account $querymethod  ";
-
-                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
-                       $this->total_records = $dbresult2->_numOfRows;
-                       $maxmatchs = 15;
-                       $dbresult = $GLOBALS['phpgw']->db->SelectLimit($sql . 
$ordermethod,$maxmatchs,$start);
-
-                       while (!$dbresult->EOF)
-                       {
-                               $b_account[] = array
-                               (
-                                       'id'                    => 
$dbresult->fields['id'],
-                                       'descr' => $dbresult->fields['descr']
-                                       );
-                               $dbresult->MoveNext();
-                       }
-
-                       return $b_account;
-               }
-
-
-               function read_street($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 
fm_streetaddress.descr DESC';
-                       }
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " where ( descr LIKE 
'%$query%')";
-                       }
-
-                       $sql = "SELECT * FROM fm_streetaddress $querymethod  ";
-
-                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
-                       $this->total_records = $dbresult2->_numOfRows;
-                       $maxmatchs = 15;
-                       $dbresult = $GLOBALS['phpgw']->db->SelectLimit($sql . 
$ordermethod,$maxmatchs,$start);
-
-                       while (!$dbresult->EOF)
-                       {
-                               $street[] = array
-                               (
-                                       'id'                    => 
$dbresult->fields['id'],
-                                       'street_name'   => 
$dbresult->fields['descr']
-                                       );
-                               $dbresult->MoveNext();
-                       }
-
-                       return $street;
-               }
-
-               function read_tenant($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 last_name DESC';
-                       }
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " where ( last_name LIKE 
'%$query%' or first_name LIKE '%$query%')";
-                       }
-
-                       $sql = "SELECT * FROM fm_tenant $querymethod  ";
-
-                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
-                       $this->total_records = $dbresult2->_numOfRows;
-                       $maxmatchs = 15;
-                       $dbresult = $GLOBALS['phpgw']->db->SelectLimit($sql . 
$ordermethod,$maxmatchs,$start);
-
-                       while (!$dbresult->EOF)
-                       {
-                               $tenant[] = array
-                               (
-                                       'id'                    => 
$dbresult->fields['tenant_id'],
-                                       'last_name'     => 
$dbresult->fields['last_name'],
-                                       'first_name'    => 
$dbresult->fields['first_name']
-                                       );
-                               $dbresult->MoveNext();
-                       }
-
-                       return $tenant;
-               }
-
-               function read_ns3420($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 tekst1 DESC';
-                       }
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " where ( tekst1 LIKE '%$query%' 
or tekst2 LIKE '%$query%' or tekst3 LIKE '%$query%' or tekst4 LIKE '%$query%' 
or tekst5 LIKE '%$query%' or tekst6 LIKE '%$query%')";
-                       }
-
-                       $sql = "SELECT * FROM fm_ns3420  $querymethod  ";
-
-                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
-                       $this->total_records = $dbresult2->_numOfRows;
-
-                       $maxmatchs = 15;
-                       $dbresult = $GLOBALS['phpgw']->db->SelectLimit($sql . 
$ordermethod,$maxmatchs,$start);
-
-                       while (!$dbresult->EOF)
-                       {
-                               $ns3420[] = array
-                               (
-                                       'id'                    => 
$dbresult->fields['id'],
-                                       'ns3420_descr'  => 
$dbresult->fields['tekst1'] . ' ' .$dbresult->fields['tekst2'] . ' ' 
.$dbresult->fields['tekst3'] . ' ' .$dbresult->fields['tekst4'] . ' ' 
.$dbresult->fields['tekst5'] . ' ' .$dbresult->fields['tekst6']
-                                       );
-                               $dbresult->MoveNext();
-                       }
-
-                       return $ns3420;
-               }
-       }
-?>
+<?php
+       
/**************************************************************************\
+       * phpGroupWare - property                                               
   *
+       * http://www.phpgroupware.org                                           
   *
+       *                                                                       
   *
+       * Facilities Management                                                 
   *
+       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
+       * 
------------------------------------------------------------------------ *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
+       * This program is part of the GNU project, see http://www.gnu.org/      
   *
+       * 
------------------------------------------------------------------------ *
+       * This program is free software; you can redistribute it and/or modify 
it  *
+       * under the terms of the GNU General Public License as published by the 
   *
+       * Free Software Foundation; either version 2 of the License, or (at 
your   *
+       * option) any later version.                                            
   *
+       
\**************************************************************************/
+
+       class property_solookup
+       {
+               var $grants;
+
+               function property_solookup()
+               {
+                       $this->currentapp       = 'property'; 
//$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->db               = $GLOBALS['phpgw']->db;
+                       $this->db2              = $this->db;
+                       $this->account  = $GLOBALS['phpgw_data']['user']['id'];
+                       $this->socommon         = 
CreateObject($this->currentapp.'_socommon');
+
+                       $this->join                     = $this->socommon->join;
+
+
+               }
+
+               function read_addressbook($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 cat_id 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 phpgw_addressbook 
$filtermethod $querymethod";
+
+                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
+                       $this->total_records = $dbresult2->_numOfRows;
+                       $maxmatchs = 15;
+                       $dbresult = $GLOBALS['phpgw']->db->SelectLimit($sql . 
$ordermethod,$maxmatchs,$start);
+
+                       while (!$dbresult->EOF)
+                       {
+                               $vendor[] = array
+                               (
+                                       'id'    => $dbresult->fields['id'],
+                                       'org_name'      => 
$dbresult->fields['org_name'],
+                                       );
+                               $dbresult->MoveNext();
+                       }
+//html_print_r($vendor);
+
+                       return $vendor;
+               }
+
+
+               function read_b_account($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 id DESC';
+                       }
+
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " where (id LIKE '%$query%' or 
descr LIKE '%$query%')";
+                       }
+
+                       $sql = "SELECT * FROM fm_b_account $querymethod  ";
+
+                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
+                       $this->total_records = $dbresult2->_numOfRows;
+                       $maxmatchs = 15;
+                       $dbresult = $GLOBALS['phpgw']->db->SelectLimit($sql . 
$ordermethod,$maxmatchs,$start);
+
+                       while (!$dbresult->EOF)
+                       {
+                               $b_account[] = array
+                               (
+                                       'id'                    => 
$dbresult->fields['id'],
+                                       'descr' => $dbresult->fields['descr']
+                                       );
+                               $dbresult->MoveNext();
+                       }
+
+                       return $b_account;
+               }
+
+
+               function read_street($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 
fm_streetaddress.descr DESC';
+                       }
+
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " where ( descr LIKE 
'%$query%')";
+                       }
+
+                       $sql = "SELECT * FROM fm_streetaddress $querymethod  ";
+
+                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
+                       $this->total_records = $dbresult2->_numOfRows;
+                       $maxmatchs = 15;
+                       $dbresult = $GLOBALS['phpgw']->db->SelectLimit($sql . 
$ordermethod,$maxmatchs,$start);
+
+                       while (!$dbresult->EOF)
+                       {
+                               $street[] = array
+                               (
+                                       'id'                    => 
$dbresult->fields['id'],
+                                       'street_name'   => 
$dbresult->fields['descr']
+                                       );
+                               $dbresult->MoveNext();
+                       }
+
+                       return $street;
+               }
+
+               function read_tenant($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 last_name DESC';
+                       }
+
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " where ( last_name LIKE 
'%$query%' or first_name LIKE '%$query%')";
+                       }
+
+                       $sql = "SELECT * FROM fm_tenant $querymethod  ";
+
+                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
+                       $this->total_records = $dbresult2->_numOfRows;
+                       $maxmatchs = 15;
+                       $dbresult = $GLOBALS['phpgw']->db->SelectLimit($sql . 
$ordermethod,$maxmatchs,$start);
+
+                       while (!$dbresult->EOF)
+                       {
+                               $tenant[] = array
+                               (
+                                       'id'                    => 
$dbresult->fields['tenant_id'],
+                                       'last_name'     => 
$dbresult->fields['last_name'],
+                                       'first_name'    => 
$dbresult->fields['first_name']
+                                       );
+                               $dbresult->MoveNext();
+                       }
+
+                       return $tenant;
+               }
+
+               function read_ns3420($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 tekst1 DESC';
+                       }
+
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " where ( tekst1 LIKE '%$query%' 
or tekst2 LIKE '%$query%' or tekst3 LIKE '%$query%' or tekst4 LIKE '%$query%' 
or tekst5 LIKE '%$query%' or tekst6 LIKE '%$query%')";
+                       }
+
+                       $sql = "SELECT * FROM fm_ns3420  $querymethod  ";
+
+                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
+                       $this->total_records = $dbresult2->_numOfRows;
+
+                       $maxmatchs = 15;
+                       $dbresult = $GLOBALS['phpgw']->db->SelectLimit($sql . 
$ordermethod,$maxmatchs,$start);
+
+                       while (!$dbresult->EOF)
+                       {
+                               $ns3420[] = array
+                               (
+                                       'id'                    => 
$dbresult->fields['id'],
+                                       'ns3420_descr'  => 
$dbresult->fields['tekst1'] . ' ' .$dbresult->fields['tekst2'] . ' ' 
.$dbresult->fields['tekst3'] . ' ' .$dbresult->fields['tekst4'] . ' ' 
.$dbresult->fields['tekst5'] . ' ' .$dbresult->fields['tekst6']
+                                       );
+                               $dbresult->MoveNext();
+                       }
+
+                       return $ns3420;
+               }
+       }
+?>




reply via email to

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