fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16316] refaktor


From: sigurdne
Subject: [Fmsystem-commits] [16316] refaktor
Date: Thu, 16 Feb 2017 03:08:29 -0500 (EST)

Revision: 16316
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16316
Author:   sigurdne
Date:     2017-02-16 03:08:29 -0500 (Thu, 16 Feb 2017)
Log Message:
-----------
refaktor

Modified Paths:
--------------
    trunk/bookingfrontend/inc/class.bouser.inc.php
    trunk/bookingfrontend/inc/custom/default/MinId.php

Modified: trunk/bookingfrontend/inc/class.bouser.inc.php
===================================================================
--- trunk/bookingfrontend/inc/class.bouser.inc.php      2017-02-15 18:20:11 UTC 
(rev 16315)
+++ trunk/bookingfrontend/inc/class.bouser.inc.php      2017-02-16 08:08:29 UTC 
(rev 16316)
@@ -235,48 +235,4 @@
                                return null;
                        }
                }
-
-               protected function get_breg_orgs( $fodselsnr )
-               {
-                       $db = createObject('phpgwapi.db', null, null, true);
-
-                       $db->Host = 
$GLOBALS['phpgw_domain']['default']['db_host'];
-                       $db->Port = '5432';
-                       $db->Type = 'postgres';
-                       $db->Database = 'breg';
-                       $db->User = 
$GLOBALS['phpgw_domain']['default']['db_user'];
-                       $db->Password = 
$GLOBALS['phpgw_domain']['default']['db_pass'];
-
-                       try
-                       {
-                               $db->connect();
-                               $this->connected = true;
-                       }
-                       catch (Exception $e)
-                       {
-                               $status = lang('unable_to_connect_to_database');
-                       }
-
-                       $sql = "SELECT DISTINCT orgnr FROM personcurrent WHERE 
fodselsnr ='{$fodselsnr}'";
-                       $results = array();
-                       $db = & $GLOBALS['phpgw']->db;
-                       $db->query($sql, __LINE__, __FILE__);
-                       while ($db->next_record())
-                       {
-                               $results[] = $db->f('orgnr', true);
-                       }
-                       return $results;
-               }
-
-      protected function get_breg_orgs_old($fodselsnr) {
-            $breg_conn = 
pg_connect("host=".$GLOBALS['phpgw_domain']['default']['db_host']." port=5432 
dbname=breg user=".$GLOBALS['phpgw_domain']['default']['db_user']." 
password=".$GLOBALS['phpgw_domain']['default']['db_pass']) or die('connection 
failed');
-            $sql = "SELECT distinct orgnr FROM breg.personcurrent WHERE 
fodselsnr ='".$fodselsnr."'";
-            $results = pg_query($breg_conn, $sql);
-            $orgs = pg_fetch_all($results);
-            print_r($sql);
-            print_r($orgs);
-            pg_close($breg_conn);
-            return $orgs;
-        }
-
        }
\ No newline at end of file

Modified: trunk/bookingfrontend/inc/custom/default/MinId.php
===================================================================
--- trunk/bookingfrontend/inc/custom/default/MinId.php  2017-02-15 18:20:11 UTC 
(rev 16315)
+++ trunk/bookingfrontend/inc/custom/default/MinId.php  2017-02-16 08:08:29 UTC 
(rev 16316)
@@ -99,4 +99,37 @@
                                return null;
                        }
                }
+
+               private function get_breg_orgs( $fodselsnr )
+               {
+                       $db = createObject('phpgwapi.db', null, null, true);
+
+                       $db->Host = 
$GLOBALS['phpgw_domain']['default']['db_host'];
+                       $db->Port = '5432';
+                       $db->Type = 'postgres';
+                       $db->Database = 'breg';
+                       $db->User = 
$GLOBALS['phpgw_domain']['default']['db_user'];
+                       $db->Password = 
$GLOBALS['phpgw_domain']['default']['db_pass'];
+
+                       try
+                       {
+                               $db->connect();
+                               $this->connected = true;
+                       }
+                       catch (Exception $e)
+                       {
+                               $status = lang('unable_to_connect_to_database');
+                       }
+
+                       $sql = "SELECT DISTINCT orgnr FROM personcurrent WHERE 
fodselsnr ='{$fodselsnr}'";
+                       $results = array();
+                       $db = & $GLOBALS['phpgw']->db;
+                       $db->query($sql, __LINE__, __FILE__);
+                       while ($db->next_record())
+                       {
+                               $results[] = $db->f('orgnr', true);
+                       }
+                       return $results;
+               }
+
        }
\ No newline at end of file




reply via email to

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