Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <style type="text/css">
- body{
- margin: 0;
- padding: 0;
- font-family: agency fb;
- font-size: 24px;
- background-color: gainsboro;
- color: #34495e;
- }
- form{
- background: #f1c40f;
- border: 3px #34495e solid;
- border-radius: 7px;
- width: 400px;
- padding: 50px;
- position: absolute;
- transform: translate(-50%, -50%);
- top: 50%;
- left: 50%;
- }
- table{
- margin-left: auto;
- margin-right: auto;
- }
- input[type='text']{
- border: 0;
- border-radius: 7px;
- display: block;
- transition: 0.7s;
- outline: none;
- }
- input[type='text']:focus{
- border: 2px solid #34495e;
- }
- input[type="submit"] {
- background: none;
- color: #34495e;
- border: none;
- padding: 5px 15px;
- cursor: pointer;
- transition: 0.4s;
- border-radius: 20px;
- }
- input[type="submit"]:hover {
- background: #2c3e50;
- color: #f1c40f;
- }
- select, textarea{
- border: 0;
- border-radius: 7px;
- transition: 0.4s;
- }
- textarea{
- height: 50px;
- resize: none;
- }
- input[type="radio"] {
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <?php
- $action = 'tambah.php';
- $disable = '';
- if (!empty($siswa)) {
- $action = 'edit.php';
- $disable = 'readonly';
- }
- ?>
- <form action="<?= $action ?>" method="POST">
- <table cellpadding="6">
- <tr>
- <td>NIS</td>
- <td><input type="text" name="nis" required="" autocomplete="off" value="<?= @$siswa['nis'] ?>" <?= $disable ?>></td>
- </tr>
- <tr>
- <td>Nama Lengkap</td>
- <td><input type="text" name="nama_lengkap" required="" autocomplete="off" value="<?= @$siswa['nama_lengkap'] ?>"></td>
- </tr>
- <tr>
- <td>Jenis Kelamin</td>
- <td><input type="radio" name="jenis_kelamin" value="L" required="required" <?= @$siswa['jenis_kelamin'] == 'L' ? 'checked' : ''?>>Laki-Laki <input type="radio" name="jenis_kelamin" value="P" required="required" <?= @$siswa['jenis_kelamin'] == 'P' ? 'checked' : ''?>>Perempuan</td>
- </tr>
- <tr>
- <td>Kelas</td>
- <td><select name="kelas" required="required">
- <option value="XI-RPL1" <?= @$siswa['kelas'] == 'XI-RPL1' ? 'selected' : '' ?>>XI-RPL1</option>
- <option value="XI-RPL2" <?= @$siswa['kelas'] == 'XI-RPL2' ? 'selected' : '' ?>>XI-RPL2</option>
- <option value="XI-RPL3" <?= @$siswa['kelas'] == 'XI-RPL3' ? 'selected' : '' ?>>XI-RPL3</option>
- </select></td>
- </tr>
- <tr>
- <td>Jurusan</td>
- <td><input type="text" name="jurusan" autocomplete="off" required="required" value=" <?= @$siswa['jurusan'] ?>"></td>
- </tr>
- <tr>
- <td>Alamat</td>
- <td><textarea name="alamat"><?php if (!empty($siswa)) {
- echo $siswa['alamat'];
- } ?></textarea></td>
- </tr>
- <tr>
- <td>Golongan Darah</td>
- <td><select name="gol_darah" required="required">
- <option value="A" <?= @$siswa['gol_darah'] == 'A' ? 'selected' : ''?>>A</option>
- <option value="B" <?= @$siswa['gol_darah'] == 'B' ? 'selected' : ''?>>B</option>
- <option value="AB" <?= @$siswa['gol_darah'] == 'AB' ? 'checked' : ''?>>AB</option>
- <option value="O" <?= @$siswa['gol_darah'] == 'O' ? 'selected' : ''?>>O</option>
- </select></td>
- </tr>
- <tr>
- <td>Nama Ibu Kandung</td>
- <td><input type="text" name="nama_ibu" autocomplete="off" value="<?= @$siswa['nama_ibu'] ?>"></td>
- </tr>
- <tr>
- <td><input type="submit" name="submit" value="Simpan"></td>
- </tr>
- </table>
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement