mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 16:44:28 +00:00
Alte SyncScripte gelöscht und aktuelle an die Datenbankklasse angepasst
This commit is contained in:
@@ -1,34 +1,55 @@
|
||||
<html>
|
||||
<?php
|
||||
/* Copyright (C) 2008 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 <[email protected]>,
|
||||
* Andreas Oesterreicher <[email protected]> and
|
||||
* Rudolf Hangl <[email protected]>.
|
||||
*/
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/mail.class.php');
|
||||
|
||||
echo '<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Stundenplan-Check (stpldev-le)</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
require('../../vilesci/config.inc.php');
|
||||
require('../../include/functions.inc.php');
|
||||
|
||||
$conn=pg_connect(CONN_STRING);
|
||||
<body>';
|
||||
|
||||
// Startvariablen setzen
|
||||
$adress='[email protected]';
|
||||
//$adress_stpl='[email protected]';
|
||||
$adress_stpl='[email protected]';
|
||||
|
||||
$message_stpl='';
|
||||
$message_sync='';
|
||||
$count_del=0;
|
||||
$count_ins=0;
|
||||
$count_upd=0;
|
||||
$count_err=0;
|
||||
|
||||
$db = new basis_db();
|
||||
|
||||
// Mails an die Lektoren und Verbaende
|
||||
$message='';
|
||||
|
||||
|
||||
// Mail Headers festlegen
|
||||
$headers= "MIME-Version: 1.0\r\n";
|
||||
$headers.="Content-Type: text/html; charset=UTF-8\r\n";
|
||||
|
||||
|
||||
$message_begin='Dies ist eine automatische Mail!<BR>Es haben sich folgende Aenderungen in Ihrem Stundenplan ergeben:<BR>';
|
||||
|
||||
|
||||
@@ -40,16 +61,16 @@ $sql_query="SELECT DISTINCT lehreinheit_id,studiengang_kz,semester,gruppe_kurzbz
|
||||
tbl_lehreinheitmitarbeiter.mitarbeiter_uid AS lehreinheitmitarbeiter_uid
|
||||
FROM lehre.tbl_stundenplandev LEFT OUTER JOIN lehre.tbl_lehreinheitmitarbeiter USING (lehreinheit_id, mitarbeiter_uid)
|
||||
WHERE datum>=now() AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid IS NULL;";
|
||||
//echo $sql_query.'<BR>';
|
||||
if (!$result=pg_query($conn, $sql_query))
|
||||
|
||||
if (!$result = $db->db_query($sql_query))
|
||||
{
|
||||
echo $sql_query.' fehlgeschlagen!<BR>'.pg_last_error($conn);
|
||||
$message.=$sql_query.' fehlgeschlagen!<BR>'.pg_last_error($conn);
|
||||
echo $sql_query.' fehlgeschlagen!<BR>'.$db->db_last_error();
|
||||
$message.=$sql_query.' fehlgeschlagen!<BR>'.$db->db_last_error();
|
||||
}
|
||||
else
|
||||
{
|
||||
flush();
|
||||
while ($row=pg_fetch_object($result))
|
||||
while ($row = $db->db_fetch_object($result))
|
||||
{
|
||||
echo $row->lehreinheit_id.'-'.$row->studiengang_kz.'-'.$row->semester.'-'.$row->gruppe_kurzbz.'-'.$row->mitarbeiter_uid.'-'.$row->ort_kurzbz.'<BR>';
|
||||
$message.=$row->lehreinheit_id.'-'.$row->studiengang_kz.'-'.$row->semester.'-'.$row->gruppe_kurzbz.'-'.$row->mitarbeiter_uid.'-'.$row->ort_kurzbz.'<BR>';
|
||||
@@ -69,9 +90,13 @@ $message_tmp=$count_upd.' Datensätze wurden geändert.<BR>
|
||||
'.$count_err.' Fehler sind dabei aufgetreten!<BR><BR>';
|
||||
echo '<BR>'.$message_tmp;
|
||||
$message_sync='<HTML><BODY>'.$message_tmp.$message_sync.$message_stpl.'</BODY></HTML>';
|
||||
mail('[email protected]',"Stundenplan update",$message,$headers."From: [email protected]");
|
||||
$mail = new mail('[email protected]','[email protected]','Stundenplan update',$message);
|
||||
$mail->send();
|
||||
|
||||
$message_stpl='<HTML><BODY>'.$message_tmp.$message_stpl.'</BODY></HTML>';
|
||||
mail('[email protected]',"Stundenplan update",$message,$headers."From: [email protected]");
|
||||
|
||||
$mail = new mail('[email protected]','[email protected]','Stundenplan update',$message);
|
||||
$mail->send();
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user