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

$saaid=$_GET['saaid1'];



$db = dbconnect();

$result3 = $db->query("SELECT saaid, uid, pos, vert_bereich, art, dst_id, date_format(beginn, '%d.%m.%Y') beginn, date_format(ende, '%d.%m.%Y') ende, abteilung, tel_abteilung, aendid
                          FROM stan_antrag
                         WHERE saaid='$saaid'");
$row3 = $result3->fetch_array();

$result3a = $db->query("SELECT bezeichnung
                          FROM stan_vertiefungsbereich
                         WHERE vbid='$row3[vert_bereich]'");
$row3a = $result3a->fetch_array();


$result3b = $db->query("SELECT artid, bezeichnung
                          FROM stan_stellenart
                         WHERE artid='$row3[art]'");
$row3b = $result3b->fetch_array();

 $result_data2 = $db->query("SELECT distinct 1 FROM stan_dienststellen WHERE dst_id= '$row3[dst_id]'");
 $rowdata2 = $result_data2->fetch_array();

 if($rowdata2[0] == '1'){
   $result_data3c = $db->query("SELECT bez
                                     , str
                                     , plz
                                     , postfach
                                     , plz_postfach
                                     , ort
                                     , bundesland
                                     , staat
                                  FROM stan_dienststellen
                                 WHERE dst_id='$row3[dst_id]'");
    $row3c = $result_data3c->fetch_array();
    
 }else{

    $result_data3c = $db->query("SELECT bez
                                      , str
                                      , plz
                                      , postfach
                                      , plz_postfach
                                      , ort
                                      , bundesland
                                      , staat
                                   FROM stan_dienststellen_tmp
                                  WHERE dst_id='$row3[dst_id]'");
     $row3c = $result_data3c->fetch_array();
  }











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>Änderungen vergleichen</title>
</head>
<script type=\"text/javascript\">
function cursorhand()
{
    document.body.style.cursor = 'pointer';
}
</script>
<title>In das Fenster klicken um zu schließen</title>
</head>
<body  onMouseover=\"cursorhand()\", onclick=\"window.close();\">
<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=\"100%\" 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\">Detailansicht</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>





<table width='100%'>

<tr>
 <td width='50%'>
 
 
 
 
<table width='100%'>
 <tr>
   <td width='51%'>
     <b>Vertiefungsbereich</b>
   </td>
   <td width='49%'>
     $row3a[bezeichnung]
   </td> 
 </tr>
 <tr>
   <td width='51%'>
     <b>Art der Praxisstelle</b>
   </td>
   <td width='49%'>
     $row3b[bezeichnung]
   </td> 
 </tr>
 <tr>
   <td width='51%'>
     <b>Bezeichnung der Praxisstelle</b>
   </td>
   <td width='49%'>
     $row3c[bez]
   </td> 
 </tr>
 <tr>
   <td width='51%'>
     <b>Straße und Nr. der Praxisstelle</b>
   </td>
   <td width='49%'>
     $row3c[str]
   </td> 
 </tr>
 <tr>
   <td width='51%'>
     <b>PLZ Ort</b>
   </td>
   <td width='49%'>
     $row3c[plz] $row3c[ort]
   </td> 
 </tr>
 <tr>
    <td width='51%'>
      <b>PLZ Postfach</b>
    </td>
    <td width='49%'>
      $row3c[plz_postfach] $row3c[postfach]
    </td> 
 </tr>
 <tr>
     <td width='51%'>
       <b>Bundesland</b>
     </td>
     <td width='49%'>
       $row3c[bundesland]
     </td> 
 </tr>
<tr>
    <td width='51%'>
      <b>Staat</b>
    </td>
    <td width='49%'>
      $row3c[staat]
    </td> 
 </tr>
<tr>
    <td width='51%'>
      <b>Zeitraum bei dieser Praxisstelle</b>
    </td>
    <td width='49%'>
      $row3[beginn] - $row3[ende]
    </td> 
 </tr>
<tr>
    <td width='51%'>
      <b>Abteilung</b>
    </td>
    <td width='49%'>
      $row3[abteilung]
    </td> 
 </tr>
<tr>
    <td width='51%'>
      <b>Tel. der Abteilung</b>
    </td>
    <td width='49%'>
      $row3[tel_abteilung]
    </td> 
 </tr>
</table>
 



 </td>
</tr>

</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\" 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>";



?>