* 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: Martin Tatzber <*****@*****.**>
 */
require_once '../config/vilesci.config.inc.php';
require_once '../include/basis_db.class.php';
require_once '../include/mail.class.php';
require_once '../include/ampel.class.php';
$db = new basis_db();
$ampel = new ampel();
$ampel->getAll(true);
foreach ($ampel->result as $a) {
    if (!$a->email) {
        continue;
    }
    $qry = $a->benutzer_select;
    $message = $a->beschreibung['German'];
    $subject = $a->kurzbz;
    if ($result = $db->db_query($qry)) {
        while ($row = $db->db_fetch_object($result)) {
            $uid = $row->uid;
            $mail = new mail($uid . '@' . DOMAIN, 'cis@' . DOMAIN, $subject, $message);
            if ($mail->send()) {
                echo "Email an {$uid} versandt\n";
            } else {
        $selected = '';
    }
    echo '<OPTION value="' . $basis->convert_html_chars($row->ampel_id) . '" ' . $selected . '>';
    echo $basis->convert_html_chars($row->kurzbz);
    echo '</OPTION>';
}
echo '</SELECT>';
echo '<input type="submit" value="OK" />';
echo '</form><br>';
if (!isset($_POST['ampel_id'])) {
    echo $p->t('tools/waehlenSieEineOEoderAmpel');
    exit;
}
$oe_arr = $oe_kurzbz != '' ? array($oe_kurzbz) : $oes;
//echo 'OE: '.$oe_kurzbz.' Ampel:'.$ampel_id;
$ampel = new ampel();
if (!$ampel->loadAmpelMitarbeiter($oe_arr, $ampel_id)) {
    die('Fehler:' . $ampel->errormsg);
}
if ($ampel_id != '') {
    $ampel_aktuell = new ampel($ampel_id);
    echo $ampel_aktuell->beschreibung[$sprache];
}
echo '
<table id="myTable" class="tablesorter">
	<thead>
		<tr>
			<th>' . $p->t('tools/ampelStatus') . '</th>
			<th>' . $p->t('tools/ampelKurzbz') . '</th>
			<th>' . $p->t('tools/ampelMitarbeiter') . '</th>
			<th>' . $p->t('global/organisationseinheit') . '</th>
Exemple #3
0
<?php

require_once '../config/cis.config.inc.php';
require_once '../include/functions.inc.php';
require_once '../include/ampel.class.php';
require_once '../include/datum.class.php';
require_once '../include/phrasen.class.php';
$sprache = getSprache();
$p = new phrasen($sprache);
if (is_user_logged_in()) {
    $user = get_uid();
    $ampel = new ampel();
    $ampel->loadUserAmpel($user);
    $rot = 0;
    $gelb = 0;
    $datum = new datum();
    foreach ($ampel->result as $row) {
        $ts_deadline = $datum->mktime_fromdate($row->deadline);
        $vlz = "-" . $row->vorlaufzeit . " day";
        $ts_vorlaufzeit = strtotime($vlz, $ts_deadline);
        $ts_now = $datum->mktime_fromdate(date('Y-m-d'));
        if ($ts_deadline < $ts_now) {
            $rot++;
        } else {
            if ($ts_vorlaufzeit <= $ts_now && $ts_now <= $ts_deadline) {
                $gelb++;
            }
        }
    }
    if ($rot == 0 && $gelb == 0) {
        echo '<a href="private/tools/ampelverwaltung.php" target="content" title="' . $p->t("tools/ampelsystem") . '"><span style="color: #A5AFB6">' . $p->t("tools/ampelsystem") . '</span></a>&nbsp;&nbsp;<span style="color: #A5AFB6">|</span>&nbsp;&nbsp;';
$datum_obj = new datum();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Ampel - Details</title>
	<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
	<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
</head>
<body>

<?php 
$action = isset($_GET['action']) ? $_GET['action'] : 'new';
$ampel_id = isset($_REQUEST['ampel_id']) ? $_REQUEST['ampel_id'] : '';
$ampel = new ampel();
if ($action == 'save') {
    $kurzbz = isset($_POST['kurzbz']) ? $_POST['kurzbz'] : die('Kurzbz fehlt');
    foreach ($_POST as $key => $value) {
        if (mb_strstr($key, 'beschreibung')) {
            $idx = mb_substr($key, mb_strlen('beschreibung'));
            $beschreibung[$idx] = $value;
        }
    }
    $benutzer_select = isset($_POST['benutzer_select']) ? $_POST['benutzer_select'] : die('Benutzer_select fehlt');
    $deadline = isset($_POST['deadline']) ? $_POST['deadline'] : die('Deadline fehlt');
    $vorlaufzeit = isset($_POST['vorlaufzeit']) ? $_POST['vorlaufzeit'] : die('Vorlaufzeit fehlt');
    $verfallszeit = isset($_POST['verfallszeit']) ? $_POST['verfallszeit'] : die('verfallszeit fehlt');
    $email = isset($_POST['email']);
    $new = isset($_POST['new']) ? $_POST['new'] : 'true';
    if ($new == 'true') {
</div>';
if (isset($_GET['action']) && $_GET['action'] == 'delete') {
    if (!$rechte->isBerechtigt('basis/ampel', null, 'suid')) {
        die('Sie haben keine Berechtigung fuer diese Seite');
    }
    if (!isset($_GET['ampel_id'])) {
        die('Fehlender Parameter Statistik');
    }
    $ampel = new ampel();
    if ($ampel->delete($_GET['ampel_id'])) {
        echo '<span class="ok">Eintrag wurde erfolgreich gelöscht</span>';
    } else {
        echo '<span class="error">' . $ampel->errormsg . '</span>';
    }
}
$ampel = new ampel();
if (!$ampel->getAll()) {
    die($ampel->errormsg);
}
echo '<table class="tablesorter" id="myTable">
	<thead>
		<tr>
			<th>ID</th>
			<th>Kurzbz</th>
			<th>Deadline</th>
			<th>Vorlaufzeit</th>
			<th>Verfallszeit</th>
			<th colspan="3">Aktion</th>
		</tr>
	</thead>
	<tbody>';
                    $message = '<script type="text/javascript">window.parent.loadampel()</script>';
                } else {
                    $message = '<span class="error">' . $ampel->errormsg . '</span>';
                }
            } else {
                $message = '<span class="error">' . $p->t('tools/ampelBereitsBestaetigt') . '</span>';
            }
        } else {
            $message = '<span class="error">' . $p->t('tools/nichtZugeteilt') . '</span>';
        }
    } else {
        $message = '<span class="error">' . $p->t('tools/ampelNichtGefunden') . '</span>';
    }
}
echo $message;
$ampel = new ampel();
$ampel->loadUserAmpel($user, true, true);
echo '
<table id="myTable" class="tablesorter">
	<thead>
		<tr>
			<th></th>
			<th>' . $p->t('tools/ampelErledigt') . '</th>
			<th>' . $p->t('tools/ampelBeschreibung') . '</th>
			<th>' . $p->t('tools/ampelDeadline') . '</th>			
		</tr>
	</thead>
	<tbody>
';
foreach ($ampel->result as $row) {
    $ts_deadline = $datum_obj->mktime_fromdate($row->deadline);