Advertisement
kangjaz

index_multi.php

Feb 17th, 2018
5,318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.10 KB | None | 0 0
  1. <?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
  2.  
  3. <!DOCTYPE html>
  4. <html lang="en">
  5. <head>
  6.     <meta charset="utf-8">
  7.     <title>Multi Insert CodeIgniter</title>
  8.  
  9.     <style type="text/css">
  10.  
  11.     ::selection { background-color: #E13300; color: white; }
  12.     ::-moz-selection { background-color: #E13300; color: white; }
  13.  
  14.     body {
  15.         background-color: #fff;
  16.         margin: 40px;
  17.         font: 13px/20px normal Helvetica, Arial, sans-serif;
  18.         color: #4F5155;
  19.     }
  20.  
  21.     h1 {
  22.         color: #444;
  23.         background-color: transparent;
  24.         border-bottom: 1px solid #D0D0D0;
  25.         font-size: 19px;
  26.         font-weight: normal;
  27.         margin: 0 0 14px 0;
  28.         padding: 14px 15px 10px 45px;
  29.     }
  30.  
  31.     #body {
  32.         margin: 0 15px 0 15px;
  33.     }
  34.  
  35.     p.footer {
  36.         text-align: right;
  37.         font-size: 13px;
  38.         border-top: 1px solid #D0D0D0;
  39.         line-height: 32px;
  40.         padding: 0 40px 0 10px;
  41.         margin: 30px 0 0 0;
  42.     }
  43.  
  44.     #container {
  45.         margin: 10px;
  46.         border: 1px solid #D0D0D0;
  47.         box-shadow: 0 0 8px #D0D0D0;
  48.     }
  49.  
  50.    input[type="text"],
  51.    input[type="number"] {
  52.       padding: 5px 10px 5px 10px;
  53.       margin: 5px;
  54.    }
  55.  
  56.    button[type="submit"] {
  57.       padding: 8px;
  58.       border-radius: 0px;
  59.       background: #005fb6;
  60.       border: 1px solid #1a79d1;
  61.       color: #fefefe;
  62.       cursor: pointer;
  63.    }
  64.  
  65.    button[type="reset"] {
  66.       padding: 8px;
  67.       border-radius: 0px;
  68.       background: #aa3535;
  69.       border: 1px solid #9e3232;
  70.       color: #fefefe;
  71.       cursor: pointer;
  72.    }
  73.     </style>
  74. </head>
  75. <body>
  76.  
  77. <div id="container">
  78.     <h1>Multi Insert CodeIgniter</h1>
  79.  
  80.     <div id="body">
  81.  
  82.       <form action="" method="post">
  83.          <fieldset>
  84.             <legend><b>Tambah Anggota</b></legend>
  85.             <?php for($i=0; $i < 4; $i++) : ?>
  86.                <input type="text" name="nama[]" value="" placeholder="Nama Anggota">
  87.                <input type="number" name="telp[]" value="" placeholder="Nomor HP">
  88.                <br />
  89.             <?php endfor; ?>
  90.             <br />
  91.             <button type="submit" name="submit" value="submit">Simpan Data</button>
  92.             <button type="reset" name="reset">Reset Data</button>
  93.          </fieldset>
  94.       </form>
  95.  
  96.       <h4>Daftar Anggota</h4>
  97.       <table style="width: 50%" border='1'>
  98.          <thead>
  99.             <tr>
  100.                <th>#</th>
  101.                <th>Nama Anggota</th>
  102.                <th>Telp</th>
  103.             </tr>
  104.          </thead>
  105.  
  106.          <tbody>
  107.             <?php
  108.            if ($data->num_rows() < 1)
  109.            {
  110.               echo '<tr><td colspan="3" align="center">Belum Ada Data</td></tr>';
  111.             }
  112.             else
  113.             {
  114.                $i = 1;
  115.  
  116.                foreach ($data->result() as $key) {
  117.                   echo '<tr>
  118.                            <td align="center">'.$i++.'</td>
  119.                            <td align="center">'.$key->nama_anggota.'</td>
  120.                            <td align="center">'.$key->telp.'</td>
  121.                         </tr>';
  122.                }
  123.             }
  124.             ?>
  125.          </tbody>
  126.       </table>
  127.     </div>
  128.  
  129.     <p class="footer">https://kangjaz.blogspot.co.id</p>
  130. </div>
  131.  
  132. </body>
  133. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement