Sefti

edit.php

Nov 6th, 2017
2,295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.60 KB | None | 0 0
  1. <?php
  2. // Notifikasi kalo ada input error
  3. echo validation_errors('<div class="alert alert-danger"><i class="fa fa-warning"></i> ', '</div>');
  4.  
  5. // kalau ada error upload maka akan tampil notifikasi
  6. if(isset($gagal)){
  7.     echo '<div class="alert alert-warning">';
  8.     echo $gagal;
  9.     echo '</div>';
  10.  
  11. }
  12.  
  13. //Open form
  14.  
  15. ?>
  16. <?php
  17. echo form_open_multipart(base_url('admin/posting/edit/'.$posting->id_posting));
  18. ?>
  19.  
  20. <div class='col-md-8'>
  21.     <div class="form-group">
  22.         <label>Judul Posting</label>
  23.         <input type="text" name="judul_posting" class="form-control" placeholder="Judul Posting" value="<?php echo $posting->judul_posting ?>">
  24.        
  25.     </div>
  26. </div> 
  27.  
  28. <div class="col-md-4">
  29.     <div class="form-group">
  30.         <label> Status Posting</label>
  31.         <select name="status_posting" class="form-control">
  32.             <option value="Publish">Publish</option>
  33.             <option value="Draft" <?php if($posting->status_posting == "Draft"){echo "selected";}?>>Draft</option>
  34.         </select>
  35.     </div>
  36. </div>
  37.  
  38. <div class="col-md-4">
  39.     <div class="form-group">
  40.         <label> Jenis Posting</label>
  41.         <select name="jenis_posting" class="form-control">
  42.             <option value="Posting">Posting</option>
  43.             <option value="Slider" <?php if($posting->jenis_posting == "Slider"){echo "selected";}?>>Slider</option>
  44.         </select>
  45.     </div>
  46. </div>
  47.  
  48. <div class="col-md-4">
  49.     <div class="form-group">
  50.         <label>Upload Gambar</label>
  51.         <input type="file" name="gambar" class="form-control" placeholder="Upload Gambar">
  52.     </div>
  53. </div>
  54.  
  55. <div class="col-md-4">
  56.     <div class="form-group">
  57.     <label>Kategori</label>
  58.         <select name="tags[]" multiple="multiple" class="form-control js-example-basic-multiple">
  59.         <?php foreach($tags as $kategori):?>   
  60.             // Scriptnya gimana nih master - master ?
  61.             <option value="<?php echo $kategori->nama_tag?>" <?php // KODENYA DISINI GIMANA ? ?> ><?php echo $kategori->nama_tag?></option>
  62.         <?php endforeach;?>
  63.         </select>
  64.     </div>
  65. </div>
  66.  
  67. <div class="col-md-12">
  68.     <div class="form-group">
  69.         <label>Isi Posting</label>
  70.         <textarea name="isi" class="form-control editor-posting" placeholder="Isi Posting" rows="10"><?php echo $posting->isi ?></textarea>
  71.     </div>
  72. </div>
  73.  
  74. <div class="col-md-12 text-right">
  75.  
  76.     <div class="form-group">
  77.         <input type="submit" name="submit" class="btn btn-primary btn-lg" value="Simpan Data">
  78.         <input type="reset" name="resete" class="btn btn-default btn-lg" value="Reset">
  79.     </div> 
  80.    
  81. </div>
  82.  
  83. <?php
  84. // Form close
  85. echo form_close();
  86. ?>
  87. <!-- Script Select2 -->
  88. <script>
  89. $(document).ready(function() {
  90.     $('.js-example-basic-multiple').select2({
  91.         placeholder: 'Pilih Kategori',
  92.  
  93.     });
  94. });
  95. </script>
Advertisement
Add Comment
Please, Sign In to add comment