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

<?php            
     	$Jumlah = $DataMahasiswa->get_mahasiswa_all('',$b,'jumlah');
		$item = array();
		for ($b=1;$b<=$Jumlah;$b++){
		$NPM = $DataMahasiswa->get_mahasiswa_all('NPM',$b,'');
		$newdata = $NPM;
		array_push($item,$newdata);
	}

?>   

<?php 

	$id = $xcode;
	$NPM = $DataMahasiswa->get_mahasiswa_single_by_id('NPM', $id);
	$nama = $DataMahasiswa->get_mahasiswa_single_by_id('Nama', $id);
	$Jurusan = $DataMahasiswa->get_mahasiswa_single_by_id('Jurusan', $id);
	$tempatLahir = $DataMahasiswa->get_mahasiswa_single_by_id('TempatLahir', $id);
	$tgl = $DataMahasiswa->get_mahasiswa_single_by_id('TglLahir', $id);
	$jenisKelamin = $DataMahasiswa->get_mahasiswa_single_by_id('JenisKelamin', $id);
	$agama = $DataMahasiswa->get_mahasiswa_single_by_id('Agama', $id);
	$alamat = $DataMahasiswa->get_mahasiswa_single_by_id('Alamat', $id);
	$notelp = $DataMahasiswa->get_mahasiswa_single_by_id('NoTelp', $id);
	$email = $DataMahasiswa->get_mahasiswa_single_by_id('Email', $id);
	$asalSekolah = $DataMahasiswa->get_mahasiswa_single_by_id('AsalSekolah', $id);
	$statusPerkawinan = $DataMahasiswa->get_mahasiswa_single_by_id('StatusPerkawinan', $id);
	$statusPekerjaan = $DataMahasiswa->get_mahasiswa_single_by_id('StatusPekerjaan', $id);
	$perusahaan = $DataMahasiswa->get_mahasiswa_single_by_id('Perusahaan', $id);
	$jabatan = $DataMahasiswa->get_mahasiswa_single_by_id('Jabatan', $id);
	$alamatPerusahaan = $DataMahasiswa->get_mahasiswa_single_by_id('AlamatPerusahaan', $id);
	$statusMahasiswa = $DataMahasiswa->get_mahasiswa_single_by_id('StatusMahasiswa', $id);
	$perguruanTinggiAsal = $DataMahasiswa->get_mahasiswa_single_by_id('PerguruanTinggiAsal', $id);
	$programStudi = $DataMahasiswa->get_mahasiswa_single_by_id('ProgramStudi', $id);
	$jenjang = $DataMahasiswa->get_mahasiswa_single_by_id('Jenjang', $id);
	$sks = $DataMahasiswa->get_mahasiswa_single_by_id('SKSDiakui', $id);
?>
<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>

<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-mahasiswa">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">Tambah Data Mahasiswa</h3>
                </div>
                <div class="box-body">
                	<form method="post" action="<?php echo $base?>query-edit-mahasiswa">
                    	<input type="hidden" value="<?php echo $id ?>" name="id">
                        <div class="form-group">
                            <label class="control-label">NPM</label>
                            <input type="text" class="form-control" placeholder="NPM" name="NPM" value="<?php echo $NPM?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Nama</label>
                            <input type="text" name="Nama" required="required" class="form-control"  placeholder="Nama Konsumen" value="<?php echo $nama?>">
                         </div>
                        <div class="form-group">
                            <label class="control-label">Jurusan</label>
                            <select class="form-control" name="Jurusan">
                            	<option value="<?php echo $Jurusan?>"><?php echo $Jurusan?></option>
                            	<option>MANAJEMEN</option>
                                <option>AKUNTANSI</option>
                            </select>
                         </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" value="<?php echo $tempatLahir?>">
                         </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="<?php echo $tgl?>" 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="tgl" 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 value="<?php echo $jenisKelamin?>"><?php echo $jenisKelamin?></option>
                                <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 value="<?php echo $agama?>"><?php echo $agama?></option>
                                <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" required="required" class="form-control"  placeholder="alamat" value="<?php echo $alamat?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">No Telepon</label>
                            <input type="text" name="notelp" required="required" class="form-control"  placeholder="no telepon" value="<?php echo $notelp?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Email</label>
                            <input type="email" name="email" required="required" class="form-control"  placeholder="email" value="<?php echo $email?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Asal Sekolah</label>
                            <input type="text" name="asalSekolah" required="required" class="form-control"  placeholder="asal sekolah" value="<?php echo $asalSekolah?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Status Perkawinan</label>
                            <select class="form-control" name="statusPerkawinan">
                            	<option value="<?php echo $statusPerkawinan?>"><?php echo $statusPerkawinan?></option>
                            	<option>MENIKAH</option>
                                <option>BELUM MENIKAH</option>
                            </select>
                         </div>
                         <div class="form-group">
                            <label class="control-label">Status Pekerjaan</label>
                            <select class="form-control" name="statusPekerjaan">
                            	<option value="<?php echo $statusPekerjaan?>"><?php echo $statusPekerjaan?></option>
                            	<option>SUDAH BEKERJA</option>
                                <option>BELUM BEKERJA</option>
                            </select>
                         </div>
                         <div class="form-group">
                            <label class="control-label">Nama Instansi / Perusahaan</label>
                            <input type="text" name="perusahaan" required="required" class="form-control"  placeholder="nama instansi / perusahaan" value="<?php echo $perusahaan?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Jabatan</label>
                            <input type="text" name="jabatan" required="required" class="form-control"  placeholder="jabatan" value="<?php echo $jabatan?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Alamat Perusahaan</label>
                            <input type="text" name="alamatPerusahaan" required="required" class="form-control"  placeholder="alamat perusahaan" value="<?php echo $alamatPerusahaan?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Status Mahasiswa</label>
                            <input type="text" name="statusMahasiswa" required="required" class="form-control"  placeholder="status mahasiswa" value="<?php echo $statusMahasiswa?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Perguruan Tinggi Asal</label>
                            <input type="text" name="perguruanTinggiAsal" required="required" class="form-control"  placeholder="perguruan tinggi asal" value="<?php echo $perguruanTinggiAsal?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Program Studi</label>
                            <input type="text" name="programStudi" required="required" class="form-control"  placeholder="program studi" value="<?php echo $programStudi ?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">Jenjang</label>
                            <input type="text" name="jenjang" required="required" class="form-control"  placeholder="jenjang" value="<?php echo $jenjang?>">
                         </div>
                         <div class="form-group">
                            <label class="control-label">SKS Diakui</label>
                            <input type="text" name="sks" required="required" class="form-control"  placeholder="sks diakui" value="<?php echo $sks?>">
                         </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>

    	
    	
   