mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Fehler beim Zusammenlegen von Firmen behoben
This commit is contained in:
@@ -21,8 +21,8 @@
|
|||||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||||
*/
|
*/
|
||||||
/*******************************************************************************************************
|
/*******************************************************************************************************
|
||||||
* Autocomplete
|
* Autocomplete
|
||||||
* projektabgabe ermöglicht den Download aller Abgaben eines Stg.
|
* projektabgabe ermöglicht den Download aller Abgaben eines Stg.
|
||||||
* fuer Diplom- und Bachelorarbeiten
|
* fuer Diplom- und Bachelorarbeiten
|
||||||
*******************************************************************************************************/
|
*******************************************************************************************************/
|
||||||
header( 'Expires: -1' );
|
header( 'Expires: -1' );
|
||||||
@@ -35,20 +35,20 @@
|
|||||||
require_once('../../config/vilesci.config.inc.php');
|
require_once('../../config/vilesci.config.inc.php');
|
||||||
require_once('../../include/functions.inc.php');
|
require_once('../../include/functions.inc.php');
|
||||||
include_once('../../include/basis_db.class.php');
|
include_once('../../include/basis_db.class.php');
|
||||||
require_once('../../include/benutzerberechtigung.class.php');
|
require_once('../../include/benutzerberechtigung.class.php');
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
// Datenbankanbindung
|
// Datenbankanbindung
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
if (!$db = new basis_db())
|
if (!$db = new basis_db())
|
||||||
die('Datenbank kann nicht geoeffnet werden. <a href="javascript:history.back()">Zurück</a>');
|
die('Datenbank kann nicht geoeffnet werden. <a href="javascript:history.back()">Zurück</a>');
|
||||||
|
|
||||||
if (!$uid = get_uid())
|
if (!$uid = get_uid())
|
||||||
die('Keine UID gefunden ! <a href="javascript:history.back()">Zurück</a>');
|
die('Keine UID gefunden ! <a href="javascript:history.back()">Zurück</a>');
|
||||||
|
|
||||||
$rechte = new benutzerberechtigung();
|
$rechte = new benutzerberechtigung();
|
||||||
$rechte->getBerechtigungen($uid);
|
$rechte->getBerechtigungen($uid);
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
// Initialisierung
|
// Initialisierung
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@@ -58,13 +58,13 @@
|
|||||||
// Parameter Aufruf uebernehmen
|
// Parameter Aufruf uebernehmen
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
$oe_kurzbz=trim((isset($_REQUEST['oe_kurzbz']) ? $_REQUEST['oe_kurzbz']:''));
|
$oe_kurzbz=trim((isset($_REQUEST['oe_kurzbz']) ? $_REQUEST['oe_kurzbz']:''));
|
||||||
$funktion_kurzbz=trim((isset($_REQUEST['funktion_kurzbz']) ? $_REQUEST['funktion_kurzbz']:''));
|
$funktion_kurzbz=trim((isset($_REQUEST['funktion_kurzbz']) ? $_REQUEST['funktion_kurzbz']:''));
|
||||||
$nation=trim((isset($_REQUEST['nation']) ? $_REQUEST['nation']:''));
|
$nation=trim((isset($_REQUEST['nation']) ? $_REQUEST['nation']:''));
|
||||||
$plz=trim((isset($_REQUEST['plz']) ? $_REQUEST['plz']:''));
|
$plz=trim((isset($_REQUEST['plz']) ? $_REQUEST['plz']:''));
|
||||||
|
|
||||||
$work=trim(isset($_REQUEST['work'])?$_REQUEST['work']:(isset($_REQUEST['ajax'])?$_REQUEST['ajax']:false));
|
$work=trim(isset($_REQUEST['work'])?$_REQUEST['work']:(isset($_REQUEST['ajax'])?$_REQUEST['ajax']:false));
|
||||||
$work=strtolower($work);
|
$work=strtolower($work);
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
// Datenlesen
|
// Datenlesen
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@@ -83,7 +83,7 @@ cellSeparator (default value: "|")
|
|||||||
exit();
|
exit();
|
||||||
if (is_null($gemeinde) || $gemeinde=='')
|
if (is_null($gemeinde) || $gemeinde=='')
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($gemeinde))));
|
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($gemeinde))));
|
||||||
$pWhere=" upper(gemeinde) like '%".addslashes($matchcode)."%' ";
|
$pWhere=" upper(gemeinde) like '%".addslashes($matchcode)."%' ";
|
||||||
$pSql="SELECT distinct gemeinde
|
$pSql="SELECT distinct gemeinde
|
||||||
@@ -92,14 +92,14 @@ cellSeparator (default value: "|")
|
|||||||
ORDER BY nation,gemeinde ";
|
ORDER BY nation,gemeinde ";
|
||||||
|
|
||||||
$pArt='';
|
$pArt='';
|
||||||
$pDistinct=true;
|
$pDistinct=true;
|
||||||
$pFields='';
|
$pFields='';
|
||||||
$pTable='';
|
$pTable='';
|
||||||
$matchcode='';
|
$matchcode='';
|
||||||
$pWhere='';
|
$pWhere='';
|
||||||
$pOrder='';
|
$pOrder='';
|
||||||
$pLimit='';
|
$pLimit='';
|
||||||
|
|
||||||
if (!$oRresult=$db->SQL($pArt,$pDistinct,$pFields,$pTable,$pWhere,$pOrder,$pLimit,$pSql))
|
if (!$oRresult=$db->SQL($pArt,$pDistinct,$pFields,$pTable,$pWhere,$pOrder,$pLimit,$pSql))
|
||||||
{
|
{
|
||||||
exit(' |'.$db->errormsg."\n");
|
exit(' |'.$db->errormsg."\n");
|
||||||
@@ -107,7 +107,7 @@ cellSeparator (default value: "|")
|
|||||||
for ($i=0;$i<count($oRresult);$i++)
|
for ($i=0;$i<count($oRresult);$i++)
|
||||||
echo html_entity_decode($oRresult[$i]->gemeinde).'|'.html_entity_decode($nation)."\n";
|
echo html_entity_decode($oRresult[$i]->gemeinde).'|'.html_entity_decode($nation)."\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'plz':
|
case 'plz':
|
||||||
$plz=trim((isset($_REQUEST['q']) ? $_REQUEST['q']:''));
|
$plz=trim((isset($_REQUEST['q']) ? $_REQUEST['q']:''));
|
||||||
$nation=trim((isset($_REQUEST['nation']) ? $_REQUEST['nation']:''));
|
$nation=trim((isset($_REQUEST['nation']) ? $_REQUEST['nation']:''));
|
||||||
@@ -115,7 +115,7 @@ cellSeparator (default value: "|")
|
|||||||
exit();
|
exit();
|
||||||
if (is_null($plz) || $plz=='')
|
if (is_null($plz) || $plz=='')
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($plz))));
|
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($plz))));
|
||||||
$pWhere=" to_char(plz,'999999') like '%".addslashes($matchcode)."%' ";
|
$pWhere=" to_char(plz,'999999') like '%".addslashes($matchcode)."%' ";
|
||||||
$pSql="SELECT distinct plz
|
$pSql="SELECT distinct plz
|
||||||
@@ -124,7 +124,7 @@ cellSeparator (default value: "|")
|
|||||||
ORDER BY plz ";
|
ORDER BY plz ";
|
||||||
|
|
||||||
$pArt='';
|
$pArt='';
|
||||||
$pDistinct=true;
|
$pDistinct=true;
|
||||||
$pFields='';
|
$pFields='';
|
||||||
$pTable='';
|
$pTable='';
|
||||||
$matchcode='';
|
$matchcode='';
|
||||||
@@ -146,7 +146,7 @@ cellSeparator (default value: "|")
|
|||||||
exit();
|
exit();
|
||||||
if (is_null($ort) || $ort=='')
|
if (is_null($ort) || $ort=='')
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($ort))));
|
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($ort))));
|
||||||
$pWhere=" upper(ort) like '%".addslashes($matchcode)."%' ".($nation?" and nation='".addslashes($nation)."'":'');
|
$pWhere=" upper(ort) like '%".addslashes($matchcode)."%' ".($nation?" and nation='".addslashes($nation)."'":'');
|
||||||
$pSql="SELECT distinct plz,ort
|
$pSql="SELECT distinct plz,ort
|
||||||
@@ -155,7 +155,7 @@ cellSeparator (default value: "|")
|
|||||||
ORDER BY plz,ort ";
|
ORDER BY plz,ort ";
|
||||||
|
|
||||||
$pArt='';
|
$pArt='';
|
||||||
$pDistinct=true;
|
$pDistinct=true;
|
||||||
$pFields='';
|
$pFields='';
|
||||||
$pTable='';
|
$pTable='';
|
||||||
$matchcode='';
|
$matchcode='';
|
||||||
@@ -170,20 +170,20 @@ cellSeparator (default value: "|")
|
|||||||
echo html_entity_decode($oRresult[$i]->ort).'|'.html_entity_decode($oRresult[$i]->plz)."\n";
|
echo html_entity_decode($oRresult[$i]->ort).'|'.html_entity_decode($oRresult[$i]->plz)."\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case 'position':
|
case 'position':
|
||||||
$position=trim((isset($_REQUEST['q']) ? $_REQUEST['q']:''));
|
$position=trim((isset($_REQUEST['q']) ? $_REQUEST['q']:''));
|
||||||
|
|
||||||
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($position))));
|
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($position))));
|
||||||
$pWhere=" upper(position) like '%".addslashes($matchcode)."%' ".($funktion_kurzbz?" and funktion_kurzbz='".addslashes($funktion_kurzbz)."'":'');
|
$pWhere=" upper(position) like '%".addslashes($matchcode)."%' ".($funktion_kurzbz?" and funktion_kurzbz='".addslashes($funktion_kurzbz)."'":'');
|
||||||
$pSql="SELECT distinct funktion_kurzbz,position
|
$pSql="SELECT distinct funktion_kurzbz,position
|
||||||
FROM public.tbl_personfunktionstandort
|
FROM public.tbl_personfunktionstandort
|
||||||
where ". $pWhere ."
|
where ". $pWhere ."
|
||||||
ORDER BY funktion_kurzbz,position ";
|
ORDER BY funktion_kurzbz,position ";
|
||||||
|
|
||||||
$pArt='';
|
$pArt='';
|
||||||
$pDistinct=true;
|
$pDistinct=true;
|
||||||
$pFields='';
|
$pFields='';
|
||||||
$pTable='';
|
$pTable='';
|
||||||
$matchcode='';
|
$matchcode='';
|
||||||
@@ -197,8 +197,8 @@ cellSeparator (default value: "|")
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($position))));
|
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($position))));
|
||||||
$pWhere=" upper(position) like '%".addslashes($matchcode)."%'";
|
$pWhere=" upper(position) like '%".addslashes($matchcode)."%'";
|
||||||
$pSql="SELECT distinct funktion_kurzbz,position
|
$pSql="SELECT distinct funktion_kurzbz,position
|
||||||
FROM public.tbl_personfunktionstandort
|
FROM public.tbl_personfunktionstandort
|
||||||
where ". $pWhere ."
|
where ". $pWhere ."
|
||||||
ORDER BY funktion_kurzbz,position ";
|
ORDER BY funktion_kurzbz,position ";
|
||||||
@@ -211,7 +211,7 @@ cellSeparator (default value: "|")
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'work_firmen_search':
|
case 'work_firmen_search':
|
||||||
$json=array();
|
$json=array();
|
||||||
$berechtigung_kurzbz = 'basis/firma:begrenzt';
|
$berechtigung_kurzbz = 'basis/firma:begrenzt';
|
||||||
if(!$rechte->isBerechtigt($berechtigung_kurzbz))
|
if(!$rechte->isBerechtigt($berechtigung_kurzbz))
|
||||||
exit(json_encode(array_push($json, array ('oFirma_id' => '','oName' =>'keine Berechtigung'))));
|
exit(json_encode(array_push($json, array ('oFirma_id' => '','oName' =>'keine Berechtigung'))));
|
||||||
@@ -223,17 +223,17 @@ cellSeparator (default value: "|")
|
|||||||
$qry.=" FROM public.tbl_firma, public.tbl_standort ";
|
$qry.=" FROM public.tbl_firma, public.tbl_standort ";
|
||||||
$qry.=" left outer join public.tbl_adresse on ( tbl_adresse.adresse_id=tbl_standort.adresse_id ) ";
|
$qry.=" left outer join public.tbl_adresse on ( tbl_adresse.adresse_id=tbl_standort.adresse_id ) ";
|
||||||
$qry.=" WHERE tbl_standort.firma_id=tbl_firma.firma_id ";
|
$qry.=" WHERE tbl_standort.firma_id=tbl_firma.firma_id ";
|
||||||
|
|
||||||
if($filter!='')
|
if($filter!='')
|
||||||
$qry.= " and ( lower(tbl_firma.name) like lower('%$filter%')
|
$qry.= " and ( lower(tbl_firma.name) like lower('%$filter%')
|
||||||
OR lower(kurzbz) like lower('%$filter%')
|
OR lower(kurzbz) like lower('%$filter%')
|
||||||
OR lower(tbl_adresse.strasse) like lower('%$filter%')
|
OR lower(tbl_adresse.strasse) like lower('%$filter%')
|
||||||
OR lower(bezeichnung) like lower('%$filter%')
|
OR lower(bezeichnung) like lower('%$filter%')
|
||||||
OR lower(anmerkung) like lower('%$filter%')
|
OR lower(tbl_firma.anmerkung) like lower('%$filter%')
|
||||||
".(is_numeric($filter)?" OR tbl_firma.firma_id='$filter'":'')."
|
".(is_numeric($filter)?" OR tbl_firma.firma_id='$filter'":'')."
|
||||||
) ";
|
) ";
|
||||||
|
|
||||||
|
|
||||||
if($firmentyp_kurzbz!='')
|
if($firmentyp_kurzbz!='')
|
||||||
$qry.=" and firmentyp_kurzbz='".addslashes($firmentyp_kurzbz)."'";
|
$qry.=" and firmentyp_kurzbz='".addslashes($firmentyp_kurzbz)."'";
|
||||||
$qry.=" ORDER BY tbl_firma.name ";
|
$qry.=" ORDER BY tbl_firma.name ";
|
||||||
@@ -242,7 +242,7 @@ cellSeparator (default value: "|")
|
|||||||
$qry.=" limit 350 ";
|
$qry.=" limit 350 ";
|
||||||
|
|
||||||
$pArt='';
|
$pArt='';
|
||||||
$pDistinct=false;
|
$pDistinct=false;
|
||||||
$pFields='';
|
$pFields='';
|
||||||
$pTable='';
|
$pTable='';
|
||||||
$matchcode='';
|
$matchcode='';
|
||||||
@@ -253,10 +253,10 @@ cellSeparator (default value: "|")
|
|||||||
if (!$oRresult=$db->SQL($pArt,$pDistinct,$pFields,$pTable,$pWhere,$pOrder,$pLimit,$pSql))
|
if (!$oRresult=$db->SQL($pArt,$pDistinct,$pFields,$pTable,$pWhere,$pOrder,$pLimit,$pSql))
|
||||||
{
|
{
|
||||||
array_push($json, array ('oFirma_id' => '','oName' => $db->errormsg ));
|
array_push($json, array ('oFirma_id' => '','oName' => $db->errormsg ));
|
||||||
}
|
}
|
||||||
else if ($oRresult)
|
else if ($oRresult)
|
||||||
{
|
{
|
||||||
for ($i=0;$i<count($oRresult);$i++)
|
for ($i=0;$i<count($oRresult);$i++)
|
||||||
{
|
{
|
||||||
array_push($json, array ('oFirma_id' => $oRresult[$i]->firma_id,'oName' => $oRresult[$i]->name ));
|
array_push($json, array ('oFirma_id' => $oRresult[$i]->firma_id,'oName' => $oRresult[$i]->name ));
|
||||||
}
|
}
|
||||||
@@ -264,17 +264,17 @@ cellSeparator (default value: "|")
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
array_push($json, array ('oFirma_id' => '','oName' => 'keine Daten gefunden!' ));
|
array_push($json, array ('oFirma_id' => '','oName' => 'keine Daten gefunden!' ));
|
||||||
}
|
}
|
||||||
echo json_encode($json);
|
echo json_encode($json);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'tags':
|
case 'tags':
|
||||||
$tag=trim((isset($_REQUEST['term']) ? $_REQUEST['term']:''));
|
$tag=trim((isset($_REQUEST['term']) ? $_REQUEST['term']:''));
|
||||||
|
|
||||||
$pWhere=" upper(tag) like upper('%".addslashes($tag)."%')";
|
$pWhere=" upper(tag) like upper('%".addslashes($tag)."%')";
|
||||||
|
|
||||||
$pArt='select';
|
$pArt='select';
|
||||||
$pDistinct=false;
|
$pDistinct=false;
|
||||||
$pFields='tag';
|
$pFields='tag';
|
||||||
$pTable='public.tbl_tag';
|
$pTable='public.tbl_tag';
|
||||||
$matchcode='';
|
$matchcode='';
|
||||||
@@ -283,7 +283,7 @@ cellSeparator (default value: "|")
|
|||||||
$pSql='';
|
$pSql='';
|
||||||
if (!$result=$db->SQL($pArt,$pDistinct,$pFields,$pTable,$pWhere,$pOrder,$pLimit,$pSql))
|
if (!$result=$db->SQL($pArt,$pDistinct,$pFields,$pTable,$pWhere,$pOrder,$pLimit,$pSql))
|
||||||
exit(' |'.$db->errormsg."\n");
|
exit(' |'.$db->errormsg."\n");
|
||||||
|
|
||||||
if(is_array($result))
|
if(is_array($result))
|
||||||
{
|
{
|
||||||
$json=array();
|
$json=array();
|
||||||
@@ -296,13 +296,13 @@ cellSeparator (default value: "|")
|
|||||||
echo json_encode($json);
|
echo json_encode($json);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Person - FH Technikum suche
|
// Person - FH Technikum suche
|
||||||
case 'person':
|
case 'person':
|
||||||
$person_id=trim((isset($_REQUEST['term']) ? $_REQUEST['term']:''));
|
$person_id=trim((isset($_REQUEST['term']) ? $_REQUEST['term']:''));
|
||||||
if (is_null($person_id) || $person_id=='')
|
if (is_null($person_id) || $person_id=='')
|
||||||
exit('person_id wurde nicht übergeben!');
|
exit('person_id wurde nicht übergeben!');
|
||||||
|
|
||||||
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($person_id))));
|
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($person_id))));
|
||||||
$pWhere=" aktiv ";
|
$pWhere=" aktiv ";
|
||||||
if ($person_id)
|
if ($person_id)
|
||||||
@@ -313,20 +313,20 @@ cellSeparator (default value: "|")
|
|||||||
$pWhere.=" or UPPER(trim(vorname)) like '%".addslashes($matchcode)."%' ";
|
$pWhere.=" or UPPER(trim(vorname)) like '%".addslashes($matchcode)."%' ";
|
||||||
$pWhere.=" or UPPER(trim(nachname || ' ' || vorname)) like '%".addslashes($matchcode)."%' ";
|
$pWhere.=" or UPPER(trim(nachname || ' ' || vorname)) like '%".addslashes($matchcode)."%' ";
|
||||||
$pWhere.=" or UPPER(trim(vorname || ' ' || nachname)) like '%".addslashes($matchcode)."%' ) ";
|
$pWhere.=" or UPPER(trim(vorname || ' ' || nachname)) like '%".addslashes($matchcode)."%' ) ";
|
||||||
}
|
}
|
||||||
if (!empty($oe_kurzbz))
|
if (!empty($oe_kurzbz))
|
||||||
{
|
{
|
||||||
$pSql="SELECT vw_benutzer.uid,vw_benutzer.person_id,vw_benutzer.aktiv,uid,person_id,titelpre,anrede,vorname,nachname,vornamen,titelpost,funktion_kurzbz
|
$pSql="SELECT vw_benutzer.uid,vw_benutzer.person_id,vw_benutzer.aktiv,uid,person_id,titelpre,anrede,vorname,nachname,vornamen,titelpost,funktion_kurzbz
|
||||||
FROM public.tbl_benutzerfunktion JOIN campus.vw_benutzer USING(uid)
|
FROM public.tbl_benutzerfunktion JOIN campus.vw_benutzer USING(uid)
|
||||||
where ". $pWhere ."
|
where ". $pWhere ."
|
||||||
and (funktion_kurzbz='oezuordnung')
|
and (funktion_kurzbz='oezuordnung')
|
||||||
and oe_kurzbz IN(
|
and oe_kurzbz IN(
|
||||||
WITH RECURSIVE oes(oe_kurzbz, oe_parent_kurzbz) as
|
WITH RECURSIVE oes(oe_kurzbz, oe_parent_kurzbz) as
|
||||||
(
|
(
|
||||||
SELECT oe_kurzbz, oe_parent_kurzbz FROM public.tbl_organisationseinheit
|
SELECT oe_kurzbz, oe_parent_kurzbz FROM public.tbl_organisationseinheit
|
||||||
WHERE upper(trim(oe_kurzbz))=upper(trim('".addslashes($oe_kurzbz)."'))
|
WHERE upper(trim(oe_kurzbz))=upper(trim('".addslashes($oe_kurzbz)."'))
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
|
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
|
||||||
WHERE o.oe_parent_kurzbz=oes.oe_kurzbz
|
WHERE o.oe_parent_kurzbz=oes.oe_kurzbz
|
||||||
)
|
)
|
||||||
SELECT oe_kurzbz
|
SELECT oe_kurzbz
|
||||||
@@ -335,7 +335,7 @@ cellSeparator (default value: "|")
|
|||||||
ORDER BY nachname, vorname, funktion_kurzbz ";
|
ORDER BY nachname, vorname, funktion_kurzbz ";
|
||||||
|
|
||||||
$pArt='';
|
$pArt='';
|
||||||
$pDistinct=true;
|
$pDistinct=true;
|
||||||
$pFields='';
|
$pFields='';
|
||||||
$pTable='';
|
$pTable='';
|
||||||
$matchcode='';
|
$matchcode='';
|
||||||
@@ -347,7 +347,7 @@ cellSeparator (default value: "|")
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pArt='select';
|
$pArt='select';
|
||||||
$pDistinct=true;
|
$pDistinct=true;
|
||||||
$pFields='uid,person_id,titelpre,anrede,vorname,nachname,vornamen,aktiv,\'\' as funktion_kurzbz';
|
$pFields='uid,person_id,titelpre,anrede,vorname,nachname,vornamen,aktiv,\'\' as funktion_kurzbz';
|
||||||
$pTable=' campus.vw_benutzer ';
|
$pTable=' campus.vw_benutzer ';
|
||||||
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($person_id))));
|
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($person_id))));
|
||||||
@@ -372,19 +372,19 @@ cellSeparator (default value: "|")
|
|||||||
$json[]=$item;
|
$json[]=$item;
|
||||||
/* echo html_entity_decode($oRresult[$i]->person_id).'|'
|
/* echo html_entity_decode($oRresult[$i]->person_id).'|'
|
||||||
.trim($oRresult[$i]->anrede).' '.($oRresult[$i]->titelpre?html_entity_decode($oRresult[$i]->titelpre).' ':'')
|
.trim($oRresult[$i]->anrede).' '.($oRresult[$i]->titelpre?html_entity_decode($oRresult[$i]->titelpre).' ':'')
|
||||||
.html_entity_decode($oRresult[$i]->vorname).' '.html_entity_decode($oRresult[$i]->nachname).($oRresult[$i]->funktion_kurzbz?html_entity_decode($oRresult[$i]->funktion_kurzbz).' ':'')
|
.html_entity_decode($oRresult[$i]->vorname).' '.html_entity_decode($oRresult[$i]->nachname).($oRresult[$i]->funktion_kurzbz?html_entity_decode($oRresult[$i]->funktion_kurzbz).' ':'')
|
||||||
.($oRresult[$i]->aktiv==true || $oRresult[$i]->aktiv=='t'?' <img src="../../skin/images/tick.png" alt="aktiv" />':' <img src="../../skin/images/cross.png" alt="nicht aktiv" />')
|
.($oRresult[$i]->aktiv==true || $oRresult[$i]->aktiv=='t'?' <img src="../../skin/images/tick.png" alt="aktiv" />':' <img src="../../skin/images/cross.png" alt="nicht aktiv" />')
|
||||||
."\n"; */
|
."\n"; */
|
||||||
}
|
}
|
||||||
echo json_encode($json);
|
echo json_encode($json);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Lektor,Student - FHTW Suche im LV-Plan
|
// Lektor,Student - FHTW Suche im LV-Plan
|
||||||
case 'lektor_student':
|
case 'lektor_student':
|
||||||
$person_id=trim((isset($_REQUEST['q']) ? $_REQUEST['q']:''));
|
$person_id=trim((isset($_REQUEST['q']) ? $_REQUEST['q']:''));
|
||||||
if (is_null($person_id) || $person_id=='')
|
if (is_null($person_id) || $person_id=='')
|
||||||
exit('person_id wurde nicht übergeben!');
|
exit('person_id wurde nicht übergeben!');
|
||||||
|
|
||||||
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($person_id))));
|
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($person_id))));
|
||||||
$pWhere=" aktiv ";
|
$pWhere=" aktiv ";
|
||||||
if ($person_id)
|
if ($person_id)
|
||||||
@@ -395,20 +395,20 @@ cellSeparator (default value: "|")
|
|||||||
$pWhere.=" or UPPER(trim(vorname)) like '%".addslashes($matchcode)."%' ";
|
$pWhere.=" or UPPER(trim(vorname)) like '%".addslashes($matchcode)."%' ";
|
||||||
$pWhere.=" or UPPER(trim(nachname || ' ' || vorname)) like '%".addslashes($matchcode)."%' ";
|
$pWhere.=" or UPPER(trim(nachname || ' ' || vorname)) like '%".addslashes($matchcode)."%' ";
|
||||||
$pWhere.=" or UPPER(trim(vorname || ' ' || nachname)) like '%".addslashes($matchcode)."%' ) ";
|
$pWhere.=" or UPPER(trim(vorname || ' ' || nachname)) like '%".addslashes($matchcode)."%' ) ";
|
||||||
}
|
}
|
||||||
/*if (!empty($oe_kurzbz))
|
/*if (!empty($oe_kurzbz))
|
||||||
{
|
{
|
||||||
$pSql="SELECT vw_benutzer.uid,vw_benutzer.person_id,vw_benutzer.aktiv,uid,person_id,titelpre,anrede,vorname,nachname,vornamen,titelpost,funktion_kurzbz
|
$pSql="SELECT vw_benutzer.uid,vw_benutzer.person_id,vw_benutzer.aktiv,uid,person_id,titelpre,anrede,vorname,nachname,vornamen,titelpost,funktion_kurzbz
|
||||||
FROM public.tbl_benutzerfunktion JOIN campus.vw_benutzer USING(uid)
|
FROM public.tbl_benutzerfunktion JOIN campus.vw_benutzer USING(uid)
|
||||||
where ". $pWhere ."
|
where ". $pWhere ."
|
||||||
and (funktion_kurzbz='oezuordnung')
|
and (funktion_kurzbz='oezuordnung')
|
||||||
and oe_kurzbz IN(
|
and oe_kurzbz IN(
|
||||||
WITH RECURSIVE oes(oe_kurzbz, oe_parent_kurzbz) as
|
WITH RECURSIVE oes(oe_kurzbz, oe_parent_kurzbz) as
|
||||||
(
|
(
|
||||||
SELECT oe_kurzbz, oe_parent_kurzbz FROM public.tbl_organisationseinheit
|
SELECT oe_kurzbz, oe_parent_kurzbz FROM public.tbl_organisationseinheit
|
||||||
WHERE upper(trim(oe_kurzbz))=upper(trim('".addslashes($oe_kurzbz)."'))
|
WHERE upper(trim(oe_kurzbz))=upper(trim('".addslashes($oe_kurzbz)."'))
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
|
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
|
||||||
WHERE o.oe_parent_kurzbz=oes.oe_kurzbz
|
WHERE o.oe_parent_kurzbz=oes.oe_kurzbz
|
||||||
)
|
)
|
||||||
SELECT oe_kurzbz
|
SELECT oe_kurzbz
|
||||||
@@ -417,7 +417,7 @@ cellSeparator (default value: "|")
|
|||||||
ORDER BY nachname, vorname, funktion_kurzbz ";
|
ORDER BY nachname, vorname, funktion_kurzbz ";
|
||||||
|
|
||||||
$pArt='';
|
$pArt='';
|
||||||
$pDistinct=true;
|
$pDistinct=true;
|
||||||
$pFields='';
|
$pFields='';
|
||||||
$pTable='';
|
$pTable='';
|
||||||
$matchcode='';
|
$matchcode='';
|
||||||
@@ -429,18 +429,18 @@ cellSeparator (default value: "|")
|
|||||||
else
|
else
|
||||||
{*/
|
{*/
|
||||||
$pArt='select';
|
$pArt='select';
|
||||||
$pDistinct=true;
|
$pDistinct=true;
|
||||||
$pFields='uid,vorname,nachname,tbl_mitarbeiter.lektor,aktiv';
|
$pFields='uid,vorname,nachname,tbl_mitarbeiter.lektor,aktiv';
|
||||||
$pTable=' campus.vw_benutzer LEFT JOIN public.tbl_mitarbeiter ON (uid=mitarbeiter_uid)';
|
$pTable=' campus.vw_benutzer LEFT JOIN public.tbl_mitarbeiter ON (uid=mitarbeiter_uid)';
|
||||||
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($person_id))));
|
$matchcode=mb_strtoupper(addslashes(str_replace(array('*','%',',',';',"'",'"',' '),'%',trim($person_id))));
|
||||||
$pOrder='lektor,nachname';
|
$pOrder='lektor,nachname';
|
||||||
$pLimit='100';
|
$pLimit='100';
|
||||||
$pSql='';
|
$pSql='';
|
||||||
|
|
||||||
if (!$oRresult=$db->SQL($pArt,$pDistinct,$pFields,$pTable,$pWhere,$pOrder,$pLimit,$pSql))
|
if (!$oRresult=$db->SQL($pArt,$pDistinct,$pFields,$pTable,$pWhere,$pOrder,$pLimit,$pSql))
|
||||||
exit(' |'.$db->errormsg."\n");
|
exit(' |'.$db->errormsg."\n");
|
||||||
|
|
||||||
|
|
||||||
for ($i=0;$i<count($oRresult);$i++)
|
for ($i=0;$i<count($oRresult);$i++)
|
||||||
{
|
{
|
||||||
echo html_entity_decode($oRresult[$i]->uid).'|'
|
echo html_entity_decode($oRresult[$i]->uid).'|'
|
||||||
@@ -450,7 +450,7 @@ cellSeparator (default value: "|")
|
|||||||
."\n";
|
."\n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
echo " Funktion $work fehlt! ";
|
echo " Funktion $work fehlt! ";
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user