<?php
defined("BASEPATH") or exit("No direct access allowed");
?>
<div class="card-header">
					
          <nav aria-label="breadcrumb">
                      <ol class="breadcrumb bg-warning text-white-all">
                        <li class="breadcrumb-item"><a href="#"><i class="fas fa-tachometer-alt"></i> Home</a></li>
                        <li class="breadcrumb-item"><a href="index.php?page=listgrup"><i class="far fa-file"></i> Grup</a></li>
                        <li class="breadcrumb-item active" aria-current="page"><i class="fas fa-list"></i> Setting Form Default </li>
                      </ol>
                    </nav>
                    
<div class="alert alert-primary alert-has-icon p-4">
            <div class="alert-icon"><i class="far fa-lightbulb"></i></div>
            <div class="alert-body">
            <div class="alert-title">Petunjuk:</div>
            1. Jika ingin menempatkan gambar dalam isi email, upload gambar <a href="https://postimages.org/" target="_blank">Klik Disini</a>. Kemudian copy dan paste link gambarnya. <br>
            2. Buat Countdown Timer  <a href="https://www.sendtric.com/" target="_blank">DISINI</a> 100% layanannya gratis. Kemudian copy dan paste script atau link gambarnya. 
            
            </div>
            </div>
    
 <?php 

if (isset($_POST['ubah'])){
          
            $id = $_POST['id'] ;
            $f1 = mysqli_real_escape_string($con,$_POST['f1']);
            $f2 = mysqli_real_escape_string($con,$_POST['f2']);
            $f3 = mysqli_real_escape_string($con,$_POST['f3']);

            mysqli_query($con,"update grup set f1='$f1',f2='$f2',f3='$f3' where id='".$_GET['id']."'");
            
               echo '
    		<div class="alert alert-success alert-dismissable" style="margin-top:20px">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <h4><i class="icon glyphicon glyphicon-remove"></i> Data Setting Form Deffault berhasil disimpan
                </div> 
                ';
               
               echo "
               <div class='container'>
                 <form class='form-horizontal' role='form' action='index.php?page=listgrup' method='POST'>
                   <button type='submit' class='btn btn-primary'><span class='glyphicon glyphicon-log-out'></span> Kembali</button>
                 </form>
               </div>
               
               <script>
        	        swal('Good Job','berhasil menyimpan data','success');
                </script>     
                
               " ;
             
}
?>
   
 <?php 
    
      $tampil=mysqli_fetch_row(mysqli_query($con,"select * from grup where id='".$_GET['id']."'"));
      
      

   ?>   

<div class="card-body">            

      <form action="" method="POST">
            <input type="hidden" name="id" value="<?php echo $tampil['id']; ?>">
      
      <form action="" method="POST">
        
        <p>Catatan Header Form:</p>
	    <p><textarea class="ckeditor" name="f1"><?php If(!empty($tampil[11])) { echo $tampil[11]; }?></textarea></p>  
        <p>Catatan Footer Form:</p>
	    <p><textarea class="ckeditor" name="f2"><?php If(!empty($tampil[12])) { echo $tampil[12]; }?></textarea></p>   
        <p><label>Caption Tombol</label><input type="text" name="f3" class="form-control" placeholder="Subscriber" value="<?php echo $tampil[13]; ?>"></p>
        <div class="form-group">
          <div class  ="col-sm-4">
            <button type="submit" class="btn btn-primary" name="ubah"><span class="glyphicon glyphicon-pencil"></span> Simpan Setting Form Default </button>
          </div>
        </div>
      </form>
      Catatan: Custom Field tidak masuk dalam Form Default ini.
    
</div>
    