phpgroupware-cvs
[Top][All Lists]
Advanced

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

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


From: nomail
Subject: [Phpgroupware-cvs] property/inc/class.solocation.inc.php, 1.1.1.3
Date: Tue, 25 May 2004 14:32:28 +0200

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

date: 2004/05/25 12:32:28;  author: sigurdne;  state: Exp;  lines: +79 -0

Log Message:
no message
=====================================================================
Index: property/inc/class.solocation.inc.php
diff -u property/inc/class.solocation.inc.php:1.1.1.2 
property/inc/class.solocation.inc.php:1.1.1.3
--- property/inc/class.solocation.inc.php:1.1.1.2       Tue May 18 17:53:52 2004
+++ property/inc/class.solocation.inc.php       Tue May 25 12:32:28 2004
@@ -1001,5 +1001,84 @@
 
                        return $receipt;
                }
+
+               function read_summary($data='')
+               {
+                       if(is_array($data))
+                       {
+                               $filter = 
(isset($data['filter'])?$data['filter']:0);
+                               $type_id = 
(isset($data['type_id'])?$data['type_id']:'');
+                               $district_id = 
(isset($data['district_id'])?$data['district_id']:'');
+                               $part_of_town_id = 
(isset($data['part_of_town_id'])?$data['part_of_town_id']:'');
+                       }
+
+                       if(!$type_id)
+                       {
+                               $type_id=4;
+                       }
+
+                       $entity_table = 'fm_location' . $type_id ;
+
+                       $cols= "count(*) as number, $entity_table.category, 
$entity_table"."_category.descr as type";
+
+                       $groupmethod = " GROUP by $entity_table.category , 
$entity_table"."_category.descr";
+
+                       $uicols['name'][]       = 'type';
+                       $uicols['descr'][]      = lang('type');
+
+
+                       $where = 'WHERE';
+                       if($district_id>0)
+                       {
+                               $uicols['name'][]       = 'district_id';
+                               $uicols['descr'][]      = lang('district_id');
+                               $cols.=", fm_part_of_town.district_id as 
district_id";
+                               $groupmethod .= " ,fm_part_of_town.district_id";
+                               $filtermethod = " $where 
fm_part_of_town.district_id=$district_id";
+                               $where = 'AND';
+                       }
+
+                       if($part_of_town_id>0)
+                       {
+                               $uicols['name'][]       = 'part_of_town';
+                               $uicols['descr'][]      = lang('part of town');
+                               $groupmethod .= " ,fm_part_of_town.name";
+                               $cols.=", fm_part_of_town.name as part_of_town";
+                               $filtermethod .= " $where 
fm_part_of_town.part_of_town_id=$part_of_town_id";
+                               $where = 'AND';
+                       }
+
+                       if($filter>0)
+                       {
+                               $filtermethod .= " $where 
fm_owner.owner_id=$filter";
+                               $where = 'AND';
+                       }
+
+
+                       $uicols['name'][]       = 'number';
+                       $uicols['descr'][]      = lang('number');
+
+                       $joinmethod= "$this->join $entity_table"."_category on 
$entity_table.category=$entity_table"."_category.id";
+
+                       $sql = 
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'cols_return'=>$cols_return,'cols'=>$cols,
+                                                               
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query,'no_address'=>True,'location_level'=>$type_id));
+
+                       $this->db->query($sql . $filtermethod . $groupmethod . 
" ORDER BY $entity_table.category",__LINE__,__FILE__);
+
+                       while ($this->db->next_record())
+                       {
+                               $summary[]=array(
+                                       'number'                => 
$this->db->f('number'),
+                                       'type'                  => '[' . 
$this->db->f('category') . '] ' .$this->db->f('type'),
+                                       'part_of_town'  => 
$this->db->f('part_of_town'),
+                                       'district_id'   => 
$this->db->f('district_id')
+                                       );
+                       }
+
+
+                       $this->uicols           = $uicols;
+                       return $summary;
+               }
+
        }
 ?>




reply via email to

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