- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
if (isset ( $_POST ['atest'] ) && isset ( $_POST ['date_atest'] $_POST ['student'] ) && isset ( $_POST ['point'] ) ) {
( int ) $stud_id = $_POST ['student'];
( int ) $point = $_POST ['point'];
if (strlen ( $_POST ['atest'] ) > 3 && strlen ( $_POST ['date_atest'] ) == 10) {
$sql = "insert into `subjects` (`name`,`date`,`courses`,`group`)";
$sql .= "values (" . $db->qstr ( $_POST ['atest'] ) . "," . $db->qstr ( $_POST ['date_atest'] ) . "," . $course_input . "," . $group_input . ")";
$calc_attestation = "SELECT `users`.`id`, avg (`points`.`point`) attestation FROM `users`, `points`";
$calc_attestation .= "WHERE `users`.`id` = " . $stud_id . " AND `users`.`id` = `points`.`student`";
$result_calc_attestation = mysql_fetch_assoc(mysql_query($calc_attestation));
if ($result_calc_attestation['attestation'] >= 0 && $result_calc_attestation['attestation'] <= 0,5) {
$result_calc_attestation = 0;
$add_attestation = "insert into `points` (`point`, `course`, `student`)";
$add_attestation .= "values (" . $result_calc_attestation . ", " . $course_input . ", " . $group_input;
}
if ($result_calc_attestation['attestation'] >= 0,5 && $result_calc_attestation['attestation'] <= 1) {
$result_calc_attestation = 1;
$add_attestation = "insert into `points` (`point`, `course`, `student`)";
$add_attestation .= "values (" . $result_calc_attestation . ", " . $course_input . ", " . $group_input;
}
if ($result_calc_attestation['attestation'] >= 1 && $result_calc_attestation['attestation'] <= 1,5) {
$result_calc_attestation = 1;
$add_attestation = "insert into `points` (`point`, `course`, `student`)";
$add_attestation .= "values (" . $result_calc_attestation . ", " . $course_input . ", " . $group_input;
}
if ($result_calc_attestation['attestation'] >= 1,5 && $result_calc_attestation['attestation'] <= 2) {
$result_calc_attestation = 2;
$add_attestation = "insert into `points` (`point`, `course`, `student`)";
$add_attestation .= "values (" . $result_calc_attestation . ", " . $course_input . ", " . $group_input;
}
if ($result_calc_attestation['attestation'] >= 2 && $result_calc_attestation['attestation'] <= 2,5) {
$result_calc_attestation = 2;
$add_attestation = "insert into `points` (`point`, `course`, `student`)";
$add_attestation .= "values (" . $result_calc_attestation . ", " . $course_input . ", " . $group_input;
}
[Код сокращен]
if ($result_calc_attestation['attestation'] >= 11,5 && $result_calc_attestation['attestation'] <= 12) {
$result_calc_attestation = 12;
$add_attestation = "insert into `points` (`point`, `course`, `student`)";
$add_attestation .= "values (" . $result_calc_attestation . ", " . $course_input . ", " . $group_input;
}
if ($result_calc_attestation['attestation'] == 12) {
$result_calc_attestation = 12;
$add_attestation = "insert into `points` (`point`, `course`, `student`)";
$add_attestation .= "values (" . $result_calc_attestation . ", " . $course_input . ", " . $group_input;
}
if ($db->Execute ( $sql ) or $db->Execute ( $add_attestation ) === false) {
die ( 'Опаньки: ' . $db->ErrorMsg () );
}
$GLOBALS ['inform'] [] = "Атестація проведена";
} else {
$GLOBALS ['error'] [] = "Помилка додавання пари через те, що довжина назви менше 3-х символів або дата вказана не вірно.";
}
}
Ну и как это использовать? Я уже представил что будет если будет болонская система)
Lure Of Chaos 04.04.2012 07:21 # 0
NoYaSloPaToy 04.04.2012 11:41 # 0
eth0 04.04.2012 13:00 # 0
wvxvw 04.04.2012 14:56 # −5
lucidfoxGovno 04.04.2012 15:38 # −5
wvxvw 04.04.2012 15:47 # +3
nethak 07.04.2012 18:38 # +2
lucidfoxGovno 07.04.2012 19:31 # −6
nethak 08.04.2012 01:09 # −3
lucidfoxGovno 08.04.2012 21:49 # −4
nethak 08.04.2012 22:30 # −2
Ice 12.09.2013 16:45 # 0
nethak 08.04.2012 22:37 # −2
lucidfoxGovno 08.04.2012 23:55 # −2
хау мач вотч, петушок?
TarasB 08.04.2012 23:57 # −2
lucidfoxGovno 08.04.2012 23:58 # −5
JavaGovno 09.04.2012 09:59 # −3
anonimb84a2f6fd141 12.09.2013 17:36 # −1
guest8 09.04.2019 13:00 # −999