-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestion_process.php
44 lines (40 loc) · 1.11 KB
/
question_process.php
1
2
3
4
5
6
7
8
9
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
<?php
session_start();
include 'admin/json/settings.php';
$obj1 = new commonFunctions();
$dbh = $obj1->dbh;
$status = false;
$row = '';
$query = $dbh->prepare("select * from pig_questions where peradd='1' order by id asc");
$query->execute();
$counts_questions=$query->rowCount();
if ($query->rowCount() > 0)
{
$status = true;
while($row = $query->fetch(PDO::FETCH_ASSOC))
{
if($row['type']==1)
{
$answer=$_REQUEST['optionsRadios'.$row['id']];
}
else if($row['type']==2)
{
$answer=$_REQUEST['txt'.$row['id']];
}
else if($row['type']==3)
{
$answer=$_REQUEST['options'.$row['id']];
}
else if($row['type']==4)
{
$answer=$_REQUEST['dropdownval'.$row['id']];
}
$_SESSION['qn']['question'.$row['id']]=array("question_id"=>$row['id'],"type"=>$row['type'],"answer"=>$answer);
}
echo "1";
}
else
{
echo "0";
}
?>