mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
This commit is contained in:
@@ -24,7 +24,10 @@ if(!$erg_std=pg_query($conn, "SET datestyle TO ISO; SET search_path TO campus;")
|
||||
|
||||
|
||||
//Startwerte setzen
|
||||
$db_stpl_table='stundenplan';
|
||||
if (!isset($_GET['db_stpl_table']))
|
||||
$db_stpl_table='stundenplan';
|
||||
else
|
||||
$db_stpl_table=$_GET['db_stpl_table'];
|
||||
if (isset($_GET['type']))
|
||||
$type=$_GET['type'];
|
||||
if (isset($_GET['pers_uid']))
|
||||
|
||||
@@ -54,9 +54,9 @@
|
||||
|
||||
if(isset($_GET['institut']))
|
||||
$institut = $_GET['institut'];
|
||||
else
|
||||
else
|
||||
$institut = null;
|
||||
|
||||
|
||||
$stge=array();
|
||||
if(isset($_GET['stg_kz']))
|
||||
{
|
||||
@@ -71,10 +71,10 @@
|
||||
|
||||
// Link fuer den Export
|
||||
$export_link='zeitsperre_export.php?';
|
||||
|
||||
|
||||
if(!is_null($institut))
|
||||
$export_link.="institut=$institut";
|
||||
else
|
||||
else
|
||||
{
|
||||
if ($fix==true)
|
||||
$export_link.='fix=true';
|
||||
@@ -94,20 +94,20 @@
|
||||
$studiensemester = $ss->getaktorNext();
|
||||
$ss->load($studiensemester);
|
||||
}
|
||||
|
||||
$datum_beginn=$ss->start;
|
||||
$datum_ende=$ss->ende;
|
||||
|
||||
$datum_beginn='2008-06-01'; // $ss->start;
|
||||
$datum_ende='2008-08-31'; //$ss->ende;
|
||||
$ts_beginn=$datum_obj->mktime_fromdate($datum_beginn);
|
||||
$ts_ende=$datum_obj->mktime_fromdate($datum_ende);
|
||||
|
||||
// Lektoren holen
|
||||
$ma=new mitarbeiter($conn);
|
||||
|
||||
|
||||
if(!is_null($institut))
|
||||
{
|
||||
$mitarbeiter = $ma->getMitarbeiterInstitut($institut);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if (is_null($funktion))
|
||||
$mitarbeiter=$ma->getMitarbeiter($lektor,$fix);
|
||||
@@ -151,14 +151,14 @@
|
||||
{
|
||||
if($fb->fachbereich_kurzbz==$institut)
|
||||
$selected='selected';
|
||||
else
|
||||
else
|
||||
$selected='';
|
||||
|
||||
|
||||
echo "<option value='$fb->fachbereich_kurzbz' $selected>$fb->bezeichnung</option>";
|
||||
}
|
||||
}
|
||||
echo '</SELECT><input type="submit" value="Anzeigen"></FORM>';
|
||||
echo '<br>';
|
||||
echo '<br>';
|
||||
}
|
||||
?>
|
||||
<a class="Item" href="<?php echo $export_link; ?>">Excel</a>
|
||||
|
||||
@@ -57,10 +57,10 @@
|
||||
$funktion=null;
|
||||
if ($funktion=='true' || $funktion=='1') $funktion=true;
|
||||
if ($funktion=='false' || $funktion=='') $funktion=false;
|
||||
|
||||
|
||||
if(isset($_GET['institut']))
|
||||
$institut = $_GET['institut'];
|
||||
else
|
||||
else
|
||||
$institut = null;
|
||||
|
||||
$stge=array();
|
||||
@@ -90,7 +90,7 @@
|
||||
//$studiensemester=$ss->getAktTillNext();
|
||||
}
|
||||
$datum_beginn=$ss->start;
|
||||
$datum_ende=$ss->ende;
|
||||
$datum_ende='2008-09-01';//$ss->ende;
|
||||
$ts_beginn=$datum_obj->mktime_fromdate($datum_beginn);
|
||||
$ts_ende=$datum_obj->mktime_fromdate($datum_ende);
|
||||
|
||||
@@ -98,9 +98,9 @@
|
||||
$ma=new mitarbeiter($conn);
|
||||
if(!is_null($institut))
|
||||
{
|
||||
$mitarbeiter = $ma->getMitarbeiterInstitut($institut);
|
||||
$mitarbeiter = $ma->getMitarbeiterInstitut($institut);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
//if (!is_null($funktion))
|
||||
// $mitarbeiter=$ma->getMitarbeiterStg(true,null,$stge,$funktion);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
$conn=pg_connect(CONN_STRING);
|
||||
|
||||
//Stundenplandaten ermitteln welche mehrfach vorkommen
|
||||
$sql_query="SELECT * FROM vw_reservierung WHERE datum='$datum' AND stunde=$stunde AND ort_kurzbz='$ort_kurzbz'";
|
||||
$sql_query="SELECT * FROM lehre.vw_reservierung WHERE datum='$datum' AND stunde=$stunde AND ort_kurzbz='$ort_kurzbz'";
|
||||
//echo $sql_query."<br>";
|
||||
$result=pg_exec($conn, $sql_query);
|
||||
$num_rows=pg_numrows($result);
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
// * die keinem aktiven Lehrfach zu-
|
||||
// * geteilt sind. Mittels einer Combo-
|
||||
// * box kann ein aktives Lehrfach
|
||||
// * zugewiesen werden.
|
||||
// * zugewiesen werden.
|
||||
// *********************************************
|
||||
//DB Verbindung herstellen
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/studiensemester.class.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/lehrfach.class.php');
|
||||
|
||||
|
||||
if (!$conn = @pg_pconnect(CONN_STRING))
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
|
||||
$studiensemester_kurzbz = (isset($_GET['studiensemester_kurzbz'])?$_GET['studiensemester_kurzbz']:'');
|
||||
$i=0;
|
||||
|
||||
@@ -46,7 +46,7 @@ if(isset($_GET['lf_id']))
|
||||
else
|
||||
{
|
||||
echo nl2br("<span style='font-color: Red;'>\nFehler beim Speichern Student</span>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="GET">';
|
||||
@@ -62,11 +62,11 @@ foreach($stsem_obj->studiensemester as $stsem)
|
||||
{
|
||||
$selected='selected';
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$selected='';
|
||||
}
|
||||
|
||||
|
||||
echo "<option value='$stsem->studiensemester_kurzbz' $selected>$stsem->studiensemester_kurzbz</option>";
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ echo " <INPUT type='submit' value='OK'>";
|
||||
|
||||
echo '</form>';
|
||||
|
||||
$qry="SELECT tbl_lehrveranstaltung.bezeichnung as lvbez, tbl_lehrveranstaltung.kurzbz as lvkurzbz, tbl_lehrfach.*, tbl_lehreinheit.lehreinheit_id
|
||||
FROM lehre.tbl_lehreinheit JOIN lehre.tbl_lehrfach USING (lehrfach_id) JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
|
||||
WHERE NOT tbl_lehrfach.aktiv AND studiensemester_kurzbz='".$studiensemester_kurzbz."' ORDER BY studiengang_kz,semester;";
|
||||
$qry="SELECT tbl_lehrveranstaltung.bezeichnung as lvbez, tbl_lehrveranstaltung.kurzbz as lvkurzbz, tbl_lehrfach.*, tbl_lehreinheit.lehreinheit_id
|
||||
FROM lehre.tbl_lehreinheit JOIN lehre.tbl_lehrfach USING (lehrfach_id) JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id) JOIN tbl_fachbereich USING (fachbereich_kurzbz)
|
||||
WHERE (NOT tbl_lehrfach.aktiv OR NOT tbl_fachbereich.aktiv) AND studiensemester_kurzbz='".$studiensemester_kurzbz."' ORDER BY studiengang_kz,semester;";
|
||||
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
@@ -107,15 +107,15 @@ if($result = pg_query($conn, $qry))
|
||||
{
|
||||
$selected='selected';
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$selected='';
|
||||
}
|
||||
$row_lf->bezeichnung=trim($row_lf->bezeichnung);
|
||||
echo "<option value='$row_lf->lehrfach_id' $selected>$row_lf->kurzbz - $row_lf->bezeichnung ($row_lf->fachbereich_kurzbz)</option>";
|
||||
}
|
||||
}
|
||||
echo "</SELECT>";
|
||||
}
|
||||
}
|
||||
echo "<td><input type='submit' value='Speichern'></td>";
|
||||
echo "</form>";
|
||||
if($i==20)
|
||||
|
||||
@@ -27,6 +27,32 @@ require_once('../../include/functions.inc.php');
|
||||
if(!$conn=pg_pconnect(CONN_STRING))
|
||||
die("Konnte Verbindung zur Datenbank nicht herstellen");
|
||||
|
||||
// Variablen checken
|
||||
if (isset($_GET['studiengang_kz']))
|
||||
$studiengang_kz=$_GET['studiengang_kz'];
|
||||
if (isset($_GET['semester']))
|
||||
$semester=$_GET['semester'];
|
||||
if (isset($_GET['verband']))
|
||||
$verband=$_GET['verband'];
|
||||
else
|
||||
$verband=' ';
|
||||
if ($verband=='')
|
||||
$verband=' ';
|
||||
if (isset($_GET['gruppe']))
|
||||
$gruppe=$_GET['gruppe'];
|
||||
else
|
||||
$gruppe=' ';
|
||||
if ($gruppe=='')
|
||||
$gruppe=' ';
|
||||
if (isset($_GET['gruppe_kurzbz']))
|
||||
$gruppe_kurzbz=$_GET['gruppe_kurzbz'];
|
||||
else
|
||||
$gruppe_kurzbz='';
|
||||
if (isset($_GET['leid']))
|
||||
$leid=$_GET['leid'];
|
||||
else
|
||||
$leid=0;
|
||||
|
||||
$s=new studiengang($conn);
|
||||
$s->getAll('typ, kurzbz', false);
|
||||
$studiengang=$s->result;
|
||||
@@ -52,31 +78,7 @@ else
|
||||
if (isset($_GET['insert']))
|
||||
if ($_GET['insert']=='true')
|
||||
{
|
||||
// Variablen checken
|
||||
if (isset($_GET['studiengang_kz']))
|
||||
$studiengang_kz=$_GET['studiengang_kz'];
|
||||
if (isset($_GET['semester']))
|
||||
$semester=$_GET['semester'];
|
||||
if (isset($_GET['verband']))
|
||||
$verband=$_GET['verband'];
|
||||
else
|
||||
$verband=' ';
|
||||
if ($verband=='')
|
||||
$verband=' ';
|
||||
if (isset($_GET['gruppe']))
|
||||
$gruppe=$_GET['gruppe'];
|
||||
else
|
||||
$gruppe=' ';
|
||||
if ($gruppe=='')
|
||||
$gruppe=' ';
|
||||
if (isset($_GET['gruppe_kurzbz']))
|
||||
$gruppe_kurzbz=$_GET['gruppe_kurzbz'];
|
||||
else
|
||||
$gruppe_kurzbz='';
|
||||
if (isset($_GET['leid']))
|
||||
$leid=$_GET['leid'];
|
||||
else
|
||||
$leid=0;
|
||||
|
||||
// Termine holen
|
||||
$qry = "SELECT DISTINCT datum, stunde FROM lehre.$stpl_table WHERE lehreinheit_id=$leid";
|
||||
//echo $qry.'<BR>';
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
require('../../../config.inc.php');
|
||||
//include('../../../include/functions.inc.php');
|
||||
/*require_once('../../../../include/Excel/PEAR.php');
|
||||
require_once('../../../../include/Excel/BIFFwriter.php');
|
||||
require_once('../../../../include/Excel/Workbook.php');
|
||||
require_once('../../../../include/Excel/Format.php');
|
||||
require_once('../../../../include/Excel/Worksheet.php');
|
||||
require_once('../../../../include/Excel/Parser.php');
|
||||
require_once('../../../../include/Excel/OLE.php');
|
||||
require_once('../../../../include/Excel/PPS.php');
|
||||
require_once('../../../../include/Excel/Root.php');
|
||||
require_once('../../../../include/Excel/File.php');
|
||||
require_once('../../../../include/Excel/Writer.php');
|
||||
require_once('../../../../include/Excel/Validator.php');*/
|
||||
//require_once('../../../../include/Excel/BIFFwriter.php');
|
||||
//require_once('../../../../include/Excel/Workbook.php');
|
||||
//require_once('../../../../include/Excel/Format.php');
|
||||
//require_once('../../../../include/Excel/Worksheet.php');
|
||||
//require_once('../../../../include/Excel/Parser.php');
|
||||
//require_once('../../../../include/Excel/OLE.php');
|
||||
//require_once('../../../../include/Excel/PPS.php');
|
||||
//require_once('../../../../include/Excel/Root.php');
|
||||
//require_once('../../../../include/Excel/File.php');
|
||||
//require_once('../../../../include/Excel/Writer.php');
|
||||
//require_once('../../../../include/Excel/Validator.php');*/
|
||||
|
||||
$sipass=array(array());
|
||||
$sipass=array();
|
||||
$i=0;
|
||||
$k=0;
|
||||
$key_nummer=0;
|
||||
@@ -26,19 +26,19 @@ $fausgabe='';
|
||||
|
||||
if (!$conn=pg_pconnect(CONN_STRING))
|
||||
die(pg_last_error($conn));
|
||||
|
||||
|
||||
define("DB_SERVER","192.168.101.230:1433");
|
||||
define("DB_USER","sa");
|
||||
define("DB_PASSWD","P1ss0ff");
|
||||
define("DB_DB","asco4");
|
||||
|
||||
// zugriff auf mssql-datenbank
|
||||
|
||||
// zugriff auf mssql-datenbank
|
||||
if (!$conn_ext=mssql_connect (DB_SERVER, DB_USER, DB_PASSWD))
|
||||
die('Fehler beim Verbindungsaufbau!');
|
||||
mssql_select_db(DB_DB, $conn_ext);
|
||||
|
||||
//letzte Nummer
|
||||
$sql_query="SELECT max(asco.employee.emp_id) AS last_keynr FROM asco.employee;";
|
||||
$sql_query="SELECT max(asco.employee.reference) AS last_keynr FROM asco.employee;";
|
||||
//echo $sql_query;
|
||||
if(!$result=mssql_query($sql_query,$conn_ext))
|
||||
die(mssql_get_last_message().'<BR>'.$sql_query);
|
||||
@@ -46,7 +46,7 @@ if ($row=mssql_fetch_object($result))
|
||||
$key_nummer=$row->last_keynr+1;
|
||||
else
|
||||
die('Letzte Nummer konnte nicht eruiert werden!');
|
||||
|
||||
|
||||
//einlesen der custom. daten von sipass
|
||||
$qry="SELECT * FROM asco.employee_custom_data";
|
||||
if($result = mssql_query($qry,$conn_ext))
|
||||
@@ -56,56 +56,58 @@ if($result = mssql_query($qry,$conn_ext))
|
||||
$custom[$row->emp_id][$row->field_id]=$row->char_value;
|
||||
}
|
||||
}
|
||||
$qry="SELECT * FROM asco.employee";
|
||||
|
||||
$qry="SELECT * FROM asco.employee LEFT OUTER JOIN asco.access_groups ON (asco.employee.acc_grp_id=asco.access_groups.acc_grp_id)";
|
||||
if($result_ext = mssql_query($qry,$conn_ext))
|
||||
{
|
||||
while($row=mssql_fetch_object($result_ext))
|
||||
{
|
||||
$sipass[$i][0]='';
|
||||
$sipass[$i][1]=$row->emp_id;
|
||||
$sipass[$i][2]=$row->last_name;
|
||||
$sipass[$i][3]=$row->first_name;
|
||||
$sipass[$i][4]=$row->card_no;
|
||||
$sipass[$i][5]=date('d.m.Y',strtotime($row->start_date));
|
||||
$sipass[$i][6]=date('d.m.Y',strtotime($row->end_date));
|
||||
$sipass[$i]->command='';
|
||||
$sipass[$i]->reference=$row->reference;
|
||||
$sipass[$i]->last_name=$row->last_name;
|
||||
$sipass[$i]->first_name=$row->first_name;
|
||||
$sipass[$i]->card_no=(int)$row->card_no;
|
||||
$sipass[$i]->start_date=date('d.m.Y',strtotime($row->start_date));
|
||||
$sipass[$i]->end_date=date('d.m.Y',strtotime($row->end_date));
|
||||
$sipass[$i]->acc_grp_name=$row->acc_grp_name;
|
||||
if(isset($custom[$row->emp_id][7]))
|
||||
{
|
||||
$sipass[$i][7]=$custom[$row->emp_id][7]; //UID
|
||||
$sipass[$i]->uid=$custom[$row->emp_id][7]; //UID
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$sipass[$i][7]="";
|
||||
$sipass[$i]->uid="";
|
||||
}
|
||||
if(isset($custom[$row->emp_id][8]))
|
||||
{
|
||||
$sipass[$i][8]=$custom[$row->emp_id][8]; //Matrikelnr.
|
||||
$sipass[$i]->matrikelnr=$custom[$row->emp_id][8]; //Matrikelnr.
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$sipass[$i][8]="";
|
||||
$sipass[$i]->matrikelnr="";
|
||||
}
|
||||
if(isset($custom[$row->emp_id][9]))
|
||||
/*if(isset($custom[$row->emp_id][9]))
|
||||
{
|
||||
$sipass[$i][9]=$custom[$row->emp_id][9]; //Stg./Verwaltung
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$sipass[$i][9]="";
|
||||
}
|
||||
}*/
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
//mehrfach vergebene karten
|
||||
$qry="SELECT bmp.person_id as person2, bmp.nachname as nachname2,bmp.nummer as nummer2, bmp.vorname as vorname2,
|
||||
public.vw_betriebsmittelperson.person_id AS person1, public.vw_betriebsmittelperson.nachname as nachname1, public.vw_betriebsmittelperson.nummer as nummer1,
|
||||
public.vw_betriebsmittelperson.vorname as vorname1, public.vw_betriebsmittelperson.gebdatum as gebdatum1, public.vw_betriebsmittelperson.*
|
||||
FROM public.vw_betriebsmittelperson bmp
|
||||
JOIN public.vw_betriebsmittelperson ON (bmp.nummer=public.vw_betriebsmittelperson.nummer)
|
||||
WHERE (trim(bmp.nachname)!=trim(public.vw_betriebsmittelperson.nachname) OR (trim(bmp.vorname)!=trim(public.vw_betriebsmittelperson.vorname)))
|
||||
public.vw_betriebsmittelperson.person_id AS person1, public.vw_betriebsmittelperson.nachname as nachname1, public.vw_betriebsmittelperson.nummer as nummer1,
|
||||
public.vw_betriebsmittelperson.vorname as vorname1, public.vw_betriebsmittelperson.gebdatum as gebdatum1, public.vw_betriebsmittelperson.*
|
||||
FROM public.vw_betriebsmittelperson bmp
|
||||
JOIN public.vw_betriebsmittelperson ON (bmp.nummer=public.vw_betriebsmittelperson.nummer)
|
||||
WHERE (trim(bmp.nachname)!=trim(public.vw_betriebsmittelperson.nachname) OR (trim(bmp.vorname)!=trim(public.vw_betriebsmittelperson.vorname)))
|
||||
AND public.vw_betriebsmittelperson.betriebsmitteltyp='Zutrittskarte' AND bmp.betriebsmitteltyp='Zutrittskarte'
|
||||
AND public.vw_betriebsmittelperson.benutzer_aktiv AND public.vw_betriebsmittelperson.retouram IS NULL AND bmp.benutzer_aktiv AND bmp.retouram IS NULL
|
||||
AND bmp.person_id<public.vw_betriebsmittelperson.person_id
|
||||
AND public.vw_betriebsmittelperson.benutzer_aktiv AND public.vw_betriebsmittelperson.retouram IS NULL AND bmp.benutzer_aktiv AND bmp.retouram IS NULL
|
||||
AND bmp.person_id<public.vw_betriebsmittelperson.person_id
|
||||
ORDER BY bmp.nachname;";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
@@ -123,7 +125,7 @@ if($result = pg_query($conn, $qry))
|
||||
}
|
||||
|
||||
|
||||
$qry="SELECT DISTINCT ON (person_id, nummer) nachname as LastName, vorname as FirstName,nummer as CardNumber, matrikelnr, uid, kurzbzlang, personalnummer, lektor,
|
||||
$qry="SELECT DISTINCT ON (person_id, nummer) nachname as LastName, vorname as FirstName,nummer as CardNumber, matrikelnr, uid, kurzbzlang,tbl_studiengang.kurzbz,typ, personalnummer, lektor,
|
||||
EXTRACT(DAY FROM vw_betriebsmittelperson.insertamum) AS tag,
|
||||
EXTRACT(MONTH FROM vw_betriebsmittelperson.insertamum) AS monat,
|
||||
EXTRACT(YEAR FROM vw_betriebsmittelperson.insertamum) AS jahr
|
||||
@@ -138,70 +140,83 @@ if($result = pg_query($conn, $qry))
|
||||
while($row=pg_fetch_object($result))
|
||||
{
|
||||
$update=false;
|
||||
$stg_kurzbz=strtoupper(trim($row->typ).trim($row->kurzbz));
|
||||
$row->cardnumber=(int)$row->cardnumber;
|
||||
//doppelte ueberspringen
|
||||
if(in_array($row->cardnumber,$doppelte))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//überprüfen, ob bereits vorhanden
|
||||
for($j=0;$j<$i;$j++)
|
||||
{
|
||||
//überprüfen, ob bereits vorhanden
|
||||
if($sipass[$j][4]==$row->cardnumber)
|
||||
if($sipass[$j]->card_no==$row->cardnumber)
|
||||
{
|
||||
$upd=FALSE;
|
||||
if($sipass[$j][2]!=trim($row->lastname))
|
||||
if($sipass[$j]->last_name!=trim($row->lastname))
|
||||
{
|
||||
$sipass[$j][2]=trim($row->lastname);
|
||||
$sipass[$j]->last_name_old=$sipass[$j]->last_name;
|
||||
$sipass[$j]->last_name=trim($row->lastname);
|
||||
$sipass[$j]->update.=' last_name';
|
||||
$upd=TRUE;
|
||||
}
|
||||
if($sipass[$j][3]!=trim($row->firstname))
|
||||
if($sipass[$j]->first_name!=trim($row->firstname))
|
||||
{
|
||||
$sipass[$j][3]=trim($row->firstname);
|
||||
$sipass[$j]->first_name_old=$sipass[$j]->first_name;
|
||||
$sipass[$j]->first_name=trim($row->firstname);
|
||||
$sipass[$j]->update.=' first_name';
|
||||
$upd=TRUE;
|
||||
}
|
||||
if($sipass[$j][5]!=date('d.m.Y',strtotime($row->tag.'.'.$row->monat.'.'.$row->jahr)))
|
||||
if($sipass[$j]->start_date!=date('d.m.Y',strtotime($row->tag.'.'.$row->monat.'.'.$row->jahr)))
|
||||
{
|
||||
$sipass[$j][5]=date('d.m.Y',strtotime($row->tag.'.'.$row->monat.'.'.$row->jahr));
|
||||
$sipass[$j]->start_date=date('d.m.Y',strtotime($row->tag.'.'.$row->monat.'.'.$row->jahr));
|
||||
$sipass[$j]->update.=' start_date';
|
||||
$upd=TRUE;
|
||||
}
|
||||
if($sipass[$j][6]!=date('d.m.Y',strtotime($row->tag.'.'.$row->monat.'.'.($row->jahr+5))))
|
||||
if($sipass[$j]->end_date!=date('d.m.Y',strtotime($row->tag.'.'.$row->monat.'.'.($row->jahr+5))))
|
||||
{
|
||||
$sipass[$j][6]=date('d.m.Y',strtotime($row->tag.'.'.$row->monat.'.'.($row->jahr+5)));
|
||||
$sipass[$j]->end_date=date('d.m.Y',strtotime($row->tag.'.'.$row->monat.'.'.($row->jahr+5)));
|
||||
$sipass[$j]->update.=' end_date';
|
||||
$upd=TRUE;
|
||||
}
|
||||
if($sipass[$j][7]!=trim($row->uid))
|
||||
if($sipass[$j]->uid!=trim($row->uid))
|
||||
{
|
||||
$sipass[$j][7]=trim($row->uid);
|
||||
$sipass[$j]->uid=trim($row->uid);
|
||||
$sipass[$j]->update.=' uid';
|
||||
$upd=TRUE;
|
||||
}
|
||||
if($sipass[$j][8]!=trim($row->matrikelnr))
|
||||
if(trim($row->matrikelnr)!='' && $sipass[$j]->matrikelnr!=trim($row->matrikelnr))
|
||||
{
|
||||
$sipass[$j][8]=trim($row->matrikelnr);
|
||||
$sipass[$j]->matrikelnr=trim($row->matrikelnr);
|
||||
$sipass[$j]->update=' matrikelnr';
|
||||
$upd=TRUE;
|
||||
}
|
||||
if($row->personalnummer!='' && $row->personalnummer!= NULL)
|
||||
{
|
||||
if($sipass[$j][9]!="Verwaltung")
|
||||
if($sipass[$j]->acc_grp_name!="Verwaltung")
|
||||
{
|
||||
$sipass[$j][9]="Verwaltung";
|
||||
$upd=TRUE;
|
||||
$sipass[$j]->acc_grp_name="Verwaltung";
|
||||
$sipass[$j]->update=' acc_grp_name';
|
||||
$upd=TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if($sipass[$j][9]!=trim($row->kurzbzlang))
|
||||
if($sipass[$j]->acc_grp_name!=trim($stg_kurzbz))
|
||||
{
|
||||
$sipass[$j][9]=trim($row->kurzbzlang);
|
||||
$sipass[$j]->acc_grp_name_old=$sipass[$j]->acc_grp_name;
|
||||
$sipass[$j]->acc_grp_name=trim($stg_kurzbz);
|
||||
$sipass[$j]->update=' acc_grp_name';
|
||||
$upd=TRUE;
|
||||
}
|
||||
}
|
||||
if($upd)
|
||||
{
|
||||
$sipass[$j][0]="U";
|
||||
$sipass[$j]->command="U";
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$sipass[$j][0]="V"; //kein update, wird auch nicht gelöscht
|
||||
$sipass[$j]->command="V"; //kein update, wird auch nicht gelöscht
|
||||
}
|
||||
$update=true;
|
||||
break;
|
||||
@@ -212,23 +227,23 @@ if($result = pg_query($conn, $qry))
|
||||
//wenn nicht gefunden, dann append
|
||||
if($row->lastname!='' && $row->firstname!='' && $row->cardnumber!='' &&$row->tag!='' && $row->monat!='' && $row->jahr!='')
|
||||
{
|
||||
$sipass[$i][0]="A";
|
||||
$sipass[$i][1]=$key_nummer;
|
||||
$sipass[$i][2]=trim($row->lastname);
|
||||
$sipass[$i][3]=trim($row->firstname);
|
||||
$sipass[$i][4]=str_replace(" ","",$row->cardnumber);
|
||||
$sipass[$i][5]=$row->tag.'.'.$row->monat.'.'.$row->jahr;
|
||||
$sipass[$i][6]=$row->tag.'.'.$row->monat.'.'.($row->jahr+5);
|
||||
$sipass[$j][7]=trim($row->uid);
|
||||
$sipass[$j][8]=trim($row->matrikelnr);
|
||||
$sipass[$i]->command="A";
|
||||
$sipass[$i]->reference=$key_nummer;
|
||||
$sipass[$i]->last_name=trim($row->lastname);
|
||||
$sipass[$i]->first_name=trim($row->firstname);
|
||||
$sipass[$i]->card_no=str_replace(" ","",$row->cardnumber);
|
||||
$sipass[$i]->start_date=$row->tag.'.'.$row->monat.'.'.$row->jahr;
|
||||
$sipass[$i]->end_date=$row->tag.'.'.$row->monat.'.'.($row->jahr+5);
|
||||
$sipass[$j]->uid=trim($row->uid);
|
||||
$sipass[$j]->matrikelnr=trim($row->matrikelnr);
|
||||
if($row->personalnummer!='' && $row->personalnummer!= NULL)
|
||||
{
|
||||
$sipass[$j][9]="Verwaltung";
|
||||
$sipass[$j]->acc_grp_name="Verwaltung";
|
||||
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$sipass[$j][9]=trim($row->kurzbzlang);
|
||||
$sipass[$j]->acc_grp_name=$stg_kurzbz;
|
||||
}
|
||||
$key_nummer++;
|
||||
$i++;
|
||||
@@ -239,26 +254,46 @@ if($result = pg_query($conn, $qry))
|
||||
$ausdruck='';
|
||||
for($j=0;$j<$i;$j++)
|
||||
{
|
||||
if(trim($sipass[$j][0]==''))
|
||||
if(trim($sipass[$j]->command==''))
|
||||
{
|
||||
$sipass[$j][0]='D';
|
||||
$ausdruck.=$sipass[$j][0]."\t";
|
||||
$ausdruck.=$sipass[$j][1]."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(trim($sipass[$j][0]!='V'))
|
||||
$sipass[$j]->command='D';
|
||||
/*if ($sipass[$j]->acc_grp_name!='Extern1' && $sipass[$j]->acc_grp_name!='Extern2' && $sipass[$j]->acc_grp_name!='Extern3' && $sipass[$j]->acc_grp_name!='Extern4' && $sipass[$j]->acc_grp_name!='Extern5')
|
||||
{
|
||||
$ausdruck.=$sipass[$j][0]."\t";
|
||||
$ausdruck.=$sipass[$j][1]."\t";
|
||||
$ausdruck.=$sipass[$j][2]."\t";
|
||||
$ausdruck.=$sipass[$j][3]."\t";
|
||||
$ausdruck.=$sipass[$j][4]."\t";
|
||||
$ausdruck.=$sipass[$j][5]."\t";
|
||||
$ausdruck.=$sipass[$j][6]."\t";
|
||||
$ausdruck.=$sipass[$j][7]."\t";
|
||||
$ausdruck.=$sipass[$j][8]."\t";
|
||||
$ausdruck.=$sipass[$j][9]."\n";
|
||||
$ausdruck.=$sipass[$j]->command."\t"; // Command
|
||||
$ausdruck.=$sipass[$j]->reference."\t"; // ID
|
||||
$ausdruck.=$sipass[$j]->last_name."\t"; // Lastname
|
||||
$ausdruck.=$sipass[$j]->first_name."\t"; // Firstname
|
||||
$ausdruck.=$sipass[$j]->acc_grp_name."\t"; // Access Group
|
||||
$ausdruck.=$sipass[$j]->card_no."\n"; // Cardnumber
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
if(trim($sipass[$j]->command!='V'))
|
||||
{
|
||||
$ausdruck.=$sipass[$j]->command."\t"; // Command
|
||||
$ausdruck.=$sipass[$j]->reference."\t"; // ID
|
||||
$ausdruck.=$sipass[$j]->last_name."\t"; // Lastname
|
||||
$ausdruck.=$sipass[$j]->first_name."\t"; // Firstname
|
||||
$ausdruck.=$sipass[$j]->acc_grp_name."\t"; // Access Group
|
||||
$ausdruck.=$sipass[$j]->card_no."\t"; // Cardnumber
|
||||
$ausdruck.=$sipass[$j]->start_date."\t"; // Valid From
|
||||
$ausdruck.=$sipass[$j]->end_date."\t"; // Valid till
|
||||
$ausdruck.="0\t"; // CardState
|
||||
$ausdruck.=$sipass[$j]->uid."\t"; // Text1 UID
|
||||
$ausdruck.=$sipass[$j]->matrikelnr."\t"; // Text2 Matrikelnummer
|
||||
if (isset($sipass[$j]->last_name_old))
|
||||
$ausdruck.=$sipass[$j]->last_name_old; // Text3 // alter Vorname
|
||||
$ausdruck.="\t";
|
||||
if (isset($sipass[$j]->fist_name_old))
|
||||
$ausdruck.=$sipass[$j]->fist_name_old; // Text4 // alter Nachname
|
||||
$ausdruck.="\t";
|
||||
if (isset($sipass[$j]->acc_grp_name_old))
|
||||
$ausdruck.=$sipass[$j]->acc_grp_name_old; // Text5 // alte Accessgroup
|
||||
$ausdruck.="\t";
|
||||
if (isset($sipass[$j]->update))
|
||||
$ausdruck.=$sipass[$j]->update; // Text6 // alte Accessgroup
|
||||
$ausdruck.="\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,11 +331,11 @@ for($j=0;$j<$i;$j++)
|
||||
if(trim($sipass[$j][0]!=''))
|
||||
{
|
||||
$worksheet->write($z,0, $sipass[$j][0]);
|
||||
$worksheet->write($z,1, $sipass[$j][1]);
|
||||
$worksheet->write($z,1, $sipass[$j][1]);
|
||||
$worksheet->write($z,2, $sipass[$j][2]);
|
||||
$worksheet->write($z,3, $sipass[$j][3]);
|
||||
$worksheet->write($z,4, $sipass[$j][4]);
|
||||
$worksheet->write($z,5, $sipass[$j][5]);
|
||||
$worksheet->write($z,5, $sipass[$j][5]);
|
||||
$worksheet->write($z,6, $sipass[$j][6]);
|
||||
$z++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user