Current File : /home/inlingua/public_html/sensoriumpsychologists.com/backup/student/student_edit_profile.php |
<?php
include_once('../classes/config.php');
include_once('common/session.php');
$student_id=$session_row['student_id'];
$student_no=$session_row['registration_no'];
//print_r($row);die;
?>
<?php require("common/head_links.php");?>
<?php require("common/header.php");?>
<?php require("common/left_side_bar.php");?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<section class="content-header">
<h1> Update Profile</h1>
</section>
<?php
extract($_REQUEST);
if(isset($submit)){
function test_input($data) {
$data = trim($data);
$data = htmlspecialchars($data);
$data=htmlspecialchars_decode($data);
$data =strip_tags($data);
$data = addslashes($data);
return $data;
}
$data2=array(
'student_id' => $student_id,
'student_code' => $student_no,
'mobile1' => $_POST['mobile1'],
'dob' => $_POST['dob'],
'gender' => test_input($_POST['gender']),
'father_name' => test_input($_POST['father_name']),
'mother_name' => test_input($_POST['mother_name']),
'p_address' => test_input($_POST['p_local']),
'c_address' => test_input($_POST['c_address']),
'city' => test_input($_POST['city']),
'state' => test_input($_POST['state']),
'p_code' => test_input($_POST['p_pincode']),
'mboard' => test_input($_POST['matriculation1']),
'myear' => test_input($_POST['matriculation2']),
'mprecentage' => test_input($_POST['matriculation3']),
'hboard' => test_input($_POST['h_s1']),
'hyear' => test_input($_POST['h_s2']),
'hprecentage' => test_input($_POST['h_s3']),
'oboard' => test_input($_POST['o_q1']),
'oyear' => test_input($_POST['o_q2']),
'oprecentage' => test_input($_POST['o_q3']),
'gboard' => test_input($_POST['graduation1']),
'gyear' => test_input($_POST['graduation2']),
'gprecentage' => test_input($_POST['graduation3']),
'status' => '2',
'created_at' => $date_time,
);
$insert1=$query->qry_insert('shristi_students_details',$data2);
if($insert1){
$message->success_updated();
}else{
$message->error();
}
}
?>
<?php
$resultss=$query->select_where_field('shristi_students_details','student_id',$student_id,'AND status!=1 AND student_code='."'$student_no'");
$row=$resultss->fetch_assoc();
?>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body" style="padding:50px 15px;">
<?php
if(isset($msg)){
echo "<span style='color:red'><strong>$msg</strong></span>";
}
if(isset($msg1)){
echo "<span style='color:green'><strong>$msg1</strong></span>";
}
?>
<form class="form-horizontal" name="frmChange" role="form" method="post">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="form-group">
<label class="control-label col-md-4" for="p_add">Permanent Address:</label>
<div class="col-md-6">
<textarea class="form-control" name="p_local" id="p_local" rows="3" placeholder="Permanent Address" ><?php echo $row['p_address'] ?></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-4" for="c_address">Correspondence Address:</label>
<div class="col-md-6">
<textarea class="form-control" name="c_address" id="c_address" placeholder="Correspondence Address" rows="3" ><?php echo $row['c_address'] ?></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-4" for="p_city">City:</label>
<div class="col-md-6">
<input type="text" class="form-control" name="city" id="p_city" placeholder="City" style="text-transform:capitalize;" value="<?php echo $row['city'] ?>" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-4" for="state">State:</label>
<div class="col-md-6">
<input type="text" name="state" class="form-control" placeholder="State" value="<?php echo $row['state'];?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-4" for="p_pincode">Pin Code:</label>
<div class="col-md-6">
<input type="text" class="form-control" name="p_pincode" id="p_pincode" placeholder="Pincode" value="<?php echo $row['p_code'] ?>" maxlength="6" onkeypress="return isNumberKey(event)" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-4" for="contact">Phone Number:</label>
<div class="col-md-6">
<input type="text" class="form-control" id="mobile1" name="mobile1" placeholder="Phone Number" value="<?php echo $row['mobile1']?>" >
</div>
</div>
<input type="hidden" class="form-control" value="<?php echo $session_row['fname']." ".$session_row['lname']; ?>" disabled>
<input type="hidden" class="form-control" value="<?php echo $session_row['email'];?>" disabled>
<input type="hidden" class="form-control" value="<?php echo $session_row['registration_no'];?>" disabled>
<input type="hidden" class="form-control" id="first_name" name="f_name" value="<?php echo $session_row['fname']?>" disabled>
<input type="hidden" class="form-control" id="last_name" name="l_name" value="<?php echo $session_row['lname'] ?>" disabled>
<input type="hidden" class="form-control" id="dob" name="dob" value="<?php echo $row['dob'] ?>">
<input type="hidden" value="<?php echo $row['gender'];?>" name="gender">
<input type="hidden" class="form-control" id="father_name" name="father_name" style="text-transform:capitalize;" value="<?php echo $row['father_name'] ?>" >
<input type="hidden" class="form-control" id="mother_name" name="mother_name" style="text-transform:capitalize;" value="<?php echo $row['mother_name'] ?>" >
<?php
$results=$query->select('shristi_course');
$rows=$results->fetch_assoc();
?>
<input type="hidden" class="form-control" value="<?php echo $rows['name'] ?>" name="name" id="" disabled>
<input type="hidden" class="form-control" value="<?php echo $rows['fee'] ?>" name="fee" id="" disabled>
<input type="hidden" class="form-control" name="" id="" value="<?php echo $session_row['join_batch'] ?>" disabled>
<input type="hidden" class="form-control" name="" id="" value="<?php echo $session_row['registration_date'] ?>" disabled>
<input id="mboard" type="hidden" class="form-control" name="matriculation1" value="<?php echo $row['mboard'] ?>"readonly >
<input id="myear" type="hidden" class="form-control" name="matriculation2" value="<?php echo $row['myear'] ?>" readonly>
<input id="mprecentage" type="hidden" class="form-control" name="matriculation3" value="<?php echo $row['mprecentage'] ?>" readonly>
<input id="hboard" type="hidden" class="form-control" name="h_s1" value="<?php echo $row['hboard'] ?>" readonly>
<input id="hyear" type="hidden" class="form-control" name="h_s2" value="<?php echo $row['hyear'] ?>" readonly>
<input id="hprecentage" type="hidden" class="form-control" name="h_s3" value="<?php echo $row['hprecentage'] ?>" readonly>
<input id="gboard" type="hidden" class="form-control" name="graduation1" value="<?php echo $row['gboard'] ?>" readonly>
<input id="gyear" type="hidden" class="form-control" name="graduation2" value="<?php echo $row['gyear'] ?>" readonly>
<input id="gprecentage" type="hidden" class="form-control" name="graduation3" value="<?php echo $row['gprecentage'] ?>" readonly>
<input id="oboard" type="hidden" class="form-control" name="o_q1" value="<?php echo $row['oboard'] ?>" readonly>
<input id="oyear" type="hidden" class="form-control" name="o_q2" value="<?php echo $row['oyear'] ?>" readonly>
<input id="oprecentage" type="hidden" class="form-control" name="o_q3" value="<?php echo $row['oprecentage'] ?>" readonly>
<div class="form-group">
<div class="col-sm-offset-5 col-sm-10">
<button type="submit" class="btn btn-success" name="submit">Update</button>
</div>
</div>
</form>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div><!-- /.content-wrapper -->
<?php require("common/footer.php");?>
</div><!-- ./wrapper -->
<?php require("common/footer_links.php");?>
</body>
</html>