Current File : /home/inlingua/www/sensoriumpsychologists.com/screening/franchise/imagetest.php |
<?php include('../franchise_back/connection.php');
$mysqli = new mysqli($host_db,$user_db,$pass_db,$name_db);
if ($mysqli -> connect_errno) {
echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
exit();
}
session_start();
$prepared_statement="SELECT * FROM shristi_questionnaires_sub_questions WHERE TYPE='5' AND short_by>0 ";
//$res=$mysql_obj->simply_run_statement_passed($prepared_statement);
//$result = mysql_query($prepared_statement);
$result = $mysqli -> query($prepared_statement);
//echo 'TTTT-->'.$rowass = $result -> fetch_rows();
echo $number = $result->num_rows;
//$row = $result -> fetch_assoc();
if($number>0)
{
echo '<form id="nextform" action="/" >';
echo '<table border="0" class="tables_fieldset" style="width:100%;font-size:14px;" cellpadding="3px" cellspacing="0">';
$sno=0;
while($detail=$result -> fetch_assoc())
{
if($detail['type']=="questions_category")
{
echo("<tr>");
echo("<td colspan=\"3\" style=\"text-decoration:underline;\">".$detail['question']."</td>");
echo("</tr>");
}
else
{
$sno++;
$sno=$detail['short_by'];
echo("<input type=\"hidden\" value=\"".$detail['table_id']."\" name=\"question_".$sno."\" id=\"question_".$sno."\" />");
if($detail['type']=="5")
{
echo("<tr>");
echo("<td style=\"height:20px;\"></td>");
echo("</tr>");
}
echo("<tr valign=\"top\">");
echo("<td style=\"width:20px;text-align:left;\">Q".$sno."</td>");
echo("<td style=\"padding:0 5px;width:5px;\">:</td>");
//echo("</tr>");
if($detail['type']=="5")
{
//echo("<tr>");
//echo("<td style=\"height:20px;\">".$detail['question']."</td>");
//echo("</tr>");
}
/*if($detail['type']=="5")
{
$url="https://translate.google.com/translate_tts?tl=IN&q=".$detail['question'];
echo("<td>");
echo("<input type=\"hidden\" id=\"google_link_".$sno."\" value=\"".$url."\" />");
echo("<div id=\"embed_div_".$sno."\"><embed src=\"none\" id=\"embed_".$sno."\" autostart=\"false\" width=\"2\" height=\"0\"></embed></div><noembed><bgsound src=\"none\"></noembed>");
echo("<img src=\"images/im-listen-icon.png\" height=\"100px\" onClick=\"play_sound('".$sno."')\" volume=\"100\" style=\"cursor:pointer;\" />");
}*/
/* if($detail['type']=="5")
{
echo("<td>");
//echo("<img src=\"images/im-listen-icon.png\" height=\"100px\" onClick=\"play_sound_2('".$detail['question']."')\" volume=\"100\" style=\"cursor:pointer;\" />");
echo("<img src=\"images/im-listen-icon.png\" height=\"100px\" onClick=\"responsiveVoice.speak('".$detail['question']."')\" style=\"cursor:pointer;\" />");
}*/
if($detail['type']=="5")
{
//$aufile="https://shristisensorium.com/franchise/".$detail['audio_file_link'];
echo("<td>");
echo '<div style="margin-top:0px;">'. ''.'</div>';
$val='message'.$detail['table_id'];
//echo $newimg= strtoupper($detail['question']).'.png';
$pathx = "images/quiz/";
$file = strtoupper($detail['question']).'.png';
echo '<img style="margin-left: 50px;
margin-top: -30px;margin-right: 10px;" height="80px;" src="'.$pathx.$file.'">';
echo("<input type=\"text\" id=\"".$val."\" value=\"".$detail['question']."\" /> ");
$link_address = 'javascript:;';
$dattata=$detail['table_id'];
echo "<a class=\"button_img\" href='".$link_address."' onClick=\"songplay('".$dattata."');\"><img height=\"50px;\" src=\"images\speak_icon.png\"></a>";
}
else if($detail['type']=="8")
{
echo("<td rowspan=\"2\">");
echo("<table style=\"font-size:20px;\"><tr>");
$options=$detail['options'];
$options_array=explode("!@!@",$options);
for($i=0;$i<count($options_array);$i++)
{
$j=$i+1;
echo("<td align=\"center\" style=\"padding:0 10px;\"><label for=\"ans_".$detail['table_id']."_".$j."\">".$options_array[$i]."</label><br />");
echo("<input type=\"radio\" name=\"ans_".$detail['table_id']."\" id=\"ans_".$detail['table_id']."_".$j."\" value=\"".$j."\" /></td>");
}
echo("</tr></table>");
}
else if($detail['type']=="50")
{
echo("<td rowspan=\"2\">");
echo("<table border=\"0\" style=\"font-size:20px;\"><tr valign=\"top\">");
echo("<td align=\"center\">".$detail['answer']."</td>");
echo("</tr>");
echo("<tr>");
echo("<td colspan=\"4\" style=\"padding:10px;padding-right:0;\"><div style=\"position:relative;width:150px;height:1px;border-bottom:2px dashed #333;\"></div></td>");
echo("</tr>");
$options=$detail['options'];
$options_array=explode("!@!@",$options);
for($i=0;$i<count($options_array);$i++)
{
$j=$i+1;
echo("<td align=\"center\" style=\"padding:0 20px;\"><label for=\"ans_".$detail['table_id']."_".$j."\">".$options_array[$i]."</label><br />");
echo("<input type=\"radio\" name=\"ans_".$detail['table_id']."\" id=\"ans_".$detail['table_id']."_".$j."\" value=\"".$j."\" /></td>");
}
echo("</tr></table>");
}
else
{
echo("<td>");
echo($detail['question']."");
}
echo(" <span id=\"error_span_".$detail['table_id']."\" style=\"color:#F00;display:none;\">Please select answer !!!</span></td>");
echo("</tr>");
if($detail['type']=="5")
{
$options=$detail['options'];
$options_array=explode("!@!@",$options);
for($i=0;$i<count($options_array);$i++)
{
$j=$i+1;
echo("<tr>");
echo("<td colspan=\"3\"><input type=\"radio\" name=\"ans_".$detail['table_id']."\" id=\"ans_".$detail['table_id']."_".$j."\" value=\"".$j."\" /> ");
echo("<label for=\"ans_".$detail['table_id']."_".$j."\">".$options_array[$i]."</label></td>");
echo("</tr>");
}
}
else if($detail['type']=="50")
{
echo("<tr style=\"line-height:100px\"><td colspan=\"3\"> </td></tr>");
echo("<input type=\"hidden\" value=\"radio\" name=\"question_type_".$sno."\" id=\"question_type_".$sno."\" />");
}
else if($detail['type']!="8")
{
echo("<tr valign=\"top\">");
echo("<td style=\"width:20px;text-align:right;\">Ans</td>");
echo("<td style=\"padding:0 5px;width:5px;\">:</td>");
echo("<td>");
echo("<table>");
$options=$detail['options'];
$options_array=explode("!@!@",$options);
if(count($options_array)>4)
{
echo("<tr>");
for($i=0;$i<count($options_array);$i++)
{
$j=$i+1;
echo("<td><input type=\"radio\" name=\"ans_".$detail['table_id']."\" id=\"ans_".$detail['table_id']."_".$j."\" value=\"".$j."\" /></td>");
echo("<td><label for=\"ans_".$detail['table_id']."_".$j."\">".$options_array[$i]."</label></td>");
}
echo("</tr>");
}
else {
for($i=0;$i<count($options_array);$i++)
{
$j=$i+1;
echo("<tr>");
echo("<td><input type=\"radio\" name=\"ans_".$detail['table_id']."\" id=\"ans_".$detail['table_id']."_".$j."\" value=\"".$j."\" /></td>");
echo("<td><label for=\"ans_".$detail['table_id']."_".$j."\">".$options_array[$i]."</label></td>");
echo("</tr>");
}
}
echo("</table>");
echo("</td>");
echo("</tr>");
echo("<tr style=\"height:20px\"><td colspan=\"3\"></td></tr>");
}
else
{
echo("<tr style=\"line-height:150px\"><td colspan=\"3\"> </td></tr>");
}
}
}
$sno;
//echo("<input type=\"text\" name=\"total_questions\" id=\"total_questions\" value=\"".$sno."\" />");
?>
<table>
<tr>
<td>
<input type="hidden" id="nextquestions" name="next" value="<?php echo $sno; ?>" />
<input type="hidden" id="count" name="count" value="<?php echo $number; ?>" />
<input type="hidden" name="submit" value="1" />
</td>
</tr>
</table>
</form>
<?php } else {
echo "error"; exit;
} ?>