<?php
	include "php_class/class_mysql.php";
	include "php_class/class_mahasiswa.php";
	$DataMahasiswa = new DataMahasiswa;
?>

<link href="<?php echo $base?>plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $base?>plugins/iCheck/all.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $base?>plugins/timepicker/bootstrap-timepicker.min.css" rel="stylesheet"/>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/timepicker/bootstrap-timepicker.min.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/iCheck/icheck.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $base?>plugins/autocomplete/shieldui-all.css" />
<link href="<?php echo $base?>bootstrap/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="<?php echo $base?>bootstrap/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="<?php echo $base?>bootstrap/js/locales/bootstrap-datetimepicker.id.js" charset="UTF-8"></script>
<script type="text/javascript" src="<?php echo $base?>plugins/autocomplete/shieldui-all.min.js"></script>
<script type="text/javascript">
    var countries = <?php echo json_encode($item);?>;
		
		jQuery(function ($) {
        $("#NPM").shieldAutoComplete({
            dataSource: {
                data: countries
            },
            minLength: 1
        });
        
    });
</script>
<script>
	$(document).ready(function(){
		$('#NPM').keyup(function(e){
	  		if(e.keyCode == 13){
				var npm = $('#NPM').val();
				var action = '3';
				if (npm==''){
					$('.peringatan').html('<div id="warning"><div class="alert alert-warning" role="alert">NPM Masih Kosong!</div></div>')			
				}else{
					$.ajax({
						type:"POST",
						data: "index=" + npm + "&action=" + action,
						url:"<?php echo $base?>cek-npm.php",     
						success: function(data){
							var tampung = data;
							if(tampung!=404){
								$('.peringatan').html('<div id="warning"><div class="alert alert-warning" role="alert">NPM sudah ada!</div></div>')	
								$('#Nama').val(data);
							}else{
								$('.peringatan').html('<div id="warning"><div class="alert alert-warning" role="alert">!!!</div></div>')
								$('#Nama').focus();	
								}
						}
					});
				}
			} 
		});
	});
</script>
<section class="content-header">
  <h1>
   Data Mahasiswa
  </h1>
  <ol class="breadcrumb">
    <li><a href="<?php echo $base?>"><i class="fa fa-dashboard"></i> Home</a></li>
    <li><a href="<?php echo $base?>data-konsumen">Data Mahasiswa</a></li>
    <li class="active">Tambah Data Mahasiswa</li>
  </ol>
</section>
<section class="content">
 	<div class="row">
    	<div class="row">
        	<div class="col-md-12">
            </div>
        </div>
    	<div class="col-md-12">
        	 <div class="box box-info">
                <div class="box-header">
                  <h3 class="box-title">Pendaftaran Mahasiswa</h3>
                </div>

                <div class="box-body">
                <div class="peringatan">
                </div>
                	<form method="post" action="<?php echo $base?>query-add-pendaftaran">
                        <div class="form-group">
                            <label class="control-label">Jurusan</label>
                            <div class="radio">
                            	<label><input type="radio" value="AKUNTANSI" name="Jurusan" required="required">AKUNTANSI</label>
                            </div>
                            <div class="radio">
                            	<label><input type="radio" value="MANAJEMEN" name="Jurusan" required="required">MANAJEMEN</label>
                            </div>
                            <div class="radio">
                            	<label><input type="radio" value="IESP" name="Jurusan" required="required">IESP</label>
                            </div>
                         </div>
                         <div class="form-group">
                            <label class="control-label">Nama</label>
                            <input type="text" name="Nama" required="required" class="form-control"  placeholder="Nama Konsumen" id="Nama">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Tempat Lahir</label>
                            <input type="text" name="tempatLahir" required="required" class="form-control"  placeholder="Tempat Lahir">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Tanggal Lahir</label>
                            <div class="input-group date form_date" data-date="" data-date-format="dd-mm-yyyy" data-link-field="tglspk">
                                <input required="required" class="form-control" type="text" value="" placeholder="tanggal lahir" readonly>
                                <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                                <input type="hidden" id="tglspk" name="tgl" value="" />
                                <script type="text/javascript">
                                    $('.form_date').datetimepicker({
                                        language:  'id',
                                        weekStart: 1,
                                        todayBtn:  1,
                                        autoclose: 1,
                                        todayHighlight: 1,
                                        startView: 2,
                                        minView: 2,
                                        forceParse: 0
                                    });
                                </script>  
                            </div>
 		                 </div>
                         <div class="form-group">
                            <label class="control-label">Jenis Kelamin</label>
                            <select class="form-control" name="jenisKelamin">
                            	<option>PRIA</option>
                                <option>WANITA</option>
                            </select>
                         </div>
                         <div class="form-group">
                            <label class="control-label">Agama</label>
                            <select class="form-control" name="agama">
                            	<option>ISLAM</option>
                                <option>HINDU</option>
                                <option>BUDHA</option>
                                <option>KRISTEN PROTESTAN</option>
                                <option>KRISTEN KATOLIK</option>
                                <option>KONGHUCU</option>
                            </select>
                         </div>
                         <div class="form-group">
                            <label class="control-label">Alamat</label>
                            <input type="text" name="alamat" class="form-control"  placeholder="alamat" required="required">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Desa</label>
                            <input type="text" name="desa" class="form-control"  placeholder="desa" required="required">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Kecamatan</label>
                            <input type="text" name="kecamatan" class="form-control"  placeholder="kecamatan" required="required">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Kabupaten</label>
                            <input type="text" name="kabupaten" class="form-control"  placeholder="kabupaten" required="required">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Provinsi</label>
                            <input type="text" name="provinsi" class="form-control"  placeholder="alamat" required="required">
                         </div>
                         <div class="form-group">
                            <label class="control-label">No Telepon</label>
                            <input type="text" name="notelp"  class="form-control"  placeholder="no telepon" required="required">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Email</label>
                            <input type="text" name="email"  class="form-control"  placeholder="email" required="required">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Asal Sekolah</label>
                            <input type="text" name="asalSekolah"  class="form-control"  placeholder="asal sekolah" required="required">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Nama Ibu</label>
                            <input type="text" name="orangtua"  class="form-control"  placeholder="nama ibu" required="required">
                         </div>
                         <div class="form-group">
                            <button type="submit" class="btn btn-default"><i class='glyphicon glyphicon-ok'></i> Simpan</button>
                          </div>
                    </form>
                </div>
               </div>
         </div>
    </div>
</section>

    	
    	
   