Current File : /home/inlingua/www/sensoriumpsychologists.com/screening/profile.php |
<?php
session_start();
include('include/header.php');
include_once('../classes/config.php');
if(isset($_SESSION['c_error']) && $_SESSION['c_error']==1)
{
$Caperror='<span style="color:red;">reCAPTCHA is mandatory</span>';
}else{
$Caperror='';
}
$ref_no=$_SESSION['ref_no'];
$sql="SELECT * FROM shristi_child_details WHERE table_id='".$ref_no."'";
$result = $conn->query($sql);
$totalcount=$result->num_rows;
$row = $result->fetch_assoc();
if(!empty($_POST)){
//echo "<pre>";print_r($_REQUEST);//die;
//require_once("franchise_between/student_funcs.php");
$school = explode('@@', $_POST['school_name']);
$dateOfBirth = $_REQUEST['dob'];
//echo $dateOfBirth = date("Y-m-d", strtotime($_REQUEST['dob']));
$today = date("Y-m-d");
$diff = date_diff(date_create($dateOfBirth), date_create($today));
//$password=hash('sha256', $_POST['ppasscode']);
$child_name=$_POST['child_name'];
$email=$_POST['email'];
$age=$diff->format('%y');
$gender=$_POST['gender'];
$education=$_POST['education'];
$school_name=$school[0];
$dob_date=$dateOfBirth;
$contact_no=$_POST['contact_no'];
$informant=$_POST['informant'];
$c_local=$_POST['c_local'];
$c_city=$_POST['c_city'];
$c_district=$_POST['c_district'];
$c_state=$_POST['c_state'];
$c_pincode=$_POST['c_pincode'];
$p_local=$_POST['p_local'];
$p_city=$_POST['p_city'];
$p_district=$_POST['p_district'];
$p_state=$_POST['p_state'];
$p_pincode=$_POST['p_pincode'];
$problem=$_POST['problem'];
$walking=$_POST['walking'];
$first_sentence=$_POST['first_sentence'];
$toilet_behaviour=$_POST['toilet_behaviour'];
$self_help=$_POST['self_help'];
$sleeping_pattern=$_POST['sleeping_pattern'];
$play=$_POST['play'];
$play_group=$_POST['play_group'];
$type_of_play=$_POST['type_of_play'];
$behav_with_family=$_POST['behav_with_family'];
$reln_with_siblings=$_POST['reln_with_siblings'];
$table_id=$_POST['table_id'];
$columns_array=array("name","age","gender","dob_date","education","contact_no","informant","c_local","c_city","c_district","c_state","c_pincode","p_local","p_city","p_district","p_state","p_pincode","problem","walking","first_sentence","toilet_behaviour","self_help","sleeping_pattern","play","play_group","type_of_play","behav_with_family","reln_with_siblings");
$table_name="shristi_child_details";
$values_array=array($child_name,$age,$gender,$dob_date,$education,$contact_no,$informant,$c_local,$c_city,$c_district,$c_state,$c_pincode,$p_local,$p_city,$p_district,$p_state,$p_pincode,$problem,$walking,$first_sentence,$toilet_behaviour,$self_help,$sleeping_pattern,$play,$play_group,$type_of_play,$behav_with_family,$reln_with_siblings);
$conditions="where table_id=$table_id";
$columns_total_elements=count($columns_array);
$values_total_elements=count($values_array);
$prepared_statement="UPDATE $table_name SET ";
for($i=0;$i<$columns_total_elements;$i++)
{
$values_array[$i]=$values_array[$i];
if($i==0)
{
$prepared_statement.=$columns_array[$i]." = '".$values_array[$i]."'";
}
else
{
$prepared_statement.=", ".$columns_array[$i]." = '".$values_array[$i]."'";
}
}
$prepared_statement.=" ".$conditions;
//echo $prepared_statement; exit;
$result_update = $conn->query($prepared_statement);
//$this->new_conn->query($prepared_statement);
$msg="Updated successfully...";
//$temp_filename="student_initial_fees_payment.php?payment_no=".$payment_no;
//header("Location:/franchise/redirect_back.php?q=".$temp_filename."&msg=".$msg);
}
?>
<section class="contact-page spad pt-0">
<div class="container">
<div class="section-title pt-30">
<h3>Profile Update</h3>
</div>
<div class="row">
</div>
<div class="text-center">
<h3><?php echo $msg; ?></h3>
<p></p>
</div>
<div class="sc_contact_form sc_contact_form_contact contact-form" style="border:1px solid #c3c3cc; padding:25px;">
<form method="POST" class="validate123 comment-form --contact" name="myForm" id="myForm" enctype="multipart/form-data" novalidate="novalidate" >
<input type="hidden" name="table_id" id="table_id" value="<?php echo $row['table_id']; ?>" style="width:300px;" >
<input type="hidden" name="franchise_id" id="franchise_id" value="<?php echo $row['franchise_id']; ?>" style="width:300px;" >
<input type="hidden" name="school_name" id="school_name" value="<?php echo $row['school_name']; ?>" style="width:300px;" >
<!--<form method="post" name="myform" enctype="multipart/form-data">-->
<div class="row" id="next-1">
<div class="col-lg-12"><h3>PERSONAL DETAILS</h3></div>
<div class="col-lg-4">
<label class="required" for="f_name">Student's Name</label>
<input id="child_name" type="text" name="child_name" value="<?php echo $row['name']; ?>" placeholder="Student Name">
</div>
<div class="col-lg-4">
<label class="required" for="f_name">Email</label>
<input id="email" type="text" name="email" placeholder="Email" value="<?php echo $row['email']; ?>">
</div>
<div class="col-lg-4">
<label class="required" for="f_name">Contact No</label>
<input id="contact_no" type="text" name="contact_no" placeholder="Contact No" value="<?php echo $row['contact_no']; ?>">
</div>
<div class="col-lg-4">
<label class="required" for="f_name">Date Of Birth</label>
<input id="dob" type="text" name="dob" placeholder="Date Of Birth" autocomplete="off" value="<?php echo $row['dob_date']; ?>">
</div>
<div class="col-lg-4">
<label class="required" for="f_name">Gender</label>
<select name="gender" id="gender">
<option value="">---Gender---</option>
<option <?php if($row['gender']=='Male') { echo 'selected'; } ?> >Male</option>
<option <?php if($row['gender']=='Female') { echo 'selected'; } ?> >Female</option>
</select>
</div>
<div class="col-lg-4">
<label class="required" for="f_name">Education</label>
<select name="education" id="education">
<option value="">---std---</option>
<option <?php if($row['education']=='1') { echo 'selected'; } ?> value="1">1st</option>
<option <?php if($row['education']=='2') { echo 'selected'; } ?> value="2">2nd</option>
<option <?php if($row['education']=='3') { echo 'selected'; } ?> value="3">3rd</option>
<option <?php if($row['education']=='4') { echo 'selected'; } ?> value="4">4th</option>
<option <?php if($row['education']=='5') { echo 'selected'; } ?> value="5">5th</option>
</select>
</div>
<div class="col-lg-4">
<label class="required" for="school_name">School Name</label>
<select class="form-control" name="school_name" id="school_name">
<option value="">Select School</option>
<?php $field="and status='active'";
$result=$query->select_where_field('shristi_login','type','franchise',$field);
while($rows=$result->fetch_assoc()){
if($rows['name']==$row['school_name'])
{
$style="selected";
}else {
$style="";
}
?>
<option <?php echo $style; ?> value="<?php echo $rows['name'].'@@'.$rows['table_id'];?>"><?php echo $rows['name'];?></option>
<?php }?>
</select>
</div>
<div class="col-lg-4">
<label class="required" for="f_name">Informant</label>
<input id="informant" type="text" name="informant" value="<?php echo $row['informant']; ?>" placeholder="informant">
</div>
</div>
<div class="row" id="next-2">
<div class="col-lg-12">
<h3>ADDRESS</h3>
</div>
<div class="col-lg-6">
CORRESPONDANCE ADDRESS <span style="color:#F00;font-weight:bold;font-size:1.4em;">*</span>
<div class="col-lg-12">
<label class="required" for="c_local">Local Address</label>
<textarea placeholder="Local Address" name="c_local" style="margin-bottom: 10px;" id="c_local" rows="3"><?php echo $row['c_local']; ?></textarea>
</div>
<div class="col-lg-12">
<label class="required" for="c_city">City</label>
<input type="text" placeholder="City" name="c_city" id="c_city" value="<?php echo $row['c_city']; ?>" >
</div>
<div class="col-lg-12">
<label class="required" for="c_district">District</label>
<input type="text" placeholder=" District" name="c_district" id="c_district" value="<?php echo $row['c_district']; ?>" >
</div>
<div class="col-lg-12">
<select class="textboxes" name="c_state" id="c_state">
<option value="">--- Select ---</option>
<?php
$result=$query->select_where('shristi_tblstate','status','1');
while($staterow=$result->fetch_assoc()){
if($staterow['StateID']==$row['c_state'])
{
$sts="selected";
}else {
$sts="";
}
?>
<option <?php echo $sts; ?> value="<?php echo $staterow['StateID'];?>"><?php echo $staterow['StateName'];?></option>
<?php }?>
</select>
</div>
<div class="col-lg-12">
<label class="required" for="c_pincode">Pincode</label>
<input type="text" placeholder=" Pincode" name="c_pincode" value="<?php echo $row['c_pincode']; ?>" id="c_pincode" onkeypress="return isNumberKey(event)" maxlength="6" class="textboxes" >
</div>
</div>
<div class="col-lg-6">
<div class="col-lg-12">PERMANENT ADDRESS <span style="color:#F00;font-weight:bold;font-size:1.4em;">*</span>
<input type="button" value="Copy Correspondance Address" onClick="copy_addr()" ></div>
<div class="col-lg-12">
<label class="required" for="p_local">Permanent Address</label>
<textarea placeholder="Permanent Address" name="p_local" style="margin-bottom: 10px;" id="p_local" rows="3"><?php echo $row['p_local']; ?></textarea>
</div>
<div class="col-lg-12">
<label class="required" for="p_city">City</label>
<input type="text" placeholder="City" name="p_city" id="p_city" value="<?php echo $row['p_city']; ?>" >
</div>
<div class="col-lg-12">
<label class="required" for="p_district">District</label>
<input type="text" placeholder=" District" name="p_district" id="p_district" value="<?php echo $row['p_district']; ?>" >
</div>
<div class="col-lg-12">
<select class="textboxes" name="p_state" id="p_state">
<option value="">--- Select ---</option>
<?php
$result=$query->select_where('shristi_tblstate','status','1');
while($pstaterow=$result->fetch_assoc()){
if($pstaterow['StateID']==$row['p_state'])
{
$psts="selected";
}else {
$psts="";
}
?>
<option <?php echo $psts;?> value="<?php echo $pstaterow['StateID'];?>"><?php echo $pstaterow['StateName'];?></option>
<?php }?>
</select>
</div>
<div class="col-lg-12">
<label class="required" for="p_pincode">Pincode</label>
<input type="text" placeholder=" Pincode" name="p_pincode"value="<?php echo $row['p_pincode']; ?>" id="p_pincode" onkeypress="return isNumberKey(event)" maxlength="6" class="textboxes" >
</div>
</div>
</div>
<div class="row" id="next-3">
<div class="col-lg-12">
<h3>PROBLEMS & BEHAVIOURS</h3>
</div>
<div class="col-lg-12">
<label class="required" for="problem">PRESENTING PROBLEMS OF THE CHILD</label>
<textarea name="problem" id="problem" rows="2"><?php echo $row['problem'];?></textarea>
</div>
<div class="col-lg-12"><h5>POSTNATAL DEVELOPMENT :</h5></div>
<div class="col-lg-6">
<label class="required" for="walking">Walking</label>
<select name="walking" id="walking">
<option value="">---</option>
<option <?php if($row['walking']=='10-11 months') { echo 'selected'; } ?> value="10-11 months">10-11 months</option>
<option <?php if($row['walking']=='12-13 months') { echo 'selected'; } ?> value="12-13 months">12-13 months</option>
<option <?php if($row['walking']=='14-16 months') { echo 'selected'; } ?> value="14-16 months" >14-16 months</option>
<option <?php if($row['walking']=='17-20 months') { echo 'selected'; } ?> value="17-20 months">17-20 months</option>
</select>
</div>
<div class="col-lg-6">
<label class="required" for="first_sentence">First Sentence </label>
<select name="first_sentence" id="first_sentence">
<option value="">---</option>
<option <?php if($row['first_sentence']=='10-12 months') { echo 'selected'; } ?> value="10-12 months">10-12 months</option>
<option <?php if($row['first_sentence']=='12-13 months') { echo 'selected'; } ?> value="12-13 months">12-13 months</option>
<option <?php if($row['first_sentence']=='13-15 months') { echo 'selected'; } ?> value="13-15 months">13-15 months</option>
<option <?php if($row['first_sentence']=='16-24 months') { echo 'selected'; } ?> value="16-24 months">16-24 months</option>
<option <?php if($row['first_sentence']=='not yet') { echo 'selected'; } ?> value="not yet">not yet</option>
</select>
</div>
<div class="col-lg-12">
<h5>CHILD'S BEHAVIOUR : </h5>
</div>
<div class="col-lg-4">
<label class="required" for="toilet_behaviour">Toilet Behaviour</label>
<select name="toilet_behaviour" id="toilet_behaviour">
<option value="">---</option>
<option <?php if($row['toilet_behaviour']=='Dependent') { echo 'selected'; } ?> value="Dependent" >Dependent</option>
<option <?php if($row['toilet_behaviour']=='Independent') { echo 'selected'; } ?> value="Independent">Independent</option>
</select>
</div>
<div class="col-lg-4">
<label class="required" for="self_help">Self help skills (bathing, eating, dressing, communication skills)</label>
<select name="self_help" id="self_help">
<option value="">---</option>
<option <?php if($row['toilet_behaviour']=='Dependent') { echo 'selected'; } ?> value="Dependent" >Dependent</option>
<option <?php if($row['toilet_behaviour']=='Independent') { echo 'selected'; } ?> value="Independent">Independent</option>
</select>
</div>
<div class="col-lg-4">
<label class="required" for="sleeping_pattern">Sleeping Pattern</label>
<select name="sleeping_pattern" id="sleeping_pattern">
<option value="">---</option>
<option <?php if($row['sleeping_pattern']=='Normal') { echo 'selected'; } ?> value="Normal" >Normal</option>
<option <?php if($row['sleeping_pattern']=='Disturbed') { echo 'selected'; } ?> value="Disturbed" >Disturbed</option>
</select>
</div>
<div class="col-lg-4">
<label class="required" for="play">Play (during free time)</label>
<select name="play" id="play" >
<option value="">---</option>
<option <?php if($row['play']=='yes') { echo 'selected'; } ?> value="yes" >Yes</option>
<option <?php if($row['play']=='no') { echo 'selected'; } ?> value="no" >No</option>
</select>
</div>
<div class="col-lg-4">
<label class="required" for="play_group">Play Group</label>
<select name="play_group" id="play_group">
<option value="">---</option>
<option <?php if($row['play_group']=='yes') { echo 'selected'; } ?> value="yes" >Yes</option>
<option <?php if($row['play_group']=='no') { echo 'selected'; } ?> value="no" >No</option>
</select>
</div>
<div class="col-lg-4">
<label class="required" for="type_of_play">Type of play</label>
<select name="type_of_play" id="type_of_play">
<option value="">---</option>
<option <?php if($row['type_of_play']=='Indoor games') { echo 'selected'; } ?> value="Indoor games" >Indoor games</option>
<option <?php if($row['type_of_play']=='outdoor games') { echo 'selected'; } ?> value="outdoor games" >outdoor games</option>
<option <?php if($row['type_of_play']=='indoor as well as outdoor') { echo 'selected'; } ?> value="indoor as well as outdoor" >indoor as well as outdoor</option>
<option <?php if($row['type_of_play']=='All Type') { echo 'selected'; } ?> value="All Type" >All Type</option>
</select>
</div>
<div class="col-lg-4">
<label class="required" for="behav_with_family">Behaviour with family</label>
<select name="behav_with_family" id="behav_with_family">
<option value="">---</option>
<option <?php if($row['behav_with_family']=='normal') { echo 'selected'; } ?> value="normal" >Normal</option>
<option <?php if($row['behav_with_family']=='good') { echo 'selected'; } ?> value="good" >Good</option>
<option <?php if($row['behav_with_family']=='normal but some times aggresive') { echo 'selected'; } ?> value="normal but some times aggresive" >normal but some times aggresive</option>
<option <?php if($row['behav_with_family']=='sads') { echo 'selected'; } ?> value="sads" >Sads</option>
<option <?php if($row['behav_with_family']=='poor') { echo 'selected'; } ?> value="poor" >Poor</option>
</select>
</div>
<div class="col-lg-4">
<label class="required" for="reln_with_siblings">Relationship with siblings</label>
<select name="reln_with_siblings" id="reln_with_siblings" style="width:50%;">
<option value="">---</option>
<option <?php if($row['reln_with_siblings']=='normal and emotionally attached') { echo 'selected'; } ?> value="normal and emotionally attached" >Normal and Emotionally attached</option>
<option <?php if($row['reln_with_siblings']=='moderate rivalry') { echo 'selected'; } ?> value="moderate rivalry" >Moderate Rivalry</option>
<option <?php if($row['reln_with_siblings']=='severely affected and emotionally detached') { echo 'selected'; } ?> value="severely affected and emotionally detached" >Severely affected and emotionally detached</option>
</select>
</div>
</div>
<!--<input type="submit" name="sumnit" value="Save Now" />--></td>
<div id="submit-3">
<div class="col-md-12" style="overflow: hidden; margin-top:20px;">
<div class="sc_contact_form_button3">
<div class="site-btn" value="Save" onClick="submit_form_save();">
Update
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<link href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" rel="Stylesheet" type="text/css" >
<script type="text/javascript" src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script language="javascript">
$(document).ready(function () {
$("#dob").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "yy-mm-dd",
yearRange: "-90:+00"
});
});
</script>
<script>
function submit_form()
{
if($("#child_name").val()=="")
{
alert("Error : Please enter child's name...");
$("#child_name").focus();
return false;
}
if($("#email").val()=="")
{
alert("Error : Please enter Email...");
$("#email").focus();
return false;
}
if($("#age").val()=="")
{
alert("Error : Please select child's age...");
$("#age").focus();
return false;
}
if($("#gender").val()=="")
{
alert("Error : Please select gender");
$("#gender").focus();
return false;
}
if($("#dob_day").val()=="")
{
alert("Error : Please select Day in D.O.B");
$("#dob_day").focus();
return false;
}
if($("#dob_month").val()=="")
{
alert("Error : Please select Month in D.O.B");
$("#dob_month").focus();
return false;
}
if($("#dob_year").val()=="")
{
alert("Error : Please select Year in D.O.B");
$("#dob_year").focus();
return false;
}
if($("#education").val()=="")
{
alert("Error : Please select Education");
$("#education").focus();
return false;
}
if($("#school_name").val()=="")
{
alert("Error : Please enter school name");
$("#school_name").focus();
return false;
}
if($("#contact_no").val()=="")
{
alert("Error : Please select contact no");
$("#contact_no").focus();
return false;
}
if($("#informant").val()=="")
{
alert("Error : Please select informant");
$("#informant").focus();
return false;
}
else
{
$("#next-2").show();
$("#next-1").hide();
$("#submit-1").hide();
$("#submit-2").show();
//return false;
}
}
function submit_form_next()
{
if($("#c_local").val()=="")
{
alert("Error : Please enter local address in 'Correspondance Address'");
$("#c_local").focus();
return false;
}
if($("#c_city").val()=="")
{
alert("Error : Please enter city in 'Correspondance Address'");
$("#c_city").focus();
return false;
}
if($("#c_district").val()=="")
{
alert("Error : Please enter district in 'Correspondance Address'");
$("#c_district").focus();
return false;
}
if($("#c_state").val()=="")
{
alert("Error : Please select state in 'Correspondance Address'");
$("#c_state").focus();
return false;
}
if($("#c_pincode").val()=="")
{
alert("Error : Please enter pincode in 'Correspondance Address'");
$("#c_pincode").focus();
return false;
}
if($("#p_local").val()=="")
{
alert("Error : Please enter local address in 'Permanent Address'");
$("#p_local").focus();
return false;
}
if($("#p_city").val()=="")
{
alert("Error : Please enter city in 'Permanent Address'");
$("#p_city").focus();
return false;
}
var p_city=$("#p_city").val();
if(p_city.length<3)
{
alert("Error : City in 'Permanent Address' must be 3 characters long");
$("#p_city").focus();
return false;
}
if($("#p_district").val()=="")
{
alert("Error : Please enter district in 'Permanent Address'");
$("#p_district").focus();
return false;
}
if($("#p_state").val()=="")
{
alert("Error : Please select state in 'Permanent Address'");
$("#p_state").focus();
return false;
}
if($("#p_pincode").val()=="")
{
alert("Error : Please enter pincode in 'Permanent Address'");
$("#p_pincode").focus();
return false;
}else {
$("#next-3").show();
$("#next-2").hide();
$("#submit-2").hide();
$("#submit-3").show();
}
}
function submit_form_save()
{
if($("#problem").val()=="")
{
alert("Error : Please enter 'PRESENTING PROBLEM OF THE CHILD'");
$("#problem").focus();
return false;
}
if($("#walking").val()=="")
{
alert("Error : Please select walking");
$("#walking").focus();
return false;
}
if($("#first_sentence").val()=="")
{
alert("Error : Please select first sentence");
$("#first_sentence").focus();
return false;
}
if($("#toilet_behaviour").val()=="")
{
alert("Error : Please select 'Toilet Behaviour'");
$("#toilet_behaviour").focus();
return false;
}
if($("#self_help").val()=="")
{
alert("Error : Please select 'Self help skills'");
$("#self_help").focus();
return false;
}
if($("#sleeping_pattern").val()=="")
{
alert("Error : Please select 'Sleeping Pattern'");
$("#sleeping_pattern").focus();
return false;
}
if($("#play").val()=="")
{
alert("Error : Please enter 'Play (during free time)'");
$("#play").focus();
return false;
}
if($("#play_group").val()=="")
{
alert("Error : Please enter 'Play Group'");
$("#play_group").focus();
return false;
}
if($("#type_of_play").val()=="")
{
alert("Error : Please enter 'Type of Play'");
$("#type_of_play").focus();
return false;
}
if($("#behav_with_family").val()=="")
{
alert("Error : Please enter 'Behaviour with Family'");
$("#behav_with_family").focus();
return false;
}
if($("#reln_with_siblings").val()=="")
{
alert("Error : Please enter 'Relationaship with Siblings'");
$("#reln_with_siblings").focus();
return false;
}
var ans=confirm("Are you sure you want to continue?");
if(ans==true)
{
document.myForm.submit();
}
else
{
return false;
}
}
function copy_addr()
{
$("#p_local").val($("#c_local").val());
$("#p_city").val($("#c_city").val());
$("#p_district").val($("#c_district").val());
$("#p_state").val($("#c_state").val());
$("#p_pincode").val($("#c_pincode").val());
}
</script>
<?php include('include/footer.php'); ?>