-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.php
More file actions
24 lines (24 loc) · 825 Bytes
/
Copy pathaction.php
File metadata and controls
24 lines (24 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
session_start();
$uid=$_SESSION['id'];
$gtid=$_POST['gtid'];
$itog=$_POST['itog'];
$data=date('H:i:s d-m-Y');
for($i=1;$i<=$itog;$i++) {
$kolich=$_POST["kolich$i"];
for($j=0;$j<$kolich;$j++) {
$tid=$_POST["tid$i$j"];
$temp="";
for($t=1;$t<=10;$t++) {
$name="input$i$j";
if( !$_POST["$name$t"]==""){ $temp .=$_POST["$name$t"].","; }
elseif( !$_POST["radio$i$j"]==""){ $temp .=$_POST["radio$i$j"].","; }
$n=strlen($temp);
$temp=substr($temp,0,$n-1);
mysql_query("INSERT INTO `stud_otvet` VALUES (0, '$uid', '$gtid', '$tid', '$temp', '$data')") or die(mysql_error());
}
}
}
mysql_query("DELETE FROM `dostup` WHERE `id_user` = '$uid' AND `id_test` = '$gtid'") or die (mysql_error());
print "<div align='center'>Òåñòèðîâàíèå îêîí÷åíî.</div>";
?>