phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/class.someter.php, 1.1.1.6


From: nomail
Subject: [Phpgroupware-cvs] property/class.someter.php, 1.1.1.6
Date: Sun, 9 May 2004 15:42:22 +0200

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

date: 2004/05/09 13:42:22;  author: sigurdne;  state: Exp;  lines: +8 -3

Log Message:
no message
=====================================================================
Index: property/class.someter.php
diff -u property/class.someter.php:1.1.1.5 property/class.someter.php:1.1.1.6
--- property/class.someter.php:1.1.1.5  Thu Apr 29 07:10:49 2004
+++ property/class.someter.php  Sun May  9 13:42:22 2004
@@ -229,15 +229,20 @@
 
                        $meter['remark'] = 
$this->functions->db_addslashes($meter['remark']);
 
-                       $GLOBALS['phpgw']->db->Execute("INSERT INTO fm_meter 
(location_code, num,user_id,entry_date,name,address,category,remark $cols ) "
-                               . "VALUES ('" . $meter['location_code'] . "','" 
. $meter['num'] . "','" . $this->account . "','" . time() . "','" . 
$meter['name']
+                       $GLOBALS['phpgw']->db->begintrans();
+                       $id = $GLOBALS['phpgw']->db->genid('fm_meter_id_seq');
+
+                       $GLOBALS['phpgw']->db->Execute("INSERT INTO fm_meter 
(id,location_code, num,user_id,entry_date,name,address,category,remark $cols ) "
+                               . "VALUES ($id,'" . $meter['location_code'] . 
"','" . $meter['num'] . "','" . $this->account . "','" . time() . "','" . 
$meter['name']
                                . "','" . $address ."','" . $meter['cat_id'] 
."','" . $meter['remark']. "' $vals )");
 
 
-                       $meter_id = 
$this->db->get_last_insert_id('fm_meter','id');
+//                     $meter_id = 
$this->db->get_last_insert_id('fm_meter','id');
+                       $meter_id = $id;
 
                        $receipt['meter_id'] = $meter_id;
                        $receipt['message'][]=array('msg'=>lang('Meter %1 has 
been saved',$meter['num']));
+                       $GLOBALS['phpgw']->db->committrans();
                        return $receipt;
                }
 




reply via email to

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