<?php
ob_start();
include('configure.php');
DB::connect();
require_once("check.php");
$id = $_SESSION['id'];
$start = $_REQUEST['start'];
if(isset($_POST['submit12345'])){
$application_type = $_POST['application_type'];
$application_message = $_POST['application_message'];
$application_teacher = $_POST['application_teacher'];
$application_timestamp = $_POST['application_timestamp'];
$application_teacher_id = $_POST['application_teacher_id'];
$insert_bookings = "INSERT `applications` SET
$sql2
application_type = '".addslashes($application_type)."',
application_message = '".addslashes($application_message)."',
application_teacher_id = '".addslashes($application_teacher_id)."',
application_timestamp = now(),
application_teacher = '".addslashes($application_teacher)."'";
$sql_insert = $dbconn->prepare($insert_bookings);
$sql_insert->execute();
$message="Details successfully updated.";
$status="success";
header("Location: application_success.php?id=$id&message=1&status=success");
}
if($id !=''){
$select_bookings31= "SELECT * FROM `teacher` WHERE id = '".$_SESSION['id']."'";
$sql31=$dbconn->prepare($select_bookings31);
$sql31->execute();
$wlvd31=$sql31->fetchAll(PDO::FETCH_OBJ);
foreach($wlvd31 as $rows31);
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<?php include('inc/header.php'); ?>
<body>
<?php include('inc/preloader.php'); ?>
<!-- ============================================================== -->
<!-- Main wrapper - style you can find in pages.scss -->
<!-- ============================================================== -->
<div id="main-wrapper">
<!-- ============================================================== -->
<!-- Topbar header - style you can find in pages.scss -->
<!-- ============================================================== -->
<?php include('inc/top_menu.php'); ?>
<!-- ============================================================== -->
<!-- End Topbar header -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Left Sidebar - style you can find in sidebar.scss -->
<!-- ============================================================== -->
<?php include('inc/main_menu.php'); ?>
<!-- ============================================================== -->
<!-- End Left Sidebar - style you can find in sidebar.scss -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Page wrapper -->
<!-- ============================================================== -->
<div class="page-wrapper">
<!-- ============================================================== -->
<!-- Bread crumb and right sidebar toggle -->
<!-- ============================================================== -->
<div class="page-breadcrumb">
<div class="row">
<div class="col-5 align-self-center">
<h4 class="page-title">Add An Application</h4>
<div class="d-flex align-items-center">
</div>
</div>
</div>
</div>
<!-- ============================================================== -->
<!-- End Bread crumb and right sidebar toggle -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Container fluid -->
<!-- ============================================================== -->
<div class="container-fluid">
<!-- ============================================================== -->
<!-- Start Page Content -->
<!-- ============================================================== -->
<div class="container-fluid">
<!-- ============================================================== -->
<!-- Start Page Content -->
<!-- ============================================================== -->
<!-- row -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<?php if($message!="") { ?>
<?php
switch($vendor_status) {
case "success":
echo $db->success_message_info($message);
break;
case "failed":
echo $db->error_message_info($message);
break;
default:
echo "Nothing Done";
break;
}
?>
<?php } ?>
<form id="formID" class="m-t-30" method="post" action="" enctype="multipart/form-data">
<div class="form-group">
<input name="application_teacher" type="hidden" class="form-control" id="application_teacher" aria-describedby="emailHelp" required="" value="<?php echo $rows31->teacher_name; ?>" >
</div>
<div class="form-group">
<input name="application_type" type="hidden" class="form-control" id="application_type" aria-describedby="emailHelp" required="" value="Leave" >
<input name="application_teacher_id" type="hidden" class="form-control" id="application_teacher_id" aria-describedby="emailHelp" required="" value="<?php echo $rows31->id; ?>" >
</div>
<div class="form-group">
<label for="exampleInputEmail1">Message</label>
<textarea name="application_message" id="application_message" cols="50" rows="15" class="ckeditor">
<p><strong>To,<br />
The Principal,<br />
Goreswar College,<br />
Goreswar.</strong><br />
<br />
<strong>Subject: Leave Application. </strong></p>
<p><strong>Dear Sir,</strong></p>
<p>With due respect, I would like to inform you that I will not be able to conduct my classes from <em>{DD/MM/YYYY to DD/MM/YYYY}</em> on account of<em> {WRITE THE REASON HERE}</em></p>
<p>I therefore request you to accept my application.</p>
<p> </p>
Sincerely Yours,<br />
<?php echo $rows31->teacher_name; ?><br />
<?php echo $rows31->teacher_phone; ?><br />
<?php echo $rows31->teacher_dept; ?> Department<br />
</textarea>
<small id="emailHelp" class="form-text text-muted"></small>
</div>
</div>
</div>
<button type="submit" name="submit12345" value="Submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
</div>
</div>
<!-- row -->
<!-- .row -->
</div>
<!-- ============================================================== -->
<!-- End Container fluid -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<script src="assets/libs/ckeditor/ckeditor.js"></script>
<script src="assets/libs/ckeditor/samples/js/sample.js"></script>
<script>
//default
initSample();
//inline editor
// We need to turn off the automatic editor creation first.
CKEDITOR.disableAutoInline = true;
CKEDITOR.inline('editor2', {
extraPlugins: 'sourcedialog',
removePlugins: 'sourcearea'
});
var editor1 = CKEDITOR.replace('editor1', {
extraAllowedContent: 'div',
height: 460
});
editor1.on('instanceReady', function() {
// Output self-closing tags the HTML4 way, like <br>.
this.dataProcessor.writer.selfClosingEnd = '>';
// Use line breaks for block elements, tables, and lists.
var dtd = CKEDITOR.dtd;
for (var e in CKEDITOR.tools.extend({}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent)) {
this.dataProcessor.writer.setRules(e, {
indent: true,
breakBeforeOpen: true,
breakAfterOpen: true,
breakBeforeClose: true,
breakAfterClose: true
});
}
// Start in source mode.
this.setMode('source');
});
</script>
<?php include('inc/footer.php'); ?>