mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
79 lines
2.0 KiB
PHP
79 lines
2.0 KiB
PHP
<?php
|
|
/* Copyright (C) 2010 Technikum-Wien
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
* License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
|
*
|
|
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
|
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
|
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
|
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
|
*
|
|
*/
|
|
|
|
/**
|
|
* Implementation super class
|
|
*/
|
|
class basis
|
|
{
|
|
/**
|
|
* Error message
|
|
* @var base_errors $msgs
|
|
*/
|
|
public $errormsg;
|
|
|
|
/**
|
|
* Constructor
|
|
*
|
|
* @access public
|
|
*/
|
|
public function __construct($db_system='pgsql')
|
|
{
|
|
//empty
|
|
}
|
|
|
|
public function getErrorMsg()
|
|
{
|
|
return $this->errormsg;
|
|
}
|
|
|
|
/**
|
|
* wenn $var '' ist wird NULL zurueckgegeben
|
|
* wenn $var !='' ist werden Datenbankkritische
|
|
* Zeichen mit Backslash versehen und das Ergbnis
|
|
* unter Hochkomma gesetzt.
|
|
*/
|
|
public function addslashes($var)
|
|
{
|
|
return ($var!=''?"'".addslashes($var)."'":'null');
|
|
}
|
|
|
|
/**
|
|
* Splittet ein Array auf um es zB in der IN Klausel eines SQL Befehles zu verwenden
|
|
* Die einzelnen Elemente werden unter Hochkomma gesetzt und mit Beistrich getrennt.
|
|
* @param $array
|
|
*/
|
|
public function implode4SQL($array)
|
|
{
|
|
$string = '';
|
|
foreach($array as $row)
|
|
{
|
|
if($string!='')
|
|
$string.=',';
|
|
$string.="'".addslashes($row)."'";
|
|
}
|
|
return $string;
|
|
}
|
|
}
|
|
?>
|