https://t.me/RX1948
Server : Apache/2.4.18 (Ubuntu)
System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64
User : oppastar ( 1041)
PHP Version : 7.0.33-0ubuntu0.16.04.15
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Directory :  /var/www/rabbithabit.com/public_html/application/views/admin/vouchers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/rabbithabit.com/public_html/application/views/admin/vouchers/edit.php
<div class="row">
    <div class="col-sm-12">
        <p><a href="<?= base_url('admin/vouchers'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke halaman Voucher</a></p><br>
        <h4><?= empty($vouchers->id_vouchers) ? 'Tambah voucher baru' : 'Edit voucher: ' 
    	. $vouchers->voucher_code; ?></h4> 
        <?= $this->session->flashdata('success'); //to display success message ?> 
        <?= $this->session->flashdata('result'); //to display result message ?>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 
 
<?= form_open(); ?>

<div class="row"> 
    <div class="col-sm-3">
        <p>Nama Voucher</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
        <p>
        <?php
        $data = array(  
            'name'        => 'voucher_name',
            'value'       => $vouchers->voucher_name,
            'class'       => 'form-control'
         );
        echo form_input($data); ?>
        <?= form_error('voucher_name'); ?></p>
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row -->  

<div class="row"> 
    <div class="col-sm-3">
        <p>Kode Voucher<br>
            (Contoh: IGXQVWVP)</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
        <p>
        <?php
        $data = array(  
            'name'        => 'voucher_code',
            'value'       => $vouchers->voucher_code,
            'class'       => 'form-control'
         );
        echo form_input($data); ?>
        <?= form_error('voucher_code'); ?></p>
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row"> 
    <div class="col-sm-3">
        <p>Tipe Voucher</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
        <p><strong>Promo Normal</strong>: Promo biasa. Bila memasukan kode voucher di Periksa, maka ada diskon berdasarkan persentase atau jumlah.</p>
        <p><strong>Promo Ulang Tahun</strong>: Misal Promo Agustus. Promo yang hanya berlaku untuk pelanggan yang ulang tahun di bulan agustus.
        <!-- <p><strong>Gender Promo</strong>: Misal Promo Cowok. Promo ini hanya berlaku untuk customer yang gender nya Cowok saja.</p> -->
        <p><strong>Promo Waktu</strong>: Misal Promo Penjualan Tengah Malam. Promo ini akan berjalan ketika jam 00.00 s/d jam 02.00 saja.</p>
        <p><strong>Promo Provinsi</strong>: Misal Promo Jawa Timur. Promo ini hanya berlaku untuk pelanggan yang beralamat di Jawa Timur saja. Ia akan dapat gratis ongkir atau diskon 10% untuk total pembayaran.</p>
        <p><strong>Promo Jumlah</strong>: Misal Promo Beli 4 Dapat 10%. Promo ini berlaku ketika pelanggan beli 4 pcs produk apa saja, maka dia dapat diskon 10% untuk total pembayaran.</p>
        <p><strong>Promo Kategori Produk</strong>: Promo ini berlaku untuk kategori produk tertentu.</p>
        <p><strong>Promo merek</strong>: Promo ini berlaku untuk merek tertentu.</p>
       
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row"> 
    <div class="col-sm-3">
        <p>Tipe Voucher</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
         <?php
            $options = array(
                'normal promo'    => 'Promo Normal',
                'birthday promo'  => 'Promo Ulang Tahun',
                /* 'gender promo'    => 'Gender Promo', */
                'time promo'      => 'Promo Waktu',
                'province promo'  => 'Promo Provinsi',
                'quantity promo'  => 'Promo Jumlah',
                'category promo'  => 'Promo Kategori Produk',
                'brand promo'  => 'Promo merek',
            );
            echo form_dropdown('voucher_type', $options, $vouchers->voucher_type, 'class="form-control choosePromoType"');
            ?>   
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row birthdayPromo">
    <div class="col-sm-12">
         <h4>Ulangtahun Promo<br>
          (Hanya berlaku untuk Promo Ulang Tahun)</h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

<div class="row birthdayPromo"> 
    <div class="col-sm-3">
        <p>Bulan lahir</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
         <?php
            $options = array(
            ''  => 'Pilih Bulan Lahir...',
            '1'  => 'Januari',
            '2'  => 'Februari',
            '3'  => 'Maret',
            '4'  => 'April',
            '5'  => 'Mei',
            '6'  => 'Juni',
            '7'  => 'Juli',
            '8'  => 'Agustus',
            '9'  => 'September',
            '10'  => 'Oktober',
            '11'  => 'November',
            '12'  => 'Desember'
            );
            echo form_dropdown('birthmonth', $options, $vouchers->birthmonth, 'class="form-control"');
        
        ?>   
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row genderPromo">
    <div class="col-sm-12">
         <h4>Promo Jenis kelamin<br>
          (Hanya berlaku untuk Promo Jenis kelamin)
          </h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

<div class="row genderPromo"> 
    <div class="col-sm-3">
        <p>Jenis kelamin</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
          <?php
                $options = array(
                ''  => 'Pilih Jenis kelamin...',
                'male'  => 'Laki-Laki',
                'female'  => 'Perempuan',
                );
                echo form_dropdown('gender', $options, $vouchers->gender, 'class="form-control"');
            ?>   
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row timePromo">
    <div class="col-sm-12">
         <h4>Promo Waktu<br>
          (Hanya berlaku untuk Promo Waktu)
          </h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

<div class="row timePromo"> 
    <div class="col-sm-3">
        <p>Waktu mulai</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
         <input class="datetimepicker form-control" type="text" name="promostart" value="<?= $vouchers->promostart; ?>">
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row timePromo"> 
    <div class="col-sm-3">
        <p>Akhir waktu</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
          <input class="datetimepicker form-control" type="text" name="promoend" value="<?= $vouchers->promoend; ?>">
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row provincePromo">
    <div class="col-sm-12">
         <h4>Promo Provinsi<br>
          (Hanya berlaku untuk Promo Provinsi)
          </h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

<div class="row provincePromo"> 
  <div class="col-sm-3">
    <p>Propinsi</p>
  </div><!-- end class="col-sm-3" -->
  <div class="col-sm-9"> 
    <select name="provincepromo" class="form-control">
      <option value="">Pilih Propinsi...</option>
      <?php foreach($provinces as $province) : ?>
        <option value="<?= $province->rajaongkir_province_id; ?>"
          <?php if( $vouchers->provincepromo == $province->rajaongkir_province_id) : ?>
            selected
          <?php endif; ?> 
        >
          <?= ucwords($province->province); ?>
        </option>
      <?php endforeach; ?>  
    </select>
  </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row quantityPromo">
    <div class="col-sm-12">
         <h4>Promo Jumlah<br>
          (Hanya berlaku untuk Promo Jumlah)
          </h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

<div class="row quantityPromo"> 
    <div class="col-sm-3">
        <p>Jumlah Minimal</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
         <input class="form-control" type="text" name="quantitypromo" value="<?= $vouchers->quantitypromo; ?>" />
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row categoryPromo">
    <div class="col-sm-12">
         <h4>Promo Kategori Produk<br>
          (Hanya berlaku untuk Promo Kategori Produk)
          </h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

<div class="row categoryPromo">
    <div class="col-sm-3">
        <p>Pilih Kategori Produk</p>
    </div><!-- end class="col-sm-3" -->
    <div class="col-sm-9">
        <div style="height: 200px; overflow-y: scroll; padding: 20px; border:1px solid #ccc;">
             
                <?php foreach($parent_categories as $category) : ?>
               
                  <input style="position:relative; bottom:3px; margin-right: 10px;" type="checkbox" name="category_id[]" value="<?= $category->id_categories; ?>" <?= set_checkbox('category_id[]', $category->id_categories); ?>
                 
                  <?php if (isset($chosen_categories)) : ?>
                   
                    <?php //checked item 
                    foreach ($chosen_categories as $key => $chosen_category) : ?>

                      <?php if ($chosen_category == $category->id_categories) : ?>
                        checked
                      <?php endif; ?>
                      
                    <?php endforeach; ?>

                  <?php endif; ?>

                  > <?= ucfirst($category->category); ?> <br> 

                  <?php
                    //check if this parent categories does have sub categories
                    $this->db->select('id_categories')->from('categories')->where('parent', $category->id_categories);
                    $count_child = $this->db->get()->num_rows();
                  ?>
                  <?php if ($count_child > 0) : //this category does have childen ?>
                    
                    <?php
                      //get all child categories
                      $this->db->select('*')->from('categories')->where('parent', $category->id_categories)->order_by('priority', 'ASC');
                       $child_categories = $this->db->get()->result(); 
                    ?>

                    <?php foreach ($child_categories as $child) : ?>
                        
                        -- <input style="position:relative; bottom:3px; margin-right: 10px; margin-left:10px;" type="checkbox" name="category_id[]" value="<?= $child->id_categories; ?>" <?= set_checkbox('category_id[]', $child->id_categories); ?>

                        <?php if (isset($chosen_categories)) : ?>

                          <?php
                          //checked item
                          foreach ($chosen_categories as $key => $chosen_category) : ?>

                            <?php if ($chosen_category == $child->id_categories) : ?>
                              checked

                            <?php endif; ?>
                          
                          <?php endforeach; ?>

                        <?php endif; ?>  

                      > <?= ucfirst($child->category); ?> <br>

                      <?php
                    //check if this parent categories does have sub categories
                    $this->db->select('id_categories')->from('categories')->where('parent', $child->id_categories);
                    $count_grandchild = $this->db->get()->num_rows();
                  ?>
                  <?php if ($count_grandchild > 0) : //this category does have childen ?>
                    
                    <?php
                      //get all child categories
                      $this->db->select('*')->from('categories')->where('parent', $child->id_categories)->order_by('priority', 'ASC');
                       $grandchild_categories = $this->db->get()->result(); 
                    ?>

                    <?php foreach ($grandchild_categories as $grandchild) : ?>
                        
                        ------- <input style="position:relative; bottom:3px; margin-right: 10px; margin-left:10px;" type="checkbox" name="category_id[]" value="<?= $grandchild->id_categories; ?>" <?= set_checkbox('category_id[]', $grandchild->id_categories); ?>

                        <?php if (isset($chosen_categories)) : ?>
                   
                          <?php
                          //checked item
                          foreach ($chosen_categories as $key => $chosen_category) : ?>

                            <?php if ($chosen_category == $grandchild->id_categories) : ?>
                              checked

                            <?php endif; ?>
                          
                          <?php endforeach; ?>

                        <?php endif; ?>  

                      > <?= ucfirst($grandchild->category); ?> <br>

                    <?php endforeach; ?>

                  <?php endif; ?>

                    <?php endforeach; ?>

                  <?php endif; ?>

                <?php endforeach; ?>      
            
              </div>
              <?= form_error('category_id'); ?>
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 




<div class="row brandPromo">
    <div class="col-sm-3">
        <p>Pilih Merek</p>
    </div><!-- end class="col-sm-3" -->
    <div class="col-sm-9">
        <div style="height: 200px; overflow-y: scroll; padding: 20px; border:1px solid #ccc;">
             
            <?php foreach($brands as $brand) : ?>
                <input style="position:relative; bottom:3px; margin-right: 10px;" type="checkbox" name="brand_id[]" value="<?= $brand->id_brands; ?>" <?= set_checkbox('brand_id[]', $brand->id_brands); ?>
                
                <?php if (isset($chosen_brands)) : ?>
                    <?php //checked item 
                    foreach ($chosen_brands as $key => $chosen_brand) : ?>
                        <?php if ($chosen_brand == $brand->id_brands) : ?>
                        checked
                        <?php endif; ?>
                    <?php endforeach; ?>
                <?php endif; ?>
                > <?= ucfirst($brand->brand); ?> 
            <?php endforeach; ?>     
            
        </div>
        <?= form_error('category_id'); ?>
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<script>
$(function() {
    $('.birthdayPromo').hide(); 
    $('.genderPromo').hide(); 
    $('.birthdayPromo').hide(); 
    $('.timePromo').hide(); 
    $('.provincePromo').hide(); 
    $('.quantityPromo').hide(); 
    $('.categoryPromo').hide();
    $('.brandPromo').hide();

    //initial state
    if($('.choosePromoType').val() == 'birthday promo') {
        $('.birthdayPromo').show(); 
    } else {
        $('.birthdayPromo').hide(); 
    } 

    if($('.choosePromoType').val() == 'gender promo') {
        $('.genderPromo').show(); 
    } else {
        $('.genderPromo').hide(); 
    } 

    if($('.choosePromoType').val() == 'time promo') {
        $('.timePromo').show(); 
    } else {
        $('.timePromo').hide(); 
    } 

    if($('.choosePromoType').val() == 'province promo') {
        $('.provincePromo').show(); 
    } else {
        $('.provincePromo').hide(); 
    } 

    if($('.choosePromoType').val() == 'quantity promo') {
        $('.quantityPromo').show(); 
    } else {
        $('.quantityPromo').hide(); 
    } 

    if($('.choosePromoType').val() == 'category promo') {
        $('.categoryPromo').show(); 
    } else {
        $('.categoryPromo').hide(); 
    } 

    if($('.choosePromoType').val() == 'brand promo') {
        $('.brandPromo').show(); 
    } else {
        $('.brandPromo').hide(); 
    } 
    
    //change select for category product
    $('.choosePromoType').change(function(){
      
        if($('.choosePromoType').val() == 'birthday promo') {
            $('.birthdayPromo').show(); 
        } else {
            $('.birthdayPromo').hide(); 
        } 

        if($('.choosePromoType').val() == 'gender promo') {
            $('.genderPromo').show(); 
        } else {
            $('.genderPromo').hide(); 
        } 

        if($('.choosePromoType').val() == 'time promo') {
            $('.timePromo').show(); 
        } else {
            $('.timePromo').hide(); 
        } 

        if($('.choosePromoType').val() == 'province promo') {
            $('.provincePromo').show(); 
        } else {
            $('.provincePromo').hide(); 
        } 

        if($('.choosePromoType').val() == 'quantity promo') {
            $('.quantityPromo').show(); 
        } else {
            $('.quantityPromo').hide(); 
        } 

        if($('.choosePromoType').val() == 'category promo') {
            $('.categoryPromo').show(); 
        } else {
            $('.categoryPromo').hide(); 
        } 

        if($('.choosePromoType').val() == 'brand promo') {
            $('.brandPromo').show(); 
        } else {
            $('.brandPromo').hide(); 
        } 
    });
});

</script>

<div class="row"> 
    <div class="col-sm-3">
        <p>Jumlah Voucher Siap<br> 
         (Biarkan kosong untuk tidak terbatas. Hanya angka-angka)</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
         <?= form_input('qty_ready' , set_value('qty_ready', $vouchers->qty_ready), 'class="form-control"'); ?>
         <?= form_error('qty_ready'); ?>
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row"> 
    <div class="col-sm-3">
        <p>Jumlah Maksimum per Pelanggan<br>
         (Biarkan kosong untuk tidak terbatas. Hanya angka-angka)</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
        <?= form_input('maxqty_per_person' , set_value('maxqty_per_person', $vouchers->maxqty_per_person), 'class="form-control"'); ?>
        <?= form_error('maxqty_per_person'); ?>
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row"> 
    <div class="col-sm-3">
        <p>Pembelian Minimum<br>
         (Biarkan kosong untuk tidak terbatas. Hanya angka-angka)</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
       <?= form_input('min_order' , set_value('min_order', $vouchers->min_order), 'class="form-control"'); ?>
       <?= form_error('min_order'); ?>
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row"> 
    <div class="col-sm-3">
        <p>Tipe Diskon ?</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
       <?php
            $options = array(
                'amount'  => 'Dari Jumlah',
                'percentage'  => 'Dari Persentase (%)',
                /* 'free shipping'  => 'Free Shipping', */
            );
            echo form_dropdown('discount_type', $options, $vouchers->discount_type, 'class="form-control"');
        ?>   
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row"> 
    <div class="col-sm-3">
        <p>Nilai Diskon<br>
        (Contoh: untuk jumlah: 50000, untuk%: 10)</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
      <?= form_input('discount_value' , set_value('discount_value', $vouchers->discount_value), 'class="form-control"'); ?>
      <?= form_error('discount_value'); ?>
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row"> 
    <div class="col-sm-3">
        <p>Tanggal kadaluarsa<br>
        (Biarkan kosong untuk waktu tak terbatas)</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
      <?php 

            if (empty($vouchers->expired_date)) {
                $trim_expired_date = '';
            } else {
                $expired_date = $vouchers->expired_date;
                $trim_expired_date = date('d-m-Y',strtotime($expired_date));
            }

            $data = array(
              'name'        => 'expired_date',
              'value'       => $trim_expired_date,
              'class'       => 'datepicker form-control'
            );

            echo form_input($data); ?>    

            <?= form_error('expired_date'); ?>
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<div class="row"> 
    <div class="col-sm-3">
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
      
     <?= form_submit('submit', 'Update', 'class="btn btn-primary btn-success button-brown"'); ?>
    &nbsp;&nbsp;&nbsp;<?= anchor('admin/vouchers', 'Batal'); ?>
   
    </div><!-- end class="col-sm-9" -->
</div> <!-- end row --> 

<?= form_close(); ?>

<link rel="stylesheet" type="text/css" href="<?= base_url('assets/admin/css/jquery.datetimepicker.min.css'); ?>"/ >

<script src="<?= base_url('assets/admin/js/jquery.datetimepicker.full.min.js'); ?>"></script>

<script>
$(document).ready(function() {
    $('.datetimepicker').datetimepicker({
      format:'Y-m-d H:i'  
    });
});
</script>

https://t.me/RX1948 - 2025