<div class="navbar navbar-inverse">
	<div class="container" style="z-index: 0">
		<div class="navbar-header">
			<span class="navbar-brand" href="#">Detail Data Mahasiswa</span>
		</div>
	</div><!-- /.container -->
	
</div><!-- /.navbar -->

	<div class="row-fluid well" style="overflow: hidden">
	
		<div class="col-lg-12">
			
		</div>
<!-- /.batas dari ci_lama -->
<?php 
    echo "<div class='col-md-12'>
              <div class='box box-info'>
                
              <div class='box-body'>";
              $attributes = array('class'=>'form-horizontal','role'=>'form');
              echo form_open_multipart('mahasiswa/edit_',$attributes); 
			  echo "<div class='col-md-12'>
                  <table class='table table-condensed table-bordered'>
                  <tbody>
                    <input type='hidden' name='id' value='$rows[mahasiswa_id]'>
					<tr><th scope='row'>Pas Photo</th>          <td>";
                                                                   if ($rows['photo'] != ''){ 
																			echo "<img src='".base_url()."asset/pas_photo/$rows[photo]' height='150' width='150'>"; 
																			}else {
																			echo "<img src='".base_url()."asset/pas_photo/no-image.jpg' height='150' width='150'>"; 	
																			} echo "</td></tr>
					<tr><th width='190px' scope='row'>Kategori Mahasiswa</th>   <td>"; if ($rows['kategori_mahasiswa']=='B') { 
																						echo "<input type='radio' name='a' value='B' checked> Mahasiswa Baru &nbsp; 
																							<input type='radio' name='a' value='P'> Mahasiswa Pindahan &nbsp"; 
																					} else { 
																						echo "<input type='radio' name='a' value='B'> Mahasiswa Baru &nbsp; 
																							<input type='radio' name='a' value='P' checked> Mahasiswa Pindahan &nbsp";
																					} echo "</td></tr>
                    <tr><th  scope='row'>Stambuk</th>    <td><input type='text' class='form-control' name='b' value='$rows[stambuk]' required></td></tr>
					 <tr><th scope='row'>N.I.R.M</th>              	  <td><input type='text' class='form-control' name='c' value='$rows[nim]'></td></tr>
                    <tr><th scope='row'>Nama Mahasiswa</th>           <td><input type='text' class='form-control' name='d' value='$rows[nama_lengkap]' required></td></tr>
					 <tr><th scope='row'>Jenis Kelamin</th>              	 	<td>"; if ($rows['jenis_kelamin']=='L') { 
																			echo "<input type='radio' name='e' value='L' checked> Laki-laki &nbsp; 
																				<input type='radio' name='e' value='P'> Perempuan &nbsp"; 
																		} else { 
																			echo "<input type='radio' name='e' value='L' > Laki-laki &nbsp; 
																				<input type='radio' name='e' value='P' checked> Perempuan &nbsp"; 
																		} echo "</td></tr>
                      <tr><th scope='row'>Agama</th>               	  <td><select name='f' id='f' class='form-control' required>
					
                                                                            <option value='' selected>- Pilih Agama -</option>";
                                                                            foreach ($agama->result_array() as $row){
                                                                                if ($rows['agama_id'] == $row['agama_id']){
                                                                                  echo "<option value='$row[agama_id]' selected>$row[keterangan]</option>";
                                                                                }else{
                                                                                  echo "<option value='$row[agama_id]'>$row[keterangan]</option>";
                                                                                }
                                                                            }
                    echo "</td></tr>
					<tr><th  scope='row'>Alamat</th>    			<td><input type='text' class='form-control' name='g'  value='$rows[alamat]' required></td></tr>
					<tr><th scope='row'>Nomor Telpon/HP</th>    	<td><input type='number' class='form-control' name='h' value='$rows[nomor_hp]' required></td></tr>
					<tr><th scope='row'>Email</th>           		<td><input type='email' class='form-control' name='email' value='$rows[email]'></td></tr>
					<tr><th scope='row'>Angkatan</th>               <td><select name='i' class='form-control' required>
					
                                                                            <option value='' selected>- Pilih Angkatan -</option>";
                                                                            foreach ($angkatan->result_array() as $row){
                                                                                if ($rows['tahun_akademik_id'] == $row['tahun_akademik_id']){
                                                                                  echo "<option value='$row[tahun_akademik_id]' selected>$row[tahun_akademik] - $row[keterangan]</option>";
                                                                                }else{
                                                                                  echo "<option value='$row[tahun_akademik_id]'>$row[tahun_akademik] - $row[keterangan]</option>";
                                                                                }
                                                                            }
                    echo "</td></tr>
					<tr><th scope='row'>Pilihan Reguler</th>   <td>"; if ($rows['reguler']=='Y') { 
																						echo "<input type='radio' name='j' value='Y' checked> Reguler &nbsp; 
																							<input type='radio' name='j' value='N'> Non Reguler &nbsp"; 
																					} else { 
																						echo "<input type='radio' name='j' value='Y'> Reguler &nbsp; 
																							<input type='radio' name='j' value='N' checked> Non Reguler &nbsp";
																					} echo "</td></tr>
					 <tr><th scope='row'>Pilihan Kelas</th>               	  <td><select name='k' id='k' class='form-control' required>
					
                                                                            <option value='' selected>- Pilih Kelas -</option>";
                                                                            foreach ($kelas->result_array() as $row){
                                                                                if ($rows['ruangan_id'] == $row['ruangan_id']){
                                                                                  echo "<option value='$row[ruangan_id]' selected>$row[nama_ruangan]</option>";
                                                                                }else{
                                                                                  echo "<option value='$row[ruangan_id]'>$row[nama_ruangan]</option>";
                                                                                }
                                                                            }
                    echo "</td></tr>
					<tr><th scope='row'>Status</th>   <td>"; if ($rows['status']=='A') { 
																echo "<input type='radio' name='status' value='A' checked> Aktif &nbsp; 
																	<input type='radio' name='status' value='B'> Cuti &nbsp
																	<input type='radio' name='status' value='C'> Lulus &nbsp
																	<input type='radio' name='status' value='D'> Drop Out &nbsp"; 
															} elseif ($rows['status']=='B') { 
																echo "<input type='radio' name='status' value='A' > Aktif &nbsp; 
																	<input type='radio' name='status' value='B' checked> Cuti &nbsp
																	<input type='radio' name='status' value='C'> Lulus &nbsp
																	<input type='radio' name='status' value='D'> Drop Out &nbsp"; 
															}elseif ($rows['status']=='C') { 
																echo "<input type='radio' name='status' value='A' > Aktif &nbsp; 
																	<input type='radio' name='status' value='B' > Cuti &nbsp
																	<input type='radio' name='status' value='C' checked> Lulus &nbsp
																	<input type='radio' name='status' value='D'> Drop Out &nbsp"; 
															} else { 
																echo "<input type='radio' name='status' value='A' > Aktif &nbsp; 
																	<input type='radio' name='status' value='B' > Cuti &nbsp
																	<input type='radio' name='status' value='C' > Lulus &nbsp
																	<input type='radio' name='status' value='D' checked> Drop Out &nbsp"; 
															} echo "</td></tr>														
					<tr><th scope='row'>Username</th>           <td><input type='text' class='form-control' name='username' value='$rows[username]'></td></tr>
					<tr><th scope='row'>Password</th>           <td><input type='password' class='form-control' name='password'></td></tr>																
					 												
				  </tbody>
                  </table>
                </div>
              </div>
              <div class='box-footer'>
                    <button type='submit' name='submit' class='btn btn-primary btn btn-info'><i class='icon icon-ok icon-white'></i> Tambahkan</button>
                   <a href='".base_url()."mahasiswa/list_data'><button type='button' class='btn btn-success btn btn-default pull-right'><i class='icon icon-arrow-left icon-white'></i> Kembali</button></a>
                    
                  </div>
            </div>";
