mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 09:04:28 +00:00
This commit is contained in:
+379
-154
@@ -34,187 +34,412 @@
|
||||
* @return - kein Retourn des Konstruktors
|
||||
*
|
||||
*/
|
||||
include_once(dirname(__FILE__)."/postgre_sql.class.php");
|
||||
class komune_wettbewerb extends postgre_sql
|
||||
require_once(dirname(__FILE__).'/basis_db.class.php');
|
||||
class komune_wettbewerb extends basis_db
|
||||
{
|
||||
protected $wettbewerb;
|
||||
protected $wbtyp_kurzbz;
|
||||
protected $wettbewerb_kurzb;
|
||||
public $result;
|
||||
public $new=false; // boolean
|
||||
|
||||
public $wbtyp_kurzbz;
|
||||
public $wettbewerb_kurzbz;
|
||||
|
||||
public $schemaSQL="kommune"; // string Datenbankschema
|
||||
|
||||
//-----Konstruktor
|
||||
function komune_wettbewerb($connectSQL,$wbtyp_kurzbz="",$wettbewerb_kurzbz="")
|
||||
function __construct($wbtyp_kurzbz="",$wettbewerb_kurzbz="",$uid="",$team_kurzbz="")
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->InitWettbewerb();
|
||||
|
||||
$this->setConnectSQL($connectSQL);
|
||||
$this->setWbtyp_kurzbz($wbtyp_kurzbz);
|
||||
$this->setWettbewerb_kurzbz($wettbewerb_kurzbz);
|
||||
$this->wbtyp_kurzbz=$wbtyp_kurzbz;
|
||||
$this->wettbewerb_kurzbz=$wettbewerb_kurzbz;
|
||||
}
|
||||
//-----Initialisierung--------------------------------------------------------------------------------------------
|
||||
function InitWettbewerb()
|
||||
{
|
||||
$this->setError('');
|
||||
$this->new=false;
|
||||
$this->errormsg='';
|
||||
$this->result=array();
|
||||
|
||||
$this->setWettbewerb('');
|
||||
$this->setWbtyp_kurzbz('');
|
||||
$this->setWettbewerb_kurzbz('');
|
||||
$this->wbtyp_kurzbz='';
|
||||
$this->wettbewerb_kurzbz='';
|
||||
|
||||
}
|
||||
//-----wbtyp_kurzbz--------------------------------------------------------------------------------------------
|
||||
function getWettbewerb()
|
||||
{
|
||||
return $this->wettbewerb;
|
||||
}
|
||||
function setWettbewerb($wettbewerb)
|
||||
{
|
||||
$this->wettbewerb=$wettbewerb;
|
||||
}
|
||||
//-----wbtyp_kurzbz--------------------------------------------------------------------------------------------
|
||||
function getWbtyp_kurzbz()
|
||||
{
|
||||
return $this->wbtyp_kurzbz;
|
||||
}
|
||||
function setWbtyp_kurzbz($wbtyp_kurzbz)
|
||||
{
|
||||
$this->wbtyp_kurzbz=$wbtyp_kurzbz;
|
||||
}
|
||||
//-----wettbewerb_kurzbz--------------------------------------------------------------------------------------------
|
||||
function getWettbewerb_kurzbz()
|
||||
{
|
||||
return $this->wettbewerb_kurzbz;
|
||||
}
|
||||
function setWettbewerb_kurzbz($wettbewerb_kurzbz="")
|
||||
{
|
||||
$this->wettbewerb_kurzbz=$wettbewerb_kurzbz;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
function loadWettbewerbTyp()
|
||||
{
|
||||
|
||||
$cSchemaSQL=$this->getSchemaSQL();
|
||||
$tmpwbtyp_kurzbz=$this->getWbtyp_kurzbz();
|
||||
|
||||
$cTmpSQL="";
|
||||
$cTmpSQL.="SELECT * FROM ".$cSchemaSQL."tbl_wettbewerbtyp ";
|
||||
$cTmpSQL.=" WHERE ".$cSchemaSQL."tbl_wettbewerbtyp.wbtyp_kurzbz>'' ";
|
||||
|
||||
// Suche nach einem einzigen Wetttbewerbstypen wbtyp_kurzbz
|
||||
if (!is_array($tmpwbtyp_kurzbz) && !empty($tmpwbtyp_kurzbz) )
|
||||
{
|
||||
$cTmpSQL.=" AND UPPER(".$cSchemaSQL."tbl_wettbewerbtyp.wbtyp_kurzbz)=UPPER('".$tmpwbtyp_kurzbz."') ";
|
||||
}
|
||||
elseif (is_array($tmpwbtyp_kurzbz) && count($tmpwbtyp_kurzbz)>0 )
|
||||
{
|
||||
if (isset($tmpwbtyp_kurzbz[0]['wbtyp_kurzbz'])) // Check ob nicht kpl. Tablestruck in Array
|
||||
{
|
||||
$tmpwbtyp_kurzbzE=array();
|
||||
for ($indZEILE=0;$indZEILE<count($tmpwbtyp_kurzbz);$indZEILE++)
|
||||
$tmpwbtyp_kurzbzE[]=trim($tmpwbtyp_kurzbz[$indZEILE]['wbtyp_kurzbz']);
|
||||
$tmpwbtyp_kurzbz=$tmpwbtyp_kurzbzE;
|
||||
}
|
||||
elseif (isset($tmpwbtyp_kurzbz['wbtyp_kurzbz'])) // Check ob nicht kpl. Tablestruck in Array
|
||||
{
|
||||
$tmpwbtyp_kurzbzE=array();
|
||||
$tmpwbtyp_kurzbzE[]=trim($tmpwbtyp_kurzbz['wbtyp_kurzbz']);
|
||||
$tmpwbtyp_kurzbz=$tmpwbtyp_kurzbzE;
|
||||
}
|
||||
$cTmpSQL.=" AND UPPER(".$cSchemaSQL."tbl_wettbewerbtyp.wbtyp_kurzbz) in ('".strtoupper(implode("','",$tmpwbtyp_kurzbz))."') ";
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// ------------------------ Wettbewerbstypen
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* Speichert bzw. Aendert eine Veranstaltungskategorie
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function saveWettbewerbTyp()
|
||||
{
|
||||
// Initialisieren
|
||||
$this->errormsg='';
|
||||
$qry="";
|
||||
|
||||
$fildsList='';
|
||||
$fildsValue='';
|
||||
|
||||
|
||||
if (empty($this->wbtyp_kurzbz) || $this->wbtyp_kurzbz==null )
|
||||
{
|
||||
$this->errormsg='Wettbewerb - Typ fehlt!';
|
||||
return false;
|
||||
}
|
||||
$cTmpSQL.=" OFFSET 0 LIMIT ALL FOR SHARE;";
|
||||
|
||||
#exit($cTmpSQL);
|
||||
if (empty($this->bezeichnung))
|
||||
{
|
||||
$this->errormsg='Wettbewerbstyp - Bezeichnung fehlt!';
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->new)
|
||||
{
|
||||
|
||||
// Entfernen der Temporaeren Variablen aus dem Speicher
|
||||
if (isset($cSchemaSQL)) unset($cSchemaSQL);
|
||||
if (isset($tmpwbtyp_kurzbz)) unset($tmpwbtyp_kurzbz);
|
||||
// Datenbankabfrage
|
||||
$this->setStringSQL($cTmpSQL);
|
||||
unset($cTmpSQL);
|
||||
$fildsList.='wbtyp_kurzbz,';
|
||||
$fildsList.='bezeichnung,';
|
||||
$fildsList.='farbe';
|
||||
|
||||
$this->setResultSQL(null);
|
||||
if (!$this->fetch_all())
|
||||
return false;
|
||||
$this->setWettbewerb($this->getResultSQL());
|
||||
$this->setResultSQL(null);
|
||||
|
||||
return true;
|
||||
}
|
||||
$fildsValue.="'".addslashes($this->wbtyp_kurzbz)."',";
|
||||
$fildsValue.="'".addslashes($this->bezeichnung)."',";
|
||||
$fildsValue.="'".addslashes($this->farbe)."'";
|
||||
|
||||
$qry=" insert into ".$this->schemaSQL.".tbl_wettbewerbtyp (".$fildsList.") values (".$fildsValue."); ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$fildsValue.=(!empty($fildsValue)?',':'')."bezeichnung='".addslashes($this->bezeichnung)."'";
|
||||
$fildsValue.=(!empty($fildsValue)?',':'')."farbe='".addslashes($this->farbe)."'";
|
||||
|
||||
function loadWettbewerb()
|
||||
$qry.=" update ".$this->schemaSQL.".tbl_wettbewerbtyp set ";
|
||||
$qry.=$fildsValue;
|
||||
$qry.=" where wbtyp_kurzbz='".addslashes($this->wbtyp_kurzbz)."' ";
|
||||
}
|
||||
if($resurce=$this->db_query($qry))
|
||||
return $resurce;
|
||||
else
|
||||
{
|
||||
if (empty($this->errormsg))
|
||||
$this->errormsg = 'Fehler beim speichern des Datensatzes ';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* Loescht eine Veranstaltungskategorie
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function deleteWettbewerbTyp($wbtyp_kurzbz="")
|
||||
{
|
||||
$cSchemaSQL=$this->getSchemaSQL();
|
||||
$tmpwbtyp_kurzbz=$this->getWbtyp_kurzbz();
|
||||
$cWettbewerb_kurzbz=$this->getWettbewerb_kurzbz();
|
||||
|
||||
$cTmpSQL="";
|
||||
$cTmpSQL.="SELECT *,tbl_wettbewerbtyp.wbtyp_kurzbz,case WHEN tbl_wettbewerb.teamgroesse >1 then 'Teambewerb' else 'Einzelbewerb' end as wettbewerbart FROM ".$cSchemaSQL."tbl_wettbewerbtyp ";
|
||||
$cTmpSQL.=" LEFT JOIN ".$cSchemaSQL."tbl_wettbewerb ON UPPER(".$cSchemaSQL."tbl_wettbewerb.wbtyp_kurzbz)=UPPER(".$cSchemaSQL."tbl_wettbewerbtyp.wbtyp_kurzbz) ";
|
||||
$cTmpSQL.=" WHERE ".$cSchemaSQL."tbl_wettbewerbtyp.wbtyp_kurzbz>'' ";
|
||||
|
||||
// Initialisieren
|
||||
$qry="";
|
||||
$this->errormsg='';
|
||||
|
||||
// Parameter
|
||||
if (!empty($wbtyp_kurzbz))
|
||||
$this->wbtyp_kurzbz=$wbtyp_kurzbz;
|
||||
|
||||
// Plausib
|
||||
if (empty($this->wbtyp_kurzbz) || $this->wbtyp_kurzbz==null )
|
||||
{
|
||||
$this->errormsg='Wettbewerb - Typ fehlt!';
|
||||
return false;
|
||||
}
|
||||
|
||||
// Abfrage
|
||||
$qry.=" BEGIN; ";
|
||||
$qry.=" delete from ".$this->schemaSQL.".tbl_wettbewerb ";
|
||||
if (is_array($this->wbtyp_kurzbz))
|
||||
$qry.=" where wbtyp_kurzbz in ('".implode("','",$this->wbtyp_kurzbz)."') ";
|
||||
else
|
||||
$qry.=" where wbtyp_kurzbz='".addslashes($this->wbtyp_kurzbz)."' ";
|
||||
$qry.="; ";
|
||||
|
||||
$qry.=" delete from ".$this->schemaSQL.".tbl_wettbewerbtyp ";
|
||||
if (is_array($this->wbtyp_kurzbz))
|
||||
$qry.=" where wbtyp_kurzbz in ('".implode("','",$this->wbtyp_kurzbz)."') ";
|
||||
else
|
||||
$qry.=" where wbtyp_kurzbz='".addslashes($this->wbtyp_kurzbz)."' ";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($this->db_query('COMMIT;'))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db_query('ROLLBACK;');
|
||||
if (empty($this->errormsg))
|
||||
$this->errormsg = 'Fehler beim Veranstaltungskategorie löschen';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function loadWettbewerbTyp($wbtyp_kurzbz=null)
|
||||
{
|
||||
// Init
|
||||
$this->result=array();
|
||||
$this->errormsg='';
|
||||
if (!is_null($wbtyp_kurzbz))
|
||||
$this->wbtyp_kurzbz=$wbtyp_kurzbz;
|
||||
|
||||
$qry="";
|
||||
$qry.="SELECT * FROM ".$this->schemaSQL.".tbl_wettbewerbtyp ";
|
||||
$qry.=" WHERE ".$this->schemaSQL.".tbl_wettbewerbtyp.wbtyp_kurzbz>'' ";
|
||||
|
||||
// Suche nach einem einzigen Wetttbewerbstypen wbtyp_kurzbz
|
||||
if (!is_array($tmpwbtyp_kurzbz) && !empty($tmpwbtyp_kurzbz) )
|
||||
if ( !empty($this->wettbewerb_kurzbz) && !is_array($this->wettbewerb_kurzbz) )
|
||||
{
|
||||
$qry.=" AND UPPER(".$this->schemaSQL.".tbl_wettbewerbtyp.wbtyp_kurzbz)=UPPER('".addslashes($this->wettbewerb_kurzbz)."') ";
|
||||
}
|
||||
elseif (is_array($this->wettbewerb_kurzbz) && count($this->wettbewerb_kurzbz)>0 )
|
||||
{
|
||||
$qry.=" AND UPPER(".$this->schemaSQL.".tbl_wettbewerbtyp.wbtyp_kurzbz) in ('".strtoupper(implode("','",$this->wettbewerb_kurzbz))."') ";
|
||||
}
|
||||
$qry.=" order by wbtyp_kurzbz ";
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->result[]=$row;
|
||||
}
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (empty($this->errormsg))
|
||||
$this->errormsg = 'Fehler beim lesen der Wettbewerbstypen';
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
// ------------------------ Wettbewerbe
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* Speichert bzw. Aendert eine Veranstaltungskategorie
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function saveWettbewerb()
|
||||
{
|
||||
// Initialisieren
|
||||
$this->errormsg='';
|
||||
$qry="";
|
||||
|
||||
$fildsList='';
|
||||
$fildsValue='';
|
||||
|
||||
|
||||
// Plausib
|
||||
if (empty($this->wbtyp_kurzbz) || $this->wbtyp_kurzbz==null )
|
||||
{
|
||||
$this->errormsg='Wettbewerb - Type fehlt!';
|
||||
return false;
|
||||
}
|
||||
if (empty($this->wettbewerb_kurzbz) || $this->wettbewerb_kurzbz==null )
|
||||
{
|
||||
$this->errormsg='Wettbewerb - Kurzbz. fehlt!';
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty($this->regeln))
|
||||
{
|
||||
$this->errormsg='Wettbewerb - Regeln fehlen!';
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty($this->forderungstage) || is_null($this->forderungstage) )
|
||||
$this->forderungstage=7;
|
||||
|
||||
if (!is_numeric($this->forderungstage) )
|
||||
{
|
||||
$this->errormsg='Forderungstage nur Nummerisch';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (empty($this->teamgroesse) || is_null($this->teamgroesse))
|
||||
$this->teamgroesse=1;
|
||||
|
||||
if (!is_numeric($this->teamgroesse) )
|
||||
{
|
||||
$this->errormsg='Forderungstage nur Nummerisch';
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->new)
|
||||
{
|
||||
|
||||
$fildsList.='wbtyp_kurzbz,';
|
||||
$fildsList.='wettbewerb_kurzbz,';
|
||||
$fildsList.='regeln,';
|
||||
$fildsList.='forderungstage,';
|
||||
|
||||
$fildsList.='teamgroesse,';
|
||||
$fildsList.='uid,';
|
||||
$fildsList.='icon';
|
||||
|
||||
$fildsValue.="'".addslashes($this->wbtyp_kurzbz)."',";
|
||||
$fildsValue.="'".addslashes($this->wettbewerb_kurzbz)."',";
|
||||
|
||||
$fildsValue.="'".addslashes($this->regeln)."',";
|
||||
$fildsValue.="".addslashes($this->forderungstage).",";
|
||||
|
||||
$fildsValue.="".addslashes($this->teamgroesse).",";
|
||||
$fildsValue.="'".addslashes($this->uid)."',";
|
||||
|
||||
$fildsValue.="'".addslashes($this->icon)."'";
|
||||
|
||||
$qry=" insert into ".$this->schemaSQL.".tbl_wettbewerb (".$fildsList.") values (".$fildsValue."); ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$fildsValue.=(!empty($fildsValue)?',':'')."regeln='".addslashes($this->regeln)."'";
|
||||
$fildsValue.=(!empty($fildsValue)?',':'')."forderungstage=".addslashes($this->forderungstage)."";
|
||||
|
||||
|
||||
$fildsValue.=(!empty($fildsValue)?',':'')."teamgroesse=".addslashes($this->teamgroesse)."";
|
||||
|
||||
$fildsValue.=(!empty($fildsValue)?',':'')."uid='".addslashes($this->uid)."'";
|
||||
|
||||
$fildsValue.=(!empty($fildsValue)?',':'')."icon='".addslashes($this->icon)."'";
|
||||
|
||||
$qry.=" update ".$this->schemaSQL.".tbl_wettbewerb set ";
|
||||
$qry.=$fildsValue;
|
||||
$qry.=" where wbtyp_kurzbz='".addslashes($this->wbtyp_kurzbz)."' and wettbewerb_kurzbz='".addslashes($this->wettbewerb_kurzbz)."' ";
|
||||
}
|
||||
if($this->db_query($qry))
|
||||
return true;
|
||||
else
|
||||
{
|
||||
if (empty($qry))
|
||||
$this->errormsg = 'Fehler beim speichern des Datensatzes ';
|
||||
$this->errormsg .=' '.$qry;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* Loescht eine Veranstaltungskategorie
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function deleteWettbewerb($wbtyp_kurzbz="",$wettbewerb_kurzbz=null)
|
||||
{
|
||||
|
||||
// Initialisieren
|
||||
$qry="";
|
||||
|
||||
$this->result=array();
|
||||
$this->errormsg='';
|
||||
|
||||
// Parameter
|
||||
if (!is_null($wbtyp_kurzbz))
|
||||
$this->wbtyp_kurzbz=$wbtyp_kurzbz;
|
||||
if (!is_null($wettbewerb_kurzbz))
|
||||
$this->wettbewerb_kurzbz=$wettbewerb_kurzbz;
|
||||
|
||||
// Plausib
|
||||
if (empty($this->wbtyp_kurzbz) || $this->wbtyp_kurzbz==null )
|
||||
{
|
||||
$this->errormsg='Wettbewerb - Typ fehlt!';
|
||||
return false;
|
||||
}
|
||||
if (empty($this->wettbewerb_kurzbz) || $this->wettbewerb_kurzbz==null )
|
||||
{
|
||||
$this->errormsg='Wettbewerb - Kurzbz. fehlt!';
|
||||
return false;
|
||||
}
|
||||
|
||||
// Abfrage
|
||||
$qry.=" delete from ".$this->schemaSQL.".tbl_wettbewerb ";
|
||||
if (is_array($this->wbtyp_kurzbz))
|
||||
$qry.=" where wbtyp_kurzbz in ('".implode("','",$this->wbtyp_kurzbz)."') ";
|
||||
else
|
||||
$qry.=" where wbtyp_kurzbz='".addslashes($this->wbtyp_kurzbz)."' ";
|
||||
|
||||
if (is_array($this->wettbewerb_kurzbz))
|
||||
$qry.=" and wettbewerb_kurzbz in ('".implode("','",$this->wettbewerb_kurzbz)."') ";
|
||||
else
|
||||
$qry.=" and wettbewerb_kurzbz='".addslashes($this->wettbewerb_kurzbz)."' ";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (empty($this->errormsg))
|
||||
$this->errormsg = 'Fehler beim Veranstaltungskategorie löschen';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function loadWettbewerb($wbtyp_kurzbz=null,$wettbewerb_kurzbz=null)
|
||||
{
|
||||
// Init
|
||||
$this->result=array();
|
||||
$this->errormsg='';
|
||||
|
||||
if (!is_null($wbtyp_kurzbz))
|
||||
$this->wbtyp_kurzbz=$wbtyp_kurzbz;
|
||||
if (!is_null($wettbewerb_kurzbz))
|
||||
$this->wettbewerb_kurzbz=$wettbewerb_kurzbz;
|
||||
|
||||
|
||||
$qry="";
|
||||
$qry.="SELECT *,tbl_wettbewerbtyp.wbtyp_kurzbz,case WHEN tbl_wettbewerb.teamgroesse >1 then 'Teambewerb' else 'Einzelbewerb' end as wettbewerbart FROM ".$this->schemaSQL.".tbl_wettbewerbtyp ";
|
||||
$qry.=" LEFT JOIN ".$this->schemaSQL.".tbl_wettbewerb ON UPPER(".$this->schemaSQL.".tbl_wettbewerb.wbtyp_kurzbz)=UPPER(".$this->schemaSQL.".tbl_wettbewerbtyp.wbtyp_kurzbz) ";
|
||||
$qry.=" WHERE ".$this->schemaSQL.".tbl_wettbewerbtyp.wbtyp_kurzbz>'' ";
|
||||
|
||||
// Suche nach einem einzigen Wetttbewerbstypen wbtyp_kurzbz
|
||||
if (!is_array($this->wbtyp_kurzbz) && !empty($this->wbtyp_kurzbz) )
|
||||
{
|
||||
$cTmpSQL.=" AND UPPER(".$cSchemaSQL."tbl_wettbewerbtyp.wbtyp_kurzbz)=UPPER('".$tmpwbtyp_kurzbz."') ";
|
||||
$qry.=" AND UPPER(".$this->schemaSQL.".tbl_wettbewerbtyp.wbtyp_kurzbz)=UPPER('".$this->wbtyp_kurzbz."') ";
|
||||
}
|
||||
elseif (is_array($tmpwbtyp_kurzbz) && count($tmpwbtyp_kurzbz)>0 )
|
||||
elseif (is_array($this->wettbewerb_kurzbz) && count($this->wettbewerb_kurzbz)>0 )
|
||||
{
|
||||
if (isset($tmpwbtyp_kurzbz[0]['wbtyp_kurzbz'])) // Check ob nicht kpl. Tablestruck in Array
|
||||
{
|
||||
$tmpwbtyp_kurzbzE=array();
|
||||
for ($indZEILE=0;$indZEILE<count($tmpwbtyp_kurzbz);$indZEILE++)
|
||||
$tmpwbtyp_kurzbzE[]=trim($tmpwbtyp_kurzbz[$indZEILE]['wbtyp_kurzbz']);
|
||||
$tmpwbtyp_kurzbz=$tmpwbtyp_kurzbzE;
|
||||
}
|
||||
elseif (isset($tmpwbtyp_kurzbz['wbtyp_kurzbz'])) // Check ob nicht kpl. Tablestruck in Array
|
||||
{
|
||||
$tmpwbtyp_kurzbzE=array();
|
||||
$tmpwbtyp_kurzbzE[]=trim($tmpwbtyp_kurzbz['wbtyp_kurzbz']);
|
||||
$tmpwbtyp_kurzbz=$tmpwbtyp_kurzbzE;
|
||||
}
|
||||
$cTmpSQL.=" AND UPPER(".$cSchemaSQL."tbl_wettbewerbtyp.wbtyp_kurzbz) in ('".strtoupper(implode("','",$tmpwbtyp_kurzbz))."') ";
|
||||
$qry.=" AND UPPER(".$this->schemaSQL.".tbl_wettbewerbtyp.wbtyp_kurzbz) in ('".strtoupper(implode("','",$this->wbtyp_kurzbz))."') ";
|
||||
}
|
||||
|
||||
// Suche nach Wettbewerben wettbewerb_kurzbz
|
||||
if (!is_array($cWettbewerb_kurzbz) && !empty($cWettbewerb_kurzbz) )
|
||||
{
|
||||
$cTmpSQL.=" AND UPPER(".$cSchemaSQL."tbl_wettbewerb.wettbewerb_kurzbz)=UPPER('".$cWettbewerb_kurzbz."') ";
|
||||
}
|
||||
elseif (is_array($cWettbewerb_kurzbz) && count($cWettbewerb_kurzbz)>0 )
|
||||
if (!is_array($this->wettbewerb_kurzbz) && !empty($this->wettbewerb_kurzbz) )
|
||||
{
|
||||
$qry.=" AND UPPER(".$this->schemaSQL.".tbl_wettbewerb.wettbewerb_kurzbz)=UPPER('".$this->wettbewerb_kurzbz."') ";
|
||||
}
|
||||
elseif (is_array($this->wettbewerb_kurzbz) && count($this->wettbewerb_kurzbz)>0 )
|
||||
{
|
||||
if (isset($cWettbewerb_kurzbz[0]['wettbewerb_kurzbz'])) // Check ob nicht kpl. Tablestruck in Array
|
||||
{
|
||||
$tmpwbtyp_kurzbzE=array();
|
||||
for ($indZEILE=0;$indZEILE<count($tmpwbtyp_kurzbz);$indZEILE++)
|
||||
$tmpwbtyp_kurzbzE[]=trim($tmpwbtyp_kurzbz[$indZEILE]['wettbewerb_kurzbz']);
|
||||
$cWettbewerb_kurzbz=$tmpwbtyp_kurzbzE;
|
||||
unset($tmpwbtyp_kurzbzE);
|
||||
}
|
||||
elseif (isset($cWettbewerb_kurzbz['wettbewerb_kurzbz'])) // Check ob nicht kpl. Tablestruck in Array
|
||||
{
|
||||
$tmpwbtyp_kurzbzE=array();
|
||||
$tmpwbtyp_kurzbzE[]=trim($tmpwbtyp_kurzbz['wettbewerb_kurzbz']);
|
||||
$cWettbewerb_kurzbz=$tmpwbtyp_kurzbzE;
|
||||
unset($tmpwbtyp_kurzbzE);
|
||||
}
|
||||
$cTmpSQL.=" AND UPPER(".$cSchemaSQL."tbl_wettbewerb.wettbewerb_kurzbz) in ('".strtoupper(implode("','",$tmpwbtyp_kurzbzE))."') ";
|
||||
$qry.=" AND UPPER(".$this->schemaSQL.".tbl_wettbewerb.wettbewerb_kurzbz) in ('".strtoupper(implode("','",$this->wettbewerb_kurzbz))."') ";
|
||||
}
|
||||
$cTmpSQL.=" OFFSET 0 LIMIT ALL FOR SHARE OF tbl_wettbewerbtyp;";
|
||||
|
||||
// Entfernen der Temporaeren Variablen aus dem Speicher
|
||||
if (isset($cSchemaSQL)) unset($cSchemaSQL);
|
||||
if (isset($tmpwbtyp_kurzbz)) unset($tmpwbtyp_kurzbz);
|
||||
if (isset($cWettbewerb_kurzbz)) unset($cWettbewerb_kurzbz);
|
||||
|
||||
// Datenbankabfrage
|
||||
$this->setStringSQL($cTmpSQL);
|
||||
unset($cTmpSQL);
|
||||
|
||||
$this->setResultSQL(null);
|
||||
if (!$this->fetch_all())
|
||||
return false;
|
||||
$this->setWettbewerb($this->getResultSQL());
|
||||
$this->setResultSQL(null);
|
||||
|
||||
return true;
|
||||
}
|
||||
$qry.=" order by tbl_wettbewerbtyp.wbtyp_kurzbz,wettbewerb_kurzbz ";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->result[]=$row;
|
||||
}
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (empty($this->errormsg))
|
||||
$this->errormsg = 'Fehler beim lesen der Wettbewerbstypen';
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} // Class komune_wettbewerb Ende
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user