2021-02-01 22:51:05 +01:00
<! DOCTYPE html >
2020-12-06 20:15:35 +01:00
< html >
2021-02-01 22:51:05 +01:00
< head >
2021-02-13 21:48:18 +01:00
< link rel = " stylesheet " href = " style.css " >
2021-02-01 22:51:05 +01:00
< meta charset = " utf-8 " >
< meta name = " viewport " content = " width=device-width, initial-scale=1.0 " >
< title ></ title >
</ head >
2020-12-06 20:15:35 +01:00
< body >
< h1 > Recepcjonista </ h1 >
< script type = " text/javascript " >
function przekierowanie ()
{
window . location . replace ( " ../rejestracja/index.php " );
}
</ script >
2021-01-30 17:10:07 +01:00
< ? php
2021-02-20 00:03:15 +01:00
if ( isset ( $_POST [ 'submit' ]))
{
header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ]);
}
$godziny = [];
2021-02-08 21:30:39 +01:00
$polaczenie = mysqli_connect ( 'localhost' , 'root' , '' , 'rejestracja' );
2021-02-20 00:03:15 +01:00
$zapytanie = " SELECT `dzien`,`godzina`, `stan`, `imie`, `nazwisko`, `id` FROM `wizyty` INNER JOIN `pacjenci` WHERE `dzien`='2020-12-13' AND pacjenci.telefon=wizyty.telefon ORDER BY `godzina` " ;
$wynik = mysqli_query ( $polaczenie , $zapytanie ) or die ( " bład zapytania1! " );
2021-02-13 21:48:18 +01:00
echo '<form method="POST" id="formularz2">' ;
print " <div id= 'tabele'> " ;
/*print '<form method="post" >';*/
print " <table class='tabela'> " ;
2021-01-30 17:10:07 +01:00
print " <br> " ;
2021-02-20 00:03:15 +01:00
$tab1 = [];
2021-02-13 21:48:18 +01:00
$licznik = 0 ;
for ( $i = 10 ; $i < 18 ; $i ++ )
2021-01-30 17:10:07 +01:00
{
if ( $wiersz = mysqli_fetch_assoc ( $wynik ))
{
$data = explode ( " : " , $wiersz [ " godzina " ]);
2021-02-20 00:03:15 +01:00
$tab1 [ $data [ 0 ]] = $wiersz [ " dzien " ];
$tab1 [ $data [ 0 ] + 10 ] = $wiersz [ " godzina " ];
$tab1 [ $data [ 0 ] + 20 ] = $wiersz [ " imie " ];
$tab1 [ $data [ 0 ] + 30 ] = $wiersz [ " nazwisko " ];
$tab1 [ $data [ 0 ] + 40 ] = $wiersz [ " stan " ];
$tab1 [ $data [ 0 ] + 50 ] = $wiersz [ " id " ];
2021-01-30 17:10:07 +01:00
}
}
2021-02-13 21:48:18 +01:00
print " <tr><td>godzina</td><td colspan='2'>terminy</td><td>imie</td><td>nazwisko</td><td>stan</td><td>potwierdzenie</td></tr><br> " ;
for ( $i = 10 ; $i < 18 ; $i ++ )
{
2021-02-20 00:03:15 +01:00
if ( isset ( $tab1 [ $i ]) && $tab1 [ $i + 40 ] == 0 )
{
print " <tr><td> " . $i . " </td><td> " . $tab1 [ $i ] . " </td><td> " . $tab1 [ $i + 10 ] . " </td><td> " . $tab1 [ $i + 20 ] . " </td><td> " . $tab1 [ $i + 30 ] . " </td><td> " . $tab1 [ $i + 40 ] . " </td><td><input name= \" anything[] \" type= \" text \" style= \" width: 20px \" /></td></tr><br> " ;
//dzien
$godziny [ $licznik ] = $tab1 [ $i ];
//godzina
$godziny [ $licznik + 30 ] = $tab1 [ $i + 10 ];
$licznik ++ ;
} else if ( isset ( $tab1 [ $i ]) && $tab1 [ $i + 40 ] == 1 )
print " <tr><td> " . $i . " </td><td> " . $tab1 [ $i ] . " </td><td> " . $tab1 [ $i + 10 ] . " </td><td> " . $tab1 [ $i + 20 ] . " </td><td> " . $tab1 [ $i + 30 ] . " </td><td> " . $tab1 [ $i + 40 ] . " </td><td>zatwierdzono</td></tr><br> " ;
2021-02-13 21:48:18 +01:00
else
echo " <tr><td> " . $i . " </td><td colspan='6'>wolny termin / brak chętnych</td></tr><br> " ;
2021-02-08 21:30:39 +01:00
}
2021-02-13 21:48:18 +01:00
print " </table> " ;
2021-02-20 00:03:15 +01:00
$zapytanie = " SELECT `dzien`,`godzina`, `stan`, `imie`, `nazwisko`, `id` FROM `wizyty` INNER JOIN `pacjenci` WHERE `dzien`='2020-12-14' AND pacjenci.telefon=wizyty.telefon ORDER BY `godzina` " ;
$wynik = mysqli_query ( $polaczenie , $zapytanie ) or die ( " bład zapytania2! " );
2021-02-13 21:48:18 +01:00
print " <table class='tabela'> " ;
print " <br> " ;
2021-02-20 00:03:15 +01:00
$tab2 = [];
2021-02-13 21:48:18 +01:00
for ( $i = 10 ; $i < 18 ; $i ++ )
{
if ( $wiersz = mysqli_fetch_assoc ( $wynik ))
{
$data = explode ( " : " , $wiersz [ " godzina " ]);
2021-02-20 00:03:15 +01:00
$tab2 [ $data [ 0 ]] = $wiersz [ " dzien " ];
$tab2 [ $data [ 0 ] + 10 ] = $wiersz [ " godzina " ];
$tab2 [ $data [ 0 ] + 20 ] = $wiersz [ " imie " ];
$tab2 [ $data [ 0 ] + 30 ] = $wiersz [ " nazwisko " ];
$tab2 [ $data [ 0 ] + 40 ] = $wiersz [ " stan " ];
$tab2 [ $data [ 0 ] + 50 ] = $wiersz [ " id " ];
2021-02-13 21:48:18 +01:00
}
}
print " <tr><td>godzina</td><td colspan='2'>terminy</td><td>imie</td><td>nazwisko</td><td>stan</td><td>potwierdzenie</td></tr><br> " ;
for ( $i = 10 ; $i < 18 ; $i ++ )
{
2021-02-20 00:03:15 +01:00
if ( isset ( $tab2 [ $i ]) && $tab2 [ $i + 40 ] == 0 )
{
print " <tr><td> " . $i . " </td><td> " . $tab2 [ $i ] . " </td><td> " . $tab2 [ $i + 10 ] . " </td><td> " . $tab2 [ $i + 20 ] . " </td><td> " . $tab2 [ $i + 30 ] . " </td><td> " . $tab2 [ $i + 40 ] . " </td><td><input name= \" anything[] \" type= \" text \" style= \" width: 20px \" /></td></tr><br> " ;
//dzien
$godziny [ $licznik ] = $tab2 [ $i ];
//godzina
$godziny [ $licznik + 30 ] = $tab2 [ $i + 10 ];
$licznik ++ ;
}
else if ( isset ( $tab2 [ $i ]) && $tab2 [ $i + 40 ] == 1 )
print " <tr><td> " . $i . " </td><td> " . $tab2 [ $i ] . " </td><td> " . $tab2 [ $i + 10 ] . " </td><td> " . $tab2 [ $i + 20 ] . " </td><td> " . $tab2 [ $i + 30 ] . " </td><td> " . $tab2 [ $i + 40 ] . " </td><td>zatwierdzono</td></tr><br> " ;
2021-02-13 21:48:18 +01:00
else
echo " <tr><td> " . $i . " </td><td colspan='6'>wolny termin / brak chętnych</td></tr><br> " ;
2021-02-20 00:03:15 +01:00
2021-02-13 21:48:18 +01:00
}
print " </table> " ;
2021-02-20 00:03:15 +01:00
$zapytanie = " SELECT `dzien`,`godzina`, `stan`, `imie`, `nazwisko`, `id` FROM `wizyty` INNER JOIN `pacjenci` WHERE `dzien`='2020-12-15' AND pacjenci.telefon=wizyty.telefon ORDER BY `godzina` " ;
$wynik = mysqli_query ( $polaczenie , $zapytanie ) or die ( " bład zapytania 3 ! " );
2021-02-13 21:48:18 +01:00
print " <table class='tabela'> " ;
print " <br> " ;
2021-02-20 00:03:15 +01:00
$tab3 = [];
2021-02-13 21:48:18 +01:00
for ( $i = 10 ; $i < 18 ; $i ++ )
{
if ( $wiersz = mysqli_fetch_assoc ( $wynik ))
{
$data = explode ( " : " , $wiersz [ " godzina " ]);
2021-02-20 00:03:15 +01:00
$tab3 [ $data [ 0 ]] = $wiersz [ " dzien " ];
$tab3 [ $data [ 0 ] + 10 ] = $wiersz [ " godzina " ];
$tab3 [ $data [ 0 ] + 20 ] = $wiersz [ " imie " ];
$tab3 [ $data [ 0 ] + 30 ] = $wiersz [ " nazwisko " ];
$tab3 [ $data [ 0 ] + 40 ] = $wiersz [ " stan " ];
$tab3 [ $data [ 0 ] + 50 ] = $wiersz [ " id " ];
2021-02-13 21:48:18 +01:00
}
}
print " <tr><td>godzina</td><td colspan='2'>terminy</td><td>imie</td><td>nazwisko</td><td>stan</td><td>potwierdzenie</td></tr><br> " ;
for ( $i = 10 ; $i < 18 ; $i ++ )
{
2021-02-20 00:03:15 +01:00
if ( isset ( $tab3 [ $i ]) && $tab3 [ $i + 40 ] == 0 )
{
print " <tr><td> " . $i . " </td><td> " . $tab3 [ $i ] . " </td><td> " . $tab3 [ $i + 10 ] . " </td><td> " . $tab3 [ $i + 20 ] . " </td><td> " . $tab3 [ $i + 30 ] . " </td><td> " . $tab3 [ $i + 40 ] . " </td><td><input name= \" anything[] \" type= \" text \" style= \" width: 20px \" /></td></tr><br> " ;
//dzien
$godziny [ $licznik ] = $tab3 [ $i ];
//godzina
$godziny [ $licznik + 30 ] = $tab3 [ $i + 10 ];
$licznik ++ ;
}
else if ( isset ( $tab3 [ $i ]) && $tab3 [ $i + 40 ] == 1 )
print " <tr><td> " . $i . " </td><td> " . $tab3 [ $i ] . " </td><td> " . $tab3 [ $i + 10 ] . " </td><td> " . $tab3 [ $i + 20 ] . " </td><td> " . $tab3 [ $i + 30 ] . " </td><td> " . $tab3 [ $i + 40 ] . " </td><td>zatwierdzono</td></tr><br> " ;
2021-02-13 21:48:18 +01:00
else
2021-02-20 00:03:15 +01:00
echo " <tr><td> " . $i . " </td><td colspan='6'>wolny termin / brak chętnych</td></tr><br> " ;
2021-02-13 21:48:18 +01:00
}
2021-02-20 00:03:15 +01:00
print " </table></div> " ;
print '<input type="hidden" name="op" value="sent" />' ;
print '<input type="submit" value="submit" />' ;
print " </form><div id='czysc'></div> " ;
if ( ! empty ( $_POST [ " op " ])) {
print_r ( $godziny );
print " <br> " ;
for ( $i = 1 ; $i < $licznik ; $i ++ ) {
if ( $_POST [ " anything " ][ $i ] == 1 ) {
print " godz " . $godziny [ $i + 30 ] . " <br> " ;
print " dzien " . $godziny [ $i ] . " <br> " ;
print " licz " . $licznik . " <br> " ;
$zapytanie = " UPDATE `wizyty` SET `stan`='1' WHERE wizyty.dzien=' " . $godziny [ $i ] . " ' AND wizyty.godzina=' " . $godziny [ $i + 30 ] . " ' " ;
$wynik = mysqli_query ( $polaczenie , $zapytanie ) or die ( " bład zapytania! " );
echo $_POST [ " anything " ][ $i ];
} else {
print " not set<br> " ;
}
}
2021-02-13 21:48:18 +01:00
}
mysqli_close ( $polaczenie );
2021-01-30 17:10:07 +01:00
?>
2021-02-20 00:03:15 +01:00
< script >
if ( window . history . replaceState ) {
window . history . replaceState ( null , null , window . location . href );
}
</ script >
2020-12-06 20:15:35 +01:00
< input type = " button " value = " home " onClick = " przekierowanie() " >
</ body >
</ html >