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/laciasmara.com/public_html/shop/application/views/admin/resellers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/laciasmara.com/public_html/shop/application/views/admin/resellers/product_price.php
<?php
// exit(); 
?>
<div class="row">
    <div class="col-sm-12">
        <p><a href="<?= base_url('admin/reseller_page'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke halaman Reseller</a></p>
        <h2>Harga Produk Reseller</h2>
        <?= $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 -->

<div class="row">
    <div class="col-sm-12">
        <?= form_open('admin/resellers/product_price'); ?>
        <div class="col-sm-10">
            <input class="form-control" type="text" name="keyword" placeholder="Cari Produk..." />
        </div>
        <div class="col-sm-2">
            <button class="form-control" type="submit">Cari</button>
        </div>
        <?= form_close(); ?>
    </div>
</div>
<div class="row">
    <div class="col-sm-12">
        <div class="table-responsive">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>Nama Produk</th>
                        <th>SKU</th>
                        <th>Eceran (Rp)</th>
                        <?php
                        //get reseller categories
                        $this->db->select('id_resellers, reseller_name')->from('resellers')->where('active', 'yes')->order_by('id_resellers', 'ASC');
                        $resellers = $this->db->get()->result();
                        ?>
                        <?php foreach ($resellers as $reseller) : ?>
                            <th><?= ucwords($reseller->reseller_name); ?> (Rp)</th>
                            <th>Min Qty</th>
                        <?php endforeach; ?>
                    </tr>
                </thead>

                <tbody>
                    <?php if (count($products)) : ?>


                        <?= form_open('admin/resellers/update_product_price'); ?>

                        <div style="text-align:right;">
                            <a href="<?= base_url('admin/special_price') ?>"><button type="button" class="btn btn-success">
                                    Special Price
                                </button></a>
                            <input type="submit" name="update_price" value="UPDATE PRICE" class="btn btn-primary">
                        </div>



                        <?php foreach ($products as $product) : ?>
                            <?php

                            //get product name
                            $count_product_name = $this->db->select('title')->from('products')->where('id_products', $product->product_id)->get()->num_rows();
                            $product_name = $this->db->select('title')->from('products')->where('id_products', $product->product_id)->get()->row()->title;
                            if ($count_product_name > 0) {
                            ?>
                                <tr>
                                    <td>
                                        <?= ucwords($product_name); ?>
                                    </td>

                                    <td><?= $product->sku; ?></td>
                                    <!-- <td><?= $product->attributes; ?></td> -->
                                    <td><?= $product->price; ?></td>
                                    <?php foreach ($resellers as $reseller) : ?>

                                        <td><input class="form-control" <?php
                                                                        //check if the reseller price already exists in reseller_price table. If not exit, so use the value from retail price
                                                                        $this->db->select('id_resellers_price')->from('resellers_price')->where('product_detail_id', $product->id)->where('reseller_id', $reseller->id_resellers);
                                                                        $count_price = $this->db->get()->num_rows();
                                                                        ?> <?php if ($count_price == 0) : ?> value="<?= $product->price; ?>" <?php else : ?> <?php
                                                                                                                                                                //get price
                                                                                                                                                                $this->db->select('price')->from('resellers_price')->where('product_detail_id', $product->id)->where('reseller_id', $reseller->id_resellers);
                                                                                                                                                                $reseller_price = $this->db->get()->row()->price;
                                                                                                                                                                ?> value="<?= $reseller_price; ?>" <?php endif; ?> type="text" name="price[<?= $product->id; ?>][<?= $reseller->id_resellers; ?>][]" required></td>

                                        <td><input class="form-control" <?php
                                                                        //check if the min qty already exists in reseller_price table. If not exit, so use the default value of 1
                                                                        $this->db->select('id_resellers_price')->from('resellers_price')->where('product_detail_id', $product->id)->where('reseller_id', $reseller->id_resellers);
                                                                        $count_qty = $this->db->get()->num_rows();
                                                                        ?> <?php if ($count_qty == 0) : ?> value="1" <?php else : ?> <?php
                                                                                                                                        //get min qty
                                                                                                                                        $this->db->select('min_quantity')->from('resellers_price')->where('product_detail_id', $product->id)->where('reseller_id', $reseller->id_resellers);
                                                                                                                                        $min_quantity = $this->db->get()->row()->min_quantity;
                                                                                                                                        ?> value="<?= $min_quantity; ?>" <?php endif; ?> type="text" name="quantity[<?= $product->id; ?>][<?= $reseller->id_resellers; ?>][]" required></td>

                                    <?php endforeach; ?>
                                </tr>
                            <?php } ?>
                        <?php endforeach; ?>



                    <?php else : ?>
                        <tr>
                            <td colspan="3">Kami tidak dapat menemukan data apa pun.</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        <div style="text-align:right;">
            <input type="submit" name="update_price" value="Perbarui Harga" class="btn btn-primary">
        </div>
        <?= form_close(); ?>
    </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 -->

https://t.me/RX1948 - 2025