![]() |
![]() |
![]()
Post
#1
|
||
Grupa: Zarejestrowani Postów: 21 Pomógł: 0 Dołączył: 30.09.2008 Skąd: Krosno Ostrzeżenie: (0%) ![]() ![]() |
Witam Napisałem skrypt który zwraca zwraca sukces ale mimo wszystko nic się nie wykonuje tzn nie dodaje rekordów do bazy danych. Jeśli dodam je ręcznie to wyświetla prawidłowo. Jeśli zamienię funkcję INSERT na DELETE to również działa bez problemu Męczy mnie to już trzeci dzień i nie mogę znaleźć żadnego błędu. Dlatego bardzo proszę o pomoc Jeśli ktoś potrafi wskazać mi błąd to będę bardzo wdzięczny. exit; } page_header(); page_menu(); $absentdate = $_POST['toyear'] . '-' . $_POST['tomonth'] . '-' . $_POST['today']; $classinfo = classGetClassById($classid); } else { $classinfo = classGetClassById($classid); } $confquery = 'SELECT * FROM `CONFIG_DB_TABLE` WHERE `id`=1 '; $max=$confrow['lessonmax']; // Wstawinie nieobecności ------------------------------------------------------------------------ if ($_POST['todo'] == 'Wstaw') { ?> <div id="content"> <div id="breadcrumb"><a href="<?=$conf_settings['site_url']?>">Strona główna</a> -> <a href="/frekwencja/">Frekwencja</a> -> <em>Wstawianie nieobecności</em></div> <div id="subnav"> <ul> <li> <form method="post" action="do.php" class="search"> <label for="toyear"> <img src="/images/options/search.png"/> Przejdź do: </label> <?php dateboxes(true, false); ?> <label for="class"> Klasy: </label> <?php classSelectBox(); ?> <input type="submit" name="submit" value="Przejdź" /> </form> </li> </ul> </div> <div style="clear: both;"></div> <p>Umieść znacznik obok każdego nieobecnego ucznia.</p> <?php $studentlist = classGetStudentsById($classid); ?> W tej klasie nie ma wpisanych uczniów. Aby zarządzać frekwencją, musisz <a href="/klasy/dodajstudent.php">dodać uczniów do tej klasy</a>. <?php } else { ?> <form method="post" action="wstaw.php"> <table cellpadding="5" class="classlist"> <tr><th rowspan="2">ID ucznia</th><th rowspan="2">Imię</th><th rowspan="2">Nazwisko</th><th rowspan="2">Nieobecny?</th><th colspan="<?=$max?>">Lekcje</th></tr> <tr> <?php for($j=0; $j < $max; $j++) { $n=$j+1; } $i = 0; foreach ($studentlist as $student) { $i++; if ($i % 2) else if ($absent == true) { $absvalue = 'checked="checked" '; } for($j=0; $j < $max; $j++) { if ($lesson[$j] == 1){ $lesson_value[$j] = 'checked="checked"'; } ?> <?php if ($lesson[$j] == true){ $lesson[$j] = 1; } else { $lesson[$j] = 0; } } } } ?> <input type="hidden" name="absentdate" value="<?=$absentdate?>" /> <input type="hidden" name="classid" value="<?=$classid?>" /> <input type="hidden" name="classid" value="<?=$studentid?>" /> <input type="submit" name="todo" value="Wstaw" /> <?php // Koniec wstawiania nieobecności ------------------------------------------------------------------- page_footer(); ?> [/list] [PHP] EACHER_GROUP); exit; } page_header(); page_menu(); $absentdate = $_POST['toyear'] . '-' . $_POST['tomonth'] . '-' . $_POST['today']; $classinfo = classGetClassById($classid); } else { $classinfo = classGetClassById($classid); } $confquery = 'SELECT * FROM `CONFIG_DB_TABLE` WHERE `id`=1 '; $max=$confrow['lessonmax']; // Wstawinie nieobecności ------------------------------------------------------------------------ if ($_POST['todo'] == 'Wstaw') { ?> <div id="content"> <div id="breadcrumb"><a href="<?=$conf_settings['site_url']?>">Strona główna</a> -> <a href="/frekwencja/">Frekwencja</a> -> <em>Wstawianie nieobecności</em></div> <div id="subnav"> <ul> <li> <form method="post" action="do.php" class="search"> <label for="toyear"> <img src="/images/options/search.png"/> Przejdź do: </label> <?php dateboxes(true, false); ?> <label for="class"> Klasy: </label> <?php classSelectBox(); ?> <input type="submit" name="submit" value="Przejdź" /> </form> </li> </ul> </div> <div style="clear: both;"></div> <p>Umieść znacznik obok każdego nieobecnego ucznia.</p> <?php $studentlist = classGetStudentsById($classid); ?> W tej klasie nie ma wpisanych uczniów. Aby zarządzać frekwencją, musisz <a href="/klasy/dodajstudent.php">dodać uczniów do tej klasy</a>. <?php } else { ?> <form method="post" action="wstaw.php"> <table cellpadding="5" class="classlist"> <tr><th rowspan="2">ID ucznia</th><th rowspan="2">Imię</th><th rowspan="2">Nazwisko</th><th rowspan="2">Nieobecny?</th><th colspan="<?=$max?>">Lekcje</th></tr> <tr> <?php for($j=0; $j < $max; $j++) { $n=$j+1; } $i = 0; foreach ($studentlist as $student) { $i++; if ($i % 2) else if ($absent == true) { $absvalue = 'checked="checked" '; } for($j=0; $j < $max; $j++) { if ($lesson[$j] == 1){ $lesson_value[$j] = 'checked="checked"'; } ?> <?php if ($lesson[$j] == true){ $lesson[$j] = 1; } else { $lesson[$j] = 0; } } } } ?> <input type="hidden" name="absentdate" value="<?=$absentdate?>" /> <input type="hidden" name="classid" value="<?=$classid?>" /> <input type="hidden" name="classid" value="<?=$studentid?>" /> <input type="submit" name="todo" value="Wstaw" /> <?php // Koniec wstawiania nieobecności ------------------------------------------------------------------- page_footer(); ?> [/list] [PHP] ); exit; } $date = $_POST['absentdate']; foreach ($student as $studentid => $status) { $query = 'INSERT INTO `intra_attendance` (`classid`, `studentid`, `date_absent`) VALUES ('.$classid.', '.$studentid.', '.$date.');'; } } exit; ?> [/list] [PHP] EACHER_GROUP); exit; } $date = $_POST['absentdate']; foreach ($student as $studentid => $status) { $query = 'INSERT INTO `intra_attendance` (`classid`, `studentid`, `date_absent`) VALUES ('.$classid.', '.$studentid.', '.$date.');'; } } exit; ?> [/list] |
|
![]() ![]() |
![]() |
Aktualny czas: 27.08.2025 - 12:44 |