mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 01:42:17 +00:00
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
require_once('basis.class.php');
|
||||
|
||||
abstract class db extends basis
|
||||
{
|
||||
protected static $db_conn=null;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
if (is_null(db::$db_conn))
|
||||
$this->db_connect();
|
||||
}
|
||||
|
||||
abstract function db_connect();
|
||||
abstract function db_query($sql);
|
||||
|
||||
}
|
||||
|
||||
require_once(DB_SYSTEM.'.class.php');
|
||||
|
||||
?>
|
||||
+10
-5
@@ -1,15 +1,20 @@
|
||||
function emailCheck(emailStr) {
|
||||
function emailCheck(emailStr)
|
||||
{
|
||||
// checks if the e-mail address is valid
|
||||
var emailPat = /^(\".*\"|[A-Za-z0-9\w\.\-]*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z\w\-]*(\.[A-Za-z]\w*)+)$/;
|
||||
var matchArray = emailStr.match(emailPat);
|
||||
if (matchArray == null) {
|
||||
if (matchArray == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// make sure the IP address domain is valid
|
||||
var IPArray = matchArray[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/);
|
||||
if (IPArray != null) {
|
||||
for (var i=1;i<=4;i++) {
|
||||
if (IPArray[i]>255) {
|
||||
if (IPArray != null)
|
||||
{
|
||||
for (var i=1;i<=4;i++)
|
||||
{
|
||||
if (IPArray[i]>255)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+18
-15
@@ -24,9 +24,11 @@
|
||||
* @create 2007-05-14
|
||||
*/
|
||||
|
||||
class konto
|
||||
require_once ('basis_db.class.php');
|
||||
|
||||
class konto extends basis_db
|
||||
{
|
||||
var $conn; // @var resource DB-Handle
|
||||
//var $conn; // @var resource DB-Handle
|
||||
var $new; // @var boolean
|
||||
var $errormsg; // @var string
|
||||
var $result = array(); // @var adresse Objekt
|
||||
@@ -65,9 +67,10 @@ class konto
|
||||
// * @param $conn Connection
|
||||
// * $buchungsnr ID der Adresse die geladen werden soll (Default=null)
|
||||
// **************************************************************************
|
||||
function konto($conn, $buchungsnr=null, $unicode=false)
|
||||
function konto($buchungsnr=null, $unicode=false)
|
||||
{
|
||||
$this->conn = $conn;
|
||||
parent::__construct();
|
||||
//$this->conn = $conn;
|
||||
if($unicode!=null)
|
||||
{
|
||||
if ($unicode)
|
||||
@@ -78,7 +81,7 @@ class konto
|
||||
{
|
||||
$qry="SET CLIENT_ENCODING TO 'LATIN9';";
|
||||
}
|
||||
if(!pg_query($conn,$qry))
|
||||
if(!pg_query($this->db_conn,$qry))
|
||||
{
|
||||
$this->errormsg = "Encoding konnte nicht gesetzt werden";
|
||||
return false;
|
||||
@@ -105,9 +108,9 @@ class konto
|
||||
$qry = "SELECT tbl_konto.*, anrede, titelpost, titelpre, nachname, vorname, vornamen
|
||||
FROM public.tbl_konto JOIN public.tbl_person USING (person_id) WHERE buchungsnr='$buchungsnr'";
|
||||
|
||||
if($result = pg_query($this->conn, $qry))
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
if($row = pg_fetch_object($result))
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->buchungsnr = $row->buchungsnr;
|
||||
$this->person_id = $row->person_id;
|
||||
@@ -347,12 +350,12 @@ class konto
|
||||
$this->errormsg = 'Person_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if($studiengang_kz!='')
|
||||
$stgwhere = " AND tbl_konto.studiengang_kz='$studiengang_kz' ";
|
||||
else
|
||||
else
|
||||
$stgwhere = '';
|
||||
|
||||
|
||||
if($filter=='offene')
|
||||
{
|
||||
//Alle Buchungen und 'darunterliegende' holen die noch offen sind
|
||||
@@ -477,7 +480,7 @@ class konto
|
||||
|
||||
|
||||
// ******************************
|
||||
// * ueberprueft, ob studiengebuehr gebucht ist fuer
|
||||
// * ueberprueft, ob studiengebuehr gebucht ist fuer
|
||||
// * student_uid und studiensemester
|
||||
// * gibt true/false zurueck und setzt bei true das buchungsdatum $this->buchungsdatum
|
||||
// ******************************
|
||||
@@ -495,8 +498,8 @@ class konto
|
||||
$buch_date[] = $subrow->buchungsdatum;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$qry = "SELECT sum(betrag) as differenz FROM public.tbl_konto WHERE buchungsnr='".$buch_nr[0]."' OR buchungsnr_verweis='".$buch_nr[0]."'";
|
||||
|
||||
if($result = pg_query($this->conn, $qry))
|
||||
@@ -506,8 +509,8 @@ class konto
|
||||
if ($row->differenz == 0)
|
||||
{
|
||||
$this->buchungsdatum = isset($buch_date[1])?$buch_date[1]:'';
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
class basis_db extends db
|
||||
{
|
||||
function db_connect()
|
||||
{
|
||||
$conn_str=CONN_STRING;
|
||||
//Connection Herstellen
|
||||
if (DB_CONNECT_PERSISTENT)
|
||||
{
|
||||
if(!basis_db::$db_conn = pg_pconnect($conn_str))
|
||||
die('Fehler beim Oeffnen der Datenbankverbindung');
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!basis_db::$db_conn = pg_connect($conn_str))
|
||||
die('Fehler beim Oeffnen der Datenbankverbindung');
|
||||
}
|
||||
}
|
||||
|
||||
function db_query($sql)
|
||||
{
|
||||
if ($this->db_result=pg_query(basis_db::$db_conn,$sql))
|
||||
return true;
|
||||
else
|
||||
{
|
||||
$this->errormsg='Abfrage in Datenbank fehlgeschlagen! '.$this->db_lasterror();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function db_fetch_object()
|
||||
{
|
||||
return pg_fetch_object($this->db_result);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user