Current File : /home/inlingua/public_html/sensoriumpsychologists.com/diagnostics/admin/treatment_actual_delete.php
<?php require_once("../franchise_between/check_franchise.php");?>
<?php require_once("../franchise_between/user_details_msg_setup.php");?>
<?php require_once("../franchise_between/validate_functions.php");?>
<?php require_once("../franchise_between/student_funcs.php");?>
<?php require_once("../franchise_between/treatment_funcs.php");?>
<?php
$ref_no=$_SESSION['ref_no'];
$validate_obj=new validate_functions();
$validate_obj->check_isset_empty($ref_no,"ref_no");
$validate_obj->check_is_num($ref_no,"ref_no");
?>
<?php
$student_obj=new student_funcs();
$student_obj->set_value("franchise_id",$session_id);
$student_obj->view_child($ref_no);
$child_name=$student_obj->get_value("child_name");
$registration_no=$student_obj->get_value("registration_no");
$theme_link=$student_obj->get_value("theme_class");
$theme_font=$student_obj->get_value("theme_font");
?>
<?php
$treatment_id=$_SESSION['treatment_id'];
$validate_obj=new validate_functions();
$validate_obj->check_isset_empty($treatment_id,"treatment_id");
$validate_obj->check_is_num($treatment_id,"treatment_id");
?>
<?php
//$treatment_id=247;
?>
<?php
$treatment_obj=new treatment_funcs();
$treatment_obj->get_treatment_name_and_duration($treatment_id);
$treatment_name=$treatment_obj->get_value("treatment_name");
?>
<?php
if(!empty($_POST)&&(isset($_POST['cancel_exam']))&&($_POST['cancel_exam']=="yes"))
{
	header ("location:cancel_treatment.php");
}
else if(!empty($_POST))
{
	if(count($_SESSION['treatment_id_array'])>0)
	{
		$treatment_id=array_shift($_SESSION['treatment_id_array']);
		$_SESSION['treatment_id']=$treatment_id;
		header ("location:treatment_session.php");
	}
	else
	{
		unset($_SESSION['treatment_id']);
		header ("location:treatment_available.php?ref_no=".$ref_no);
	}
}
?>
<!doctype html>
<html>
<?php include("common/page_head.php");?>

		<script type="text/javascript" src="countdown/jquery.countdown.js"></script>
		<script type="text/javascript">
		$(function () {
			$('#defaultCountdown').countdown({
				until: +<?php echo($duration_in_sec);?>,
				format: 'YDHMS',
				layout: '<div id="timer">'+
							'<div id="vals">'+
								'<div id="h" class="numbs">{hnn}</div>'+
								'<div id="m" class="numbs">{mnn}</div>'+
								'<div id="s" class="numbs">{snn}</div>'+
							'</div>'+
							'<div id="labels">'+
								'<div id="hl" class="labs">hours</div>'+
								'<div id="ml" class="labs">mins</div>'+
								'<div id="sl" class="labs">secs</div>'+
							'</div>'+
							'<div id="timer_over"></div>'+
						'</div>'
				});
		});
		</script>
		<link rel="stylesheet" type="text/css" href="countdown/style_countdown.css" media="all" />

  <script src="css/jquery-ui.js"></script>
  <style>
  .match_left_column_item{width: 100px; height: 60px;background-color:#06C;color:#FFF;border-radius:10px;font-weight:400;text-align:center;line-height:60px;margin-bottom:20px;position:relative;}
  
  .match_center_column_item{width: 100px; height: 60px;background-color:#CCC;color:#555;border-radius:10px;font-weight:400;text-align:center;line-height:60px;margin-bottom:20px;position:relative;}
  
  .match_right_column_item{width: 100px; height: 60px;background-color:#F88;color:#FFF;border-radius:10px;font-weight:400;text-align:center;line-height:60px;margin-bottom:20px;position:relative;}
  
  .draggable { cursor:move;position:relative; }
  .draggable:active {background-color:#FF4646;}
  
  .droppable { }
  .match_list_heading{ width:100px;text-align:center;}
  </style>
  <script>
  $(function() {
	  
	  $(".draggable").draggable({
		  helper:'clone',
        revert : function(event, ui) {
            // on older version of jQuery use "draggable"
            // $(this).data("draggable")
            // on 2.x versions of jQuery use "ui-draggable"
            // $(this).data("ui-draggable")
            $(this).data("uiDraggable").originalPosition = {
                top : 0,
                left : 0
            };
            // return boolean
            return !event;
            // that evaluate like this:
            // return event !== false ? false : true; 
        }
    });
	
    //$( ".draggable" ).draggable();
    /*$( ".droppable" ).droppable({
      drop: function( event, ui ) {
		  $(this).css({'color':'#F00'});
		  $(ui.draggable).css({'color':'#F00'});
      }
    });*/
	
	$('.droppable').droppable({
    drop: function(event, ui) {
        /*$(ui.draggable).detach().css({top: 0,left: 0,margin:0,position:'absolute'}).appendTo(this);*/
		var new_text=$(ui.draggable).html();
		$(this).html(new_text);
		$(this).css({'background-color':'#FF4646','color':'#FFF'});
    }
});
  });
  </script>

<style>
:checked + #correct_span_audio {
	color:#090;
    font-weight: bold;
	font-size:1.2em;
}
:checked + #incorrect_span_audio {
	color:#F00;
    font-weight: bold;
	font-size:1.2em;
}
</style>

<body>
<?php include("common/header_var.php");?>
<?php
$top_children=$top_val;
?>
<?php include("common/header.php");?>
<div id="main_container">
  <div id="main"><br><br>
    <table border="0" cellpadding="5px" cellspacing="0" style="width:100%;">
      <tr>
        <td>
          <table style="border:1px solid #000;" cellpadding="5px" cellspacing="0">
            <tr>
              <td><strong>Admission No :</strong> <?php echo($registration_no);?></td>
              <td>&nbsp;&nbsp;&nbsp;</td>
              <td><strong>Name :</strong> <?php echo($child_name);?></td>
              <td>&nbsp;&nbsp;&nbsp;</td>
              <td><strong>Treatment :</strong> <?php echo($treatment_name);?></td>
            </tr>
          </table>
        </td>
<form name="cancel_form" method="post">
<input type="hidden" name="cancel_exam" id="cancel_exam" value="no" />
</form>
<form name="timeout_form" method="post">
<input type="hidden" name="timeout_submit" id="timeout_submit" value="no" />
</form>
        <td><a href="javascript:cancel_exam()"><div class="button_div" style="color:#FFF;background-color:#900;">Exit Treatment & Try Later</div></a></td>
        <td align="right">
          <table cellpadding="5px" cellspacing="0">
            <tr>
              <td><div id="defaultCountdown"></div></td>
            </tr>
          </table>
        </td>
      </tr>
    </table><br>
    <form name="myform" method="post">
    <fieldset>
    <legend>SECTION <?php echo($_SESSION['section_count']);?></legend>
    <table border="0" class="tables_fieldset" style="width:70%;font-size:14px;" cellpadding="3px" cellspacing="0">
<?php
$treatment_obj->print_sub_questions($treatment_id);
?>
<tr style="height:10px;">
  <td colspan="3"></td>
</tr>
      <tr>
        <td colspan="3">
          <a href="javascript:submit_answers()"><div class="button_div" style="color:#FFF;background-color:#060;">Proceed</div></a>
        </td>
      </tr>
    </table>
    </fieldset>
    </form>
  </div>
</div>
  <br><br><br><br>
<script>
function submit_answers()
{
	var to_check="";
	var ques_id="";
	var ans_name="";
	var response="";
	var span_id="";
	var not_ans="no";
	var total_questions=$("#total_questions").val();
	for(var i=1;i<=total_questions;i++)
	{
		to_check="#question_"+i;
		type="#question_type_"+i;
		ques_id=$(to_check).val();
		ques_type=$(type).val();
		ans_name="ans_"+ques_id;
		ans_id="#ans_"+ques_id;
		if(ques_type=="radio")
		{
			response=$("input:radio[name='"+ans_name+"']").is(":checked");
			if(response==false)
			{
				span_id="#error_span_"+ques_id;
				$(span_id).show();
				not_ans="yes";
			}
			else
			{
				span_id="#error_span_"+ques_id;
				$(span_id).hide();
			}
		}
		if(ques_type=="read_audio_radio")
		{
			response=$("input:radio[name='"+ans_name+"']").is(":checked");
			if(response==false)
			{
				span_id="#error_span_"+ques_id;
				$(span_id).show();
				not_ans="yes";
			}
			else
			{
				span_id="#error_span_"+ques_id;
				$(span_id).hide();
			}
		}
		else if(ques_type=="textbox")
		{
			response=$(ans_id).val();
			if(response=="")
			{
				span_id="#error_span_"+ques_id;
				$(span_id).show();
				not_ans="yes";
			}
			else
			{
				span_id="#error_span_"+ques_id;
				$(span_id).hide();
			}
		}
		else if(ques_type=="textarea")
		{
			response=$(ans_id).val();
			if(response=="")
			{
				span_id="#error_span_"+ques_id;
				$(span_id).show();
				not_ans="yes";
			}
			else
			{
				span_id="#error_span_"+ques_id;
				$(span_id).hide();
			}
		}
		else if(ques_type=="match_type_1")
		{
			var total_length=$(".match_center_column_item:contains('[drop here]')").length;
			if(total_length>0)
			{
				span_id="#error_span_"+ques_id;
				$(span_id).show();
				not_ans="yes";
			}
			else
			{
				span_id="#error_span_"+ques_id;
				$(span_id).hide();
			}
		}
		else if(ques_type=="blanks")
		{
			var total_blanks="#ans_no_blanks_"+ques_id;
			var total_blanks_val=$(total_blanks).val();
			
			ans_id="#ans";
			response=$(ans_id).val();
			
			var answer="";
			for(var i_blanks=1;i_blanks<=total_blanks_val;i_blanks++)
			{
				ans_id="#ans_"+ques_id+"_"+i_blanks;
				temp_answer=$(ans_id).val();
				if(temp_answer=="")
				{
					span_id="#error_span_"+ques_id;
					$(span_id).show();
					not_ans="yes";
				}
				else
				{
					span_id="#error_span_"+ques_id;
					$(span_id).hide();
				}
			}
		}
	}
	if(not_ans=="yes")
	{
		alert("Error : All questions are mandatory...!!!");
		return false;
	}
	else
	{
		document.myform.submit();
	}
}
function cancel_exam()
{
	var ans=confirm("Are you sure you want to cancel the treatment ?");
	if(ans==true)
	{
		$("#cancel_exam").val("yes");
		document.cancel_form.submit();
	}
	else
	{
		return false;
	}
}
function submit_answers_automatically()
{
	$("#timeout_submit").val("yes");
	document.timeout_form.submit();
}
</script>
<script type="text/javascript">
var final_transcript = '';
var recognizing = false;
 
if ('webkitSpeechRecognition' in window) {
 
  var recognition = new webkitSpeechRecognition();
 
  recognition.continuous = true;
  recognition.interimResults = true;
 
  recognition.onstart = function() {
    recognizing = true;
  };
 
  recognition.onerror = function(event) {
    console.log(event.error);
  };
 
  recognition.onend = function() {
    recognizing = false;
  };
  recognition.onresult = function(event) {
    var interim_transcript = '';
    for (var i = event.resultIndex; i < event.results.length; ++i) {
      if (event.results[i].isFinal) {
        final_transcript += event.results[i][0].transcript;
      } else {
        interim_transcript += event.results[i][0].transcript;
      }
    }
	
    final_transcript = capitalize(final_transcript);
    final_span.innerHTML = linebreak(final_transcript);
    interim_span.innerHTML = linebreak(interim_transcript);
    
  };
}
 
var two_line = /\n\n/g;
var one_line = /\n/g;
function linebreak(s) {
  return s.replace(two_line, '<p></p>').replace(one_line, '<br>');
}
 
function capitalize(s) {
  return s.replace(s.substr(0,1), function(m) { return m.toUpperCase(); });
}
 
function startDictation(event) {
  if (recognizing) {
    recognition.stop();
    return;
  }
  final_transcript = '';
  recognition.lang = 'en-IN';
  recognition.start();
  final_span.innerHTML = '';
  interim_span.innerHTML = '';
}
</script>
</body>	
</html>