<!DOCTYPE html>
<!DOCTYPE html>

<?php 
include "include/controller.php";
include "include/view.php";
$control = new Controller();
$view = new View();
$msg = $view->getcollege();
$fromhod = $msg[0];
$todean = $msg[1];
$msg = $view->gethodpermission();
if (!empty($_POST['rejected'])) {
    //Do all the submission part or storing in DB work and all here
    header('Location: reasonhod.php');
}
if (!empty($_POST['Accept'])) {
    $message = $_POST['textarea'];
    $temp = $_POST['hello'];
    $row = $view->getuser($temp);
    $subject = "Mail from hod in regard of leave '" . $row[0] . "'";
    $control->responcehod($row[0]);
    //echo "<script>alert('".$subject."')</script>";//echo $message;
    $headers = "From:" . $fromhod;
    //echo "<script>alert('".$row[0]."')</script>";//echo $message;
    mail($todean, $subject, "Dear Sir,\n\t.'{$message}'.\n\t please http://designghar.com/flm/deanresponce.php to for give your responce", $headers);
    //mail($todean,$subject,$message,$headers);
    //$control->responcehod();
    //echo "Mail Sent.";
    //Do all the submission part or storing in DB work and all here
}