<?php

  include('session.php');

?>
<!doctype html>
<html lang="en" class="h-100">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <title></title>
    <!-- Bootstrap core CSS -->
   <link href="css/bootstrap.css" rel="stylesheet">

    <style>

      body {
        font-size: 14px!important;
        font-family: pyidaungsu_bookregular;
      }

      input {
        font-size: 14px!important;
        font-family: pyidaungsu_bookregular;
      }


      select {
        font-size: 14px!important;
        font-family: pyidaungsu_bookregular;
      }

      .bd-placeholder-img {
        font-size: 1.125rem;
        text-anchor: middle;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }

      @media (min-width: 768px) {
        .bd-placeholder-img-lg {
          font-size: 3.5rem;
        }
      }

      .p-t-5 {
          padding-top: 5px;
      }


      .p-lr-5 {
          padding-left: 5px!important;
          padding-right: 5px!important;
      }

      .bg-dark-blue {
        background-color: #1978a5;
      }

    </style>
    <!-- Custom styles for this template -->
   
  </head>
  <body class="d-flex flex-column h-100">
  <?php
    include('include/menu.php');
  ?>

  <link href="css/fontawesome/css/all.css" rel="stylesheet">

<!-- Begin page content -->
<main role="main" class="flex-shrink-0" style="padding-top: 10px;">
  <div class="container tex">
    <br />
    <h4 class="mt-5">ဧည့်မှတ်တမ်း <a href="main.php"><i class="fas fa-address-book"></i></a></h4>
    <br />
    <center>

      <?php
        include("dbconnect.php");
        $items = getalltownship($mysqli);
      ?>

    <table border="0" width="100%">
      <tr>
        <td>

    <div style="min-height: 70vh" >
      <div class="row row-sm mg-b-10 p-t-5">
      <!-- <div class="col-sm-10 p-lr-5">
          <input type="text" name="cardnumber" id="cardnumber" class="form-control " placeholder="ကတ်နံပါတ်ရိုက်ပါ။ (သို့) Scan ဖတ်ပါ" required>
      </div> -->
      </div>
      

     <!--  <input type="file" accept="image/*" capture="camera" id="firstcam" caption="မျက်နှာပုံရိုက်ရန်"/> -->
      <form action="savelog.php" method="post" id="dataform" name="dataform" enctype="multipart/form-data">

     <div class="custom-file">
      <input type="file" accept="image/*" capture="camera" name="firstcam" id="firstcam" class="custom-file-input" >
      <label class="custom-file-label" for="customFile">မျက်နှာပုံရိုက်ရန်</label>
     </div>
      <img src="" id="firstcampreview" width="100%" style="padding-bottom: 15px;" />
   

      <br />
     <div class="custom-file">
      <input type="file" accept="image/*" capture="camera" id="secondcam" name="secondcam" class="custom-file-input" >
      <label class="custom-file-label" for="customFile">မှတ်ပုံတင်ရိုက်ရန်</label>
     </div>
      <img src="" id="secondcampreview" width="100%" style="padding-bottom: 15px;" />
      

      <br />
      <div class="custom-file">
      <input type="file" accept="image/*" capture="camera" id="thirdcam" name="thirdcam" class="custom-file-input" >
      <label class="custom-file-label" for="customFile">ဖောင်ပုံစံ ရိုက်ရန်</label>
      </div>
      <img src="" id="thirdcampreview" width="100%"  style="padding-bottom: 15px;"  />
      

   
      <div id="carea" style="">
     

         
        

           <div class="row row-sm mg-b-10 p-t-5">
            <div class="col-sm-5 p-lr-5">
            <select id="dept" name="dept" class="form-control"> 
                   
            <?php
              foreach ($items as $key => $value) {
                echo '<option value="'.$value['name'].','.$value['dept_name'].'"> '.$value['name']." - " .$value['dept_name'].' </option>';
              }
            ?>
              </select>
              </div>
          </div>



           <div class="row row-sm mg-b-10 p-t-5">
            <div class="col-sm-5 p-lr-5">
            <select id="topic" name="topic" class="form-control"> 
                   
             <?php

           
                $topic = getalltopic($mysqli);

              foreach ($topic as $key => $value) {
                echo '<option value="'.$value['name'].'"> '.$value['name'].' </option>';
              }
              ?>
              </select>
              </div>
          </div>


          <div class="row row-sm mg-b-10 p-t-5">
          <div class="col-sm-5 p-lr-5">
            <input type="number" id="phonenumber" name="phonenumber" class="form-control" placeholder="ဖုန်းနံပါတ်">
          </div>
        </div>



        <div class="row row-sm mg-b-10 p-t-5">
          <div class="col-sm-5 p-lr-5">
            <input type="number" id="vcard" name="vcard" class="form-control" required placeholder="ကတ်နံပါတ်">
          </div>
        </div>

        

         <div class="row row-sm mg-b-10 p-t-5">
         
           <div class="col-sm-5 p-lr-5">
             <button type="submit" class="btn btn-success">သိမ်းမည်</button>
          </div>
        </div>
      </div>

  </form>
  </div>
  </div>
</main>

<?php   
  include("include/footerandbasedscript.php");
?>

<script type="text/javascript">


  $("#firstcam").on('change', function(){
    var file = document.getElementById("firstcam").files[0];
    var blob_url = window.URL.createObjectURL(file);
    $("#firstcampreview").attr("src", blob_url);
    

  });

  $("#secondcam").on('change', function(){
    var file = document.getElementById("secondcam").files[0];
    var blob_url = window.URL.createObjectURL(file);
    $("#secondcampreview").attr("src", blob_url);
    
  });

  $("#thirdcam").on('change', function(){
    var file = document.getElementById("thirdcam").files[0];
    var blob_url = window.URL.createObjectURL(file);
    $("#thirdcampreview").attr("src", blob_url);
  
  });


  $("#phonenumber").on('focus', function(){
      $("#phonenumber").val("09");
  
  });





 


</script>
</html>