Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.61 KB | None | 0 0
  1. <?php include "head.php"; ?>
  2. <!-- Body -->
  3.  
  4.             <!-- Link Menu -->
  5.             <?php include "menu.php"; ?>
  6.  
  7.             </div>
  8.         <br />
  9.  
  10.         <div id="content">
  11.         <!-- Page title -->
  12.             <div class="page-title">
  13.                 <h5><i class="fa fa-desktop"></i> Halaman Admin</h5>
  14.             </div>
  15.             <!-- /page title -->
  16.  
  17.             <!-- Right labels -->
  18.             <form class="form-horizontal" action="mahasiswa_tambah.php" method="post" role="form">
  19.                 <div class="panel panel-default">
  20.                     <div class="panel-heading"><h6 class="panel-title">Calon Atlet Terpilih</h6></div>
  21.                     <div class="panel-body">
  22.  
  23.                         <div class="form-group">
  24.                             <label class="col-sm-2 control-label text-right">Id Calon Atlet:</label>
  25.                             <div class="col-sm-5">
  26.                                 <input type="text" name="id_mhs" class="form-control" value="<?php echo kdauto('calonatlet','CAS-'); ?>" readonly="true" required>
  27.                             </div>
  28.                         </div>
  29.                        
  30.                         <div class="form-group">
  31.                             <label class="col-sm-2 control-label text-right">Nama Calon Atlet:</label>
  32.                             <div class="col-sm-5">
  33.                                 <input type="text" onfocus="if(this.value == 'input nama'){this.value = '';}" value = "input nama" name="nama_mhs" required class="form-control">
  34.                             </div>
  35.                         </div>
  36.                        
  37.                         <div class="form-group">
  38.                             <label class="col-sm-2 control-label text-right">Sprint 300 Meter:</label>
  39.                           <div class="col-sm-5">
  40.                                 <input type="text" onfocus="if(this.value == 'input waktu yang ditempuh dalah satuan detik'){this.value = '';}" value = "input waktu yang ditempuh dalah satuan detik" name="nilai" required class="form-control">
  41.                                 </br><input type="submit" name="submit" value="Konversi" /> </br>
  42.  
  43.     </form>
  44. </br>
  45. <?php
  46. if(isset($_POST['submit'])){
  47. $nilai=$_POST['nilai'];
  48. $hm='Sangat Kurang';
  49. $nm='1';
  50. $nm1='2';
  51. $c1=$nm;
  52. $hm1='Kurang';
  53. if ($nilai>60.04)
  54. {
  55.     echo "Nilai $nm </br>";
  56.     echo "Keterangan $hm";
  57.  
  58.     (KALAU TERPILIH KONDIS INI GIMANA MASUKIN $nm KE DATABASENY?)  
  59. }
  60.  
  61. else if($nilai>57.47)
  62. {
  63.     echo "Nilai $nm1 </br>";
  64.     echo "Keterangan $hm1";
  65.     (KALAU TERPILIH KONDIS INI GIMANA MASUKIN $nm1 KE DATABASENY?)  
  66. }
  67. }
  68.  
  69. ?>
  70.                           </div>
  71.                         </div>
  72.                                                                    
  73.                        
  74.                                                 <div class="form-group">
  75.                             <label class="col-sm-2 control-label text-right">Bleep Test:</label>
  76.                             <div class="col-sm-5">
  77.  
  78.                                 <input type="text" onfocus="if(this.value == 'input level yang ditempuh'){this.value = '';}" value = "input level yang ditempuh" name="c2" required class="form-control">
  79.                             </div>
  80.                         </div>
  81.                        
  82.                                                                         <div class="form-group">
  83.                             <label class="col-sm-2 control-label text-right">Sit Up:</label>
  84.                             <div class="col-sm-5">
  85.                                 <input type="text" onfocus="if(this.value == 'input jumlah'){this.value = '';}" value = "input jumlah" name="c3" required class="form-control">
  86.                             </div>
  87.                         </div>
  88.                        
  89.                                                                                                 <div class="form-group">
  90.                             <label class="col-sm-2 control-label text-right">Back Up:</label>
  91.                             <div class="col-sm-5">
  92.                                 <input type="text" onfocus="if(this.value == 'input jumlah'){this.value = '';}" value = "input jumlah" name="c4" required class="form-control">
  93.                             </div>
  94.                         </div>
  95.                        
  96.                         <div class="form-group">
  97.                             <label class="col-sm-2 control-label text-right">Sprint 40 Meter:</label>
  98.                             <div class="col-sm-5">
  99.                                 <input type="text" onfocus="if(this.value == 'input waktu yang ditempuh dalam satuan detik'){this.value = '';}" value = "input waktu yang ditempuh dalam satuan detik" name="c5" required class="form-control">
  100.                             </div>
  101.                         </div>
  102.                         <div class="form-group">
  103.                             <label class="col-sm-2 control-label text-right">Side Split:</label>
  104.                             <div class="col-sm-5">
  105.                                 <input type="text" onfocus="if(this.value == 'input lebar jarak dalam cm'){this.value = '';}" value = "input lebar jarak dalam cm" name="c6" required class="form-control">
  106.                             </div>
  107.                         </div>
  108.                                                 <div class="form-group">
  109.                             <label class="col-sm-2 control-label text-right">Standing Triple Jump:</label>
  110.                             <div class="col-sm-5">
  111.                                 <input type="text" onfocus="if(this.value == 'input lebar jarak dalam cm'){this.value = '';}" value = "input lebar jarak dalam cm" name="c7" required class="form-control">
  112.                             </div>
  113.                         </div>
  114.                                               <div class="form-group">
  115.                             <label class="col-sm-2 control-label text-right">Push Up:</label>
  116.                             <div class="col-sm-5">
  117.                                 <input type="text" onfocus="if(this.value == 'input jumlah'){this.value = '';}" value = "input jumlah" name="c8" required class="form-control">
  118.                             </div>
  119.                         </div>
  120.                                               <div class="form-group">
  121.                             <label class="col-sm-2 control-label text-right">Shutle Run:</label>
  122.                             <div class="col-sm-5">
  123.                                 <input type="text" onfocus="if(this.value == 'input waktu yang ditempuh dalam satuan detik'){this.value = '';}" value = "input waktu yang ditempuh dalam satuan detik" name="c9" required class="form-control">
  124.                             </div>
  125.                         </div>
  126.                                                                       <div class="form-group">
  127.                             <label class="col-sm-2 control-label text-right">kelas bobot:</label>
  128.                             <div class="col-sm-5">
  129.                                 <input type="text" onfocus="if(this.value == 'input berat badan dalam Kg'){this.value = '';}" value = "input berat badan dalam Kg" name="kelas" required class="form-control">
  130.                             </div>
  131.                         </div>
  132.  
  133.                                         <div class="form-group">
  134.                             <label class="col-sm-2 control-label text-right">kontingen team:</label>
  135.                             <div class="col-sm-10">
  136.                                 <input type="text" onfocus="if(this.value == 'input kontingen'){this.value = '';}" value = "input kontingen" name="team" required class="form-control">
  137.                             </div>
  138.                         </div>
  139.  
  140.  
  141.  
  142.                         <div class="form-actions text-right">
  143.                             <input type="submit" name="simpan" value="Simpan" class="btn btn-primary">
  144.                             <input type="button" name="kembali" value="Kembali" onClick="javascript:history.back()" class="btn btn-default">
  145.                         </div>
  146.  
  147.                     </div>
  148.                 </div>
  149.             </form>
  150. <?php
  151. if(isset($_POST['simpan'])){
  152.     $id_mhs = $_POST['id_mhs'];
  153.     $nama_mhs   = $_POST['nama_mhs'];
  154.     $c1     = $_POST['c1'];
  155.     //$id_klasifikasi       = $_POST['id_klasifikasi'];
  156.     $c2     = $_POST['c2'];
  157.     $c3     = $_POST['c3'];
  158.     $c4     = $_POST['c4'];
  159.     $c5     = $_POST['c5'];
  160.     $c6     = $_POST['c6'];
  161.     $c7     = $_POST['c7'];
  162.     $c8     = $_POST['c8'];
  163.     $c9     = $_POST['c9'];
  164.     $kelas     = $_POST['kelas'];
  165.     $team     = $_POST['team'];
  166.     $nilairanking     = $_POST['nilairanking'];
  167.    
  168.     (KALAU TERPILIH KONDIS INI GIMANA MASUKIN $nm KE DATABASENY?)
  169.  
  170.     $sql="insert into calonatlet values
  171.     ('$id_mhs','$nama_mhs','$c1','$c2','$c3','$c4','$c5','$c6','$c7','$c8','$c9','$kelas','$team','$nilairanking')";
  172.     $query= mysql_query($sql) or die(mysql_error());
  173.     if($query) {
  174.     echo "<script>window.alert('Calon atlet berhasil ditambah');
  175.            window.location=(href='mahasiswa.php')</script>";
  176.     }}
  177. ?>         
  178.             <!-- /right labels -->
  179. <?php include "footer.php";?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement