Advertisement
risaru

artikel

May 29th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.72 KB | None | 0 0
  1. <?php
  2. error_reporting(-1);
  3. require "includes/header.php";
  4. require "includes/config.php";
  5. ?>
  6.  
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <!-- TinyMCE -->
  11. <script type="text/javascript" src="includes/tinymce/tinymce.min.js"></script>
  12. <script type="text/javascript">
  13. tinymce.init({
  14.     selector: "textarea",
  15.     theme: "modern",
  16.     plugins: [
  17.         "advlist autolink lists link image charmap print preview hr anchor pagebreak",
  18.         "searchreplace wordcount visualblocks visualchars code fullscreen",
  19.         "insertdatetime media nonbreaking save table contextmenu directionality",
  20.         "emoticons template paste textcolor colorpicker textpattern"
  21.     ],
  22.     toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
  23.     toolbar2: "print preview media | forecolor backcolor emoticons",
  24.     image_advtab: true,
  25.     templates: [
  26.         {title: 'Test template 1', content: 'Test 1'},
  27.         {title: 'Test template 2', content: 'Test 2'}
  28.     ]
  29. });
  30. </script>
  31. </head>
  32. <body>
  33.         <div class="container">
  34.             <div class="hero-unit">
  35.             <?php
  36.             //ambil dari absen
  37.         if (isset($_GET['edit'])) {
  38.  
  39.             $query = mysql_query("SELECT * from absen WHERE id='".$_GET['edit']."'");
  40.             $hasil = mysql_fetch_array ($query);
  41.             $id = $hasil['id'];
  42.             $nama = $hasil['nama'];
  43.             $web = $hasil['web'];
  44.             $desk = $hasil['desk'];
  45.             $email = $hasil['email'];
  46.             ?>
  47.             #Edit Data
  48.             <FORM ACTION="includes/artikel_edit.php" METHOD="POST" NAME="input" enctype="multipart/form-data">
  49.                 <table width="100%px" border="0">
  50.                     <thead>
  51.                             <tr>
  52.                                 <td><input name="id" type="text" size="40"  placeholder="Absen" value="<?=$id?>" readonly disable="disabled"/></td>
  53.                             </tr>
  54.                             <tr>
  55.                                 <td><input name="nama" type="text" size="40"  placeholder="Nama Lengkap" value="<?=$nama?>"/></td>
  56.                             </tr>
  57.                             <tr>
  58.                                 <td><input name="web" type="text" size="40"  placeholder="yourwebsite.com" value="<?=$web?>"/></td>
  59.                             </tr>
  60.                             <tr>
  61.                                 <td><input name="email" type="email" size="40"  placeholder="Email" value="<?=$email?>" required autofocus/></td>
  62.                             </tr>
  63.                             <tr>
  64.                                 <td><textarea id="elm1" name="desk" rows="15" cols="60"><?=$desk?></textarea></td>
  65.                             </tr>
  66.                             <tr>
  67.                                 <td colspan="2"><input type="submit" name="Edit" value="Submit"class="btn btn-inverse"/></td>
  68.                             </tr>
  69.                     </thead>
  70.                 </table>
  71.             </form>
  72.             <?php
  73.         } else {
  74.             if (!empty($_GET['input']) && $_GET['input'] == 'success') {
  75.                 echo '<h3>Berhasil Kirim Data!</h3>';
  76.                 }      
  77.             ?>
  78.                 <form name="input_data" action="includes/artikel_input.php" method="post">
  79.                     <table class="none">     
  80.                         <thead>
  81.                             <tr>
  82.                                 <td>
  83.                                     <select name="id">
  84.                                         <option selected>-Absen-</option>
  85.                                         <option>1</option>
  86.                                         <option>2</option>
  87.                                         <option>3</option>
  88.                                         <option>4</option>
  89.                                         <option>5</option>
  90.                                         <option>6</option>
  91.                                         <option>7</option>
  92.                                         <option>8</option>
  93.                                         <option>9</option>
  94.                                         <option>10</option>
  95.                                         <option>11</option>
  96.                                         <option>12</option>
  97.                                         <option>13</option>
  98.                                         <option>14</option>
  99.                                         <option>15</option>
  100.                                         <option>16</option>
  101.                                         <option>17</option>
  102.                                         <option>18</option>
  103.                                         <option>19</option>
  104.                                         <option>20</option>
  105.                                         <option>21</option>
  106.                                         <option>22</option>
  107.                                         <option>23</option>
  108.                                         <option>23</option>
  109.                                         <option>24</option>
  110.                                         <option>25</option>
  111.                                         <option>26</option>
  112.                                         <option>27</option>
  113.                                         <option>28</option>
  114.                                         <option>29</option>
  115.                                         <option>30</option>
  116.                                     </select>
  117.                                 </td>
  118.                             </tr>
  119.                             <tr>
  120.                                 <td><input name="nama" type="text" size="40"  placeholder="Nama Lengkap" required autofocus/></td>
  121.                             </tr>
  122.                             <tr>
  123.                                 <td><input name="web" type="text" size="40"  placeholder="www.yourwebsite.com" required autofocus/></td>
  124.                             </tr>
  125.                             <tr>
  126.                                 <td><input name="email" type="email" size="40"  placeholder="Email" required autofocus/></td>
  127.                             </tr>
  128.                             <tr>
  129.                                 <td><textarea id="elm1" name="desk" rows="15" cols="60" ></textarea></td>
  130.                             </tr>
  131.                             <tr>
  132.                                 <td><input type="submit" name="input" value="Submit" class="btn btn-inverse"/>
  133.                                 <input type="reset" name="reset" value="Reset" class="btn btn-inverse"></td>
  134.                             </tr>
  135.                         </thead>
  136.                     </table>
  137.                 </form>
  138.                 <?php } ?>
  139.             </div>
  140.         </div>
  141. </body>
  142. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement