Mecze temat z systemem rez. Narazie pisze proceduralnie, jak skoncze przeloze( bede sie starac ofkors) to na oop. Narazie prowizorycznie, faza testowa bez bazy danych, mam kalendarz, przycisk wywolujacy opcje z czasem itp. Pyt -> Skad php ma wiedziec ,ze to wylasnie dnia np. 13 wybralem opcje select by pozniej wlozyc ja do bazy danych lub wyswietlic przy sfinalizowaniu zamowienia.
Prosilbym o podpowiedzi/sugestie i nie dawanie gotowego rozwiazania. Kod ponizej.
Pzdr, J.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame Remove this if you use the .htaccess --> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>HTML</title> <meta name="description" content=""> <meta name="author" content="Jakub"> <meta name="viewport" content="width=device-width; initial-scale=1.0"> <!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references --> <link rel="shortcut icon" href="/favicon.ico"> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="stylesheet" href="style.php" media="screen"> </head> <body> <form action= "" method="post"> <?php $licznik=0; $current_day=0; $calendar = '<table border="1" style="width:50%"><tr><td>'.implode('</td><td>', $headings).'</td></tr>'; $calendar .= "<tr>"; for ($i=0; $i<$day_start_month; $i++){ $calendar.='<td bgcolor="grey"></td>'; $current_day++; } for($list=1;$list<$days_in_month;$list++){ if($list==9){ /* imitacja bazy danych*/ $calendar.='<td bgcolor="red" >'.$list;}else{ $calendar.='<td bgcolor="green">'.' <input type="submit" value="wybirz" name="wybierz">'.$list.'</td>';} if($current_day==6){ $calendar.='<tr>'; if(($licznik+1) != $days_in_month){ $calendar .='<tr>'; } $current_day= -1; $licznik=-1; } $current_day++;$licznik++; } $calendar.="</tr></table>"; ?php @$ktora=$_POST['ktora']; if($ktora=="a"){ } ?> </form> </body> </html>
Problem rozwiazany. Nalezalo w do petli wrzucic nowy <form> tym razem z type="hidden" jak w przykladzie ponizej. Moze sie komus przyda..
if($list==9){ // $calendar.='<td bgcolor="red" >'.$list;}else{ $calendar.='<td bgcolor="green">'.'<form method="POST" action=""> <input type="hidden" value="'.$list.'" name="dzien"> <input type="submit" value="Wyslij '.$list.'" name="wyslij"> </form>'.$list.'</td>';}