fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7210] bkbooking: updated filter function on some lis


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [7210] bkbooking: updated filter function on some lists and some minor bugfixes
Date: Mon, 11 Apr 2011 13:44:45 +0000

Revision: 7210
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7210
Author:   kjell
Date:     2011-04-11 13:44:45 +0000 (Mon, 11 Apr 2011)
Log Message:
-----------
bkbooking: updated filter function on some lists and some minor bugfixes

Modified Paths:
--------------
    trunk/booking/inc/class.soevent.inc.php

Modified: trunk/booking/inc/class.soevent.inc.php
===================================================================
--- trunk/booking/inc/class.soevent.inc.php     2011-04-11 13:42:35 UTC (rev 
7209)
+++ trunk/booking/inc/class.soevent.inc.php     2011-04-11 13:44:45 UTC (rev 
7210)
@@ -8,6 +8,7 @@
                        parent::__construct('bb_event', 
                                array(
                                        'id'            => array('type' => 
'int'),
+                    'id_string' => array('type' => 'string', 'required' => 
false, 'default' => '0', 'query' => true),
                                        'active'        => array('type' => 
'int', 'required' => true),
                                        'activity_id'   => array('type' => 
'int', 'required' => true),
                                        'application_id'        => array('type' 
=> 'int', 'required' => false),
@@ -247,4 +248,59 @@
                        $sql = "UPDATE $table_name SET completed = 1 WHERE 
{$table_name}.id IN ($ids);";
                        $db->query($sql, __LINE__, __FILE__);
                }
+
+               public function update_id_string() {
+                       $table_name = $this->table_name;
+                       $db = $this->db;
+                       $sql = "UPDATE $table_name SET id_string = cast(id AS 
varchar)";
+                       $db->query($sql, __LINE__, __FILE__);
+               }
+
+               function get_building($id)
+               {
+                       $this->db->limit_query("SELECT name FROM bb_building 
where id=" . intval($id), 0, __LINE__, __FILE__, 1);
+                       if(!$this->db->next_record())
+                       {
+                               return False;
+                       }
+                       return $this->db->f('name', false);
+               }
+
+               function get_buildings()
+               {
+            $results = array();
+                       $results[] = array('id' =>  0,'name' => lang('Not 
selected'));
+                       $this->db->query("SELECT id, name FROM bb_building 
WHERE active != 0 ORDER BY name ASC", __LINE__, __FILE__);
+                       while ($this->db->next_record())
+                       {
+                               $results[] = array('id' => $this->db->f('id', 
false),
+                                                          'name' => 
$this->db->f('name', false));
+                       }
+                       return $results;
+               }
+
+        function get_activities_main_level()
+        {
+                   $results = array();
+                       $results[]  = array('id' =>0,'name' => lang('Not 
selected'));
+                       $this->db->query("SELECT id,name FROM bb_activity WHERE 
parent_id is NULL", __LINE__, __FILE__);
+                       while ($this->db->next_record())
+                       {
+                               $results[] = array('id' => $this->db->f('id', 
false), 'name' => $this->db->f('name', false));
+                       }
+                       return $results;
+
+        }
+        function get_activities($id)
+        {
+                       $results = array();
+                       $this->db->query("select id from bb_activity where id = 
($id) or  parent_id = ($id) or parent_id in (select id from bb_activity where 
parent_id = ($id))", __LINE__, __FILE__);
+                       while ($this->db->next_record())
+                       {
+                               $results[] = 
$this->_unmarshal($this->db->f('id', false), 'int');
+                       }
+                       return $results;
+
+        }
+
        }




reply via email to

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