<?php session_start();


$madrasa_code = $_SESSION["madrasa_code"] ?? 1;
if (!isset($con)) {
  include "../../../database_con.php";
  include "../../inc/bn.php";
}

//মাদরাসার না ও ঠিকানা
$admi_sql = mysqli_query($con, "SELECT academic_name,  academic_add, logo, favicon FROM `academic` WHERE academic_id=$madrasa_code ");
$row_ad = mysqli_fetch_assoc($admi_sql);
$madrasa_name = $row_ad['academic_name'];
$madrasa_address = $row_ad['academic_add'];
$logo = $row_ad['logo'];
$favicon = $row_ad['favicon'];
?>
<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>শিক্ষকদের নামের তালিকা</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->

  <!-- Font Awesome -->
  <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
  <link rel="shortcut icon" href="../logo/<?php echo $favicon ?>">
  <style type="text/css">
    body {
      margin: 0;
    }

    @font-face {
      font-family: 'Bangla';
      src: url('../../dist/fonts/SutonnyOMJ.ttf');
      font-weight: normal;
      font-style: normal;
    }

    .bangla {
      font-family: bangla;
      text-align: center;
      src: url(../../dist/fonts/SutonnyMJ.ttf);

    }

    #sl {
      text-align: center;
      font-size: 20px;
      width: 10%;
      font-family: bangla;
    }

    #date {
      position: absolute;
      right: 209px;
      position: absolute;
      top: 79px;
    }

    .print-area {
      width: 850px;
      height: 1050px;
      margin: auto;
      box-sizing: border-box;
    }

    .header,
    .print-area {
      text-align: center;
    }

    .header h1 {
      margin: 0px;
      padding: 0px;
      font-size: 35px;
      font-family: 'Bangla';
    }

    .header h3 {
      margin: 0px;
      padding: 0px;
      font-size: 25px;
      font-family: 'Bangla';
    }

    .header h2 {
      margin: 0px;
      padding: 0px;
      font-size: 20px;
      font-family: 'Bangla';
    }

    #heding {
      font-size: 30px;
      margin: 0;
      text-align: center;
    }

    #center_font {
      font-family: 'Bangla';
      text-align: center;
    }

    #name {
      font-family: 'Bangla';
      text-align: left;
      width: 20%px;
    }

    #title {
      font-family: 'Bangla';
      text-align: center;
      width: 15%px;
    }

    #thana_name {
      font-family: 'Bangla';
      text-align: center;
      width: 15%px;
    }

    #district_name {
      font-family: 'Bangla';
      text-align: center;
      width: 15%px;
    }

    #mobile {
      font-family: 'bangla';
      text-align: center;
      width: 15%px;
    }

    #salary {
      font-family: bangla;
      text-align: center;
      width: 15%px;
    }

    th,
    td {
      font-size: 20px;
      font-family: 'Bangla';
    }

    #pic_log {
      position: absolute;
      top: 10px;
      left: 10px;
      width: 100px;
    }


    table {
      border-collapse: collapse;
    }
  </style>


</head>
<?php
//
$date = date("d-m-Y");

$data = "";
$total = "";
$notis = "";
$sl = 1;
//ছাত্রদের তথ্য



?>

<body>

  <div class="col-md-12" style="text-align: center;">
    </head>

    <body>
      <div class="header">
        <h1><?php echo $madrasa_name ?></h1>
        <h3><?php echo $madrasa_address ?></h3>
        <tr>
          <th colspan="6">
            <h1 style="padding-bottom:10px;">শিক্ষকদের নামের তালিকা</h1>
          </th>
        </tr>
      </div>
      <div style="max-width:320px; height: 2px;"><img src="../logo/<?php echo $logo; ?>" alt="logo" id="pic_log"
          style="margin-top: px;" /></div>
      <table width="99%" align="center" border="1">
        <thead style="background-color:silver !important; text-align: center;">
          <tr>
            <th style="text-align: center;">ক্রমিক</th>
            <th style="text-align: center;">আইডি</th>
            <th style="text-align: center;">নাম</th>
            <th style="text-align: center;">পদবী</th>
            <th style="text-align: center;">গ্রাম</th>
            <th style="text-align: center;">থানা</th>
            <th style="text-align: center;">জেলা</th>
            <th style="text-align: center;">মোবাইল</th>
            <th style="text-align: center;">বেতন</th>
          </tr>
        </thead>

        <?php
        $i = 1;

        //শিক্ষক
        $result = mysqli_query($con, "SELECT  * FROM `teacher_view` 
     
     where teacher_view.status=1 AND madrasa_code='$madrasa_code'  order by teacher_sr asc");
        while ($row = mysqli_fetch_assoc($result)) { ?>
          <tbody>
            <tr>
              <td id="sl"><?= $i++; ?></td>
              <td id="sl"><?= $row['teacher_id']; ?></td>
              <td id="name">&nbsp;<?= $row['name']; ?></td>
              <td id="title"><?= $row['system_subject_name']; ?></td>
              <td id="title"><?= $row['village']; ?></td>
              <td id="thana_name"><?= $row['thana_name']; ?></td>
              <td id="district_name"><?= $row['district_name']; ?></td>
              <td id="mobile"><?= $row['mobile']; ?></td>
              <td id="salary"><?= $row['salary']; ?></td>
            </tr>
          </tbody>

          <?php
          if ($result->num_rows == 0) {
            echo '<body style="text-align: center;">
  <div class="col-md-12 text-red" id="pagewidth">
  <h1>No Data Available for Printing!</h1>';
          }
        }
        ?>
      </table>
      <br>

    </body>

</html>