<?php include ("include/head.php");?>
  <section class="main">
       <?php include ("include/header.php");
	$sql = mysqli_query($connect,"select * from db_news where id = '14' ");
	$db = mysqli_fetch_array($sql);
	?>
    <section class="big-banner">
    	    	<section class="banner-in slider" >
	<div class="sli-in">
    <div class="imgban" style=" background:url(uploaded/images/<?php echo $db['image'];?>) center center no-repeat; background-size:cover">  </div>
         <div class="box-breadcrumb">
            <div class="container">
                <div class="row">
                    <article class="col-xs-12 all-bread">
                    
                        <ol class="breadcrumb ">
                         <li class="active">
                          <span class="thh"><?php echo $db['title_th'];?></span>
              			  <span class="enn"><?php echo $db['title_en'];?></span>
                          </li>
                        </ol>
                    </article>
                </div>
            </div>
        </div>
	</div>
</section>
    </section>
    
    <section class="box-info">
    <!--Information Here-->
    <div class="container">
        <div class="row">
            <article class="col-md-7 col-lg-8 cms-area">
                <!--CMS HERE-->
                	<h1><span class="thh"><?php echo $db['title_th'];?></span>
              			  <span class="enn"><?php echo $db['title_en'];?></span></h1>
                    <span class="thh"><?php echo $db['detail_th'];?></span>
              			  <span class="enn"><?php echo $db['detail_en'];?></span>
                <!-- /CMS HERE-->
            </article>
            <?php
			$sqlpdf = mysqli_query($connect,"select * from db_news where status = '12' ");
			$num = mysqli_num_rows($sqlpdf);
			if($num > 0){
	?>
            <article class="col-md-5 col-lg-4 all-pdf">
               <div class="download-pdf">
                    <h1>Download <img src="resources/images/pdf.svg" height="40"></h1>
                </div>
                <nav>
                    <ul class="download-list">
                        <?php while($dbpdf = mysqli_fetch_array($sqlpdf)){ ?>
                        <li>
                        
                        <span class="thh">
                            <a href="uploaded/images/<?php echo $dbpdf['image'];?>" target="_blank">
                                <img src="resources/images/file.svg" height="25">
                                <span class="file-name"><?php echo $dbpdf['title_th'];?></span>
                            </a>
                        </span>
                        
                        <span class="enn">
                            <a href="uploaded/images/<?php echo $dbpdf['title_ch'];?>" target="_blank">
                                <img src="resources/images/file.svg" height="25">
                                <span class="file-name"><?php echo $dbpdf['title_en'];?></span>
                            </a>
                        </span>
                        
                        </li>
                        <?php } ?>
                    </ul>
                </nav>
            </article>
            <?php } ?>
        </div>
        
        <div class="row">
            <article class="col-xs-12">
            	<div class="box-title first-title">
                    <h1 class="title-sub">1. Personal details</h1>
                </div><!--action="print-regis.php" -->
                <form class="form-horizontal form-regis" role="form" method="post" action="data.php">
                        <div class="row">
                        	<!--box1-->
                            <div class="col-sm-6 col-md-4">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Student no.</label>
                                        <input type="text" name="no" class="form-control hcon" placeholder="Student no." >
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Date of birth</label>
                                        <input type="date" name="bdate" class="form-control hcon" placeholder="Date of birth" >
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Religion</label>
                                        <input type="text" name="religion" class="form-control hcon" placeholder="Religion" >
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">ID/Passport no.</label>
                                        <input type="text" name="passport" class="form-control hcon" placeholder="ID/Passport no." >
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Citizen of</label>
                                        <input type="text" name="citi" class="form-control hcon" placeholder="Citizen of" required>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Family name</label>
                                        <input type="text" name="family" class="form-control hcon" placeholder="Family name" required>
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Home address</label>
                                        <textarea rows="3" name="haddress" class="form-control" placeholder="Home address" ></textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Postcode.</label>
                                        <input type="text" name="postcode" class="form-control hcon" placeholder="Postcode." >
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Postal address</label>
                                        <input type="text" name="postal" class="form-control hcon" placeholder="Postal address" >
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Home phone</label>
                                        <input type="text" name="hphone" class="form-control hcon" placeholder="Home phone" required>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Fax</label>
                                        <input type="text" name="hfax" class="form-control hcon" placeholder="Fax" >
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Mobile</label>
                                        <input type="text" name="mobile" class="form-control hcon" placeholder="Mobile" >
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Office address</label>
                                        <textarea rows="3" name="oaddress" class="form-control" placeholder="Office address" ></textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Office phone</label>
                                        <input type="text" name="ophone" class="form-control hcon" placeholder="Office phone" >
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Fax</label>
                                        <input type="text" name="ofax" class="form-control hcon" placeholder="Fax" >
                                    </div>
                                </div>
                            </div>
                             <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Email</label>
                                        <input type="text" name="email" class="form-control hcon" placeholder="Email" required>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Admission date</label>
                                        <input type="date" name="admindate" class="form-control hcon" placeholder="Admission date">
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Present employer's name and address</label>
                                        <textarea rows="3" name="address" class="form-control" placeholder="Text" required></textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-12">
                                <div class="col-xs-12">
                                	<span class="thh"><?php echo $db['caption_th'];?></span>
              			  			<span class="enn"><?php echo $db['caption_en'];?></span>
                                </div>
                            </div>
                            <!--/box1-->
                           
                                                       
                                                  
                            <!--box2-->
                            <input type="hidden" id="numtxt" name="numtxt" value="0">
                            <div class="box-title col-xs-12">
                                <h1 class="title-sub">2. Education (certified copies of other degrees and other certificates must be enclosed)</h1>
                            </div>
                             <table id="myTable">
                                                <!-- head table -->
                                                <thead>
                                                  <tr>
                                                    <td>
                                                        <div id="txttest">
                            <nav>
                                <ul class="TextBoxesGroup">
                                    <li class="col-xs-12 pding">
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Education/degree</label>
                                                  <input type="text" name="degree[]"  class="form-control" placeholder="Education/degree" >
                                              </div>
                                          </div>
                                      </div>
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Institution</label>
                                                  <input type="text" name="tion[]"  class="form-control" placeholder="Institution" >
                                              </div>
                                          </div>
                                      </div>
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Faculty etc.</label>
                                                  <input type="text" name="etc[]"  class="form-control" placeholder="Faculty etc." >
                                              </div>
                                          </div>
                                      </div>
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Exammination year/term</label>
                                                  <input type="text" name="trem[]"  class="form-control" placeholder="Exammination year/term" >
                                              </div>
                                          </div>
                                      </div>
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Final grade</label>
                                                  <input type="text" name="grade[]"  class="form-control" placeholder="Final grade" >
                                              </div>
                                          </div>
                                      </div>
                                      
                                    </li>
                                </ul>
                            </nav>
                             </div>
                            </td>
                                                  </tr>
                                                </thead>
                                                <!-- body dynamic rows -->
                                                <tbody></tbody>
                                                </table>
                            <div class="col-sm-12">
                            	<div class="row">
                                    <div class="col-md-2 btnadd">
                                        <button type="button" class="btn btn-primary btn-block addb" id="createRows">
                                          <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> เพิ่มข้อมูล
                                        </button>
                                    </div>
                                    <div class="col-md-2">
                                        <div class="btnremove">
                                            <button type="button" class="btn btn-danger btn-block removeb" id="deleteRows">
                                              <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> ลบข้อมูล
                                            </button><!--show when add new TextBoxesGroup-->
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--/box2-->
                            
                            <!--box3-->
                            <input type="hidden" id="numtxt2" name="numtxt2" value="0">
                            <div class="box-title col-xs-12">
                                <h1 class="title-sub">3. Work experience after master’s degree etc. </h1>
                            </div>
                              <table id="myTable2">
                                                <!-- head table -->
                                                <thead>
                                                  <tr>
                                                    <td>
                                                        <div id="txttest2">
                            <nav>
                                <ul class="TextBoxesGroup">
                                    <li class="col-xs-12 pding">
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Employer</label>
                                                  <input type="text" name="emp[]"  class="form-control" placeholder="Employer" >
                                              </div>
                                          </div>
                                      </div>
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Position</label>
                                                  <input type="text" name="pos[]"  class="form-control" placeholder="Position" >
                                              </div>
                                          </div>
                                      </div>
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Duration</label>
                                                  <input type="text" name="dura[]"  class="form-control" placeholder="Duration" >
                                              </div>
                                          </div>
                                      </div>
                                    </li>
                                </ul>
                            </nav>
                             </div>
                             
                                </td>
                                                  </tr>
                                                </thead>
                                                <!-- body dynamic rows -->
                                                <tbody></tbody>
                                                </table>
                            <div class="col-sm-12">
                            	<div class="row">
                                    <div class="col-md-2 btnadd">
                                        <button type="button" class="btn btn-primary btn-block addb" id="createRows2">
                                          <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> เพิ่มข้อมูล
                                        </button>
                                    </div>
                                    <div class="col-md-2">
                                        <div class="btnremove">
                                            <button type="button" class="btn btn-danger btn-block removeb" id="deleteRows2">
                                              <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> ลบข้อมูล
                                            </button><!--show when add new TextBoxesGroup-->
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--/box3-->
                            
                            <!--box4-->
                            <input type="hidden" id="numtxt3" name="numtxt3" value="0">
                            <div class="box-title col-xs-12">
                                <h1 class="title-sub">4. Publications prior to admission</h1>
                            </div>
                            <table id="myTable3">
                                                <!-- head table -->
                                                <thead>
                                                  <tr>
                                                    <td>
                                                        <div id="txttest3">
                            <nav>
                                <ul class="TextBoxesGroup ">
                                    <li class="col-xs-12 pding">
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Year</label>
                                                  <input type="text" name="year[]"  class="form-control" placeholder="Year" >
                                              </div>
                                          </div>
                                      </div>
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Title</label>
                                                  <input type="text" name="title[]"  class="form-control" placeholder="Title" >
                                              </div>
                                          </div>
                                      </div>
                                      <div class="col-sm-6 col-md-4">
                                          <div class="form-group">
                                              <div class="col-xs-12">
                                                  <label for="">Published as monograph</label>
                                                  <input type="text" name="pub[]"  class="form-control" placeholder="text" >
                                              </div>
                                          </div>
                                      </div>
                                    </li>
                                </ul>
                            </nav>
                            </div>
                             
                                </td>
                                                  </tr>
                                                </thead>
                                                <!-- body dynamic rows -->
                                                <tbody></tbody>
                                                </table>
                            <div class="col-sm-12">
                            	<div class="row">
                                    <div class="col-md-2 btnadd">
                                        <button type="button" class="btn btn-primary btn-block addb" id="createRows3">
                                          <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> เพิ่มข้อมูล
                                        </button>
                                    </div>
                                    <div class="col-md-2">
                                        <div class="btnremove">
                                            <button type="button" class="btn btn-danger btn-block removeb" id="deleteRows3">
                                              <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> ลบข้อมูล
                                            </button><!--show when add new TextBoxesGroup-->
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--/box4-->
                            
                            <!--box5-->
                            <div class="box-title col-xs-12">
                                <h1 class="title-sub">5. Thesis title (The project description is to be enclosed.)</h1>
                            </div>
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Title in Thai</label>
                                        <input type="text" name="title_th" class="form-control hcon" placeholder="Title in Thai">
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">Title in English</label>
                                        <input type="text" name="title_en" class="form-control hcon" placeholder="Title in English" >
                                    </div>
                                </div>
                            </div>
                            <!--/box5-->
                            
                            <!--box6-->
                            <div class="box-title col-xs-12">
                                <h1 class="title-sub">6. List of enclosures</h1>
                            </div>
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                    	<label for="">List of enclosures:</label>
                                        <textarea rows="7" name="list" class="form-control" placeholder="Text"></textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-12">
                            	<label for="">Signature:</label>
                            </div>
                            
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                        <input type="text" name="sing" class="form-control hcon" placeholder="Place:">
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                        <input type="text" name="date" class="form-control hcon" placeholder="date:" >
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <div class="col-xs-12">
                                        <textarea rows="3" name="note" class="form-control" placeholder="Applicant's signature"></textarea>
                                    </div>
                                </div>
                            </div>
                            <!--/box6-->
                            
                            
                            <div class="col-xs-12">
                                <button type="submit" class="btn btn-update btn-lg btn-join">SUBMIT AND PRINT</button>
                            </div>
                        </div>
                    </form>
            </article>
        </div>
        
    </div>
    <!-- /Information Here-->  
    </section>

</section>
<?php include ("include/footer.php");?>

<script>
$(document).ready(function() {
    $('#menu2').addClass("active")
});
</script>
<script type="text/javascript">
$(document).ready(function(){
	

	$("#createRows").click(function(){
						
						$("#txttest").show();
						
						var txttest = $("#txttest").html();
						var customerid = txttest;
						var num = $("#myTable tr").length;
						var txtnum = num;
						var tr = "<tr>";
						tr = tr + "<td>" + customerid + "</td>";
						tr = tr + "</tr>";
						$('#myTable > tbody:last').append(tr);
						//alert(txtnum);
						$("#numtxt").val(txtnum);
						
						
		});

		$("#deleteRows").click(function(){
				var txt = $("#numtxt").val();
				
				if ($("#myTable tr").length != 1) {
					 $("#myTable tr:last").remove();
					 var total = txt - 1;
					 $("#numtxt").val(total)
				}
		});

		/*--------------------------------------------------------------------------------------------------------*/
		$("#createRows2").click(function(){
						
						$("#txttest2").show();
						
						var txttest = $("#txttest2").html();
						var customerid = txttest;
						var num = $("#myTable2 tr").length;
						var txtnum = num;
						var tr = "<tr>";
						tr = tr + "<td>" + customerid + "</td>";
						tr = tr + "</tr>";
						$('#myTable2 > tbody:last').append(tr);
						//alert(txtnum);
						$("#numtxt2").val(txtnum);
						
						
		});

		$("#deleteRows2").click(function(){
				var txt = $("#numtxt2").val();
				
				if ($("#myTable2 tr").length != 1) {
					 $("#myTable2 tr:last").remove();
					 var total = txt - 1;
					 $("#numtxt2").val(total)
				}
		});

		/*--------------------------------------------------------------------------------------------------------*/
		
		$("#createRows3").click(function(){
						
						$("#txttest3").show();
						
						var txttest = $("#txttest3").html();
						var customerid = txttest;
						var num = $("#myTable3 tr").length;
						var txtnum = num;
						var tr = "<tr>";
						tr = tr + "<td>" + customerid + "</td>";
						tr = tr + "</tr>";
						$('#myTable3 > tbody:last').append(tr);
						//alert(txtnum);
						$("#numtxt3").val(txtnum);
						
						
		});

		$("#deleteRows3").click(function(){
				var txt = $("#numtxt3").val();
				
				if ($("#myTable3 tr").length != 1) {
					 $("#myTable3 tr:last").remove();
					 var total = txt - 1;
					 $("#numtxt3").val(total)
				}
		});
		

	});
</script>