<?php
include("kurs/datenbankanbindung.php");     // f&uuml;gt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php
require("./FCKeditor/fckeditor.php") ;

$user_admin=$_COOKIE["user_admin"];
$jahrgang=$_COOKIE["jahrgang"];
$hs=$_COOKIE["ck_hs"];
$ck_beg_std=$_COOKIE["ck_beg_std"];
$ck_beg_min=$_COOKIE["ck_beg_min"];
$ck_vert=$_COOKIE["ck_vert"];
$ck_adresse=$_COOKIE["ck_adresse"];
$ck_hinweis=$_COOKIE["ck_hinweis"];


if ($jahrgang == ""){ require("jahrgang.php"); exit;} //Wenn man kein Jahrgang ausgew&auml;hlt hat wird die Jahrgangsauswahlseite geladen

// Rechte&uuml;berpr&uuml;fung
$db = dbconnect();
if ($user_admin == ""){ require("index.php"); exit;} //Wenn man nicht angemeldet ist, darf man nicht auf die Seite
$result = $db->query("SELECT 1 FROM stan_admin_rechte, stan_admin_rechte_zuord , stan_admin where stan_admin_rechte.stan_admin_rolle = stan_admin_rechte_zuord.stan_admin_rolle AND stan_admin_rechte_zuord.said = stan_admin.said AND stan_admin.user = '$user_admin' AND stan_admin_rechte_zuord.stan_admin_rolle = 'a_ausn'");
$row = $result->fetch_array();
if ($row[0] != 1){ include("kurs/rechte.php"); exit;}
// Rechte&uuml;berpr&uuml;fung ende



if (isset($_GET['action']))
   $action = $_GET['action'];
else
   $action = "";

switch($action){
default:

$vert1 = $_COOKEI['ck_vert1'];

$db = dbconnect();
include("kurs/sta/stan_soadmonline_write.php");     // F&uuml;r Statistik, wieviele User online sind

echo "

<html>
<head>
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
	<script type=\"text/javascript\" src=\"livesearch/ajax.js\"></script>
	<script type=\"text/javascript\" src=\"livesearch/ajax-dynamic-list.js\"></script>
<style type=\"text/css\">
select{
	width:250px;
}



	/* Big box with list of options */
	#ajax_listOfOptions{
		position:absolute;	/* Never change this one */
		width:320px;	/* Width of box */
		height:200px;	/* Height of box */
		overflow:auto;	/* Scrolling features */
		border:1px solid #6487DC;	/* Dark blue border */
		background-color:#FFF;	/* White background color */
		text-align:left;
		font-family		:	verdana, arial;
		z-index:10000;
	}
	#ajax_listOfOptions div{	/* General rule for both .optionDiv and .optionDivSelected */
		margin:1px;
		padding:1px;
		cursor:pointer;
		font-size:0.9em;
	}
	#ajax_listOfOptions .optionDiv{	/* Div for each item in list */

	}
	#ajax_listOfOptions .optionDivSelected{ /* Selected item in the list */
		background-color:#D6DFF7;
		color:#002276;
		font-family		:	verdana, arial;
		font-weight		:	bold;
	}
	#ajax_listOfOptions_iframe{
		background-color:#F00;
		position:absolute;
		z-index:500;
	}
</style>

<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
<title>Ausnahmeregelung</title>
</head>
<body onload=\"if(document.beleg)document.beleg.stud.focus();return false;\">
<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" id=\"table1\">
    <tr>
        <td>
        <div align=\"center\">
            <table cellspacing=\"0\" cellpadding=\"0\" width=\"60%\" border=\"0\">
                <tr>
                    <td width=\"10\" background=\"../images/box_e1.gif\">
                    <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_top.gif\" valign=\"top\">
                    <img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
                    <font class=\"hd\">Ausnahmeregelung</font><br>
                    <font class=\"sh\">12 Block-Anmeldesystem</font><br>
                    <img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></font></td>
                    <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
                    <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                </tr>
                <tr>
                    <td width=\"1%\" background=\"../images/box_l.gif\">
                    <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td>
                    <form action="; echo $_SERVER['PHP_SELF'] . "?action=bearb2"; echo" method=\"POST\" name=\"beleg\">
                      <table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" style=\"border-width:0; border-collapse: collapse\" bordercolor=\"#111111\" width=\"102%\" id=\"AutoNumber1\" height=\"18\">
                        <tr>
                          <td width='10%' style='border-style: none; border-width: medium' height='0'>
                            &nbsp;
                          </td>
                          <td width='30%' style='border-style: none; border-width: medium' height='0'>
                            <b>Student wählen*:</b>
                          </td>
                        <td width='60%' style='border-style: none; border-width: medium' height='0'>

                          <!--<input type='text' name='bezeichnung1'id='bezeichnung1' size='60'>-->
				<input type=\"text\" id=\"stud\" name=\"stud\" value=\"\" onkeyup=\"ajax_showOptions(this,'getWord',event)\" size=\"50\">
				<input type=\"hidden\" id=\"stud_hidden\" name=\"stud_ID\"><!-- THE ID OF the textstelle will be inserted into this hidden input -->
                        </td>
                        </tr>
                      </table>
                    <br>
                    <p align = \"center\">*=Pflichtfelder<br><br><input type=\"submit\" value=\"Abschicken\" name=\"B1\"></p>
                    </form>
                    </td>
                    <td width=\"1%\" background=\"../images/box_r.gif\">
                    <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                </tr>
                <tr>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
                    <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
                </tr>
            </table>
        </div>
        </td>
    </tr>
</table>
</body>
</html>

<br>
<br>
<br>

<html>
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
<title>Erfasste Ausnahmen</title>
</head>
<body>
<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\"id=\"table2\">
    <tr>
        <td>
        <div align=\"center\">
            <table cellspacing=\"0\" cellpadding=\"0\" width=\"95%\" border=\"0\">
                <tr>
                    <td width=\"10\" background=\"../images/box_e1.gif\">
                    <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_top.gif\" valign=\"top\">
                    <img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
                    <font class=\"hd\">Erfasste Ausnahmen</font>
                    <img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></font></td>
                    <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
                    <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                </tr>
                <tr>
                    <td width=\"1%\" background=\"../images/box_l.gif\">
                    <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td>
                      <table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" style=\"border-width:0; border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\" id=\"AutoNumber1\" height=\"18\">
                        <tr>
                          <td width=\"5%\">
                          <b>Nr</b>
                          </td>
                          <td width=\"15%\" align=\"left\">
                           <b>Matrikelnr</b>
                          </td>
                          <td width=\"40%\" align=\"left\">
                           <b>Name</b>
                          </td>
                          <td width=\"20%\" align=\"left\">
                           <b>UID</b>
                          </td>
                          <td width=\"20%\" align=\"center\">
                           <b>Löschen</b>
                          </td>

                        </tr>";
                          $db = dbconnect();
                        $ln_zaehler = 1; // Z&auml;hler f&uuml;r Anzahl der Termine
                        
                        
                         $query = "SELECT  b.uid
                                         , b.vorname
                                         , b.nachname
                                         , b.mtknr
                                      FROM stan_ausnahme a, stud b
                                     WHERE a.uid = b.uid
                                       AND b.jahrgang='$jahrgang'
                                       AND b.hs='$hs'
                                     ORDER BY b.nachname ASC";

                          $result = $db->query ($query)
                                    or die ("Cannot execute query");
                         

                        while ($row = $result->fetch_array()){
                        
                          

                        echo"
                        <tr>
                          <td width=\"5%\">
                          <b>$ln_zaehler</b>
                          </td>
                          <td width=\"15%\">
                          $row[mtknr]
                          </td>
                          <td width=\"40%\" align=\"left\">
                           $row[vorname] $row[nachname]
                          </td>
                          <td width=\"20%\" align=\"left\">
                           $row[uid]
                          </td>
                          <td width=\"20%\" align=\"center\">
                           <a href=".$_SERVER['PHP_SELF'] ."?action=del&ID=$row[uid]>
                           <img title = \"Ausnahme löschen\"border=\"0\" src=\"../images/drop.png\"></a>
                          </td>
                        </tr>";
                        $ln_zaehler = $ln_zaehler+1;
                       }
                       echo"
                      </table>
                    </td>
                    <td width=\"1%\" background=\"../images/box_r.gif\">
                    <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                </tr>
                <tr>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
                    <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
                </tr>
            </table>
        </div>
        </td>
    </tr>
</table>
</body>
</html>

<br>
<br>
<br>

";


break;
case "bearb2":

$stud = $_POST['stud'];
$pos1 = strpos  ($stud, '(')+1;
$pos2 = strpos  ($stud, ')')-$pos1;

$str = substr($stud, $pos1,$pos2);

$str = explode(",",$str);

$mtknr=trim($str[0]);
$uid=trim($str[1]);


$vert = $_POST['vert'];
$adresse = stripslashes( $_POST['Raum'] );
$hinweis = stripslashes( $_POST['hinweis'] );
$beg_std = $_POST['beg_std'];
$beg_min = $_POST['beg_min'];
$beg_sek = '00';

#setcookie("ck_beg_std","");


if($_POST['stud'] == ''){
  echo "
  <html>
  <head>
  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
  <link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
  <title>Falsches Datum</title>
  </head>
  <body>
  <table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
    <tr>
        <td>
        <div align=\"center\">
            <table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
                <tr>
                    <td width=\"10\" background=\"../images/box_e1.gif\">
                    <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
                    <td width=\"95%\" background=\"../images/box_top.gif\">
                    <img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
                    <span class=\"sh\">Pflichtfelder ausfüllen</span><br>
                    <img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
                    <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
                    <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                </tr>
                <tr>
                    <td width=\"1%\" background=\"../images/box_l.gif\">
                    <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td colspan=\"2\"><br>
                    <p align=\"center\"><b>Bitte füllen Sie alle Pflichtfelder aus!</p></b>
                    </p>
                    <p align=\"center\"><a href=\"javascript:history.back()\">
                    <img border=\"0\" src=\"../images/zurueck.gif\" width=\"77\" height=\"22\"></a><br>
                    </p>
                    <p></p>
                    <p></p>
                    <p></p>
                    <p></p>
                    <p><br>
                    </p>
                    </td>
                    <td width=\"1%\" background=\"../images/box_r.gif\">
                    <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                </tr>
                <tr>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
                    <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
                </tr>
            </table>
        </div>
        </td>
    </tr>
  </table>
  </body>
  </html>";
  exit;
}



$db = dbconnect();
$result = $db->query ("SELECT uid
                          FROM stud
                         WHERE mtknr='$mtknr'
                           AND uid='$uid'
                      ");
$row_stud = $result->fetch_array();


if($row_stud['uid'] == ''){
  echo "
  <html>
  <head>
  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
  <link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
  <title>Falsches Datum</title>
  </head>
  <body>
  <table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
    <tr>
        <td>
        <div align=\"center\">
            <table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
                <tr>
                    <td width=\"10\" background=\"../images/box_e1.gif\">
                    <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
                    <td width=\"95%\" background=\"../images/box_top.gif\">
                    <img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
                    <span class=\"sh\">Datensatz nicht vorhanden</span><br>
                    <img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
                    <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
                    <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                </tr>
                <tr>
                    <td width=\"1%\" background=\"../images/box_l.gif\">
                    <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td colspan=\"2\"><br>
                    <p align=\"center\"><b>Es konnte kein Datensatz mit diesen Angaben gefunden werden</p></b>
                    </p>
                    <p align=\"center\"><a href=\"javascript:history.back()\">
                    <img border=\"0\" src=\"../images/zurueck.gif\" width=\"77\" height=\"22\"></a><br>
                    </p>
                    <p></p>
                    <p></p>
                    <p></p>
                    <p></p>
                    <p><br>
                    </p>
                    </td>
                    <td width=\"1%\" background=\"../images/box_r.gif\">
                    <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                </tr>
                <tr>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
                    <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
                </tr>
            </table>
        </div>
        </td>
    </tr>
  </table>
  </body>
  </html>";
  exit;
}


$db = dbconnect();
$result = $db->query ("SELECT uid
                          FROM stan_ausnahme
                         WHERE uid='$row_stud[uid]'
                      ");
$row_stud2 = $result->fetch_array();


if($row_stud2['uid'] != ''){
  echo "
  <html>
  <head>
  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
  <link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
  <title>Falsches Datum</title>
  </head>
  <body>
  <table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
    <tr>
        <td>
        <div align=\"center\">
            <table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
                <tr>
                    <td width=\"10\" background=\"../images/box_e1.gif\">
                    <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
                    <td width=\"95%\" background=\"../images/box_top.gif\">
                    <img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
                    <span class=\"sh\">Doppelter Datensatz</span><br>
                    <img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
                    <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
                    <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                </tr>
                <tr>
                    <td width=\"1%\" background=\"../images/box_l.gif\">
                    <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td colspan=\"2\"><br>
                    <p align=\"center\"><b>Die Ausnahme für den Student wurde bereits beantragt!</p></b>
                    </p>
                    <p align=\"center\"><a href=\"javascript:history.back()\">
                    <img border=\"0\" src=\"../images/zurueck.gif\" width=\"77\" height=\"22\"></a><br>
                    </p>
                    <p></p>
                    <p></p>
                    <p></p>
                    <p></p>
                    <p><br>
                    </p>
                    </td>
                    <td width=\"1%\" background=\"../images/box_r.gif\">
                    <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                </tr>
                <tr>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
                    <td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
                    <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
                    <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
                </tr>
            </table>
        </div>
        </td>
    </tr>
  </table>
  </body>
  </html>";
  exit;
}


  $sql = "INSERT INTO stan_ausnahme
          (uid)
          VALUES
          ('$row_stud[uid]')
         ";

  $sql[0] = $db->query($sql);

  if (!$sql[0])
  {
  echo "
  <html>
  <head>
  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
  <link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
  <title>Fehlgeschlagen</title>
  </head>
  <body>
  <table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
      <tr>
          <td>
          <div align=\"center\">
              <table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
                  <tr>
                      <td width=\"10\" background=\"../images/box_e1.gif\">
                      <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                      <td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
                      <td width=\"95%\" background=\"../images/box_top.gif\">
                      <img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
                      <span class=\"sh\">Fehlgeschlagen</span><br>
                      <img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
                      <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
                      <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                  </tr>
                  <tr>
                      <td width=\"1%\" background=\"../images/box_l.gif\">
                      <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                      <td colspan=\"2\"><br>
                      <p align=\"center\"><b>Das hinzuf&uuml;gen eines Termines ist fehlgeschlagen!</b>
                      <br><br>
                      <p align=\"center\"><a href=\"javascript:history.back()\">
                      <img border=\"0\" src=\"../images/zurueck.gif\" width=\"77\" height=\"22\"></a><br>
                      </p>
                      <p></p>
                      <p><br>
                      </p>
                      </td>
                      <td width=\"1%\" background=\"../images/box_r.gif\">
                      <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                  </tr>
                  <tr>
                      <td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
                      <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
                      <td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
                      <img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
                      <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
                      <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
                  </tr>
              </table>
          </div>
          </td>
      </tr>
  </table>
  </body>
  </html>
  ";
  } // Ende IF wenn Insert Fehlgeschlagen



echo "<meta http-equiv=\"refresh\" content=\"0; URL=".$_SERVER['PHP_SELF'] ."?action=default\">";

break;
case "del":


$uid=$_GET['ID'];

$db = dbconnect();
$sql = $db->query ("DELETE FROM stan_ausnahme WHERE uid='$uid'");
if ($sql)  // Best&auml;tigungsseite bei Erfolg sonst Nichterfolgsmeldung
  {
    echo "
      <meta http-equiv=\"refresh\" content=\"0; URL=".$_SERVER['PHP_SELF'] ."?action=bearb&erfassen=$VerID\">
    ";
  }else{
    echo "
    <html>
    <head>
    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
    <link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
    <title>unerwarteter Fehler</title>
    </head>
    <body>
    <table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
      <tr>
          <td>
          <div align=\"center\">
              <table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
                  <tr>
                      <td width=\"10\" background=\"../images/box_e1.gif\">
                      <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                      <td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
                      <td width=\"95%\" background=\"../images/box_top.gif\">
                      <img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
                      <span class=\"sh\">unerwarteter Fehler</span><br>
                      <img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
                      <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
                      <img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
                  </tr>
                  <tr>
                      <td width=\"1%\" background=\"../images/box_l.gif\">
                      <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                      <td colspan=\"2\"><br>
                      <p align=\"center\"><b>Es ist ein interner Fehler aufgetreten!</b>
                      </p>
                      <p align=\"center\"><a href=\"hauptframe_jahr.php\">
                      <img border=\"0\" src=\"../images/zurueck.gif\" width=\"77\" height=\"22\"></a><br>
                      </p>
                      <p></p>
                      <p></p>
                      <p></p>
                      <p></p>
                      <p><br>
                      </p>
                      </td>
                      <td width=\"1%\" background=\"../images/box_r.gif\">
                      <img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
                  </tr>
                  <tr>
                      <td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
                      <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
                      <td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
                      <img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
                      <td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
                      <img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
                  </tr>
              </table>
          </div>
          </td>
      </tr>
    </table>
    </body>
    </html>";
  }

} //Ende Action Abfrage
?>
