<?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 />
    <h3 class="mt-5">ဧည့်မှတ်တမ်း <a href="main.php"><i class="fas fa-address-book"></i></a></h3>
    <br />
    <center>

      <?php
        include("dbconnect.php");
        $items = getallitems($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>
      

     <div id="detail" style="display:none;">
          <div class="row row-sm mg-b-10 p-t-5">
          <div class="col-sm-5 p-lr-5">
              <div class="thumbnail">

                  <!-- <img src="https://via.placeholder.com/468x360?text=ID-Image+(Offline)" alt="Nature" style="width:100%">
                  <div class="caption">
                    <p>မှတ်ပုံတင်ပုံ</p>
                  </div> -->

                   <img id="faceshot" src="https://via.placeholder.com/468x360?text=FaceShot+(Offline)" alt="Face Shot" style="width:100%">


              </div>
          </div>

         <!--  <div class="col-sm-5 p-lr-5">
              <div class="thumbnail">
                <img id="faceshot" src="https://via.placeholder.com/468x360?text=FaceShot+(Offline)" alt="Nature" style="width:100%">
                  <div class="caption text-right">
                    
                  </div>
              </div>
          </div> -->
        </div>

              <div class="row row-sm mg-b-10 p-t-5" >
                <div class="col-sm-2 p-lr-5 text-right"  style="line-height:30px;" >
                  ကတ်နံပါတ် :
                </div>
                <div class="col-sm-5 p-lr-5" id="detailcardnumber" style="line-height:30px;" >
                 
                </div>
              </div>
              <div class="row row-sm mg-b-10 p-t-5" >
                <div class="col-sm-2 p-lr-5 text-right" style="line-height:30px;" >
                  အမည် :
                </div>
                <div class="col-sm-5 p-lr-5" id="detailname" style="line-height:30px;" >
                 
                </div>
              </div>
              <div class="row row-sm mg-b-10 p-t-5" >
                <div class="col-sm-2 p-lr-5 text-right" style="line-height:30px;" >
                  မှတ်ပုံတင်နံပါတ် :
                </div>
                 <div class="col-sm-2 p-lr-5 text-left" id="detailnirc" style="line-height:30px;" >
                   
                </div>
              </div>

              <div class="row row-sm mg-b-10 p-t-5">
                <div class="col-sm-2 p-lr-5 text-right" style="line-height:30px;" >
                  ဖုန်းနံပါတ် :
                </div>
                 <div class="col-sm-2 p-lr-5 text-left" id="detailphonenumber" style="line-height:30px;" >
                    
                </div>
              </div>
              <div class="row row-sm mg-b-10 p-t-5">
                <div class="col-sm-2 p-lr-5 text-right" style="line-height:30px;" >
                  အီးမေးလ်လိပ်စာ :
                </div>
                 <div class="col-sm-5 p-lr-5" style="line-height:30px;" id="detailemail">
                
                </div>
              </div>
              <div class="row row-sm mg-b-10 p-t-5">
                <div class="col-sm-2 p-lr-5 text-right" style="line-height:30px;" >
                  နေရပ်လိပ်စာ :
                </div>
                 <div class="col-sm-5 p-lr-5" style="line-height:30px;" id="detailaddress">
                asdfasd
                </div>
              </div>
              <div class="row row-sm mg-b-10 p-t-5">
                <div class="col-sm-2 p-lr-5 text-right" style="line-height:30px;" >
                  သွားရောက်လိုသည့်ဌာန  :
                </div>
                 <div class="col-sm-5 p-lr-5" style="line-height:30px;" id="detaildept">
                asdfasd
                </div>
              </div>
              <div class="row row-sm mg-b-10 p-t-5">
                <div class="col-sm-2 p-lr-5 text-right" style="line-height:30px;" >
                  အခြေအနေ :
                </div>
                 <div class="col-sm-5 p-lr-5" style="line-height:30px;" id="detailstatus">
                asdfasd
                </div>
              </div>

              <div class="row row-sm mg-b-10 p-t-5">
                <div class="col-sm-2 p-lr-5 text-right" style="line-height:30px;" >
                  
                </div>
                 <div class="col-sm-5 p-lr-5" style="line-height:30px;" id="detailbutton">
                </div>
              </div>

     </div>
      <div id="listarea">
       <br /><br />
       <?php
       //$active = getactive($mysqli);
       ?>
       <h4> လက်ရှိဧည့်သည်များ </h4>
       <table class="table">
          <thead>
            <tr>
              <th scope="col">#</th>
              <th scope="col">အမည်</th>
              <th scope="col">ကတ်နံပါတ်</th>
              <th scope="col">မှတ်ပုံတင်</th>
              <th scope="col">ဖုန်းနံပါတ်</th>
              <th scope="col">သွားလိုသည့်ဌာန</th>
              <th scope="col">အခြေအနေ</th>
              <th scope="col">စတင်ရောက်ရှိချိန်</th>
            </tr>
          </thead>
          <tbody>
          <?php
            foreach ($active as $key => $value) {
            //echo '<option value="'.$value['name'].'"> '.$value['name'].' </option>';

            if ($value['status'] == "In Session") $color = "green";
            else $color = "orange";

            echo '<tr>
              <th scope="row">'.$value['id'].'</th>
              <td>'.$value['name'].'</td>
              <td><a href="#" onClick="checknumber(\''.$value['cardnumber'].'\')">'.$value['cardnumber'].'</a></td>
              <td>'.$value['nirc'].'</td>
              <td>'.$value['phonenumber'].'</td>
              <td>'.$value['dept'].'</td>
              <td style="color:'.$color.'">'.$value['status'].'</td>
              <td>'.$value['startdatetime'].'</td>
            </tr>';
          }
          ?>
            
            
          </tbody>
        </table>

      </div>
        <form action="savelog.php" method="post" id="dataform" name="dataform" enctype="multipart/form-data">
      <div id="carea" style="display: none;">
        <div class="row row-sm mg-b-10 p-t-5">
          <div class="col-sm-5 p-lr-5">
              <div class="thumbnail">
                  <!-- <img src="https://via.placeholder.com/468x360?text=ID-Image+(Offline)" alt="Nature" style="width:100%">
                  <div class="caption">
                    <p>မှတ်ပုံတင်ပုံ</p>
                  </div> -->

                   <div id="idcam">
                     <video id="video" width="320" autoplay></video>
                     <br />
                     <a class="btn btn-small btn-info" id="snap">ပုံရိုက် <i class="fas fa-camera"></i></a>
                    </div>

                    <div id="idcamsnap" style="display:none; width: 480px;">
                     <canvas id="canvas" name="canvas" width="320" height="240"></canvas>
                     <br />
                      <a class="btn btn-small btn-success" id="review">ထပ်မံရုက်ရန်  <i class="fas fa-retweet"></i></a> 
                   </div>

              </div>
          </div>

          <!-- <div class="col-sm-5 p-lr-5">
              <div class="thumbnail">
                <img src="https://via.placeholder.com/468x360?text=FaceShot+(Offline)" alt="Nature" style="width:100%">
                  <div class="caption text-right">
                    <p>မျက်နှာပုံ</p>
                  </div>
              </div>
          </div> -->
        </div>

        <div class="row row-sm mg-b-10 p-t-5">
          <div class="col-sm-2 p-lr-5 text-right" style="line-height: normal;" >
            ကတ်နံပါတ်
          </div>
           <div id ="vcardplace" class="col-sm-5 p-lr-5">
           </div>
           <input type="hidden" id="vcard" name="vcard" class="form-control">
          
       </div>

       <div class="row row-sm mg-b-10 p-t-5">
          <div class="col-sm-2 p-lr-5 text-right" style="line-height: normal;" >
            အမည်
          </div>
           <div class="col-sm-5 p-lr-5">
           <input type="text" id="name" name="name" class="form-control" required>
          </div>
       </div>

          <div class="row row-sm mg-b-10 p-t-5">
            <div class="col-sm-2 p-lr-5">
              <select id="idtype" name="idtype" class="form-control "> 
                <option value="nirc">နိုင်ငံသားစိစစ်ရေးကတ်</option>
                <option value="other">အခြား</option>
              </select>
            </div>
            <div class="col-sm-1 p-lr-5 nirc_content">
                <select id="nric_region" name="nric_region" class="form-control"> 
                  <option value="၁">၁</option>
                  <option value="၂">၂</option>
                  <option value="၃">၃</option>
                  <option value="၄">၄</option>
                  <option value="၅">၅</option>
                  <option value="၆">၆</option>
                  <option value="၇">၇</option>
                  <option value="၈">၈</option>
                  <option value="၉">၉</option>
                  <option value="၁၀">၁၀</option>
                  <option value="၁၁">၁၁</option>
                  <option value="၁၂">၁၂</option>
                  <option value="၁၃">၁၃</option>
                  <option value="၁၄">၁၄</option>
              </select>
            </div>
            <div class="col-sm-1 p-lr-5  nirc_content">
              <select id="nric_township" name="nric_township" class="form-control"> 
                 <option value="ကတန"> ကတန </option><option value="ကမတ"> ကမတ </option><option value="ကမန"> ကမန </option><option value="ခတဒ"> ခတဒ </option><option value="ခဖန"> ခဖန </option><option value="ခဘဒ"> ခဘဒ </option><option value="ဆဒန"> ဆဒန </option><option value="တနန"> တနန </option><option value="နမန"> နမန </option><option value="ပကတ"> ပကတ </option><option value="ပညန"> ပညန </option><option value="ပတအ"> ပတအ </option><option value="ပဘတ"> ပဘတ </option><option value="ဗမန"> ဗမန </option><option value="မကက"> မကက </option><option value="မကတ"> မကတ </option><option value="မကထ"> မကထ </option><option value="မကန"> မကန </option><option value="မကရ"> မကရ </option><option value="မခဘ"> မခဘ </option><option value="မဂဒ"> မဂဒ </option><option value="မစန"> မစန </option><option value="မညန"> မညန </option><option value="မထန"> မထန </option><option value="မဘန"> မဘန </option><option value="မဘပ"> မဘပ </option><option value="မမန"> မမန </option><option value="မအန"> မအန </option><option value="ရကန"> ရကန </option><option value="ရနက"> ရနက </option><option value="လခန"> လခန </option><option value="လဂန"> လဂန </option><option value="လမန"> လမန </option><option value="ဝမန"> ဝမန </option><option value="သတန"> သတန </option><option value="ဟခန"> ဟခန </option><option value="ဟပန"> ဟပန </option><option value="အခက"> အခက </option><option value="အဂယ"> အဂယ </option><option value="အပန"> အပန </option><option value="ဥမန"> ဥမန </option>
              </select>
            </div>   
            <div class="col-sm-1 p-lr-5  nirc_content">
              <select id="nric_type" name="nric_type" class="form-control"> 
                <option value="နိုင်">နိုင်</option>
                <option value="ဧည့်">ဧည့်</option>
                <option value="ပြု">ပြု</option>
                <option value="ယာ">ယာ</option>
            </select>
            </div>

            <div class="col-sm-2 p-lr-5  nirc_content">
               <input type="number" id="nric_digit" name="nric_digit" class="form-control"  maxlength="6" >
            </div>

            <div class="col-sm-5 p-lr-5 nirc_other" style="display: none;">
                <input type="text" id="nirc_other" name="nirc_other" class="form-control" >
            </div>

          </div>

          <input type="hidden"  id="imgdata" name="imgdata">

          <div class="row row-sm mg-b-10 p-t-5">
            <div class="col-sm-2 p-lr-5 text-right" style="line-height: normal;" >
              ဖုန်းနံပါတ်
            </div>
            <div class="col-sm-5 p-lr-5">
             <input type="text" id="phonenumber" name="phonenumber" class="form-control" >
            </div>
          </div>
          <div class="row row-sm mg-b-10 p-t-5">
            <div class="col-sm-2 p-lr-5 text-right" style="line-height: normal;" >
              အီးမေးလ်လိပ်စာ
            </div>
             <div class="col-sm-5 p-lr-5">
             <input type="text" id="email" name="email" class="form-control" >
            </div>
          </div>
          <div class="row row-sm mg-b-10 p-t-5">
            <div class="col-sm-2 p-lr-5 text-right" style="line-height: normal;" >
              နေရပ်လိပ်စာ
            </div>
             <div class="col-sm-5 p-lr-5">
             <textarea id="address" name="address" class="form-control"></textarea>
            </div>
          </div>

           <div class="row row-sm mg-b-10 p-t-5">
             <div class="col-sm-2 p-lr-5 text-right"  style="line-height: normal;" >
              သွားရောက်လိုသည့်ဌာန 
            </div>
            <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['name'].' </option>';
              }
            ?>
              </select>
              </div>
          </div>

         <div class="row row-sm mg-b-10 p-t-5">
          <div class="col-sm-2 p-lr-5 text-right" style="line-height: normal;" >          
          </div>
           <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">
  var video = document.getElementById('video');
// Get access to the camera!


var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var video = document.getElementById('video');

// Trigger photo take
document.getElementById("snap").addEventListener("click", function() {

  canvas.height = video.videoHeight;
  canvas.width = video.videoWidth;

  context.drawImage(video, 0, 0);
  $("#idcam").hide();
  $("#idcamsnap").show();

  $("#imgdata").val(canvas.toDataURL());

});


document.getElementById("review").addEventListener("click", function() {
  //context.drawImage(video, 0, 0, 640, 480);
  $("#idcam").show();
  $("#idcamsnap").hide();
});

  function nirc_change(rvvalue, tsdiv) {
        //$('#'+tsdiv).innerHTML = "<option> tws </option>";
        $('#'+tsdiv).empty();
        if (rvvalue == '၁') {
                $('#'+tsdiv).append('<option value="ကတန"> ကတန </option><option value="ကမတ"> ကမတ </option><option value="ကမန"> ကမန </option><option value="ခတဒ"> ခတဒ </option><option value="ခဖန"> ခဖန </option><option value="ခဘဒ"> ခဘဒ </option><option value="ဆဒန"> ဆဒန </option><option value="တနန"> တနန </option><option value="နမန"> နမန </option><option value="ပကတ"> ပကတ </option><option value="ပညန"> ပညန </option><option value="ပတအ"> ပတအ </option><option value="ပဘတ"> ပဘတ </option><option value="ဗမန"> ဗမန </option><option value="မကက"> မကက </option><option value="မကတ"> မကတ </option><option value="မကထ"> မကထ </option><option value="မကန"> မကန </option><option value="မကရ"> မကရ </option><option value="မခဘ"> မခဘ </option><option value="မဂဒ"> မဂဒ </option><option value="မစန"> မစန </option><option value="မညန"> မညန </option><option value="မထန"> မထန </option><option value="မဘန"> မဘန </option><option value="မဘပ"> မဘပ </option><option value="မမန"> မမန </option><option value="မအန"> မအန </option><option value="ရကန"> ရကန </option><option value="ရနက"> ရနက </option><option value="လခန"> လခန </option><option value="လဂန"> လဂန </option><option value="လမန"> လမန </option><option value="ဝမန"> ဝမန </option><option value="သတန"> သတန </option><option value="ဟခန"> ဟခန </option><option value="ဟပန"> ဟပန </option><option value="အခက"> အခက </option><option value="အဂယ"> အဂယ </option><option value="အပန"> အပန </option><option value="ဥမန"> ဥမန </option>'); 
                        
        } else if (rvvalue == '၂') {

                $('#'+tsdiv).append('<option value="ကမန">ကမန</option><option value="ကလန">ကလန</option><option value="ကလဝ">ကလဝ</option><option value="ကဝန">ကဝန</option><option value="ဂလန">ဂလန</option><option value="ဒမဆ">ဒမဆ</option><option value="ဒမသ">ဒမသ</option><option value="ပတက">ပတက</option><option value="ဖဆန">ဖဆန</option><option value="ဖရဆ">ဖရဆ</option><option value="ဘလခ">ဘလခ</option><option value="မဂတ">မဂတ</option><option value="မဂဒ">မဂဒ</option><option value="မရန">မရန</option><option value="ရကန">ရကန</option><option value="ရတန">ရတန</option><option value="လကန">လကန</option><option value="လမတ">လမတ</option><option value="အလန">အလန</option><option value="ဥကလ">ဥကလ</option>');

        }  else if (rvvalue == '၃') {

                $('#'+tsdiv).append('<option value="ကကန">ကကန</option><option value="ကကရ">ကကရ</option><option value="ကခန">ကခန</option><option value="ကစက">ကစက</option><option value="ကဆက">ကဆက</option><option value="ကမန">ကမန</option><option value="ကလန">ကလန</option><option value="တကန">တကန</option><option value="တဆက">တဆက</option><option value="တတန">တတန</option><option value="တယန">တယန</option><option value="တအန">တအန</option><option value="နတလ">နတလ</option><option value="ပကန">ပကန</option><option value="ပအန">ပအန</option><option value="ဖပန">ဖပန</option><option value="ဖအန">ဖအန</option><option value="ဗအန">ဗအန</option><option value="ဘကဆ">ဘကဆ</option><option value="ဘလန">ဘလန</option><option value="ဘသဆ">ဘသဆ</option><option value="ဘအန">ဘအန</option><option value="မဝတ">မဝတ</option><option value="လစန">လစန</option><option value="လဘန">လဘန</option><option value="လရန">လရန</option><option value="လသန">လသန</option><option value="သကန">သကန</option><option value="သတက">သတက</option><option value="သတန">သတန</option><option value="သထန">သထန</option><option value="အအန">အအန</option>');
        } else if (rvvalue == '၄') {

                $('#'+tsdiv).append('<option value="ကကန">ကကန</option><option value="ကပလ">ကပလ</option><option value="ကဝလ">ကဝလ</option><option value="တဇန">တဇန</option><option value="တတန">တတန</option><option value="တတလ">တတလ</option><option value="ထတလ">ထတလ</option><option value="ဓမန">ဓမန</option><option value="ပလန">ပလန</option><option value="ပလဝ">ပလဝ</option><option value="ဖပန">ဖပန</option><option value="ဖလန">ဖလန</option><option value="မတန">မတန</option><option value="မတပ">မတပ</option><option value="မမက">မမက</option><option value="မလန">မလန</option><option value="ရဇန">ရဇန</option><option value="ဟခန">ဟခန</option>');
        } else if (rvvalue == '၅') {

                $('#'+tsdiv).append('<option value="ကဆန">ကဆန</option><option value="ကတလ">ကတလ</option><option value="ကနန">ကနန</option><option value="ကဘလ">ကဘလ</option><option value="ကလတ">ကလတ</option><option value="ကလထ">ကလထ</option><option value="ကလန">ကလန</option><option value="ကလဝ">ကလဝ</option><option value="ကလသ">ကလသ</option><option value="ကသန">ကသန</option><option value="ခတန">ခတန</option><option value="ခပန">ခပန</option><option value="ခမန">ခမန</option><option value="ခဥက">ခဥက</option><option value="ခဥတ">ခဥတ</option><option value="ခဥန">ခဥန</option><option value="ငဇန">ငဇန</option><option value="စကန">စကန</option><option value="စကရ">စကရ</option><option value="စသန">စသန</option><option value="ဆကပ">ဆကပ</option><option value="ဆလက">ဆလက</option><option value="ညနန">ညနန</option><option value="တငန">တငန</option><option value="တဆန">တဆန</option><option value="တမန">တမန</option><option value="တသန">တသန</option><option value="ထခန">ထခန</option><option value="ထဥတ">ထဥတ</option><option value="ဒပယ">ဒပယ</option><option value="ဓကန">ဓကန</option><option value="ပဖန">ပဖန</option><option value="ပရန">ပရန</option><option value="ပလန">ပလန</option><option value="ပလဘ">ပလဘ</option><option value="ပလသ">ပလသ</option><option value="ဖပန">ဖပန</option><option value="ဗမန">ဗမန</option><option value="ဘတလ">ဘတလ</option><option value="ဘအန">ဘအန</option><option value="မကန">မကန</option><option value="မမက">မမက</option><option value="မမတ">မမတ</option><option value="မမန">မမန</option><option value="မမရ">မမရ</option><option value="မယန">မယန</option><option value="မရက">မရက</option><option value="မရန">မရန</option><option value="မလန">မလန</option><option value="ယမပ">ယမပ</option><option value="ရတန">ရတန</option><option value="ရတရ">ရတရ</option><option value="ရထန">ရထန</option><option value="ရဘန">ရဘန</option><option value="ရသန">ရသန</option><option value="ရသယ">ရသယ</option><option value="ရအန">ရအန</option><option value="ရဥန">ရဥန</option><option value="လမန">လမန</option><option value="လရန">လရန</option><option value="လဝန">လဝန</option><option value="ဝလန">ဝလန</option><option value="ဝသန">ဝသန</option><option value="သကန">သကန</option><option value="သကလ">သကလ</option><option value="ဟမလ">ဟမလ</option><option value="အတန">အတန</option><option value="အရတ">အရတ</option><option value="အရသ">အရသ</option>');
        } else if (rvvalue == '၆') {

                $('#'+tsdiv).append('<option value="ကစန">ကစန</option><option value="ကပန">ကပန</option><option value="ကယယ">ကယယ</option><option value="ကရန">ကရန</option><option value="ကလအ">ကလအ</option><option value="ကသတ">ကသတ</option><option value="ကသန">ကသန</option><option value="ခမက">ခမက</option><option value="တဂန">တဂန</option><option value="တဓန">တဓန</option><option value="တပန">တပန</option><option value="တဝန">တဝန</option><option value="တသန">တသန</option><option value="တသရ">တသရ</option><option value="ထဝန">ထဝန</option><option value="ပကမ">ပကမ</option><option value="ပတန">ပတန</option><option value="ပနလ">ပနလ</option><option value="ပလတ">ပလတ</option><option value="ပလန">ပလန</option><option value="ပသန">ပသန</option><option value="ဖမန">ဖမန</option><option value="ဗအရ">ဗအရ</option><option value="ဘပန">ဘပန</option><option value="ဘလန">ဘလန</option><option value="မကန">မကန</option><option value="မဂတ">မဂတ</option><option value="မတရ">မတရ</option><option value="မမန">မမန</option><option value="မလန">မလန</option><option value="မလလ">မလလ</option><option value="မအန">မအန</option><option value="မအရ">မအရ</option><option value="ရပန">ရပန</option><option value="ရဖန">ရဖန</option><option value="လကန">လကန</option><option value="လလန">လလန</option><option value="ဝကန">ဝကန</option><option value="ဝထန">ဝထန</option><option value="သရခ">သရခ</option>');
        } else if (rvvalue == '၇') {

                $('#'+tsdiv).append('<option value="ကကခ">ကကခ</option><option value="ကကန">ကကန</option><option value="ကကပ">ကကပ</option><option value="ကကရ">ကကရ</option><option value="ကငန">ကငန</option><option value="ကစန">ကစန</option><option value="ကတခ">ကတခ</option><option value="ကတန">ကတန</option><option value="ကထခ">ကထခ</option><option value="ကပက">ကပက</option><option value="ကပတ">ကပတ</option><option value="ကပန">ကပန</option><option value="ကမက">ကမက</option><option value="ကဝန">ကဝန</option><option value="ကသန">ကသန</option><option value="စခန">စခန</option><option value="စမန">စမန</option><option value="ဇကန">ဇကန</option><option value="ညလပ">ညလပ</option><option value="တငန">တငန</option><option value="တဆန">တဆန</option><option value="တတခ">တတခ</option><option value="တမန">တမန</option><option value="တဝန">တဝန</option><option value="ထတပ">ထတပ</option><option value="ဒဥန">ဒဥန</option><option value="ဓမန">ဓမန</option><option value="ဓဥန">ဓဥန</option><option value="နတလ">နတလ</option><option value="ပခတ">ပခတ</option><option value="ပခန">ပခန</option><option value="ပစန">ပစန</option><option value="ပဇန">ပဇန</option><option value="ပတက">ပတက</option><option value="ပတခ">ပတခ</option><option value="ပတတ">ပတတ</option><option value="ပတန">ပတန</option><option value="ပဓန">ပဓန</option><option value="ပဖန">ပဖန</option><option value="ပမန">ပမန</option><option value="ပလန">ပလန</option><option value="ပဝက">ပဝက</option><option value="ဖခန">ဖခန</option><option value="ဖတန">ဖတန</option><option value="ဖပန">ဖပန</option><option value="ဖမန">ဖမန</option><option value="ဖဥန">ဖဥန</option><option value="ဗတန">ဗတန</option><option value="ဗမန">ဗမန</option><option value="မကန">မကန</option><option value="မခန">မခန</option><option value="မစန">မစန</option><option value="မညန">မညန</option><option value="မတန">မတန</option><option value="မလန">မလန</option><option value="ရကတ">ရကတ</option><option value="ရကန">ရကန</option><option value="ရတန">ရတန</option><option value="ရတရ">ရတရ</option><option value="ရပတ">ရပတ</option><option value="ရမတ">ရမတ</option><option value="ရမန">ရမန</option><option value="လကန">လကန</option><option value="လပတ">လပတ</option><option value="လပန">လပန</option><option value="လမတ">လမတ</option><option value="လမန">လမန</option><option value="ဝခမ">ဝခမ</option><option value="ဝတန">ဝတန</option><option value="ဝမန">ဝမန</option><option value="သ၀တ">သ၀တ</option><option value="သကန">သကန</option><option value="သဆန">သဆန</option><option value="သနပ">သနပ</option><option value="သပန">သပန</option><option value="သလပ">သလပ</option><option value="သလဝ">သလဝ</option><option value="သဝက">သဝက</option><option value="သဝတ">သဝတ</option><option value="သဝန">သဝန</option><option value="အတန">အတန</option><option value="အပန">အပန</option><option value="အဖင">အဖင</option><option value="အဖန">အဖန</option><option value="အဘန">အဘန</option><option value="အမန">အမန</option>');
        } else if (rvvalue == '၈') {

                $('#'+tsdiv).append('<option value="၀ခက">၀ခက</option><option value="ကတက">ကတက</option><option value="ကတတ">ကတတ</option><option value="ကပန">ကပန</option><option value="ကမန">ကမန</option><option value="ကလန">ကလန</option><option value="ခမန">ခမန</option><option value="ဂဂန">ဂဂန</option><option value="ငဖန">ငဖန</option><option value="စတရ">စတရ</option><option value="စလန">စလန</option><option value="ဆတက">ဆတက</option><option value="ဆပန">ဆပန</option><option value="ဆပဝ">ဆပဝ</option><option value="ဆဖန">ဆဖန</option><option value="ဆမန">ဆမန</option><option value="ဆလန">ဆလန</option><option value="တကက">တကက</option><option value="တတက">တတက</option><option value="ထလန">ထလန</option><option value="နပန">နပန</option><option value="နမန">နမန</option><option value="နမဥ">နမဥ</option><option value="နလန">နလန</option><option value="ပကန">ပကန</option><option value="ပခက">ပခက</option><option value="ပခတ">ပခတ</option><option value="ပဖန">ပဖန</option><option value="ပမန">ပမန</option><option value="ဘရန">ဘရန</option><option value="ဘလန">ဘလန</option><option value="မကန">မကန</option><option value="မခက">မခက</option><option value="မခန">မခန</option><option value="မတန">မတန</option><option value="မထန">မထန</option><option value="မနမ">မနမ</option><option value="မဘန">မဘန</option><option value="မမန">မမန</option><option value="မလန">မလန</option><option value="မသန">မသန</option><option value="မအရ">မအရ</option><option value="ရကန">ရကန</option><option value="ရစက">ရစက</option><option value="ရတန">ရတန</option><option value="ရနခ">ရနခ</option><option value="ရမက">ရမက</option><option value="ရဥမ">ရဥမ</option><option value="သရန">သရန</option><option value="သလန">သလန</option><option value="ဟမန">ဟမန</option><option value="အမရ">အမရ</option><option value="အလန">အလန</option><option value="ဥမန">ဥမန</option>');
        } else if (rvvalue == '၉') {

                $('#'+tsdiv).append('<option value="ကကရ">ကကရ</option><option value="ကခတ">ကခတ</option><option value="ကဆန">ကဆန</option><option value="ကပတ">ကပတ</option><option value="ကပဘ">ကပဘ</option><option value="ကဘန">ကဘန</option><option value="ကမကန">ကမကန</option><option value="ကမတ">ကမတ</option><option value="ကမန">ကမန</option><option value="ကဝတ">ကဝတ</option><option value="ကသန">ကသန</option><option value="ခမခ">ခမခ</option><option value="ခမစ">ခမစ</option><option value="ခမန">ခမန</option><option value="ခအဇ">ခအဇ</option><option value="ငဇန">ငဇန</option><option value="ငသရ">ငသရ</option><option value="စကတ">စကတ</option><option value="စကန">စကန</option><option value="စကရ">စကရ</option><option value="စတတ">စတတ</option><option value="စတန">စတန</option><option value="စသန">စသန</option><option value="ဇဇန">ဇဇန</option><option value="ဇပသ">ဇပသ</option><option value="ဇဗသ">ဇဗသ</option><option value="ဇယသ">ဇယသ</option><option value="ညဥန">ညဥန</option><option value="ညဥလ">ညဥလ</option><option value="တကတ">တကတ</option><option value="တကန">တကန</option><option value="တတက">တတက</option><option value="တတဥ">တတဥ</option><option value="တပတ">တပတ</option><option value="တမန">တမန</option><option value="တယန">တယန</option><option value="တသန">တသန</option><option value="ဒခသ">ဒခသ</option><option value="ဒဏသ">ဒဏသ</option><option value="နတက">နတက</option><option value="နထက">နထက</option><option value="ပကခ">ပကခ</option><option value="ပကစ">ပကစ</option><option value="ပခန">ပခန</option><option value="ပတခ">ပတခ</option><option value="ပတန">ပတန</option><option value="ပတလ">ပတလ</option><option value="ပနလ">ပနလ</option><option value="ပဗသ">ပဗသ</option><option value="ပဘန">ပဘန</option><option value="ပမန">ပမန</option><option value="ပလန">ပလန</option><option value="ပသက">ပသက</option><option value="ပသန">ပသန</option><option value="ပဥလ">ပဥလ</option><option value="ဗမန">ဗမန</option><option value="မကန">မကန</option><option value="မခန">မခန</option><option value="မတန">မတန</option><option value="မတမ">မတမ</option><option value="မတရ">မတရ</option><option value="မတလ">မတလ</option><option value="မထလ">မထလ</option><option value="မနက">မနက</option><option value="မနတ">မနတ</option><option value="မနမ">မနမ</option><option value="မနလ">မနလ</option><option value="မပန">မပန</option><option value="မဖန">မဖန</option><option value="မဘန">မဘန</option><option value="မမတ">မမတ</option><option value="မမန">မမန</option><option value="မယတ">မယတ</option><option value="မယမ">မယမ</option><option value="မရက">မရက</option><option value="မရတ">မရတ</option><option value="မရန">မရန</option><option value="မရပ">မရပ</option><option value="မရဘ">မရဘ</option><option value="မရမ">မရမ</option><option value="မရသ">မရသ</option><option value="မလန">မလန</option><option value="မသက">မသက</option><option value="မသန">မသန</option><option value="မသရ">မသရ</option><option value="မဟမ">မဟမ</option><option value="မအဇ">မအဇ</option><option value="မအန">မအန</option><option value="မအရ">မအရ</option><option value="မဥလ">မဥလ</option><option value="ရနခ">ရနခ</option><option value="ရဘန">ရဘန</option><option value="ရမတ">ရမတ</option><option value="ရမသ">ရမသ</option><option value="ရဥန">ရဥန</option><option value="လဆန">လဆန</option><option value="လဝန">လဝန</option><option value="ဝတန">ဝတန</option><option value="ဝထန">ဝထန</option><option value="သကမ">သကမ</option><option value="သခက">သခက</option><option value="သစန">သစန</option><option value="သတန">သတန</option><option value="သဓန">သဓန</option><option value="သပက">သပက</option><option value="သပတ">သပတ</option><option value="သရပ">သရပ</option><option value="အတန">အတန</option><option value="အဓန">အဓန</option><option value="အမဇ">အမဇ</option><option value="အမရ">အမရ</option><option value="ဥတသ">ဥတသ</option>');
        } else if (rvvalue == '၁၀') {

                $('#'+tsdiv).append('<option value="ကကန">ကကန</option><option value="ကတန">ကတန</option><option value="ကထန">ကထန</option><option value="ကမရ">ကမရ</option><option value="ကလန">ကလန</option><option value="ကသန">ကသန</option><option value="ခစန">ခစန</option><option value="ခဆန">ခဆန</option><option value="ခဇန">ခဇန</option><option value="စတန">စတန</option><option value="ဆခန">ဆခန</option><option value="ဇလမ">ဇလမ</option><option value="တဖန">တဖန</option><option value="တမန">တမန</option><option value="တလန">တလန</option><option value="တဝန">တဝန</option><option value="ပခက">ပခက</option><option value="ပဒန">ပဒန</option><option value="ပမန">ပမန</option><option value="ဖပရ">ဖပရ</option><option value="ဘလန">ဘလန</option><option value="မကမ">မကမ</option><option value="မဆန">မဆန</option><option value="မဒန">မဒန</option><option value="မဓန">မဓန</option><option value="မပန">မပန</option><option value="မမန">မမန</option><option value="မလခ">မလခ</option><option value="မလတ">မလတ</option><option value="မလန">မလန</option><option value="မလမ">မလမ</option><option value="မအန">မအန</option><option value="မဥန">မဥန</option><option value="ယပရ">ယပရ</option><option value="ရမန">ရမန</option><option value="လဘန">လဘန</option><option value="လမတ">လမတ</option><option value="လမန">လမန</option><option value="သကန">သကန</option><option value="သခရ">သခရ</option><option value="သတန">သတန</option><option value="သထန">သထန</option><option value="သထလ">သထလ</option><option value="သဖရ">သဖရ</option><option value="သဗရ">သဗရ</option><option value="သမရ">သမရ</option><option value="သလန">သလန</option><option value="အမန">အမန</option><option value="အလန">အလန</option>');
        } else if (rvvalue == '၁၁') {

          $('#'+tsdiv).append('<option value="ကတန">ကတန</option><option value="ကတလ">ကတလ</option><option value="ကဖန">ကဖန</option><option value="ကမန">ကမန</option><option value="ခတန">ခတန</option><option value="ခမန">ခမန</option><option value="ဂမန">ဂမန</option><option value="ဂလမ">ဂလမ</option><option value="စတန">စတန</option><option value="စသန">စသန</option><option value="ဉထသ">ဉထသ</option><option value="တကတ">တကတ</option><option value="တကန">တကန</option><option value="တစန">တစန</option><option value="တပဝ">တပဝ</option><option value="တဖန">တဖန</option><option value="ဒတဂ">ဒတဂ</option><option value="ဓဓန">ဓဓန</option><option value="ပဏက">ပဏက</option><option value="ပဏတ">ပဏတ</option><option value="ပတန">ပတန</option><option value="ပတပ">ပတပ</option><option value="ပသတ">ပသတ</option><option value="ဖအန">ဖအန</option><option value="ဘတသ">ဘတသ</option><option value="ဘလန">ဘလန</option><option value="ဘသတ">ဘသတ</option><option value="မဂန">မဂန</option><option value="မတန">မတန</option><option value="မပတ">မပတ</option><option value="မပန">မပန</option><option value="မပမ">မပမ</option><option value="မလမ">မလမ</option><option value="မအတ">မအတ</option><option value="မအန">မအန</option><option value="မဥန">မဥန</option><option value="ရပန">ရပန</option><option value="ရဗန">ရဗန</option><option value="ရမန">ရမန</option><option value="ရသတ">ရသတ</option><option value="သကန">သကန</option><option value="သတန">သတန</option><option value="အမန">အမန</option>');
        } else if (rvvalue == '၁၂') {

                $('#'+tsdiv).append('<option value="ကကက">ကကက</option><option value="ကခက">ကခက</option><option value="ကခတ">ကခတ</option><option value="ကခန">ကခန</option><option value="ကခရ">ကခရ</option><option value="ကစက">ကစက</option><option value="ကတက">ကတက</option><option value="ကတတ">ကတတ</option><option value="ကတန">ကတန</option><option value="ကတလ">ကတလ</option><option value="ကထက">ကထက</option><option value="ကထထ">ကထထ</option><option value="ကပတ">ကပတ</option><option value="ကပန">ကပန</option><option value="ကဗတ">ကဗတ</option><option value="ကမက">ကမက</option><option value="ကမတ">ကမတ</option><option value="ကမထ">ကမထ</option><option value="ကမန">ကမန</option><option value="ကမရ">ကမရ</option><option value="ကမလ">ကမလ</option><option value="ကလထ">ကလထ</option><option value="ကလန">ကလန</option><option value="ကလဝ">ကလဝ</option><option value="ကသရ">ကသရ</option><option value="ခခန">ခခန</option><option value="ခဂတ">ခဂတ</option><option value="ခပန">ခပန</option><option value="ခမန">ခမန</option><option value="ခရက">ခရက</option><option value="ခရန">ခရန</option><option value="ခရဟ">ခရဟ</option><option value="ဂဟန">ဂဟန</option><option value="စကန">စကန</option><option value="စခဂ">စခဂ</option><option value="စခန">စခန</option><option value="စခမ">စခမ</option><option value="စဂန">စဂန</option><option value="စဇန">စဇန</option><option value="စတန">စတန</option><option value="စပန">စပန</option><option value="စပရ">စပရ</option><option value="ဆကခ">ဆကခ</option><option value="ဆကန">ဆကန</option><option value="ဆခန">ဆခန</option><option value="ဆဖန">ဆဖန</option><option value="တကက">တကက</option><option value="တကတ">တကတ</option><option value="တကန">တကန</option><option value="တခန">တခန</option><option value="တခလ">တခလ</option><option value="တဂတ">တဂတ</option><option value="တငန">တငန</option><option value="တတက">တတက</option><option value="တတတ">တတတ</option><option value="တတထ">တတထ</option><option value="တတန">တတန</option><option value="တတပ">တတပ</option><option value="တထန">တထန</option><option value="တထပ">တထပ</option><option value="တပန">တပန</option><option value="တဖန">တဖန</option><option value="တဗတ">တဗတ</option><option value="တမ">တမ</option><option value="တမတ">တမတ</option><option value="တမန">တမန</option><option value="တဝန">တဝန</option><option value="တသန">တသန</option><option value="ထကန">ထကန</option><option value="ထတတ">ထတတ</option><option value="ထတပ">ထတပ</option><option value="ထတမ">ထတမ</option><option value="ထမန">ထမန</option><option value="ထသန">ထသန</option><option value="ဒကတ">ဒကတ</option><option value="ဒဂဆ">ဒဂဆ</option><option value="ဒဂတ">ဒဂတ</option><option value="ဒဂန">ဒဂန</option><option value="ဒဂမ">ဒဂမ</option><option value="ဒဂရ">ဒဂရ</option><option value="ဒဒရ">ဒဒရ</option><option value="ဒနပ">ဒနပ</option><option value="ဒပန">ဒပန</option><option value="ဒဖန">ဒဖန</option><option value="ဒရန">ဒရန</option><option value="ဒလန">ဒလန</option><option value="ဓခန">ဓခန</option><option value="ဓဓန">ဓဓန</option><option value="ဓနဖ">ဓနဖ</option><option value="ဓနမ">ဓနမ</option><option value="ဓလန">ဓလန</option><option value="နကတ">နကတ</option><option value="နကယ">နကယ</option><option value="နမန">နမန</option><option value="ပကတ">ပကတ</option><option value="ပခန">ပခန</option><option value="ပဂတ">ပဂတ</option><option value="ပစတ">ပစတ</option><option value="ပဆတ">ပဆတ</option><option value="ပဇတ">ပဇတ</option><option value="ပဇန">ပဇန</option><option value="ပတတ">ပတတ</option><option value="ပတန">ပတန</option><option value="ပတအ">ပတအ</option><option value="ပဗက">ပဗက</option><option value="ပဘတ">ပဘတ</option><option value="ပဘန">ပဘန</option><option value="ပမန">ပမန</option><option value="ပရတ">ပရတ</option><option value="ပလန">ပလန</option><option value="ပသတ">ပသတ</option><option value="ပသန">ပသန</option><option value="ပအတ">ပအတ</option><option value="ဖပန">ဖပန</option><option value="ဖဟန">ဖဟန</option><option value="ဗကတ">ဗကတ</option><option value="ဗကလ">ဗကလ</option><option value="ဗဂတ">ဗဂတ</option><option value="ဗတက">ဗတက</option><option value="ဗတတ">ဗတတ</option><option value="ဗတထ">ဗတထ</option><option value="ဗတန">ဗတန</option><option value="ဗတလ">ဗတလ</option><option value="ဗထထ">ဗထထ</option><option value="ဗပန">ဗပန</option><option value="ဗဘတ">ဗဘတ</option><option value="ဗမန">ဗမန</option><option value="ဗယန">ဗယန</option><option value="ဗရက">ဗရက</option><option value="ဗလန">ဗလန</option><option value="ဗလဗ">ဗလဗ</option><option value="ဗဟတ">ဗဟတ</option><option value="ဗဟန">ဗဟန</option><option value="ဘကတ">ဘကတ</option><option value="ဘကလ">ဘကလ</option><option value="ဘတထ">ဘတထ</option><option value="ဘဓန">ဘဓန</option><option value="ဘပတ">ဘပတ</option><option value="ဘလန">ဘလန</option><option value="မကတ">မကတ</option><option value="မကန">မကန</option><option value="မကမ">မကမ</option><option value="မခန">မခန</option><option value="မဂက">မဂက</option><option value="မဂတ">မဂတ</option><option value="မဂဒ">မဂဒ</option><option value="မဂဓ">မဂဓ</option><option value="မဂန">မဂန</option><option value="မဂလ">မဂလ</option><option value="မဂဝ">မဂဝ</option><option value="မဆန">မဆန</option><option value="မဇတ">မဇတ</option><option value="မညန">မညန</option><option value="မတက">မတက</option><option value="မတည">မတည</option><option value="မတတ">မတတ</option><option value="မတထ">မတထ</option><option value="မတန">မတန</option><option value="မတလ">မတလ</option><option value="မထလ">မထလ</option><option value="မဒဂ">မဒဂ</option><option value="မဒန">မဒန</option><option value="မဓန">မဓန</option><option value="မနက">မနက</option><option value="မနမ">မနမ</option><option value="မပန">မပန</option><option value="မဘတ">မဘတ</option><option value="မဘန">မဘန</option><option value="မမက">မမက</option><option value="မမတ">မမတ</option><option value="မယက">မယက</option><option value="မရက">မရက</option><option value="မရတ">မရတ</option><option value="မရန">မရန</option><option value="မလတ">မလတ</option><option value="မလန">မလန</option><option value="မဝတ">မဝတ</option><option value="မသန">မသန</option><option value="မဟန">မဟန</option><option value="မအတ">မအတ</option><option value="မအန">မအန</option><option value="မအပ">မအပ</option><option value="မအရ">မအရ</option><option value="မဥန">မဥန</option><option value="ယပသ">ယပသ</option><option value="ရကတ">ရကတ</option><option value="ရကန">ရကန</option><option value="ရကမ">ရကမ</option><option value="ရတန">ရတန</option><option value="ရပတ">ရပတ</option><option value="ရပသ">ရပသ</option><option value="ရမက">ရမက</option><option value="ရယခ">ရယခ</option><option value="ရလန">ရလန</option><option value="ရသပ">ရသပ</option><option value="လကတ">လကတ</option><option value="လကန">လကန</option><option value="လကပ">လကပ</option><option value="လစန">လစန</option><option value="လတတ">လတတ</option><option value="လတန">လတန</option><option value="လတပ">လတပ</option><option value="လထန">လထန</option><option value="လပတ">လပတ</option><option value="လပန">လပန</option><option value="လဘန">လဘန</option><option value="လမက">လမက</option><option value="လမတ">လမတ</option><option value="လမန">လမန</option><option value="လမရ">လမရ</option><option value="လမသ">လမသ</option><option value="လရန">လရန</option><option value="လလန">လလန</option><option value="လဝန">လဝန</option><option value="လသန">လသန</option><option value="လသမ">လသမ</option><option value="လသယ">လသယ</option><option value="လသရ">လသရ</option><option value="လသသ">လသသ</option><option value="လအန">လအန</option><option value="ဝတန">ဝတန</option><option value="သကက">သကက</option><option value="သကဃ">သကဃ</option><option value="သကတ">သကတ</option><option value="သကန">သကန</option><option value="သကလ">သကလ</option><option value="သခက">သခက</option><option value="သခန">သခန</option><option value="သဃက">သဃက</option><option value="သဃတ">သဃတ</option><option value="သဃန">သဃန</option><option value="သညက">သညက</option><option value="သတက">သတက</option><option value="သတတ">သတတ</option><option value="သတန">သတန</option><option value="သနပ">သနပ</option><option value="သပန">သပန</option><option value="သမန">သမန</option><option value="သရန">သရန</option><option value="သလက">သလက</option><option value="သလတ">သလတ</option><option value="သလန">သလန</option><option value="သလပ">သလပ</option><option value="သလရ">သလရ</option><option value="ဟခန">ဟခန</option><option value="ဟသတ">ဟသတ</option><option value="အခက">အခက</option><option value="အခန">အခန</option><option value="အဂတ">အဂတ</option><option value="အဂန">အဂန</option><option value="အစန">အစန</option><option value="အစရ">အစရ</option><option value="အဆန">အဆန</option><option value="အတန">အတန</option><option value="အထက">အထက</option><option value="အပန">အပန</option><option value="အဖန">အဖန</option><option value="အမတ">အမတ</option><option value="အမန">အမန</option><option value="အလက">အလက</option><option value="အလန">အလန</option><option value="အသန">အသန</option><option value="ဥကက">ဥကက</option><option value="ဥကတ">ဥကတ</option><option value="ဥကထ">ဥကထ</option><option value="ဥကန">ဥကန</option><option value="ဥကပ">ဥကပ</option><option value="ဥကမ">ဥကမ</option><option value="ဥကလ">ဥကလ</option><option value="ဥတက">ဥတက</option><option value="ဥတတ">ဥတတ</option><option value="ဥတမ">ဥတမ</option><option value="ဥပတ">ဥပတ</option><option value="ဥသတ">ဥသတ</option>');
        } else if (rvvalue == '၁၃') {

                $('#'+tsdiv).append('<option value="ကကန">ကကန</option><option value="ကကရ">ကကရ</option><option value="ကခန">ကခန</option><option value="ကခလ">ကခလ</option><option value="ကစန">ကစန</option><option value="ကတတ">ကတတ</option><option value="ကတန">ကတန</option><option value="ကတရ">ကတရ</option><option value="ကတလ">ကတလ</option><option value="ကထန">ကထန</option><option value="ကမန">ကမန</option><option value="ကမရ">ကမရ</option><option value="ကရန">ကရန</option><option value="ကလတ">ကလတ</option><option value="ကလထ">ကလထ</option><option value="ကလဒ">ကလဒ</option><option value="ကလန">ကလန</option><option value="ကသန">ကသန</option><option value="ကသဟ">ကသဟ</option><option value="ကဟန">ကဟန</option><option value="ခရဟ">ခရဟ</option><option value="ငစန">ငစန</option><option value="စကန">စကန</option><option value="ဆဆန">ဆဆန</option><option value="ညကန">ညကန</option><option value="ညရန">ညရန</option><option value="တကန">တကန</option><option value="တခက">တခက</option><option value="တခန">တခန</option><option value="တခလ">တခလ</option><option value="တစလ">တစလ</option><option value="တတန">တတန</option><option value="တထန">တထန</option><option value="တပန">တပန</option><option value="တမည">တမည</option><option value="တယန">တယန</option><option value="တရန">တရန</option><option value="တလန">တလန</option><option value="တဟန">တဟန</option><option value="နခတ">နခတ</option><option value="နခန">နခန</option><option value="နခမ">နခမ</option><option value="နစတ">နစတ</option><option value="နစန">နစန</option><option value="နဆန">နဆန</option><option value="နတယ">နတယ</option><option value="နတရ">နတရ</option><option value="နမက">နမက</option><option value="နမတ">နမတ</option><option value="နမန">နမန</option><option value="ပဆတ">ပဆတ</option><option value="ပဇတ">ပဇတ</option><option value="ပတယ">ပတယ</option><option value="ပဘတ">ပဘတ</option><option value="ပယန">ပယန</option><option value="ပလတ">ပလတ</option><option value="ပလန">ပလန</option><option value="ပသရ">ပသရ</option><option value="ဖခန">ဖခန</option><option value="ဗဆန">ဗဆန</option><option value="ဘအန">ဘအန</option><option value="မကတ">မကတ</option><option value="မကန">မကန</option><option value="မခန">မခန</option><option value="မငန">မငန</option><option value="မဆက">မဆက</option><option value="မဆတ">မဆတ</option><option value="မဆန">မဆန</option><option value="မဆလ">မဆလ</option><option value="မတတ">မတတ</option><option value="မတန">မတန</option><option value="မနတ">မနတ</option><option value="မနန">မနန</option><option value="မပတ">မပတ</option><option value="မပန">မပန</option><option value="မဖတ">မဖတ</option><option value="မဖန">မဖန</option><option value="မဘန">မဘန</option><option value="မမက">မမက</option><option value="မမတ">မမတ</option><option value="မမန">မမန</option><option value="မယတ">မယတ</option><option value="မယန">မယန</option><option value="မရတ">မရတ</option><option value="မရန">မရန</option><option value="မလတ">မလတ</option><option value="မလန">မလန</option><option value="မဟရ">မဟရ</option><option value="မအန">မအန</option><option value="ရကစ">ရကစ</option><option value="ရခန">ရခန</option><option value="ရငန">ရငန</option><option value="ရစန">ရစန</option><option value="ရစရ">ရစရ</option><option value="လကတ">လကတ</option><option value="လကန">လကန</option><option value="လကရ">လကရ</option><option value="လခတ">လခတ</option><option value="လခန">လခန</option><option value="လနန">လနန</option><option value="လရန">လရန</option><option value="လလန">လလန</option><option value="လလရ">လလရ</option><option value="လသန">လသန</option><option value="သကတ">သကတ</option><option value="သနန">သနန</option><option value="သပန">သပန</option><option value="ဟပတ">ဟပတ</option><option value="ဟပန">ဟပန</option><option value="ဟပမ">ဟပမ</option><option value="အတန">အတန</option><option value="ဥကမ">ဥကမ</option>');
        } else if (rvvalue == '၁၄') {

                $('#'+tsdiv).append('<option value="ကကတ">ကကတ</option><option value="ကကထ">ကကထ</option><option value="ကကန">ကကန</option><option value="ကကလ">ကကလ</option><option value="ကခန">ကခန</option><option value="ကတခ">ကတခ</option><option value="ကပတ">ကပတ</option><option value="ကပန">ကပန</option><option value="ကပရ">ကပရ</option><option value="ကဖန">ကဖန</option><option value="ကဘလ">ကဘလ</option><option value="ကမန">ကမန</option><option value="ကမရ">ကမရ</option><option value="ကလန">ကလန</option><option value="ခလန">ခလန</option><option value="ဂသတ">ဂသတ</option><option value="ငဆန">ငဆန</option><option value="ငပတ">ငပတ</option><option value="ငရက">ငရက</option><option value="ငသခ">ငသခ</option><option value="စခမ">စခမ</option><option value="စနဖ">စနဖ</option><option value="စနမ">စနမ</option><option value="ဆကလ">ဆကလ</option><option value="ဇလန">ဇလန</option><option value="ညတန">ညတန</option><option value="ညနတ">ညနတ</option><option value="တကန">တကန</option><option value="တကလ">တကလ</option><option value="တခမ">တခမ</option><option value="တပတ">တပတ</option><option value="တလတ">တလတ</option><option value="တသတ">တသတ</option><option value="ထကက">ထကက</option><option value="ဒဂပ">ဒဂပ</option><option value="ဒဂမ">ဒဂမ</option><option value="ဒဒရ">ဒဒရ</option><option value="ဒနဖ">ဒနဖ</option><option value="ဓနဖ">ဓနဖ</option><option value="ပစလ">ပစလ</option><option value="ပတတ">ပတတ</option><option value="ပတန">ပတန</option><option value="ပတပ">ပတပ</option><option value="ပဖန">ပဖန</option><option value="ပဖမ">ပဖမ</option><option value="ပမန">ပမန</option><option value="ပသန">ပသန</option><option value="ပသယ">ပသယ</option><option value="ပသရ">ပသရ</option><option value="ဖပန">ဖပန</option><option value="ဖမန">ဖမန</option><option value="ဗကလ">ဗကလ</option><option value="ဗတထ">ဗတထ</option><option value="ဗသန">ဗသန</option><option value="ဘကလ">ဘကလ</option><option value="ဘတလ">ဘတလ</option><option value="မကမ">မကမ</option><option value="မကလ">မကလ</option><option value="မဂပ">မဂပ</option><option value="မဆန">မဆန</option><option value="မတန">မတန</option><option value="မနမ">မနမ</option><option value="မပက">မပက</option><option value="မပန">မပန</option><option value="မဘန">မဘန</option><option value="မမက">မမက</option><option value="မမက">မမက</option><option value="မမက">မမက</option><option value="မမတ">မမတ</option><option value="မမန">မမန</option><option value="မလမ">မလမ</option><option value="မသန">မသန</option><option value="မအန">မအန</option><option value="မအပ">မအပ</option><option value="မအဖ">မအဖ</option><option value="မအမ">မအမ</option><option value="ရကန">ရကန</option><option value="ရသယ">ရသယ</option><option value="လပတ">လပတ</option><option value="လပန">လပန</option><option value="လမတ">လမတ</option><option value="လမန">လမန</option><option value="ဝခမ">ဝခမ</option><option value="ဝတန">ဝတန</option><option value="သကတ">သကတ</option><option value="သခမ">သခမ</option><option value="သပန">သပန</option><option value="သမန">သမန</option><option value="ဟကက">ဟကက</option><option value="ဟသတ">ဟသတ</option><option value="ဟသန">ဟသန</option><option value="အခမ">အခမ</option><option value="အဂဒ">အဂဒ</option><option value="အဂပ">အဂပ</option><option value="အမတ">အမတ</option><option value="အမန">အမန</option>');
        }
}

$('#nric_region').on('change', function() {
    nirc_change($(this).val(), 'nric_township');
});

$('#idtype').on('change', function() {
    if($('#idtype').val() == 'other') {
      $(".nirc_content").hide();
      $(".nirc_other").show();

    } else {
       $(".nirc_content").show();
      $(".nirc_other").hide();
    }
});

$('#cardnumber').bind("enterKey",function(e){
   //do stuff here
   if ($("#cardnumber").val() == "") {
      $("#cardnumber").focus();
   } else {
       checknumber($("#cardnumber").val());      
  }

});
$('#cardnumber').keyup(function(e){
    if(e.keyCode == 13)
    {
        $(this).trigger("enterKey");
    }
});

function checknumber(smartcardnumber) {
    var urll = "ajax_getcard.php?smartcardnumber=" + smartcardnumber +  "&tt=" + Date.now();

    $.ajax({
      type: "GET",
      url: urll,
      cache: false,
      success: function(response) {
          var obj = JSON.parse(response);
          if (obj.length == 0) {
              $("#carea").show();
              $("#listarea").hide();
              $("#detail").hide();
              $("#vcardplace").html($("#cardnumber").val());
              $("#vcard").val($("#cardnumber").val());
              $("#name").focus();  

              if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
                  // Not adding `{ audio: true }` since we only want video now
                  navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) {
                      //video.src = window.URL.createObjectURL(stream);
                      video.srcObject = stream;
                      video.play();
                  });
              }

          } else {

              $("#carea").hide();
              $("#listarea").hide();
              $("#detail").show();

              $("#detailname").html(obj[0].name);
              $("#detailemail").html(obj[0].email);
              $("#detailphonenumber").html(obj[0].phonenumber);
              $("#detailaddress").html(obj[0].address);
              $("#detailnirc").html(obj[0].nirc);
              $("#detailcardnumber").html(obj[0].cardnumber);

              $("#faceshot").attr("src",obj[0].imgdata)

              var dellink = ' <a class="btn btn-success my-2 my-sm-0 " href="checkout.php?cid='+obj[0].id+'"> ကတ်ပြန်အပ်  </a>';
              $("#detailbutton").html(dellink);
          }
      }

    });
               
}

$("#cardnumber").focus();

</script>
</html>