Advertisement
dysphafiz_

Untitled

Oct 23rd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.48 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <style type="text/css">
  5.         body{
  6.             margin: 0;
  7.             padding: 0;
  8.             font-family: agency fb;
  9.             font-size: 24px;
  10.             background-color: gainsboro;
  11.             color: #34495e;
  12.         }
  13.  
  14.         form{
  15.             background: #f1c40f;
  16.             border: 3px #34495e solid;
  17.             border-radius: 7px;
  18.             width: 400px;
  19.             padding: 50px;
  20.             position: absolute;
  21.             transform: translate(-50%, -50%);
  22.             top: 50%;
  23.             left: 50%;
  24.         }
  25.  
  26.         table{
  27.             margin-left: auto;
  28.             margin-right: auto;
  29.         }
  30.  
  31.         input[type='text']{
  32.             border: 0;
  33.             border-radius: 7px;
  34.             display: block;
  35.             transition: 0.7s;
  36.             outline: none;
  37.         }
  38.  
  39.         input[type='text']:focus{
  40.             border: 2px solid #34495e;
  41.         }
  42.  
  43.         input[type="submit"] {
  44.             background: none;
  45.             color: #34495e;
  46.             border: none;
  47.             padding: 5px 15px;
  48.             cursor: pointer;
  49.             transition: 0.4s;
  50.             border-radius: 20px;
  51.         }
  52.  
  53.         input[type="submit"]:hover {
  54.             background: #2c3e50;
  55.             color: #f1c40f;
  56.         }
  57.  
  58.         select, textarea{
  59.             border: 0;
  60.             border-radius: 7px;
  61.             transition: 0.4s;
  62.         }
  63.  
  64.         textarea{
  65.             height: 50px;
  66.             resize: none;
  67.         }
  68.  
  69.         input[type="radio"] {
  70.             cursor: pointer;
  71.         }
  72.        
  73.     </style>
  74. </head>
  75. <body>
  76.     <?php
  77.         $action = 'tambah.php';
  78.         $disable = '';
  79.         if (!empty($siswa)) {
  80.             $action = 'edit.php';
  81.             $disable = 'readonly';
  82.         }
  83.     ?>
  84.     <form action="<?= $action ?>" method="POST">
  85.         <table cellpadding="6">
  86.             <tr>
  87.                 <td>NIS</td>
  88.                 <td><input type="text" name="nis" required="" autocomplete="off" value="<?= @$siswa['nis'] ?>" <?= $disable ?>></td>
  89.             </tr>
  90.             <tr>
  91.                 <td>Nama Lengkap</td>
  92.                 <td><input type="text" name="nama_lengkap" required="" autocomplete="off" value="<?= @$siswa['nama_lengkap'] ?>"></td>
  93.             </tr>
  94.             <tr>
  95.                 <td>Jenis Kelamin</td>
  96.                 <td><input type="radio" name="jenis_kelamin" value="L" required="required" <?= @$siswa['jenis_kelamin'] == 'L' ? 'checked' : ''?>>Laki-Laki&emsp;<input type="radio" name="jenis_kelamin" value="P" required="required" <?= @$siswa['jenis_kelamin'] == 'P' ? 'checked' : ''?>>Perempuan</td>
  97.             </tr>
  98.             <tr>
  99.                 <td>Kelas</td>
  100.                 <td><select name="kelas" required="required">
  101.                     <option value="XI-RPL1" <?= @$siswa['kelas'] == 'XI-RPL1' ? 'selected' : '' ?>>XI-RPL1</option>
  102.                     <option value="XI-RPL2" <?= @$siswa['kelas'] == 'XI-RPL2' ? 'selected' : '' ?>>XI-RPL2</option>
  103.                     <option value="XI-RPL3" <?= @$siswa['kelas'] == 'XI-RPL3' ? 'selected' : '' ?>>XI-RPL3</option>
  104.                 </select></td>
  105.             </tr>
  106.             <tr>
  107.                 <td>Jurusan</td>
  108.                 <td><input type="text" name="jurusan" autocomplete="off" required="required" value=" <?= @$siswa['jurusan'] ?>"></td>
  109.             </tr>
  110.             <tr>
  111.                 <td>Alamat</td>
  112.                 <td><textarea name="alamat"><?php if (!empty($siswa)) {
  113.                     echo $siswa['alamat'];
  114.                 } ?></textarea></td>
  115.             </tr>
  116.             <tr>
  117.                 <td>Golongan Darah</td>
  118.                 <td><select name="gol_darah" required="required">
  119.                     <option value="A" <?= @$siswa['gol_darah'] == 'A' ? 'selected' : ''?>>A</option>
  120.                     <option value="B" <?= @$siswa['gol_darah'] == 'B' ? 'selected' : ''?>>B</option>
  121.                     <option value="AB" <?= @$siswa['gol_darah'] == 'AB' ? 'checked' : ''?>>AB</option>
  122.                     <option value="O" <?= @$siswa['gol_darah'] == 'O' ? 'selected' : ''?>>O</option>
  123.                 </select></td>
  124.             </tr>
  125.             <tr>
  126.                 <td>Nama Ibu Kandung</td>
  127.                 <td><input type="text" name="nama_ibu" autocomplete="off" value="<?= @$siswa['nama_ibu'] ?>"></td>
  128.             </tr>
  129.             <tr>
  130.                 <td><input type="submit" name="submit" value="Simpan"></td>
  131.             </tr>
  132.         </table>
  133.     </form>
  134.     </div>
  135. </body>
  136. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement