| Server IP : 172.67.189.169 / Your IP : 216.73.216.59 Web Server : Apache/2 System : Linux cat167-197.static.lnwhostname.com 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13) x86_64 User : paphayomho ( 1042) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/paphayomho/domains/paphayomhospital.go.th/private_html/HHC/admin/ |
Upload File : |
<div class="row-fluid">
<!-- block -->
<div class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Add Teacher</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form method="post">
<!--
<label>Photo:</label>
<div class="control-group">
<div class="controls">
<input class="input-file uniform_on" id="fileInput" type="file" required>
</div>
</div>
-->
<div class="control-group">
<label>Department:</label>
<div class="controls">
<select name="department" class="" required>
<option></option>
<?php
$query = mysql_query("select * from department order by department_name");
while($row = mysql_fetch_array($query)){
?>
<option value="<?php echo $row['department_id']; ?>"><?php echo $row['department_name']; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="control-group">
<div class="controls">
<input class="input focused" name="firstname" id="focusedInput" type="text" placeholder = "Firstname">
</div>
</div>
<div class="control-group">
<div class="controls">
<input class="input focused" name="lastname" id="focusedInput" type="text" placeholder = "Lastname">
</div>
</div>
<div class="control-group">
<div class="controls">
<button name="save" class="btn btn-info"><i class="icon-plus-sign icon-large"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
<?php
if (isset($_POST['save'])) {
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$department_id = $_POST['department'];
$query = mysql_query("select * from teacher where firstname = '$firstname' and lastname = '$lastname' ")or die(mysql_error());
$count = mysql_num_rows($query);
if ($count > 0){ ?>
<script>
alert('Data Already Exist');
</script>
<?php
}else{
mysql_query("insert into teacher (firstname,lastname,location,department_id)
values ('$firstname','$lastname','uploads/NO-IMAGE-AVAILABLE.jpg','$department_id')
") or die(mysql_error()); ?>
<script>
window.location = "teachers.php";
</script>
<?php }} ?>