<?php  

session_start();
if(!$_SESSION['id']){
    header('location:index.php');
}

  require_once '../system/conn.php';

$stmt = $conn->prepare("SELECT * FROM `emp_details` WHERE `sn` = ?");
$stmt->execute([$_POST['id']]);
$emp = $stmt->fetch(PDO::FETCH_ASSOC);

?>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">

<style>
.letter-container {
    width: 98%;
    /* Reduced width */
    margin: auto auto;
    padding: 15px;
    font-family: 'Times New Roman', sans-serif;
    font-size: 11px;
    /* Reduced font size */
}

.header img {
    width: 100px;
    /* Reduced logo size */
}

.details-table td {
    padding: 4px;
    /* Reduced padding */
    font-size: 10px;
}

.header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}


.header h1 {
    font-size: 22px;
    text-transform: uppercase;
    margin: 0;
    font-weight: bold;
}

.sub-header {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}



.details-table td:first-child {
    font-weight: bold;
    width: 30%;
}

.signature-section {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
}

.signature-block {
    text-align: center;
}
</style>
<style>
.application-form {
    width: 95%;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    font-family: Arial, sans-serif;
    background: #fff;
}

.application-form h2 {
    text-align: center;
    margin-bottom: 20px;
}



.form-table {
    width: 100%;
    border-collapse: collapse;
}

.form-table td {
    padding: 10px;
}

.form-table td:first-child {
    font-weight: bold;
    width: 25%;
    background: #f1f1f1;
}

.photo-container {
    width: 30%;
    text-align: center;
}

.photo-container img {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    border: 2px solid #000;
}

.section-divider {
    margin-top: 20px;
    border-top: 2px solid black;
    padding-top: 20px;
}

.dual-row td {
    width: 50%;
    white-space: nowrap;
    /* Prevents text from breaking */
    text-align: left;
}

.tri-row td {
    width: 16.66% !important;
    /* Each column takes exactly 16.66% */
    white-space: nowrap;
    /* Prevents text from breaking */
    text-align: left;
    /* Ensures proper alignment */
}
</style>
<?php
$biodata = '<div class="letter-container">
    <div class="header">
        <img src="http://hr.utcpl.co.in/hrm/admin/assets/images/logo-utcpl.webp" alt="Company Logo">
        <div>
        <h1>UTKAL TEAM CARE PVT LTD</h1>
        <p>Reff. No - UTCPL/HR/TL/24/05/003</p>
        <p>Issue Date: '.date("F j, Y").'</p>
        </div>
        
    </div>
    <h4 style="text-align:center;margin-top:2rem;">JOINING LETTER</h4>
    <div class="application-form" style="margin-top:4.5rem">
        <div class="form-container">
<p><strong>To</strong><br>
        <big>Mr. '.$emp['e_name'].',</big><br>
        At- '.$emp['addr'].'</p>

        <p><strong>Sub:</strong> Appointment for the position of Fire Man</p>

        <p>Dear <strong>Mr. '.$emp['e_name'].'</strong>,</p>

        <p>On the basis of your performance, we are pleased to appoint you in our organization on the following terms and conditions with effect from '.$emp['e_doj'].'.</p>

        <h6>1. DESIGNATION</h6>
        <p>You will be ranked as a Fire Man. Your posting will be at <strong>Utkal Team Care Pvt. Ltd.</strong>, Bhubaneswar. Your immediate reporting officer will be the Site Incharge of the company.</p>

        <h6>2. STANDARD OF PERFORMANCE</h6>
        <p class="indent">You commit yourself to devote your entire time to the assigned responsibilities so as to accomplish the given tasks and achieve the objectives within the agreed time frame with expected quality and efficiency standards. As a part of performance standards, you also commit to observe and maintain the best standard of behavior, discipline, and work ethics while following the rules and regulations of the company as are in force and/or amended from time to time.</p>

        <h6>3. MONTHLY COMPENSATION AND BENEFITS</h6>
        <p class="indent">You will be entitled to compensation of Rs. '.$emp['salary'].'/- Gross per month (30 days).</p>

        <h6>4. PROBATION PERIOD</h6>
        <p class="indent">You will be on a probation period of three months from the date of your joining. The Management may, at its sole discretion, extend your probationary period for such term as considered appropriate. During the period of probation, the appointment is terminable either by the company or by you by giving fifteen days (30 days) notice or payment in lieu thereof.</p>

        <h6>5. NOTICE PERIOD</h6>
        <p class="indent">After confirmation, your services are liable for termination, without assigning any reason, on 30 days’ notice in writing on either side or basic pay in lieu thereof. The company reserves the right to pay or recover salary in lieu of the notice period.</p>

        <h6>6. TRANSFER</h6>
        <p class="indent">You will be liable to be transferred in such capacity as the company may from time to time determine, to any other location, department, establishment, factory, or branch of the company or its affiliate, associate, or subsidiary companies, subject to the provision that your remuneration will not be adversely affected. In such a case, you will be governed by the terms and conditions of service applicable to the new assignment.</p>
        </div>

</div>';

echo $biodata;
?>