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 :  /proc/self/root/var/www/laciasmara.com/public_html/shop/application/views/admin/products/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/var/www/laciasmara.com/public_html/shop/application/views/admin/products/index.php
<div class="row">
    <div class="col-sm-12">
        <p><a href="<?= base_url('admin/product_index'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke Produk</a></p>
        <h2>Produk</h2>
        <?= $this->session->flashdata('success'); ?>
        <?= $this->session->flashdata('error'); ?>
    </div>
</div>

<div>
    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a aria-controls="search" href="#search" role="tab" data-toggle="tab">Cari Produk</a></li>
        <li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Upload Produk Excel</a>
            </a></li>
    </ul>

    <!-- Tab panes -->
    <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="search">
            <div class="row">
                <?= form_open('admin/products'); ?>
                <div class="col-sm-5 col-xs-6">
                    <input class="form-control" type="text" placeholder="Tulis Nama Produk..." name="product" required <?php if (isset($keyword)) : ?> value="<?= ucwords($keyword); ?>" <?php endif; ?>>
                </div><!-- end class="col-sm-8" -->

                <div class="col-sm-3 col-xs-6">
                    <input class="btn btn-primary form-control" type="submit" name="search_product" value="CARI PRODUK">
                </div><!-- end class="col-sm-6" -->
                <?= form_close(); ?>
            </div> <!-- end row -->

            <div class="row">

                <?= form_open('admin/products/search_category'); ?>
                <div class="col-sm-5 col-xs-6">
                    <?php
                    //get parent category id and name and parent from categories table
                    $this->db->select('id_categories, category')->from('categories')->where('parent', NULL)->order_by('priority', 'ASC');
                    $categories = $this->db->get()->result();
                    ?>

                    <select name="category" class="form-control">
                        <option value="">Pilih Kategori...</option>

                        <?php foreach ($categories as $category) : ?>
                            <option value="<?= $category->id_categories; ?>" <?php if (isset($category_id)) : ?> <?php if ($category->id_categories == $category_id) : ?> selected <?php endif; ?> <?php endif; ?>><?= ucwords($category->category); ?></option>

                            <?php
                            //check if the current id does have child
                            $this->db->select('*')->from('categories')->where('parent', $category->id_categories);
                            $count_child_category = $this->db->get()->num_rows();
                            ?>

                            <?php if ($count_child_category > 0) : ?>
                                <?php
                                //get all existing child categories 
                                $this->db->select('id_categories, category')->from('categories')->where('parent', $category->id_categories)->order_by('priority', 'ASC');
                                $child_categories = $this->db->get()->result();
                                ?>

                                <?php foreach ($child_categories as $child_category) : ?>
                                    <option style="margin-left: 10px;" value="<?= $child_category->id_categories; ?>" <?php if (isset($category_id)) : ?> <?php if ($child_category->id_categories == $category_id) : ?> selected <?php endif; ?> <?php endif; ?>>- <?= ucwords($child_category->category); ?></option>

                                    <?php
                                    //check if the current id does have child
                                    $this->db->select('*')->from('categories')->where('parent', $child_category->id_categories);
                                    $count_child2_category = $this->db->get()->num_rows();
                                    ?>

                                    <?php if ($count_child2_category > 0) : ?>
                                        <?php
                                        //get all existing child categories 
                                        $this->db->select('id_categories, category')->from('categories')->where('parent', $child_category->id_categories)->order_by('priority', 'ASC');
                                        $child2_categories = $this->db->get()->result();
                                        ?>
                                        <?php foreach ($child2_categories as $child2_category) : ?>
                                            <option style="margin-left: 10px;" value="<?= $child2_category->id_categories; ?>" <?php if (isset($category_id)) : ?> <?php if ($child2_category->id_categories == $category_id) : ?> selected <?php endif; ?> <?php endif; ?>>-- <?= ucwords($child2_category->category); ?></option>
                                        <?php endforeach; ?>

                                    <?php endif ?>

                                <?php endforeach; ?>

                            <?php endif ?>

                        <?php endforeach; ?>

                    </select>
                </div><!-- end class="col-sm-5" -->

                <div class="col-sm-3 col-xs-6">
                    <input class="btn btn-primary form-control" type="submit" name="search_category" value="CARI KATEGORI">
                </div><!-- end class="col-sm-3" -->
                <?= form_close(); ?>
            </div> <!-- end row -->

            <div class="row">
                <?= form_open('admin/products/search_brand'); ?>
                <div class="col-sm-5 col-xs-6">
                    <select name="brand" class="form-control">
                        <?php
                        //get brands id and name from brandsa table
                        $this->db->select('id_brands, brand')->from('brands')->order_by('brand', 'ASC');
                        $brands = $this->db->get()->result();
                        ?>
                        <option value="">Pilih Merek...</option>
                        <?php foreach ($brands as $brand) : ?>
                            <?php if ($brand->id_brands != 0) : ?>
                                <option value="<?= $brand->id_brands; ?>" <?php if (isset($brand_id)) : ?> <?php if ($brand->id_brands == $brand_id) : ?> elected <?php endif; ?> <?php endif; ?>><?= ucwords($brand->brand); ?></option>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="col-sm-3 col-xs-6">
                    <input class="btn btn-primary form-control" type="submit" name="search_brand" value="CARI MEREK">
                </div><!-- end class="col-sm-6" -->
                <?= form_close(); ?>
            </div> <!-- end row -->
        </div>


        <div role="tabpanel" class="tab-pane" id="settings">
            <div class="row" style="border:1px solid #ddd;">
                <div class="col-sm-12">
                    <h3>Upload Produk Microsoft Excel</h3>
                    <p>DOWNLOAD CONTOH FILE EXCEL <a target="_blank" style="color:brown; font-weight: bold;" href="https://www.tokodaku.com/store-shared/assets/frontend/product_import.xls">DISINI</a>. IKUTI PENGISIAN SESUAI CONTOH.</p>
                    <p>Maksimal 50 item per file excel. Produk dengan Nama produk dan/atau SKU (Kode produk) yang sama akan diupdate. Produk dengan nama baru dan/atau SKU yang baru akan didaftarkan baru.</p>

                    <?php
                    $attributes = array(
                        'name' => 'uploadexcel',
                        'id' => 'uploadexcel'
                    );
                    ?>
                    <?= form_open_multipart('admin/products/upload_products', $attributes); ?>
                    <table>
                        <tr>
                            <td> ULPLOAD PRODUK EXCEL: </td>
                            <td>
                                <div class="form-group">
                                    <input style="float:left; width:60%;" type="file" class="form-control" name="userfile" id="userfile" align="center" /><input type="submit" name="upload_excel" class="btn btn-info" value="UPLOAD">
                                </div>
                            </td>
                        </tr>
                    </table>
                    </form>
                    <p>Note: Saat proses upload, mohon menunggu saampai proses selesai.</p>
                </div><!-- end class="col-sm-12" -->
                <?= form_close(); ?>
            </div> <!-- end row; -->
        </div>

    </div>
</div>

<div class="row">
    <div class="col-sm-12">
        <?php if (($membership_type == "starter" && $jml_produk < 100) || ($membership_type == "business" && $jml_produk < 500) || $membership_type == "enterprise" || $membership_type == "free trial") : ?>
            <a class="btn btn-primary" href="<?= base_url('admin/products/edit'); ?>"><i class="fa fa-plus" aria-hidden="true"></i> Buat Produk baru</a>
            <a class="btn btn-warning" href="<?= base_url('admin/products/bundle'); ?>"><i class="fa fa-cubes" aria-hidden="true"></i> Produk Bundle</a>
            <a class="btn btn-success" href="<?= base_url('admin/diskon_produk'); ?>"><i class="fa fa-usd" aria-hidden="true"></i> Special Discounts</a>
        <?php else : ?>
            <p style="color: red">Jumlah produk telah melebihi batas, silahkan upgrade.</p>
        <?php endif; ?>

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

<div class="row">
    <div class="col-sm-12">

        <div class="table-responsive">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>Gambar</th>
                        <th>Nama Produk</th>
                        <th>Aktif?</th>
                        <th>Edit</th>
                        <th>Stok</th>
                        <th>Foto Produk</th>
                        <th>Preview</th>
                        <th>Duplikat</th>
                        <th>Hapus</th>
                        <th>Bagikan</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if (count($products)) : ?>
                        <?php foreach ($products as $product) : ?>
                            <tr>
                                <td>
                                    <?php
                                    // Check if product_image is not null and not empty
                                    if (!is_null($product->product_image) && $product->product_image !== '') {
                                        echo '<img src="' . base_url('uploads/product/' . $product->product_image) . '" alt="' . htmlspecialchars($product->title) . '" style="max-width: 100px; max-height: 100px; cursor: pointer;" onclick="openPopup(\'' . base_url('uploads/product/' . $product->product_image) . '\')">';
                                    } else {
                                        echo '<img src="' . base_url('uploads/logo-laciasmara-email.png') . '" alt="Sample" style="max-width: 100px; max-height: 100px; cursor: pointer;" onclick="openPopup(\'' . base_url('uploads/logo-laciasmara-email.png') . '\')">';
                                    }
                                    ?>
                                </td>
                                <td><a href="<?= base_url('product/' . $product->alias); ?>" target="_blank"><?= ucfirst($product->title); ?></a></td>
                                <td>
                                    <?php
                                    if ($product->product_status == 1) {
                                        echo 'Ya';
                                    } else {
                                        echo 'Tidak';
                                    }
                                    ?>
                                </td>
                                <td><a href="<?= base_url('admin/products/edit/' . $product->id_products); ?>" target="_blank"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a></td>
                                <td><a href="<?= base_url() . 'admin/stocks/get/' . $product->id_products; ?>" target="_blank"><i class="fa fa-file" aria-hidden="true"></i> Lihat & Edit</td>
                                <td><a href="<?= base_url('admin/products/product_images/' . $product->id_products); ?>" target="_blank"><i class="fa fa-file-image-o" aria-hidden="true"></i> Lihat & Edit</a></td>
                                <td><a href="<?= base_url() . 'product/' . $product->alias; ?>"><i class="fa fa-eye" aria-hidden="true"></i></a></td>
                                <td><?= bt_duplicate('admin/products/duplicate_product/' . $product->id_products); ?></td>
                                <td><?= bt_delete('admin/products/delete/' . $product->id_products); ?></td>
                                <td>
                                    <div class="dropdown">
                                        <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" id="shareButton<?= $product->id_products ?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                            <i class="fa fa-share-alt"></i> Bagikan
                                        </button>
                                        <div class="dropdown-menu" style="margin-left: -80px; padding-top: 8px;" aria-labelledby="shareButton<?= $product->id_products ?>">
                                            <?php
                                            $product_url = base_url() . 'product/' . $product->alias;
                                            $share_links = array(
                                                'facebook' => $product_url . '?utm_source=facebook&utm_medium=social&utm_campaign=share',
                                                'instagram' => $product_url . '?utm_source=instagram&utm_medium=social&utm_campaign=share',
                                                'twitter' => $product_url . '?utm_source=twitter&utm_medium=social&utm_campaign=share',
                                                'whatsapp' => $product_url . '?utm_source=whatsapp&utm_medium=social&utm_campaign=share',
                                                'ads' => $product_url . '?utm_source=ads&utm_medium=ads&utm_campaign=ads',
                                            );
                                            ?>
                                            <a class="dropdown-item copy-link" href="javascript:void(0)" data-link="<?= $share_links['facebook'] ?>">
                                                <i class="fa fa-facebook"></i> Facebook
                                            </a>
                                            <a class="dropdown-item copy-link" href="javascript:void(0)" data-link="<?= $share_links['instagram'] ?>">
                                                <i class="fa fa-instagram"></i> Instagram
                                            </a>
                                            <a class="dropdown-item copy-link" href="javascript:void(0)" data-link="<?= $share_links['twitter'] ?>">
                                                <i class="fa fa-twitter"></i> Twitter
                                            </a>
                                            <a class="dropdown-item copy-link" href="javascript:void(0)" data-link="<?= $share_links['whatsapp'] ?>">
                                                <i class="fa fa-whatsapp"></i> WhatsApp
                                            </a>
                                            <a class="dropdown-item copy-link" href="javascript:void(0)" data-link="<?= $share_links['ads'] ?>">
                                                <i class="fa fa-google"></i> Ads
                                            </a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                    <?php else : ?>
                        <tr>
                            <td colspan="3">Produk tidak ditemukan.</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div><!-- end class responsive-->

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

<div class="row">
    <div class="col-sm-12">
        <?php if (isset($use_pagination)) : ?>
            <div style="text-align:center;"><?= $this->pagination->create_links(); ?></div>
        <?php endif; ?>
    </div><!-- end class="col-sm-12" -->
</div> <!-- end row -->

<!-- Popup Modal -->
<div id="imagePopup" style="display:none; position:fixed; top:0; left:0; width:100%; height:100%; background-color:rgba(0,0,0,0.8); z-index:9991; justify-content:center; align-items:center; flex-direction: column;" onclick="closePopup()">
    <img id="popupImage" src="" alt="Popup Image" style="max-width:90%; max-height:90%; margin:auto; display:block;">
    <span style="color:white; font-size:24px; cursor:pointer; margin-top: 20px;">Close</span>
</div>
<script>
    function openPopup(imageSrc) {
        document.getElementById('popupImage').src = imageSrc;
        document.getElementById('imagePopup').style.display = 'flex';
    }

    function closePopup() {
        document.getElementById('imagePopup').style.display = 'none';
    }
    document.addEventListener('DOMContentLoaded', function() {
        // Fungsi untuk copy link
        const copyLinks = document.querySelectorAll('.copy-link');
        copyLinks.forEach(link => {
            link.addEventListener('click', function(e) {
                e.preventDefault();
                const url = this.getAttribute('data-link');

                // Create temporary input
                const temp = document.createElement('input');
                temp.value = url;
                document.body.appendChild(temp);

                // Copy the link
                temp.select();
                document.execCommand('copy');
                document.body.removeChild(temp);

                // Show feedback
                alert('Link berhasil disalin!');

                // Optional: Track copy event
                // Anda bisa menambahkan ajax call ke server untuk tracking
                fetch(url + '&action=copy', {
                    method: 'GET',
                    credentials: 'same-origin'
                });
            });
        });
    });
</script>

<!-- Tambahkan style berikut di bagian head atau CSS file -->
<style>
    .dropdown-item {
        cursor: pointer;
        padding: 8px 20px;
    }

    .dropdown-item i {
        margin-top: 8px;
        margin-bottom: 8px;
    }

    .dropdown-item i {
        margin-right: 10px;
        width: 20px;
    }
</style>

https://t.me/RX1948 - 2025