phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] projects/inc/class.soconfig.inc.php, 1.13


From: nomail
Subject: [Phpgroupware-cvs] projects/inc/class.soconfig.inc.php, 1.13
Date: Sun, 23 May 2004 16:41:24 -0000

Update of /projects/inc
Modified Files:
        Branch: 
          class.soconfig.inc.php

date: 2004/04/29 15:53:38;  author: ceb;  state: Exp;  lines: +35 -20

Log Message:
update
=====================================================================
Index: projects/inc/class.soconfig.inc.php
diff -u projects/inc/class.soconfig.inc.php:1.12 
projects/inc/class.soconfig.inc.php:1.13
--- projects/inc/class.soconfig.inc.php:1.12    Tue Mar 16 02:46:09 2004
+++ projects/inc/class.soconfig.inc.php Thu Apr 29 15:53:38 2004
@@ -520,6 +520,23 @@
                        }
                }
 
+               function db2emps()
+               {
+                       while($this->db->next_record())
+                       {
+                               $emps[] = array
+                               (
+                                       'id'                    => 
$this->db->f('id'),
+                                       'account_id'    => 
$this->db->f('account_id'),
+                                       'accounting'    => 
$this->db->f('accounting'),
+                                       'd_accounting'  => 
$this->db->f('d_accounting'),
+                                       'sdate'                 => 
$this->db->f('sdate'),
+                                       'edate'                 => 
$this->db->f('edate')
+                               );
+                       }
+                       return $emps;
+               }
+
                function read_employees($values)
                {
                        $start          = intval($values['start']);
@@ -548,37 +565,35 @@
                        {
                                $this->db->query($sql . $acc_select . 
$ordermethod,__LINE__,__FILE__);
                        }
-
-                       while($this->db->next_record())
-                       {
-                               $emps[] = array
-                               (
-                                       'id'                    => 
$this->db->f('id'),
-                                       'account_id'    => 
$this->db->f('account_id'),
-                                       'accounting'    => 
$this->db->f('accounting'),
-                                       'd_accounting'  => 
$this->db->f('d_accounting')
-                               );
-                       }
-                       return $emps;
+                       return $this->db2emps();
                }
 
                function save_accounting_factor($values)
                {
-                       $exists = $this->exists(array('action' => 
'accounting','pa_id' => $values['account_id']));
-
+                       //$exists = $this->exists(array('action' => 
'accounting','pa_id' => $values['account_id']));
+                       $values['id']                   = intval($values['id']);
                        $values['accounting']   = $values['accounting'] + 0.0;
                        $values['d_accounting'] = $values['d_accounting'] + 0.0;
 
-                       if($exists)
+                       if($values['id'] > 0)
                        {
-                               $this->db->query('UPDATE phpgw_p_projectmembers 
set accounting=' . $values['accounting'] . ', d_accounting=' . 
$values['d_accounting']
-                                                               . ' where 
account_id=' . intval($values['account_id']) . " and 
type='accounting'",__LINE__,__FILE__);
+                               $this->db->query('UPDATE phpgw_p_projectmembers 
set accounting=' . $values['accounting'] . ', d_accounting=' . 
$values['d_accounting']. ', sdate='
+                                                               . 
intval($values['sdate']) . ', edate=' . intval($values['edate']) . ' where 
account_id=' . intval($values['account_id'])
+                                                               . " and 
type='accounting' and id=" . $values['id'],__LINE__,__FILE__);
                        }
                        else
                        {
-                               $this->db->query('INSERT into 
phpgw_p_projectmembers (account_id,type,accounting,d_accounting) values(' . 
intval($values['account_id'])
-                                                               . 
",'accounting'," . $values['accounting'] . ',' . $values['d_accounting'] . 
')',__LINE__,__FILE__);
+                               $this->db->query('INSERT into 
phpgw_p_projectmembers (account_id,type,accounting,d_accounting,sdate,edate) 
values(' . intval($values['account_id'])
+                                                               . 
",'accounting'," . $values['accounting'] . ',' . $values['d_accounting'] . ',' 
. intval($values['sdate']) . ','
+                                                               . 
intval($values['edate']) . ')',__LINE__,__FILE__);
                        }
+               }
+
+               function read_single_afactor($id = 0)
+               {
+                       $this->db->query('SELECT * from phpgw_p_projectmembers 
WHERE id=' . intval($id),__LINE__,__FILE__);
+                       list($emp) = $this->db2emps();
+                       return $emp;
                }
 
                function list_roles($values)




reply via email to

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