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/products/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/rabbithabit.com/public_html/application/views/admin/products/product_images.php
<div class="row">
    <div class="col-sm-12">
        <p><a href="<?= base_url('admin/products'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke Produk</a></p>
        <h2>Foto Produk : <?= ucwords($product_name); ?></h2>
        <?= $this->session->flashdata('success'); ?>  
    </div>
</div>  
<?php 
$this->db->select('id, product_id, sku')->from('product_details')->where('product_id', $product_id)->order_by('id', 'ASC');
$product_details = $this->db->get()->result();

 ?>
<div class="row"> 
    <?= form_open(base_url().'admin/products/edit_product_image/' . $product_id, array('id'=>'form_edit_product')); ?>
    <div class="form-inline">
        <div class="col-sm-2">
            <!-- Pilih SKU / Varian -->
            <select id="slc_product_detail_id" name="product_detail_id" class="form-control" required>
                <option value="" disabled selected>Pilih SKU/Varian...</option>
                <?php foreach($product_details as $detail) : ?>
                    <option value="<?= $detail->id; ?>">
                    <?php
                      //get variant
                      $this->db->select('attribute_detail_id')->from('product_combination')->where('product_details_id', $detail->id);
                      $attributes = $this->db->get()->result();
                      $attributes_name = '';
                      foreach($attributes as $attribute) {
                        //get atrribute detail name
                        $this->db->select('attribute_detail')->from('product_attributes_detail')->where('id', $attribute->attribute_detail_id);
                        $attribute_detail_name = $this->db->get()->row()->attribute_detail;
                        $attributes_name = $attributes_name  . '-' . $attribute_detail_name;
                      }
                    ?>
                    <?= $detail->sku . ' ' . ucwords($attributes_name); ?>
                    </option>   
                <?php endforeach; ?>
            </select>
        </div>
        <div class="col-sm-10"> 
            <button type="submit" name="btn_add_newfoto" value="add_new_foto" class="btn btn-primary">
                <i class="fa fa-plus" aria-hidden="true"></i> <strong>Tambah Foto Baru</strong>
            </button>
        </div>
    </div>
    <script>
        $(document).ready(function(){
            $("form#form_edit_product").submit(function(ev){
                ev.preventDefault();
                var slc_product_detail_id = $("select#slc_product_detail_id");
                // alert(slc_product_detail_id.val());
                if(slc_product_detail_id.val() != ''){

                window.location.href= "<?= base_url().'admin/products/edit_product_image/' . $product_id; ?>/"+slc_product_detail_id.val()+'/addnew';
                }else{
                    alert('Pilih SKU terlebih dulu.');
                }
            });
        });
    </script>
    </form>
</div> 

<div class="row">
    <div class="col-sm-12">
        <table class="table table-striped"> 
            <thead>
                <tr>
                    <th>Judul Banner</th>
                    <th>Varian / SKU</th>
                    <th>Urutan Tampilan</th>
                    <th>Aktif?</th>
                    <th>Edit</th>
                    <th>Hapus</th>
                </tr>
            </thead>
            <tbody>
                <?php if(count($product_images)) : ?> 
                <?php foreach($product_images as $item): ?> 
                    <tr>
                        <td><img style="width:100px;" src="<?= base_url() . 'uploads/product/small/' . $item->image; ?>"><br><?= ucfirst($item->title); ?></td>
                        <td>
                        <?php 
                        //get sku
                        $this->db->select('sku')->from('product_details')->where('id', $item->product_details_id);
                        $sku = $this->db->get()->row()->sku;
                        
                        //get varian
                        $this->db->select('attribute_detail_id')->from('product_combination')->where('product_details_id', $item->product_details_id);
                        $attributes = $this->db->get()->result();
                        $attributes_name = '';
                        foreach($attributes as $attribute) {
                            //get atrribute detail name
                            $this->db->select('attribute_detail')->from('product_attributes_detail')->where('id', $attribute->attribute_detail_id);
                            $attribute_detail = $this->db->get()->row();
                            
                           if(count($attribute_detail) > 0) {
                                $attribute_detail_name = $attribute_detail->attribute_detail;
                                $attributes_name = ucwords($attributes_name)  . ' ' . ucwords($attribute_detail_name);
                            } else {
                                $attributes_name = ucwords($attributes_name);
                            } 
                        }
                        echo $sku . '<br>' . $attributes_name;
                        ?>  
                        </td>
                        <td><?= $item->priority; ?></td> 
                        <td>
                        <?php
                            if ($item->status == 1) {
                                echo 'Ya';
                            }
                            else {
                                echo 'Tidak';
                            }      
                        ?>
                        </td>
                        <td><?= bt_edit('admin/products/edit_product_image/' .  $product_id . '/' . $item->id); ?></td> 
                        <td><?= bt_delete('admin/products/delete_product_image/' . $product_id . '/' . $item->id); ?></td>
                    </tr>
                <?php endforeach; ?>
                <?php else: ?>
                    <tr>
                    <td colspan="3">Foto produk tidak ditemukan.</td>
                    </tr>
                <?php endif; ?> 
            </tbody> 
        </table>
    </div><!-- end class="col-sm-12" -->
</div> <!-- end row -->  

<div class="row">
    <div class="col-sm-12">
        <?php
        //create pagination...
        echo '<p style="text-align:center;">' . $this->pagination->create_links() . '</p>';
        ?>
    </div><!-- end class="col-sm-12" -->
</div> <!-- end row --> 

https://t.me/RX1948 - 2025