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/asietex.co.id/public_html/application/views/admin/vouchers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/asietex.co.id/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> Back to voucher List Page</a></p><br>
        <h4><?= empty($vouchers->id_vouchers) ? 'Add a new voucher' : '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>Voucher Name</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>Voucher Code<br>
            (Example: 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>Voucher Type</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
        <p><strong>Normal Promo</strong>: Promo biasa. Bila memasukan kode voucher di checkout, maka ada diskon berdasarkan persentase atau amount.</p>
        <p><strong>Birthday Promo</strong>: Misal Promo Agustus. Promo yang hanya berlaku untuk customer 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>Time Promo</strong>: Misal Promo Midnight Sale. Promo ini akan berjalan ketika jam 00.00 s/d jam 02.00 saja.</p>
        <p><strong>Province Promo</strong>: Misal Promo Jawa Timur. Promo ini hanya berlaku untuk customer yang beralamat di Jawa Timur saja. Ia akan dapat free ongkir atau disc 10% untuk total pembayaran.</p>
        <p><strong>Quantity promo</strong>: Misal Promo Buy 4 Get 10%. Promo ini berlaku ketika customer beli 4 pcs produk apa saja, maka dia dapat disc 10% untuk total pembayaran.</p>
        <p><strong>Product Category promo</strong>: Promo ini berlaku untuk kategori produk tertentu.</p>
        <p><strong>Brand promo</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>Voucher Type</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
         <?php
            $options = array(
                'normal promo'    => 'Normal Promo',
                'birthday promo'  => 'Birthday Promo',
                'gender promo'    => 'Gender Promo',
                'time promo'      => 'Time Promo',
                'province promo'  => 'Province Promo',
                'quantity promo'  => 'Quantity Promo',
                'category promo'  => 'Product Category Promo',
                'brand promo'  => 'Brand Promo',
            );
            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>Birthday Promo<br>
          (Only apply for Birthday Promo)</h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

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

     <div class="col-sm-9"> 
         <?php
            $options = array(
            ''  => 'Choose Birth Month...',
            '1'  => 'January',
            '2'  => 'February',
            '3'  => 'March',
            '4'  => 'April',
            '5'  => 'May',
            '6'  => 'June',
            '7'  => 'July',
            '8'  => 'August',
            '9'  => 'September',
            '10'  => 'October',
            '11'  => 'November',
            '12'  => 'December'
            );
            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>Gender Promo<br>
          (Only apply for Gender Promo)
          </h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

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

     <div class="col-sm-9"> 
          <?php
                $options = array(
                ''  => 'Choose Gender...',
                'male'  => 'Male',
                'female'  => 'Female',
                );
                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>Time Promo<br>
          (Only apply for Time Promo)
          </h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

<div class="row timePromo"> 
    <div class="col-sm-3">
        <p>Start Time</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>End Time</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>Province Promo<br>
          (Only apply for Province Promo)
          </h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

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

     <div class="col-sm-9"> 
         <select name="provincepromo" class="form-control">
                <option value="">Choose Province...</option>

                    <?php foreach($provinces['rajaongkir']['results'] as $province) : ?>
            
                    <option value="<?= $province['province_id']; ?>"
                    <?php if( $vouchers->provincepromo == $province['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>Quantity Promo<br>
          (Only apply for Quantity Promo)
          </h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

<div class="row quantityPromo"> 
    <div class="col-sm-3">
        <p>Min Quantity</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>Product Category Promo<br>
          (Only apply for Product Category Promo)
          </h4>
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

<div class="row categoryPromo">
    <div class="col-sm-3">
        <p>Choose Product Category</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>Choose Brand</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>Voucher Quantity Ready<br> 
         (Leave blank for unlimited. Numbers only)</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>Maximum Quantity per Customer<br>
         (Leave blank for unlimited. Numbers only)</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>Minimum Purchase<br>
         (Leave blank for unlimited. Numbers only)</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>Discount Type ?</p>
    </div><!-- end class="col-sm-3" -->

     <div class="col-sm-9"> 
       <?php
            $options = array(
                'amount'  => 'By Amount',
                'percentage'  => 'By Percentage (%)',
                /* '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>Discount Value<br>
        (Example: for amount: 50000, for %: 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>Expired Date<br>
        (Leave blank for unlimited time)</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', 'cancel'); ?>
    </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