| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/(Del)pathways.org.hk/MIS20140127/old20140221/student/ |
Upload File : |
<!DOCTYPE html>
<html>
<head>
<?php
require_once '../include/head.php';
require_once '../include/checkuser.php';
require_once '../include/Nav_bar.php';
include_once '../include/DBConnect.php';
$linking_id = $_GET['linking_id'];
if (isset($_POST['delete']) && $_POST['delete'] == "Delete") {
$query = "Update student set deleted=1 where linking_id='$linking_id'";
$result = $dbh->query($query);
if ($result) {
echo "<script>alert('Delete successful.')</script>";
echo("<script>location.href ='student.php';</script>");
}
}
if (isset($_POST['submit']) && $_POST['submit'] == 'Save') {
$old_linking_id = $_POST['linking_id'];
$old_id = $_POST['old_stu_id'];
$new_id = $_POST['new_stu_id'];
$sem_yr = $_POST['sem_yr'];
$input_by = $_POST['input_by'];
$input_date = $_POST['input_date'];
$is_actived = $_POST['is_actived'];
//$reg_no=$_POST[''];
$reg_no = $_POST['reg_no'];
$old_reg_no = $_POST['old_reg_no'];
$reg_date = $_POST['reg_date'];
if (isset($_POST['is_pathway_stu']))
$is_pathway_stu = $_POST['is_pathway_stu'];
else
$is_pathway_stu = 0;
if (isset($_POST['is_in_school']))
$is_in_school = $_POST['is_in_school'];
else
$is_in_school = 0;
$reg_campus = $_POST['reg_campus'];
$reg_sem_yr = $_POST['reg_sem_yr'];
$last_name = $_POST['last_name'];
$first_name = $_POST['first_name'];
$ch_name = $_POST['ch_name'];
$gender = $_POST['gender'];
$date_of_birth = $_POST['date_of_birth'];
$home_tel = $_POST['home_tel'];
$fax = $_POST['fax'];
$email = $_POST['email'];
$address = $_POST['address'];
$address2 = $_POST['address1'];
$address3 = $_POST['address2'];
$district = $_POST['district'];
$school_name = $_POST['school_name'];
$school_district = $_POST['sch_district'];
$grade = $_POST['grade'];
$photo = $_POST['photo'];
$father_name = $_POST['father_name'];
$father_occ = $_POST['father_occ'];
$father_mobile = $_POST['father_mobile'];
$father_off_tel = $_POST['father_off_tel'];
$mother_name = $_POST['mother_name'];
$mother_occ = $_POST['mother_occ'];
$mother_mobile = $_POST['mother_mobile'];
$mother_off_tel = $_POST['mother_off_tel'];
$Guard_name = $_POST['guard_name'];
$Guard_occ = $_POST['guard_occ'];
$Guard_relationship = $_POST['guard_relationship'];
$Guard_tel_home = $_POST['guard_tel_home'];
$guard_mobile = $_POST['guard_mobile'];
$guard_off_tel = $_POST['guard_off_tel'];
$eme_name = $_POST['eme_name'];
$eme_contact_no = $_POST['eme_contact_no'];
$eme_relationship = $_POST['eme_relationship'];
$medication = $_POST['medication'];
$traveling_allowance = $_POST['traveling_allowance'];
//$front_yr = substr(explode('-',$sem_yr,0), 2);
//$last_yr = substr(explode('-',$sem_yr,1), 2);
//$new_id = $cam_short_form . $front_yr . $last_yr . $old_id;
//$reg_no = $cam_short_form . $old_reg_no;
$get_root = "Select root_id as r from student where linking_id='$old_linking_id'";
$r_get_root = $dbh->query($get_root);
$r_get_root->setFetchMode(PDO::FETCH_OBJ);
$row = $r_get_root->fetch();
/**/
$query = "Update student set deleted='1' where linking_id='$old_linking_id'";
$result = $dbh->query($query);
$query2 = "Update student_grade set deleted='1' where student_grade_id ='$old_linking_id'";
$result2 = $dbh->query($query2);
$query4 = "Update student_subsidy set deleted='1' where stu_subsidy_id ='$old_linking_id'";
$result4 = $dbh->query($query4);
$query10 = "Update student_diagnose set deleted='1' where stu_dia_ID ='$old_linking_id'";
$result4 = $dbh->query($query10);
$query11 = "Update student_additional_aspect set deleted='1' where stu_add_ID ='$old_linking_id'";
$result4 = $dbh->query($query11);
$query13 = "Update student_document set deleted='1' where stu_linking_id ='$row->r'";
$result5 = $dbh->query($query13);
$query = "Insert into student set New_stu_ID='$new_id', Old_stu_ID='$old_id', Sem_yr='$sem_yr', root_id='$row->r',
createby='$input_by', createdate=Now(), lastupby=0, lastupdate=Now(), actived='$is_actived', deleted=0,registration_no='$reg_no',old_registration_no='$old_reg_no',
reg_campus_id='$reg_campus',
input_date='$input_date', registration_date='$reg_date', is_pathway_student='$is_pathway_stu',
is_in_school_student='$is_in_school', reg_sem_year='$reg_sem_yr',last_name='$last_name', first_name='$first_name',
ch_name='$ch_name', gender='$gender', date_of_birth='$date_of_birth', home_tel='$home_tel', fax='$fax', email='$email', photo='$photo', address='$address',address2='$address2',address3='$address3',
district_id='$district',school_name='$school_name',sch_district_id='$school_district', father_name='$father_name', father_occupation='$father_occ', father_mobile='$father_mobile', father_off_tel='$father_off_tel',
mother_name='$mother_name', mother_occupation='$mother_occ', mother_mobile='$mother_mobile', mother_off_tel='$mother_off_tel', guardian_name='$Guard_name',
guardian_occupation='$Guard_occ', guardian_relationship='$Guard_relationship', guardian_mobile='$guard_mobile', guardian_home_tel='$Guard_tel_home',
guardian_off_tel='$guard_off_tel', eme_contact_name='$eme_name', eme_contact_number='$eme_contact_no', eme_contact_relationship='$eme_relationship',
ch_assessment_ID=NULL, ch_assessment_date=NULL,
en_assessment_ID=NULL, en_assessment_date=NULL, math_assessment_ID=NULL, math_assessment_date=NULL,
medication='$medication',traveling_allowance='$traveling_allowance'";
$result = $dbh->query($query);
$query1 = "Insert into student_grade set student_grade_id=(Select linking_id from student
where New_stu_ID='$new_id' and Sem_yr='$sem_yr' and lastupdate=(Select MAX(lastupdate) from student
where New_stu_ID='$new_id' and Sem_yr='$sem_yr')),createby='$input_by', createdate=Now(),
lastupby=0, lastupdate=Now(), actived=1, deleted=0,grade_id='$grade'";
$result1 = $dbh->query($query1);
if ($_POST['refer_by'][0] != "") {
for ($i = 0; $i < count($_POST['refer_by']); $i++) {
$no_of_same = 0;
$refer_by = $_POST['refer_by'][$i];
$assessed_by = $_POST['assessed_by'][$i];
$assessed_date = $_POST['assessed_date'][$i];
$f = "assessed_doc" . $i;
if (isset($_FILES[$f]) && $_FILES[$f]['size'] > 0) {
$myFile = $_FILES[$f];
if ($myFile['name'] != "") {
if ($myFile["error"] !== UPLOAD_ERR_OK) {
//echo "<p>An error occurred.</p>";
$error = "<p>An error occurred.</p>";
exit;
}
// ensure a safe filename
$name = preg_replace("/[^A-Z0-9._-]/i", "_", $myFile["name"]);
// don't overwrite an existing file
$parts = pathinfo($name);
while (file_exists('diagnose_report/' . $name)) {
$no_of_same++;
$name = $parts["filename"] . "-" . $no_of_same . "." . $parts["extension"];
}
// preserve file from temporary directory
$success = move_uploaded_file($myFile["tmp_name"], 'diagnose_report/' . $name);
if (!$success) {
$msg = "<p>Unable to save file.</p>";
echo "<script>alert('$msg')</script>";
exit;
} else {
$msg = $name;
}
// set proper permissions on the new file
chmod('diagnose_report/' . $name, 0644);
}
$dir = 'diagnose_report/' . $name;
} else {
$dir = $_POST['file_name'][$i];
}
$query5 = "Insert into student_document set stu_linking_id='$row->r',createby='$input_by',
createdate=Now(),lastupby=0, lastupdate=Now(), actived=1, deleted=0,refer_by='$refer_by',
assessed_by='$assessed_by',assessed_doc='$dir', assessed_date='$assessed_date'";
$result5 = $dbh->query($query5);
if (!$result5) {
echo "<script>alert('Error 5.')</script>";
}
}
}
if (isset($_POST['subsidy_get'])) {
for ($i = 0; $i < count($_POST['subsidy_get']); $i++) {
$subsidy_get = $_POST['subsidy_get'][$i];
$query2 = "Insert into student_subsidy set stu_subsidy_id=(Select linking_id from student
where New_stu_ID='$new_id' and Sem_yr='$sem_yr' and lastupdate=(Select MAX(lastupdate) from student
where New_stu_ID='$new_id' and Sem_yr='$sem_yr')),createby='$input_by', createdate=Now(),
lastupby=0, lastupdate=Now(), actived=1, deleted=0,subsidy_id='$subsidy_get'";
$result2 = $dbh->query($query2);
if (!$result2) {
echo "<script>alert('Error 2.')</script>";
}
}
}
if (isset($_POST['diagnose'])) {
for ($i = 0; $i < count($_POST['diagnose']); $i++) {
$diagnose = $_POST['diagnose'][$i];
$query3 = "Insert into student_diagnose set stu_dia_ID=(Select linking_id from student
where New_stu_ID='$new_id' and Sem_yr='$sem_yr' and lastupdate=(Select MAX(lastupdate) from student
where New_stu_ID='$new_id' and Sem_yr='$sem_yr')),createby='$input_by', createdate=Now(),
lastupby=0, lastupdate=Now(), actived=1, deleted=0,diagnose_id='$diagnose'";
$result3 = $dbh->query($query3);
if (!$result3) {
echo "<script>alert('Error 3.')</script>";
}
}
}
if (isset($_POST['add_aspect'])) {
for ($i = 0; $i < count($_POST['add_aspect']); $i++) {
$add_aspect = $_POST['add_aspect'][$i]; //add_aspect
$query4 = "Insert into student_additional_aspect set stu_add_ID=(Select linking_id from student
where New_stu_ID='$new_id' and Sem_yr='$sem_yr' and lastupdate=(Select MAX(lastupdate) from student
where New_stu_ID='$new_id' and Sem_yr='$sem_yr')),createby='$input_by', createdate=Now(),
lastupby=0, lastupdate=Now(), actived=1, deleted=0,aspect_id='$add_aspect'";
$result4 = $dbh->query($query4);
if (!$result4) {
echo "<script>alert('Error 4.')</script>";
}
}
}
if ($result && $result1) {
echo "<script>alert('Update data successful.')</script>";
echo("<script>location.href ='student.php';</script>");
}
}
?>
<script type="text/javascript" src="../include/FileUpload/ajaxfileupload.js"></script>
<script>
var action = 1;
var browse;
$(function() {
$('.date-picker').datetimepicker({pickTime: false, format: 'yyyy-MM-dd'});
});
$(document).ready(function() {
$.ajax({
type: "POST",
url: "ajax_edit_stu.php",
data: {
subsidy: $('#subsidy').val(),
linking_id: window.location.toString().split("?")[1].split("&")[0].split("=")[1],
action: window.location.toString().split("?")[1].split("&")[1].split("=")[1]
},
cache: false,
success: function(html) {
$("#subsidy_show").html(html);
}
});
$(document).on('click', '#upload', function ajaxFileUpload() {
$.ajaxFileUpload({
url: 'upload_stu_photo.php',
secureuri: false,
fileElementId: 'browse',
dataType: 'json',
data: {name: 'logan', id: 'id'},
success: function(data, status) {
if (typeof (data.error) != 'undefined')
{
if (data.error != '') {
alert(data.error);
}
else {
loading.src = "student_photo/" + data.msg;
$('#photo').val("student_photo/" + data.msg);
}
}
},
error: function(data, status, e) {
alert("error");
alert(e);
}
}
)
return false;
});
browse = $('#browse').clone();
});
$(document).on('change', '#subsidy', function() {
$.ajax({
type: "POST",
url: "ajax_edit_stu.php",
data: {
subsidy: $('#subsidy').val(),
linking_id: window.location.toString().split("?")[1].split("=")[1]
},
cache: false,
success: function(html) {
$("#subsidy_show").html(html);
}
});
});
$(document).ready(function() {
Add_Diagnoses()
});
$(document).ready(function() {
Add_aspect()
});
function delete_row(e) {
$(e).parent().parent().remove();
}
function Add_Diagnoses() {
var array = new Array();
var tr = "";
for (var i = 0; i < (document.getElementsByName("diagnose[]")).length; i++) {
if (document.getElementsByName("diagnose[]")[i].checked == true) {
array.push((document.getElementsByName("diagnoseval[]")[i].value));
}
}
for (var i = 0; i < array.length; i++) {
tr +=
"<tr>" +
"<td style=\"border: 1px solid #dddddd;width: 50px;\"><button onclick=\"delete_row(this);\" type='button' class=\"btn\"><i class=\"icon-remove\"></i></button></td>" +
"<td>" + array[i] + "</td>" +
"</tr>";
}
$('#Add_Diagnoses').html(tr);
}
function Add_aspect() {
var array = new Array();
var tr = "";
for (var i = 0; i < (document.getElementsByName("add_aspect[]")).length; i++) {
if (document.getElementsByName("add_aspect[]")[i].checked == true) {
array.push((document.getElementsByName("add_aspectval[]")[i].value));
}
}
for (var i = 0; i < array.length; i++) {
tr +=
"<tr>" +
"<td style=\"border: 1px solid #dddddd;width: 50px;\"><button onclick=\"delete_row(this);\" type='button' class=\"btn\"><i class=\"icon-remove\"></i></button></td>" +
"<td>" + array[i] + "</td>" +
"</tr>";
}
$('#Add_Aspect').html(tr);
}
$(document).on('focusout', '#DOB', function() {
//if (is_import=='F') {
if ($('#last_name').val().length != 0 && $('#first_name').val().length != 0 && $('#DOB').val().length != 0) {
$.ajax({
type: "POST",
url: "ajax_checking.php",
data: {
linking_id: window.location.toString().split("?")[1].split("=")[1],
last_name: $('#last_name').val(),
first_name: $('#first_name').val(),
DOB: $('#DOB').val(),
action: action
},
cache: false,
success: function(html) {
if (html == 'yes') {
alert('There is a record duplicated with the record you are inputting.Please,input again');
window.location = 'student_edit.php?linking_id=' + window.location.toString().split("?")[1].split("=")[1];
}
else {
alert('The record you are inputting is not duplicated.');
}
}
});
}
//}
});
$(document).on('focusout', '#last_name', function() {
//if (is_import=='F') {
if ($('#last_name').val().length != 0 && $('#first_name').val().length != 0 && $('#DOB').val().length != 0) {
$.ajax({
type: "POST",
url: "ajax_checking.php",
data: {
linking_id: window.location.toString().split("?")[1].split("=")[1],
last_name: $('#last_name').val(),
first_name: $('#first_name').val(),
DOB: $('#DOB').val(),
action: action
},
cache: false,
success: function(html) {
if (html == 'yes') {
alert('There is a record duplicated with the record you are inputting.Please,input again');
window.location = 'student_edit.php?linking_id=' + window.location.toString().split("?")[1].split("=")[1];
}
else {
alert('The record you are inputting is not duplicated.');
}
}
});
}
//}
});
$(document).on('focusout', '#first_name', function() {
//if (is_import=='F') {
if ($('#last_name').val().length != 0 && $('#first_name').val().length != 0 && $('#DOB').val().length != 0) {
$.ajax({
type: "POST",
url: "ajax_checking.php",
data: {
linking_id: window.location.toString().split("?")[1].split("=")[1],
last_name: $('#last_name').val(),
first_name: $('#first_name').val(),
DOB: $('#DOB').val(),
action: action
},
cache: false,
success: function(html) {
if (html == 'yes') {
alert('There is a record duplicated with the record you are inputting.Please,input again');
window.location = 'student_edit.php?linking_id=' + window.location.toString().split("?")[1].split("=")[1];
}
else {
alert('The record you are inputting is not duplicated.');
}
}
});
}
//}
});
$(document).on('click', '#add_assessed', function() {
$.ajax({
type: "POST",
url: "ajax_stu_add_assess.php",
data: {
i: $('#i').val()
},
cache: false,
success: function(html) {
$("#add_thing2").append(html);
var tem_i = $("#i").val();
tem_i++;
$("#i").val(tem_i);
$('.date-picker').datetimepicker({pickTime: false, format: 'yyyy-MM-dd'});
}
});//add_assessed
});
function delete_photo() {
$.ajax({
type: "POST",
url: "ajax_delete_photo.php",
data: {
photo: $('#photo').val()
},
cache: false,
success: function(html) {
if (html == 'Yes') {
alert('Delete photo successful');
$('#loading').attr('src', 'student_photo/personal_photo.gif');
$('#photo').val('no photo');
$('#browse').replaceWith(browse);
}
else {
alert('Fail to delete this photo');
}
}
});
}
;
function delete_assessed(row) {
var tem_i = $("#i").val();
if (tem_i == 1) {
alert('You cannot remove this row.');
}
else {
var obj = document.getElementById('add_thing2');
$(obj).children().next.remove();
//$(row).parent().parent().parent().prev().children().nextAll().remove();
//$(row).parent().parent().parent().prev().children().nextAll().remove();
tem_i--;
$("#i").val(tem_i);
}
}
;//not finished yet
</script>
</head>
<body>
<?php
$i = 0;
$query_init = "Select Old_stu_id as o,New_stu_id as n,Sem_yr as s_yr,root_id,
createby, createdate, lastupby, lastupdate, actived, deleted,registration_no,old_registration_no,
reg_campus_id,input_date, registration_date, is_pathway_student, is_in_school_student,
reg_sem_year,last_name, first_name, ch_name, gender, date_of_birth, home_tel,
fax, email, photo, address,address2,address3,district_id,school_name,sch_district_id, father_name,
father_occupation, father_mobile, father_off_tel,mother_name, mother_occupation,
mother_mobile, mother_off_tel, guardian_name,guardian_occupation, guardian_relationship,
guardian_mobile, guardian_home_tel,guardian_off_tel, eme_contact_name, eme_contact_number,
eme_contact_relationship, ch_assessment_ID, ch_assessment_date,
en_assessment_ID, en_assessment_date, math_assessment_ID, math_assessment_date,
medication,traveling_allowance from student where linking_id='$linking_id' and deleted='0'";
$query_init1 = "Select grade_id from student_grade where student_grade_id='$linking_id' and deleted='0'";
$query_init2 = "Select diagnose_id from student_diagnose where stu_dia_ID='$linking_id' and deleted='0'";
$query_init3 = "Select aspect_id from student_additional_aspect where stu_add_ID='$linking_id' and deleted='0'";
$result = $dbh->query($query_init);
$result->setFetchMode(PDO::FETCH_OBJ);
$row = $result->fetch();
$result1 = $dbh->query($query_init1);
$result1->setFetchMode(PDO::FETCH_OBJ); //grade
$row_init = $result1->fetch();
$result2 = $dbh->query($query_init2);
$result3 = $dbh->query($query_init3);
?>
<!-- line between nav bar and content -->
<?php if ($_GET['action'] == "View") { ?>
<div class="text-right">
<ul class="breadcrumb">
<li><a href="student.php">Student Record</a></li>
<li><a href="#"></a> <span class="divider">></span></li>
<li class="active">View Student Record</li>
</ul>
</div>
<div class="container-fluid pathways-container">
<form action="" method="POST" enctype="multipart/form-data">
<table border="0" class="table table-bordered table-hover table-condensed">
<tr>
<td colspan="4"><h2>View Student Record</h2></td>
<tr>
<td colspan="4"><b><h4>Student Record</h4></b></td>
</tr>
<tr>
<td>Student No.(Old System)</td><td><input type="text" name="old_stu_id" required="true" readonly="true" value="<?= $row->o ?>"></td>
<td>Student No.(New System)</td><td><input type="text" name="new_stu_id" required="true" readonly="true" value="<?= $row->n ?>"></td>
</tr>
<tr>
<td>Semester_year</td>
<td colspan="3"><input type="text" name="sem_yr" readonly="true" placeholder="2013-2014" required="true" maxlength="9" minlength="9" value="<?= $row->s_yr; ?>"></td>
</tr>
<tr>
<td>Registration No(Old system)</td>
<td>
<input type="text" name="old_reg_no" required="true" value="<?= $row->old_registration_no; ?>" readonly="true">
</td>
<td>Registration No</td>
<td>
<input type="text" name="reg_no" required="true" value="<?= $row->registration_no; ?>" readonly="true">
</td>
</tr>
<tr>
<td>Registration Campus</td>
<td>
<select name="reg_campus" disabled="true">
<option></option>
<?php
$query = "Select campus_id,campus_name from campus";
$result = $dbh->query($query);
$result->setFetchMode(PDO::FETCH_OBJ);
while ($row1 = $result->fetch()) {
if ($row->reg_campus_id == $row1->campus_id)
print '<option value=' . $row1->campus_id . ' selected>' . $row1->campus_name . '</option>';
else
print '<option value=' . $row1->campus_id . '>' . $row1->campus_name . '</option>';
}
?>
</select>
</td>
<td>Registration Date</td>
<td>
<div class="input-append date-picker">
<input type="text" name="reg_date" class="dateISO" readonly="true" required="true" value="<?= $row->registration_date; ?>">
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div>
</td>
</tr>
<tr>
<td>Registration Semester</td>
<td colspan="3"><input type="text" name="reg_sem_yr" placeholder="2013-2014" readonly="true" required="true" value="<?= $row->reg_sem_year ?>"></td>
</tr>
<tr>
<td>Type</td>
<td>
<?php
if ($row->is_pathway_student == 1) {
?>
<input type="checkbox" name="is_pathway_stu" value="1" checked disabled="true">Pathway Student
<?php
} else {
?>
<input type="checkbox" name="is_pathway_stu" value="1"disabled="true">Pathway Student
<?php
}
?>
<?php
if ($row->is_in_school_student == 1) {
?>
<input type="checkbox" name="is_in_school" value="1" checked disabled="true">In-School Student
<?php
} else {
?>
<input type="checkbox" name="is_in_school" value="1" disabled="true">In-School Student
<?php
}
?>
</td>
<td>Status</td>
<td>
<select name="is_actived" disabled="true">
<option></option>
<?php
if ($row->actived == 1) {
?>
<option value="1" selected>Active</option>
<option value="0">Disable</option>
<?php
} else {
?>
<option value="1">Active</option>
<option value="0" selected>Disable</option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Data Input Date</td>
<td>
<div class="input-append date-picker">
<input type="text" name="input_date" class="dateISO" readonly="true" required="true" data-format="yyyy-MM-dd" value="<?= $row->input_date; ?>">
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div>
</td>
<td>Input By</td>
<td>
<input type="text" name="input_by" value="Chung Wai ki" readonly="true" required="true">
</td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td colspan="4"><b><h4>Student Information</h4></b></td>
</tr>
<tr>
<td>Date of Birth</td>
<td colspan="3">
<div class="input-append" id="day_of_birth">
<input type="text" name="date_of_birth" id="DOB" readonly="true" class="dateISO" required="true" value="<?= $row->date_of_birth ?>">
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div>
</td>
</tr>
<tr>
<td>Last Name</td>
<td><input type="text" name="last_name" id="last_name" readonly="true" required="true" value="<?= $row->last_name; ?>"></td>
<td>First Name</td>
<td><input type="text" name="first_name" id="first_name" readonly="true" required="true" value="<?= $row->first_name; ?>"></td>
</tr>
<tr>
<td>中文姓名</td>
<td><input type="text" name="ch_name" readonly="true" required="true" value="<?= $row->ch_name; ?>"></td>
<td>Gender</td>
<td>
<select name="gender" disabled="true">
<option></option>
<?php
if ($row->gender == 1) {
?>
<option value="1" selected>Male</option>
<option value="0">Female</option>
<?php
} else {
?>
<option value="1">Male</option>
<option value="0" selected>Female</option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Tel(Home)</td>
<td><input type="tel" name="home_tel" placeholder="24131323" readonly="true" required="true" value="<?= $row->home_tel ?>"></td>
<td>Fax</td>
<td><input type="tel" name="fax" readonly="true" value="<?= $row->fax ?>"></td>
</tr>
<tr>
<td>E-mail</td>
<td colspan="3"><input type="email" name="email" readonly="true" placeholder="user@example.com" value="<?= $row->email ?>"></td>
</tr>
<tr>
<td>Address</td>
<td colspan="2"><input type="text" name="address" readonly="true" required="true" class="input-block-level" value="<?= $row->address ?>"></td>
<td rowspan="6">
<center>
<?php
if ($row->photo != 'no photo') {
?>
<img id="loading" src="<?= $row->photo ?>">
<input type="hidden" name="photo" id="photo" value="<?= $row->photo ?>">
<?php
} else {
?>
<img id="loading" src="student_photo/personal_photo.gif">
<input type="hidden" name="photo" id="photo" value="no photo">
<?php
}
?>
</center>
</td>
</tr>
<tr>
<td>Address2</td>
<td colspan="2"><input type="text" name="address1" readonly="true" required="true" class="input-block-level" value="<?= $row->address2 ?>"></td>
</tr>
<tr>
<td>Address3</td>
<td colspan="2"><input type="text" name="address2" readonly="true" required="true" class="input-block-level" value="<?= $row->address3 ?>"></td>
</tr>
<tr>
<td>District</td>
<td colspan="2">
<select name="district" disabled="true">
<option></option>
<?php
$query1 = "Select district,district_id from district";
$result4 = $dbh->query($query1);
$result4->setFetchMode(PDO::FETCH_OBJ);
while ($row1 = $result4->fetch()) {
if ($row1->district_id == $row->district_id)
print '<option value=' . $row1->district_id . ' selected>' . $row1->district . '</option>';
else
print '<option value=' . $row1->district_id . '>' . $row1->district . '</option>';
}
?>
</select>
</td>
</tr>
<tr>
<td>Name of School Attending</td>
<td colspan="2"><input type="text" name="school_name" readonly="true" required="true" value="<?= $row->school_name ?>"></td>
</tr>
<tr>
<td>School District</td>
<td colspan="2">
<select name="sch_district" disabled="true">
<option></option>
<?php
$query1 = "Select district,district_id from district";
$result4 = $dbh->query($query1);
$result4->setFetchMode(PDO::FETCH_OBJ);
while ($row1 = $result4->fetch()) {
if ($row1->district_id == $row->sch_district_id)
print '<option value=' . $row1->district_id . ' selected>' . $row1->district . '</option>';
else
print '<option value=' . $row1->district_id . '>' . $row1->district . '</option>';
}
?>
</select>
</td>
</tr>
<tr>
<td>Year/Grade</td>
<td colspan="2">
<select name="grade" disabled="true">
<option></option>
<?php
$query2 = "Select grade_id,grade from grade";
$result5 = $dbh->query($query2);
$result5->setFetchMode(PDO::FETCH_OBJ);
while ($row1 = $result5->fetch()) {
if ($row1->grade_id == $row_init->grade_id)//<<$row cant get grade_id
print '<option value=' . $row1->grade_id . '. selected>' . $row1->grade . '</option>';
else
print '<option value=' . $row1->grade_id . '.>' . $row1->grade . '</option>';
}
?>
</select>
</td>
<td>
<center>
<input type="file" name="browse" id="browse" size="10" disabled="true">
</center>
</td>
</tr>
<tr>
<td colspan='3'></td>
<td>
<center>
<input type='button' name='upload' id='upload' class='btn' value='Upload' disabled="true">
<input type='button' name='remove' id='remove' class='btn' value='Remove' onclick="delete_photo();" disabled="true">
</center>
</td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td colspan="4"><b><h4>Father</h4></b></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="father_name" value='<?= $row->father_name ?>' readonly="true"></td>
<td>Occupation</td>
<td><input type="text" name="father_occ" value='<?= $row->father_occupation ?>' readonly="true"></td>
</tr>
<tr>
<td>Mobile</td>
<td><input type="tel" name="father_mobile" value='<?= $row->father_mobile ?>' readonly="true"></td>
<td>Tel(Office)</td>
<td><input type="tel" name="father_off_tel" value='<?= $row->father_off_tel ?>' readonly="true"></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td colspan="4"><b><h4>Mother</h4></b></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="mother_name" value='<?= $row->mother_name ?>' readonly="true"></td>
<td>Occupation</td>
<td><input type="text" name="mother_occ" value='<?= $row->father_occupation ?>' readonly="true"></td>
</tr>
<tr>
<td>Mobile</td>
<td><input type="tel" name="mother_mobile" value='<?= $row->mother_mobile ?>' readonly="true"></td>
<td>Tel(Office)</td>
<td><input type="tel" name="mother_off_tel" value='<?= $row->mother_off_tel ?>' readonly="true"></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td colspan="4"><b><h4>Guardian</h4></b></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="guard_name" value='<?= $row->guardian_name ?>' readonly="true"></td>
<td>Occupation</td>
<td><input type="text" name="guard_occ" value='<?= $row->guardian_occupation ?>' readonly="true"></td>
</tr>
<tr>
<td>Relationship</td>
<td><input type="text" name="guard_relationship" value='<?= $row->guardian_relationship ?>' readonly="true"></td>
<td>Tel(Home)</td>
<td><input type="tel" name="guard_tel_home" value='<?= $row->guardian_home_tel ?>' readonly="true"></td>
</tr>
<tr>
<td>Mobile</td>
<td><input type="tel" name="guard_mobile" value='<?= $row->guardian_mobile ?>' readonly="true"></td>
<td>Tel(Office)</td>
<td><input type="tel" name="guard_off_tel" value='<?= $row->guardian_off_tel ?>' readonly="true"></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td colspan="4"><b><h4>Emergency Contact Person</h4></b></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="eme_name" value='<?= $row->eme_contact_name ?>' readonly="true"></td>
<td>Contact No.</td>
<td><input type="tel" name="eme_contact_no" value='<?= $row->eme_contact_number ?>' readonly="true"></td>
</tr>
<tr>
<td>Relationship</td>
<td colspan="3"><input type="text" name="eme_relationship" value='<?= $row->eme_contact_relationship ?>' readonly="true"></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td><b><h4>Diagnoses</h4></b></td>
<td><button type="button" class="btn" id="diagnoses_btn" data-toggle="modal" data-target="#diagnoses" disabled="true"><i class="icon-plus" ></i> Add</button></td>
<td><b><h4>Intellectual Functioning </h4></b></td>
<td><button type="button" class="btn" id="add_aspect_btn" data-toggle="modal" data-target="#add_aspect" disabled="true"><i class="icon-plus" ></i> Add</button></td>
</tr>
<tr>
<td colspan="2">
<table id="Add_Diagnoses" style="width: 80%;border: 1px solid #dddddd;margin-left: 40px;margin-bottom: 10px;margin-top: 10px;margin-right: 10px;" >
</table>
</td>
<td colspan="2">
<table id="Add_Aspect" style="width: 80%;border: 1px solid #dddddd;margin-left: 40px;margin-bottom: 10px;margin-top: 10px;margin-right: 10px;" >
</table>
<input type="hidden" name="linking_id" value="<?= $linking_id ?>">
</td>
</tr>
<tbody id='add_thing2'>
<?php
$query7 = "Select stu_doc_id,stu_linking_id,refer_by,assessed_by,assessed_doc,assessed_date
from student_document where stu_linking_id=(Select root_id from student where linking_id='$linking_id') and deleted=0";
$query8 = "Select count(*) as num from student_document where stu_linking_id=(Select root_id from student where linking_id='$linking_id') and deleted=0";
$result7 = $dbh->query($query7);
$result8 = $dbh->query($query8);
$result8->setFetchMode(PDO::FETCH_OBJ);
$no_of_doc = $result8->fetch()->num;
if ($result7->rowcount() != 0) {
$result7->setFetchMode(PDO::FETCH_OBJ);
while ($row7 = $result7->fetch()) {
$i = 0;
?>
<tr>
<td>Refer to</td>
<td><input type="text" name="refer_by[]" value="<?= $row7->refer_by ?>" readonly="true"></td>
<td>Assessed By</td>
<td><input type="text" name="assessed_by[]" value="<?= $row7->assessed_by ?>" readonly="true"></td>
</tr>
<tr>
<td>Assessed date</td>
<td>
<div class="input-append date-picker">
<input type="text" name="assessed_date[]" class="dateISO" value="<?= $row7->assessed_date ?>" readonly="true">
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div>
</td>
<td>Assessed document</td>
<td colspan="3">
<div class="fileupload fileupload-new" style="margin:0px" data-provides="fileupload">
<div class="input-append">
<div class="uneditable-input ">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><a href="<?= $row7->assessed_doc ?>" target="_blank"><?= $row7->assessed_doc ?></a></span>
<input type='hidden' name='file_name[]' value='<?= $row7->assessed_doc ?>' >
</div>
<span class="btn btn-file">
<span class="fileupload-new">Select file</span>
<span class="fileupload-exists">Change</span>
<input type="file" name="assessed_doc<?= $i ?>">
<?php if ($i == 0) { ?>
<input type='hidden' name='i' id='i' value='<?= $no_of_doc ?>' >
<?php } ?>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>
</div>
</div>
</td>
</tr>
<?php
$i++;
}
} else {
?>
<tr>
<td>Refer to</td>
<td><input type="text" name="refer_by[]" readonly="true"></td>
<td>Assessed By</td>
<td><input type="text" name="assessed_by[]" readonly="true"></td>
</tr>
<tr>
<td>Assessed date</td>
<td>
<div class="input-append date-picker">
<input type="text" name="assessed_date[]" class="dateISO" readonly="true">
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div>
</td>
<td>Assessed document</td>
<td colspan="3">
<div class="fileupload fileupload-new" style="margin:0px" data-provides="fileupload">
<div class="input-append">
<div class="uneditable-input ">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><a href="diagnose_report/<? //= $attachment[$attribute] ?>" target="_blank"><? //= $attachment[$attribute] ?></a></span>
</div>
<span class="btn btn-file">
<span class="fileupload-new">Select file</span>
<span class="fileupload-exists">Change</span>
<input type="file" name="assessed_doc<?= $i ?>">
<?php $i++; ?>
<input type='hidden' name='i' id='i' value='<?= $i ?>' >
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>
</div>
</div>
</td>
</tr>
<?php
}
?>
</tbody>
<tr>
<td colspan="4">
<input type="button" class="btn" name="add_assessed" id="add_assessed" value="Add a record">
<!--<input type="button" class="btn" name="del_assessed" id="del_assessed" value="Remove a record" onclick='delete_assessed(this);'>-->
</td>
</tr>
<tr>
<td>Medication</td>
<td colspan="4"><textarea name="medication" disabled="true"><?= $row->medication ?></textarea></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr><td colspan="4"><b><h4>Assessment Result</h4></b></td></tr>
<tr><td colspan="4"><hr></td></tr>
<tr><td colspan="4"><b><h4>Subsidy</h4></b></td></tr>
<tr>
<td>
<?php
$query10 = "Select subsidy_type from subsidy where actived='1' and deleted='0'
and Subsidy_ID IN (Select subsidy_id from student_subsidy where stu_subsidy_id='$linking_id' and actived='1' and deleted='0')";
$result10 = $dbh->query($query10);
if ($result10->rowcount() > 0) {
$result10->setFetchMode(PDO::FETCH_OBJ);
$row10 = $result10->fetch();
$subsidy_type = $row10->subsidy_type;
if ($subsidy_type == 2) {
?>
<select name="select_subsidy" id="subsidy" disabled="true">
<option value="1">None</option>
<option value="2" selected>Subsidy Rate</option>
</select>
<?php
}
} else {
?>
<select name="select_subsidy" id="subsidy" disabled="true">
<option value="1" selected>None</option>
<option value="2">Subsidy Rate</option>
</select>
<?php
}
?>
</td>
<td colspan="3"><input type="text" name="subsidy_pecent" id="subsidy_percent" value="0%" readonly="true"></td>
</tr>
<tr>
<tbody id="subsidy_show"></tbody>
</tr>
<tr>
<td>Traveling Allowance </td>
<td colspan="3">
<select name="traveling_allowance" disabled="true">
<option></option>
<?php
if ($row->traveling_allowance == 1) {
?>
<option value="1" selected>Yes</option>
<option value="0">No</option>
<?php
} else {
?>
<option value="1">Yes</option>
<option value="0" selected>No</option>
<?php
}
?>
</select>
</td>
</tr>
</table>
<?php
if ($_GET['action'] == "View") {
?>
<input type="submit" name="submit" class="btn" value="Save" disabled="true">
<input type="submit" name="delete" class="btn" value="Delete" disabled="true">
<input type="button" value="Back" class="btn" onclick="history.back()"/>
<?php } else { ?>
<input type="submit" name="submit" class="btn" value="Save">
<input type="submit" name="delete" class="btn" value="Delete">
<input type="button" value="Back" class="btn" onclick="history.back()"/>
<?php } ?>
<div style="display: none;" class="modal fade" id="add_aspect" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4>Addidtional aspects</h4>
</div>
<div class="modal-body">
<table border="0">
<?php
$check = FALSE;
$query3 = "Select aspect_id,aspect_name from additional_aspect";
$result6 = $dbh->query($query3);
$result6->setFetchMode(PDO::FETCH_OBJ);
while ($row = $result6->fetch()) {
$result3 = $dbh->query($query_init3);
$result3->setFetchMode(PDO::FETCH_OBJ); //aspect
print '<tr>';
print '<td>';
while ($row1 = $result3->fetch()) {
if ($row1->aspect_id == $row->aspect_id)
$check = TRUE;
}
if ($check == TRUE) {
print '<input type="checkbox" name="add_aspect[]" value="' . $row->aspect_id . '" checked>' . $row->aspect_name;
print '<input type="hidden" name="add_aspectval[]" value="' . $row->aspect_name . '" >';
} else {
print '<input type="checkbox" name="add_aspect[]" value="' . $row->aspect_id . '">' . $row->aspect_name;
print '<input type="hidden" name="add_aspectval[]" value="' . $row->aspect_name . '" >';
}
print '</td>';
print '</tr>';
$check = FALSE;
}
?>
</table>
</div>
<div class="modal-footer">
<input type="button" name="submit_aspect" class="btn" value="Add" data-dismiss="modal" onclick="Add_aspect();">
</div>
</div>
</div>
</div>
<div style="display: none;" class="modal fade" id="diagnoses" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4>Diagnoses</h4>
</div>
<div class="modal-body">
<table border="0">
<?php
$query3 = "Select diagnose_id,diagnose_name from diagnose";
$result30 = $dbh->query($query3);
$result30->setFetchMode(PDO::FETCH_OBJ);
while ($row = $result30->fetch()) {
$result2 = $dbh->query($query_init2);
$result2->setFetchMode(PDO::FETCH_OBJ); //diagnose
print '<tr>';
print '<td>';
while ($row_init2 = $result2->fetch()) {
if ($row_init2->diagnose_id == $row->diagnose_id) {
$check = TRUE;
}
}
if ($check == TRUE) {
print '<input type="checkbox" name="diagnose[]" value="' . $row->diagnose_id . '" checked>' . $row->diagnose_name;
print '<input type="hidden" name="diagnoseval[]" value="' . $row->diagnose_name . '" >';
} else {
print '<input type="checkbox" name="diagnose[]" value="' . $row->diagnose_id . '">' . $row->diagnose_name;
print '<input type="hidden" name="diagnoseval[]" value="' . $row->diagnose_name . '" >';
}
print '</td>';
print '</tr>';
$check = FALSE;
}
?>
</table>
</div>
<div class="modal-footer">
<input type="button" name="submit_diagnose" class="btn" value="Add" data-dismiss="modal" onclick="Add_Diagnoses();">
</div>
</div>
</div>
</div>
</form>
</div> <!-- /container -->
</body>
</html>
</tr>
<?php } else { ?>
<style>
.table{
background:#feffde;
}
</style>
<div class="text-right">
<ul class="breadcrumb">
<li><a href="student.php">Student Record</a></li>
<li><a href="#"></a> <span class="divider">></span></li>
<li class="active">Edit Student Record</li>
</ul>
</div>
<div class="container-fluid pathways-container">
<form action="" method="POST" enctype="multipart/form-data">
<table border="0" class="table table-bordered table-hover table-condensed">
<tr>
<td colspan="4"><h2>Edit Student Record</h2></td>
</tr>
<tr>
<td colspan="4"><b><h4>Student Record</h4></b></td>
</tr>
<tr>
<td>Student No.(Old System)</td><td><input type="text" name="old_stu_id" required="true" readonly="true" value="<?= $row->o ?>"></td>
<td>Student No.(New System)</td><td><input type="text" name="new_stu_id" required="true" readonly="true" value="<?= $row->n ?>"></td>
</tr>
<tr>
<td>Semester_year</td>
<td colspan="3"><input type="text" name="sem_yr" placeholder="2013-2014" required="true" maxlength="9" minlength="9" value="<?= $row->s_yr; ?>"></td>
</tr>
<tr>
<td>Registration No(Old system)</td>
<td>
<input type="text" name="old_reg_no" required="true" value="<?= $row->old_registration_no; ?>" readonly="true">
</td>
<td>Registration No</td>
<td>
<input type="text" name="reg_no" required="true" value="<?= $row->registration_no; ?>" readonly="true">
</td>
</tr>
<tr>
<td>Registration Campus</td>
<td>
<select name="reg_campus">
<option></option>
<?php
$query = "Select campus_id,campus_name from campus";
$result = $dbh->query($query);
$result->setFetchMode(PDO::FETCH_OBJ);
while ($row1 = $result->fetch()) {
if ($row->reg_campus_id == $row1->campus_id)
print '<option value=' . $row1->campus_id . ' selected>' . $row1->campus_name . '</option>';
else
print '<option value=' . $row1->campus_id . '>' . $row1->campus_name . '</option>';
}
?>
</select>
</td>
<td>Registration Date</td>
<td>
<div class="input-append date-picker">
<input type="text" name="reg_date" class="dateISO" required="true" value="<?= $row->registration_date; ?>">
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div>
</td>
</tr>
<tr>
<td>Registration Semester</td>
<td colspan="3"><input type="text" name="reg_sem_yr" placeholder="2013-2014" required="true" value="<?= $row->reg_sem_year ?>"></td>
</tr>
<tr>
<td>Type</td>
<td>
<?php
if ($row->is_pathway_student == 1) {
?>
<input type="checkbox" name="is_pathway_stu" value="1" checked>Pathway Student
<?php
} else {
?>
<input type="checkbox" name="is_pathway_stu" value="1">Pathway Student
<?php
}
?>
<?php
if ($row->is_in_school_student == 1) {
?>
<input type="checkbox" name="is_in_school" value="1" checked>In-School Student
<?php
} else {
?>
<input type="checkbox" name="is_in_school" value="1">In-School Student
<?php
}
?>
</td>
<td>Status</td>
<td>
<select name="is_actived">
<option></option>
<?php
if ($row->actived == 1) {
?>
<option value="1" selected>Active</option>
<option value="0">Disable</option>
<?php
} else {
?>
<option value="1">Active</option>
<option value="0" selected>Disable</option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Data Input Date</td>
<td>
<div class="input-append date-picker">
<input type="text" name="input_date" class="dateISO" required="true" data-format="yyyy-MM-dd" value="<?= $row->input_date; ?>">
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div>
</td>
<td>Input By</td>
<td>
<input type="text" name="input_by" value="Chung Wai ki" readonly="true" required="true">
</td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td colspan="4"><b><h4>Student Information</h4></b></td>
</tr>
<tr>
<td>Date of Birth</td>
<td colspan="3">
<div class="input-append" id="day_of_birth">
<input type="text" name="date_of_birth" id="DOB" class="dateISO" required="true" value="<?= $row->date_of_birth ?>">
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div>
</td>
</tr>
<tr>
<td>Last Name</td>
<td><input type="text" name="last_name" id="last_name" required="true" value="<?= $row->last_name; ?>"></td>
<td>First Name</td>
<td><input type="text" name="first_name" id="first_name" required="true" value="<?= $row->first_name; ?>"></td>
</tr>
<tr>
<td>中文姓名</td>
<td><input type="text" name="ch_name" required="true" value="<?= $row->ch_name; ?>"></td>
<td>Gender</td>
<td>
<select name="gender">
<option></option>
<?php
if ($row->gender == 1) {
?>
<option value="1" selected>Male</option>
<option value="0">Female</option>
<?php
} else {
?>
<option value="1">Male</option>
<option value="0" selected>Female</option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Tel(Home)</td>
<td><input type="tel" name="home_tel" placeholder="24131323" required="true" value="<?= $row->home_tel ?>"></td>
<td>Fax</td>
<td><input type="tel" name="fax" value="<?= $row->fax ?>"></td>
</tr>
<tr>
<td>E-mail</td>
<td colspan="3"><input type="email" name="email" placeholder="user@example.com" value="<?= $row->email ?>"></td>
</tr>
<tr>
<td>Address</td>
<td colspan="2"><input type="text" name="address" required="true" class="input-block-level" value="<?= $row->address ?>"></td>
<td rowspan="6">
<center>
<?php
if ($row->photo != 'no photo') {
?>
<img id="loading" src="<?= $row->photo ?>">
<input type="hidden" name="photo" id="photo" value="<?= $row->photo ?>">
<?php
} else {
?>
<img id="loading" src="student_photo/personal_photo.gif">
<input type="hidden" name="photo" id="photo" value="no photo">
<?php
}
?>
</center>
</td>
</tr>
<tr>
<td>Address2</td>
<td colspan="2"><input type="text" name="address1" required="true" class="input-block-level" value="<?= $row->address2 ?>"></td>
</tr>
<tr>
<td>Address3</td>
<td colspan="2"><input type="text" name="address2" required="true" class="input-block-level" value="<?= $row->address3 ?>"></td>
</tr>
<tr>
<td>District</td>
<td colspan="2">
<select name="district">
<option></option>
<?php
$query1 = "Select district,district_id from district";
$result4 = $dbh->query($query1);
$result4->setFetchMode(PDO::FETCH_OBJ);
while ($row1 = $result4->fetch()) {
if ($row1->district_id == $row->district_id)
print '<option value=' . $row1->district_id . ' selected>' . $row1->district . '</option>';
else
print '<option value=' . $row1->district_id . '>' . $row1->district . '</option>';
}
?>
</select>
</td>
</tr>
<tr>
<td>Name of School Attending</td>
<td colspan="2"><input type="text" name="school_name" required="true" value="<?= $row->school_name ?>"></td>
</tr>
<tr>
<td>School District</td>
<td colspan="2">
<select name="sch_district">
<option></option>
<?php
$query1 = "Select district,district_id from district";
$result4 = $dbh->query($query1);
$result4->setFetchMode(PDO::FETCH_OBJ);
while ($row1 = $result4->fetch()) {
if ($row1->district_id == $row->sch_district_id)
print '<option value=' . $row1->district_id . ' selected>' . $row1->district . '</option>';
else
print '<option value=' . $row1->district_id . '>' . $row1->district . '</option>';
}
?>
</select>
</td>
</tr>
<tr>
<td>Year/Grade</td>
<td colspan="2">
<select name="grade">
<option></option>
<?php
$query2 = "Select grade_id,grade from grade";
$result5 = $dbh->query($query2);
$result5->setFetchMode(PDO::FETCH_OBJ);
while ($row1 = $result5->fetch()) {
if ($row1->grade_id == $row_init->grade_id)//<<$row cant get grade_id
print '<option value=' . $row1->grade_id . '. selected>' . $row1->grade . '</option>';
else
print '<option value=' . $row1->grade_id . '.>' . $row1->grade . '</option>';
}
?>
</select>
</td>
<td>
<center>
<input type="file" name="browse" id="browse" size="10">
</center>
</td>
</tr>
<tr>
<td colspan='3'></td>
<td>
<center>
<input type='button' name='upload' id='upload' class='btn' value='Upload'>
<input type='button' name='remove' id='remove' class='btn' value='Remove' onclick="delete_photo();">
</center>
</td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td colspan="4"><b><h4>Father</h4></b></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="father_name" value='<?= $row->father_name ?>'></td>
<td>Occupation</td>
<td><input type="text" name="father_occ" value='<?= $row->father_occupation ?>'></td>
</tr>
<tr>
<td>Mobile</td>
<td><input type="tel" name="father_mobile" value='<?= $row->father_mobile ?>'></td>
<td>Tel(Office)</td>
<td><input type="tel" name="father_off_tel" value='<?= $row->father_off_tel ?>'></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td colspan="4"><b><h4>Mother</h4></b></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="mother_name" value='<?= $row->mother_name ?>'></td>
<td>Occupation</td>
<td><input type="text" name="mother_occ" value='<?= $row->father_occupation ?>'></td>
</tr>
<tr>
<td>Mobile</td>
<td><input type="tel" name="mother_mobile" value='<?= $row->mother_mobile ?>'></td>
<td>Tel(Office)</td>
<td><input type="tel" name="mother_off_tel" value='<?= $row->mother_off_tel ?>'></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td colspan="4"><b><h4>Guardian</h4></b></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="guard_name" value='<?= $row->guardian_name ?>'></td>
<td>Occupation</td>
<td><input type="text" name="guard_occ" value='<?= $row->guardian_occupation ?>'></td>
</tr>
<tr>
<td>Relationship</td>
<td><input type="text" name="guard_relationship" value='<?= $row->guardian_relationship ?>'></td>
<td>Tel(Home)</td>
<td><input type="tel" name="guard_tel_home" value='<?= $row->guardian_home_tel ?>'></td>
</tr>
<tr>
<td>Mobile</td>
<td><input type="tel" name="guard_mobile" value='<?= $row->guardian_mobile ?>'></td>
<td>Tel(Office)</td>
<td><input type="tel" name="guard_off_tel" value='<?= $row->guardian_off_tel ?>'></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td colspan="4"><b><h4>Emergency Contact Person</h4></b></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="eme_name" value='<?= $row->eme_contact_name ?>'></td>
<td>Contact No.</td>
<td><input type="tel" name="eme_contact_no" value='<?= $row->eme_contact_number ?>'></td>
</tr>
<tr>
<td>Relationship</td>
<td colspan="3"><input type="text" name="eme_relationship" value='<?= $row->eme_contact_relationship ?>'></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td><b><h4>Diagnoses</h4></b></td>
<td><button type="button" class="btn" id="diagnoses_btn" data-toggle="modal" data-target="#diagnoses"><i class="icon-plus" ></i> Add</button></td>
<td><b><h4>Intellectual Functioning </h4></b></td>
<td><button type="button" class="btn" id="add_aspect_btn" data-toggle="modal" data-target="#add_aspect"><i class="icon-plus" ></i> Add</button></td>
</tr>
<tr>
<td colspan="2">
<table id="Add_Diagnoses" style="width: 80%;border: 1px solid #dddddd;margin-left: 40px;margin-bottom: 10px;margin-top: 10px;margin-right: 10px;" >
</table>
</td>
<td colspan="2">
<table id="Add_Aspect" style="width: 80%;border: 1px solid #dddddd;margin-left: 40px;margin-bottom: 10px;margin-top: 10px;margin-right: 10px;" >
</table>
<input type="hidden" name="linking_id" value="<?= $linking_id ?>">
</td>
</tr>
<tbody id='add_thing2'>
<?php
$query7 = "Select stu_doc_id,stu_linking_id,refer_by,assessed_by,assessed_doc,assessed_date
from student_document where stu_linking_id=(Select root_id from student where linking_id='$linking_id') and deleted=0";
$query8 = "Select count(*) as num from student_document where stu_linking_id=(Select root_id from student where linking_id='$linking_id') and deleted=0";
$result7 = $dbh->query($query7);
$result8 = $dbh->query($query8);
$result8->setFetchMode(PDO::FETCH_OBJ);
$no_of_doc = $result8->fetch()->num;
if ($result7->rowcount() != 0) {
$result7->setFetchMode(PDO::FETCH_OBJ);
while ($row7 = $result7->fetch()) {
$i = 0;
?>
<tr>
<td>Refer to</td>
<td><input type="text" name="refer_by[]" value="<?= $row7->refer_by ?>"></td>
<td>Assessed By</td>
<td><input type="text" name="assessed_by[]" value="<?= $row7->assessed_by ?>"></td>
</tr>
<tr>
<td>Assessed date</td>
<td>
<div class="input-append date-picker">
<input type="text" name="assessed_date[]" class="dateISO" value="<?= $row7->assessed_date ?>">
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div>
</td>
<td>Assessed document</td>
<td colspan="3">
<div class="fileupload fileupload-new" style="margin:0px" data-provides="fileupload">
<div class="input-append">
<div class="uneditable-input ">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><a href="<?= $row7->assessed_doc ?>" target="_blank"><?= $row7->assessed_doc ?></a></span>
<input type='hidden' name='file_name[]' value='<?= $row7->assessed_doc ?>' >
</div>
<span class="btn btn-file">
<span class="fileupload-new">Select file</span>
<span class="fileupload-exists">Change</span>
<input type="file" name="assessed_doc<?= $i ?>">
<?php if ($i == 0) { ?>
<input type='hidden' name='i' id='i' value='<?= $no_of_doc ?>' >
<?php } ?>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>
</div>
</div>
</td>
</tr>
<?php
$i++;
}
} else {
?>
<tr>
<td>Refer to</td>
<td><input type="text" name="refer_by[]"></td>
<td>Assessed By</td>
<td><input type="text" name="assessed_by[]"></td>
</tr>
<tr>
<td>Assessed date</td>
<td>
<div class="input-append date-picker">
<input type="text" name="assessed_date[]" class="dateISO">
<span class="add-on">
<i class="icon-calendar" data-date-icon="icon-calendar" data-time-icon="icon-time"></i>
</span>
</div>
</td>
<td>Assessed document</td>
<td colspan="3">
<div class="fileupload fileupload-new" style="margin:0px" data-provides="fileupload">
<div class="input-append">
<div class="uneditable-input ">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><a href="diagnose_report/<? //= $attachment[$attribute] ?>" target="_blank"><? //= $attachment[$attribute] ?></a></span>
</div>
<span class="btn btn-file">
<span class="fileupload-new">Select file</span>
<span class="fileupload-exists">Change</span>
<input type="file" name="assessed_doc<?= $i ?>">
<?php $i++; ?>
<input type='hidden' name='i' id='i' value='<?= $i ?>' >
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>
</div>
</div>
</td>
</tr>
<?php
}
?>
</tbody>
<tr>
<td colspan="4">
<input type="button" class="btn" name="add_assessed" id="add_assessed" value="Add a record">
<!--<input type="button" class="btn" name="del_assessed" id="del_assessed" value="Remove a record" onclick='delete_assessed(this);'>-->
</td>
</tr>
<tr>
<td>Medication</td>
<td colspan="4"><textarea name="medication"><?= $row->medication ?></textarea></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr><td colspan="4"><b><h4>Assessment Result</h4></b></td></tr>
<tr><td colspan="4"><hr></td></tr>
<tr><td colspan="4"><b><h4>Subsidy</h4></b></td></tr>
<tr>
<td>
<?php
$query10 = "Select subsidy_type from subsidy where actived='1' and deleted='0'
and Subsidy_ID IN (Select subsidy_id from student_subsidy where stu_subsidy_id='$linking_id' and actived='1' and deleted='0')";
$result10 = $dbh->query($query10);
if ($result10->rowcount() > 0) {
$result10->setFetchMode(PDO::FETCH_OBJ);
$row10 = $result10->fetch();
$subsidy_type = $row10->subsidy_type;
if ($subsidy_type == 2) {
?>
<select name="select_subsidy" id="subsidy">
<option value="1">None</option>
<option value="2" selected>Subsidy Rate</option>
</select>
<?php
}
} else {
?>
<select name="select_subsidy" id="subsidy">
<option value="1" selected>None</option>
<option value="2">Subsidy Rate</option>
</select>
<?php
}
?>
</td>
<td colspan="3"><input type="text" name="subsidy_pecent" id="subsidy_percent" value="0%" readonly="true"></td>
</tr>
<tr>
<tbody id="subsidy_show"></tbody>
</tr>
<tr>
<td>Traveling Allowance </td>
<td colspan="3">
<select name="traveling_allowance">
<option></option>
<?php
if ($row->traveling_allowance == 1) {
?>
<option value="1" selected>Yes</option>
<option value="0">No</option>
<?php
} else {
?>
<option value="1">Yes</option>
<option value="0" selected>No</option>
<?php
}
?>
</select>
</td>
</tr>
</table>
<?php
if ($_GET['action'] == "View") {
?>
<input type="submit" name="submit" class="btn" value="Save" disabled="true">
<input type="submit" name="delete" class="btn" value="Delete" disabled="true">
<input type="button" value="Back" class="btn btn-danger" onclick="history.back()"/>
<?php } else { ?>
<input type="submit" name="submit" class="btn" value="Save">
<input type="submit" name="delete" class="btn" value="Delete">
<input type="button" value="Back" class="btn btn-danger" onclick="history.back()"/>
<?php } ?>
<div style="display: none;" class="modal fade" id="add_aspect" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4>Addidtional aspects</h4>
</div>
<div class="modal-body">
<table border="0">
<?php
$check = FALSE;
$query3 = "Select aspect_id,aspect_name from additional_aspect";
$result6 = $dbh->query($query3);
$result6->setFetchMode(PDO::FETCH_OBJ);
while ($row = $result6->fetch()) {
$result3 = $dbh->query($query_init3);
$result3->setFetchMode(PDO::FETCH_OBJ); //aspect
print '<tr>';
print '<td>';
while ($row1 = $result3->fetch()) {
if ($row1->aspect_id == $row->aspect_id)
$check = TRUE;
}
if ($check == TRUE) {
print '<input type="checkbox" name="add_aspect[]" value="' . $row->aspect_id . '" checked>' . $row->aspect_name;
print '<input type="hidden" name="add_aspectval[]" value="' . $row->aspect_name . '" >';
} else {
print '<input type="checkbox" name="add_aspect[]" value="' . $row->aspect_id . '">' . $row->aspect_name;
print '<input type="hidden" name="add_aspectval[]" value="' . $row->aspect_name . '" >';
}
print '</td>';
print '</tr>';
$check = FALSE;
}
?>
</table>
</div>
<div class="modal-footer">
<input type="button" name="submit_aspect" class="btn" value="Add" data-dismiss="modal" onclick="Add_aspect();">
</div>
</div>
</div>
</div>
<div style="display: none;" class="modal fade" id="diagnoses" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4>Diagnoses</h4>
</div>
<div class="modal-body">
<table border="0">
<?php
$query3 = "Select diagnose_id,diagnose_name from diagnose";
$result30 = $dbh->query($query3);
$result30->setFetchMode(PDO::FETCH_OBJ);
while ($row = $result30->fetch()) {
$result2 = $dbh->query($query_init2);
$result2->setFetchMode(PDO::FETCH_OBJ); //diagnose
print '<tr>';
print '<td>';
while ($row_init2 = $result2->fetch()) {
if ($row_init2->diagnose_id == $row->diagnose_id) {
$check = TRUE;
}
}
if ($check == TRUE) {
print '<input type="checkbox" name="diagnose[]" value="' . $row->diagnose_id . '" checked>' . $row->diagnose_name;
print '<input type="hidden" name="diagnoseval[]" value="' . $row->diagnose_name . '" >';
} else {
print '<input type="checkbox" name="diagnose[]" value="' . $row->diagnose_id . '">' . $row->diagnose_name;
print '<input type="hidden" name="diagnoseval[]" value="' . $row->diagnose_name . '" >';
}
print '</td>';
print '</tr>';
$check = FALSE;
}
?>
</table>
</div>
<div class="modal-footer">
<input type="button" name="submit_diagnose" class="btn" value="Add" data-dismiss="modal" onclick="Add_Diagnoses();">
</div>
</div>
</div>
</div>
</form>
</div> <!-- /container -->
</body>
</html>
<?php } ?>