phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc/custom synkroniser_med_boei.php


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property/inc/custom synkroniser_med_boei.php
Date: Tue, 29 Aug 2006 10:54:17 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   06/08/29 10:54:17

Modified files:
        inc/custom     : synkroniser_med_boei.php 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/custom/synkroniser_med_boei.php?cvsroot=phpgroupware&r1=1.2&r2=1.3

Patches:
Index: synkroniser_med_boei.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/custom/synkroniser_med_boei.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- synkroniser_med_boei.php    8 Mar 2006 10:29:14 -0000       1.2
+++ synkroniser_med_boei.php    29 Aug 2006 10:54:17 -0000      1.3
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage custom
-       * @version $Id: synkroniser_med_boei.php,v 1.2 2006/03/08 10:29:14 
sigurdne Exp $
+       * @version $Id: synkroniser_med_boei.php,v 1.3 2006/08/29 10:54:17 
sigurdne Exp $
        */
 
        /**
@@ -117,6 +117,8 @@
 
                function execute($cron='')
                {
+                       $receipt = $this->legg_til_eier_phpgw();
+                       $this->cron_log($receipt,$cron);
                        $receipt = $this->legg_til_gateadresse_phpgw();
                        $this->cron_log($receipt,$cron);
                        $receipt = $this->legg_til_objekt_phpgw();
@@ -165,6 +167,53 @@
                        $this->db->query($sql,__LINE__,__FILE__);
                }
 
+               function legg_til_eier_phpgw()
+               {
+                       $sql = "SELECT v_Eier.id, 
v_Eier.org_name,v_Eier.category FROM  fm_owner RIGHT OUTER JOIN "
+                               . " v_Eier ON fm_owner.id = v_Eier.id"
+                                       . " WHERE (fm_owner.id IS NULL)";
+
+                       $this->db_boei->query($sql,__LINE__,__FILE__);
+                       while ($this->db_boei->next_record())
+                       {
+                               if($this->db_boei->f('category')==0)
+                               {
+                                       $category = 4;
+                               }
+                               else
+                               {
+                                       $category = 
$this->db_boei->f('category');
+                               }
+                               $owner[]= array (
+                                'id'           => $this->db_boei->f('id'),
+                                'org_name'     => 
$this->db->db_addslashes($this->db_boei->f('org_name')),
+                                'category'     => $category
+                                );
+
+                       }
+
+                       for ($i=0; $i<count($owner); $i++)
+                       {
+
+                               $sql2 = "INSERT INTO fm_owner 
(id,org_name,remark,category)"
+                                       . " VALUES (" . $owner[$i]['id'] . ", 
'". $owner[$i]['org_name'] . "', '". $owner[$i]['org_name'] . "', '". 
$owner[$i]['category']. "')";
+
+                               $this->db->query($sql2,__LINE__,__FILE__);
+                               $this->db_boei->query($sql2,__LINE__,__FILE__);
+
+                               $owner_msg[]=$owner[$i]['org_name'];
+                       }
+
+                       $msg = count($owner) . ' eier er lagt til: ' . 
@implode(",", $owner_msg);
+                       $this->receipt['message'][]=array('msg'=> $msg);
+                       unset ($owner);
+                       unset ($owner_msg);
+                       return $msg;
+
+               }
+
+
+
                function legg_til_gateadresse_phpgw()
                {
                        $sql = "SELECT v_Gateadresse.gateadresse_id, 
v_Gateadresse.gatenavn FROM  fm_streetaddress RIGHT OUTER JOIN "




reply via email to

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