phpgroupware-cvs
[Top][All Lists]
Advanced

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

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


From: nomail
Subject: [Phpgroupware-cvs] property/class.sob_account.php, 1.1.1.3
Date: Fri, 21 May 2004 19:11:19 -0000

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

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

Log Message:
no message
=====================================================================
Index: property/class.sob_account.php
diff -u property/class.sob_account.php:1.1.1.2 
property/class.sob_account.php:1.1.1.3
--- property/class.sob_account.php:1.1.1.2      Fri Apr 23 20:25:39 2004
+++ property/class.sob_account.php      Fri Apr 23 21:26:33 2004
@@ -1,150 +1,150 @@
-<?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_sob_account
-       {
-
-               function property_sob_account()
-               {
-                       $this->currentapp       = 'property'; 
//$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->db               = $GLOBALS['phpgw']->db;
-                       $this->db2              = $this->db;
-                       $this->account  = $GLOBALS['phpgw_data']['user']['id'];
-               }
-
-               function read($data)
-               {
-                       if(is_array($data))
-                       {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $start=0;
-                               }
-                               $query          = 
(isset($data['query'])?$data['query']:'');
-                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
-                               $order          = 
(isset($data['order'])?$data['order']:'');
-                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
-                       }
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by id asc';
-                       }
-
-                       $table = 'fm_b_account';
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " where id LIKE '%$query%' or 
descr LIKE '%$query%'";
-                       }
-
-                       $sql = "SELECT * FROM $table $querymethod";
-
-                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
-                       $this->total_records = $dbresult2->_numOfRows;
-
-                       $maxmatchs = 15;
-
-                       if(!$allrows)
-                       {
-                               $dbresult = 
$GLOBALS['phpgw']->db->SelectLimit($sql . $ordermethod,$maxmatchs,$start);
-
-                       }
-                       else
-                       {
-                               $dbresult = $GLOBALS['phpgw']->db->Execute($sql 
. $ordermethod);
-                       }
-
-                       while (!$dbresult->EOF)
-                       {
-                               $b_account[] = array
-                               (
-                                       'id'    => $dbresult->fields['id'],
-                                       'descr'                 => 
$dbresult->fields['descr']
-                               );
-                               $dbresult->MoveNext();
-                       }
-                       return $b_account;
-               }
-
-               function read_single($id)
-               {
-
-                       $table = 'fm_b_account';
-
-                       $sql = "SELECT * FROM $table  where id='$id'";
-
-                       $dbresult = $GLOBALS['phpgw']->db->Execute($sql);
-
-                       if (!$dbresult->EOF)
-                       {
-                               $b_account['id']                        = 
$dbresult->fields['id'];
-                               $b_account['descr']                     = 
$dbresult->fields['descr'];
-                               $b_account['group']                     = 
$dbresult->fields['grouping'];
-
-                               return $b_account;
-                       }
-               }
-
-               function add($b_account)
-               {
-                       $table = 'fm_b_account';
-
-                       $b_account['descr'] = 
$this->db->db_addslashes($b_account['descr']);
-
-                       $GLOBALS['phpgw']->db->Execute("INSERT INTO $table (id, 
descr,grouping) "
-                               . "VALUES ('" . $b_account['id'] . "','" . 
$b_account['descr']. "','" . substr($b_account['id'],0,2) . "')");
-
-                       $receipt['message'][]=array('msg'=>lang('budget account 
%1 has been saved',$b_account['id']));
-                       return $receipt;
-               }
-
-               function edit($b_account)
-               {
-
-                       $table = 'fm_b_account';
-
-                       $b_account['descr'] = 
$this->db->db_addslashes($b_account['descr']);
-
-                       $GLOBALS['phpgw']->db->Execute("UPDATE $table set 
descr='" . $b_account['descr']
-                                                       . "' WHERE id='" . 
$b_account['id']. "'");
-
-
-                       $receipt['message'][]=array('msg'=>lang('budget account 
%1 has been edited',$b_account['id']));
-                       return $receipt;
-               }
-
-               function delete($id)
-               {
-                       $table = 'fm_b_account';
-
-                       $GLOBALS['phpgw']->db->Execute("DELETE FROM $table 
WHERE id='" . $id . "'");
-               }
-       }
-?>
+<?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_sob_account
+       {
+
+               function property_sob_account()
+               {
+                       $this->currentapp       = 'property'; 
//$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->db               = $GLOBALS['phpgw']->db;
+                       $this->db2              = $this->db;
+                       $this->account  = $GLOBALS['phpgw_data']['user']['id'];
+               }
+
+               function read($data)
+               {
+                       if(is_array($data))
+                       {
+                               if ($data['start'])
+                               {
+                                       $start=$data['start'];
+                               }
+                               else
+                               {
+                                       $start=0;
+                               }
+                               $query          = 
(isset($data['query'])?$data['query']:'');
+                               $sort           = 
(isset($data['sort'])?$data['sort']:'DESC');
+                               $order          = 
(isset($data['order'])?$data['order']:'');
+                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
+                       }
+
+                       if ($order)
+                       {
+                               $ordermethod = " order by $order $sort";
+
+                       }
+                       else
+                       {
+                               $ordermethod = ' order by id asc';
+                       }
+
+                       $table = 'fm_b_account';
+
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " where id LIKE '%$query%' or 
descr LIKE '%$query%'";
+                       }
+
+                       $sql = "SELECT * FROM $table $querymethod";
+
+                       $dbresult2 = $GLOBALS['phpgw']->db->Execute($sql);
+                       $this->total_records = $dbresult2->_numOfRows;
+
+                       $maxmatchs = 15;
+
+                       if(!$allrows)
+                       {
+                               $dbresult = 
$GLOBALS['phpgw']->db->SelectLimit($sql . $ordermethod,$maxmatchs,$start);
+
+                       }
+                       else
+                       {
+                               $dbresult = $GLOBALS['phpgw']->db->Execute($sql 
. $ordermethod);
+                       }
+
+                       while (!$dbresult->EOF)
+                       {
+                               $b_account[] = array
+                               (
+                                       'id'    => $dbresult->fields['id'],
+                                       'descr'                 => 
$dbresult->fields['descr']
+                               );
+                               $dbresult->MoveNext();
+                       }
+                       return $b_account;
+               }
+
+               function read_single($id)
+               {
+
+                       $table = 'fm_b_account';
+
+                       $sql = "SELECT * FROM $table  where id='$id'";
+
+                       $dbresult = $GLOBALS['phpgw']->db->Execute($sql);
+
+                       if (!$dbresult->EOF)
+                       {
+                               $b_account['id']                        = 
$dbresult->fields['id'];
+                               $b_account['descr']                     = 
$dbresult->fields['descr'];
+                               $b_account['group']                     = 
$dbresult->fields['grouping'];
+
+                               return $b_account;
+                       }
+               }
+
+               function add($b_account)
+               {
+                       $table = 'fm_b_account';
+
+                       $b_account['descr'] = 
$this->db->db_addslashes($b_account['descr']);
+
+                       $GLOBALS['phpgw']->db->Execute("INSERT INTO $table (id, 
descr,grouping) "
+                               . "VALUES ('" . $b_account['id'] . "','" . 
$b_account['descr']. "','" . substr($b_account['id'],0,2) . "')");
+
+                       $receipt['message'][]=array('msg'=>lang('budget account 
%1 has been saved',$b_account['id']));
+                       return $receipt;
+               }
+
+               function edit($b_account)
+               {
+
+                       $table = 'fm_b_account';
+
+                       $b_account['descr'] = 
$this->db->db_addslashes($b_account['descr']);
+
+                       $GLOBALS['phpgw']->db->Execute("UPDATE $table set 
descr='" . $b_account['descr']
+                                                       . "' WHERE id='" . 
$b_account['id']. "'");
+
+
+                       $receipt['message'][]=array('msg'=>lang('budget account 
%1 has been edited',$b_account['id']));
+                       return $receipt;
+               }
+
+               function delete($id)
+               {
+                       $table = 'fm_b_account';
+
+                       $GLOBALS['phpgw']->db->Execute("DELETE FROM $table 
WHERE id='" . $id . "'");
+               }
+       }
+?>




reply via email to

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