<?php

REQUIRE 'pu.php';



?>
<font size=4>Siin Saad vaadata ja kustutada Broneeringuid.</font><BR><BR><BR><BR>

<?php
  mysql_connect("localhost","kasutajanimi","parool");
  mysql_select_db("baas");

$aasta=date('Y'); 
$kuu=date('m');
$paev=date('d');
$string="RUUMI RENT!";

  $lause="SELECT id,SEADE,KLASS,BRON_algus,BRON_lopp,BRONNIA FROM BRONEERINGUD where year(BRON_algus)= '$aasta' && month(BRON_algus)='$kuu' &&  DAYOFMONTH(BRON_algus)='$paev' && SEADE!='$string'";
  $vastus=mysql_query($lause);

  

  $lause2="SELECT id,SEADE,KLASS,BRON_algus,BRON_lopp,BRONNIA FROM BRONEERINGUD where SEADE!='$string'";
  $vastus2=mysql_query($lause2);


  $lause3="SELECT id,SEADE,KLASS,BRON_algus,BRON_lopp,BRONNIA FROM BRONEERINGUD where year(BRON_algus)= '$aasta' && month(BRON_algus)='$kuu' &&  DAYOFMONTH(BRON_algus)='$paev' && SEADE='$string'";
  $vastus3=mysql_query($lause3);




echo "<form action='masskustutus4.php'>";
    
echo "Tänased Seadmed : <BR>";

while($rida=mysql_fetch_array($vastus))

    {
echo "

     <table>
     <tr>
     <td><input type='checkbox' name='ruut[]' value='$rida[id]'></td>
     <td>$rida[SEADE]</td><td>$rida[KLASS]</td><td>$rida[BRON_algus]</td>
     <td>$rida[BRON_lopp]</td>
     <td>$rida[BRONNIA]</td>	 
     </tr>
      </table>\n";

}

echo "<BR><BR>Tänased Ruumid : <BR>";
while($rida=mysql_fetch_array($vastus3))

    {
echo "<table>
     <tr>
     <td><input type='checkbox' name='ruut[]' value='$rida[id]'></td>
     <td>$rida[SEADE]</td><td>$rida[KLASS]</td><td>$rida[BRON_algus]</td>
     <td>$rida[BRON_lopp]</td>
     <td>$rida[BRONNIA]</td>	 
     </tr>
     </table>\n";

}

echo "<BR><BR>Kõik broneeringud : <BR>";
while($rida=mysql_fetch_array($vastus2))

    {
echo "<table>
     <tr>
     <td><input type='checkbox' name='ruut[]' value='$rida[id]'></td>
     <td>$rida[SEADE]</td><td>$rida[KLASS]</td><td>$rida[BRON_algus]</td>
     <td>$rida[BRON_lopp]</td>
     <td>$rida[BRONNIA]</td>	 
     </tr>
      </table>\n";

}




echo"<input type='submit' value='Kustuta'></form>";
  mysql_close();
?>