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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/laciasmara.com/public_html/shop/application/views/admin/affiliator/product.php
<div class="row">
    <div class="col-sm-12">
        <p><a href="<?= base_url('admin/promotion'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke Promosi</a></p><br>
        <h2>Dashboard Product Affiliator</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>
    <div class="row">
        <div class="col-sm-12">
            <!-- Button with different colors -->
            <a href="<?= base_url('admin/affiliator'); ?>"><button class="btn btn-success">Dashboard</button></a>
            <a href="<?= base_url('admin/affiliator/list'); ?>"><button class="btn btn-info">Ranking Affiliator</button></a>
            <a href="<?= base_url('admin/affiliator/mission'); ?>"><button class="btn btn-warning">Misi</button></a>
            <a href="<?= base_url('admin/affiliator/commision'); ?>"><button class="btn btn-danger">Komisi</button></a>
            <a href="<?= base_url('admin/affiliator/product'); ?>"><button class="btn btn-primary">Produk Affiliator</button></a>
        </div>
    </div>
</div>
<div>
    <div class="row">
        <div class="col-sm-12">
            <ul style="width: max-content;" class="nav nav-tabs" id="myTabs" role="tablist">
                <li class="nav-item">
                    <a class="nav-link active" id="tab1" data-toggle="tab" href="#orders1" role="tab" aria-controls="orders1" aria-selected="true">Dashboard Item</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" id="tab2" data-toggle="tab" href="#orders2" role="tab" aria-controls="orders2" aria-selected="false">Dashboard Pengiriman</a>
                </li>

            </ul>

            <div class="tab-content" id="myTabContent">

                <div style="padding: 15px;" class="tab-pane active" id="orders1" role="tabpanel" aria-labelledby="tab1">
                    <h5 style="text-align: center;">Dashboard Product</h5>
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="table-responsive">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>Produk</th>
                                            <?php foreach ($affiliator_list as $al) : ?>
                                                <th><?php echo $al->nama; ?></th>
                                            <?php endforeach; ?>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php if (count($product_list)) : ?>
                                            <?php foreach ($product_list as $product) : ?>
                                                <tr>
                                                    <td>
                                                        <?php
                                                        $this->db->select('title')->from('products')->where('id_products', $product->product_id);
                                                        $product_name = $this->db->get()->row();
                                                        echo $product_name ? $product_name->title : 'Produk Tidak Ditemukan';
                                                        ?>
                                                    </td>
                                                    <?php foreach ($affiliator_list as $affiliator) : ?>
                                                        <td>
                                                            <?php
                                                            $this->db->from('affiliator_product')->where('product_id', $product->product_id)->where('affiliator_id', $affiliator->id_daftar);
                                                            $affiliator_product = $this->db->get()->row();

                                                            if ($affiliator_product) {
                                                                echo '<i class="fa fa-check"></i>';
                                                            }
                                                            ?>
                                                        </td>
                                                    <?php endforeach; ?>
                                                </tr>
                                            <?php endforeach; ?>
                                        <?php else : ?>
                                            <tr>
                                                <td colspan="<?php echo count($affiliator_list) + 1; ?>">Tidak Ada Produk</td>
                                            </tr>
                                        <?php endif; ?>
                                    </tbody>
                                </table>

                                <?php echo $this->pagination->create_links(); ?>
                            </div>
                        </div> <!-- end class col-sm-12 -->
                    </div> <!-- end class="row" -->
                </div>
                <div style="padding: 15px;" class="tab-pane " id="orders2" role="tabpane2" aria-labelledby="tab2">
                    <div class="text-right">
                        <a href="<?= base_url('admin/affiliator/product_add'); ?>" class="btn btn-success ml-auto">Kirim Product</a>
                    </div>
                    <h5 style="text-align: center;">Dashboard Pengiriman</h5>
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="table-responsive">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>Affiliator</th>
                                            <th>Produk</th>
                                            <th>Tanggal Kirim</th>
                                            <!--<th>Tanggal Sampai</th>-->
                                            <th>Alamat</th>
                                            <th>Status</th>
                                            <th>Delivery Receipt</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php if (count($sent)) : ?>
                                            <?php foreach ($sent as $ar) : ?>
                                                <tr>
                                                    <td>
                                                        <?php

                                                        $this->db->select('nama')->from('affiliator_register')->where('id_daftar', $ar->affiliator_id);
                                                        $affiliator_name = $this->db->get()->row();

                                                        echo $affiliator_name->nama;
                                                        ?>
                                                    </td>
                                                    <td>
                                                        <?php

                                                        $this->db->select('title')->from('products')->where('id_products', $ar->product_id);
                                                        $product_name = $this->db->get()->row();

                                                        echo $product_name->title;
                                                        ?>
                                                    </td>
                                                    <td><?php echo $ar->created; ?></td>
                                                    <!--<td><?php echo $ar->arrived_date; ?></td>-->
                                                    <td><?php echo $ar->address; ?></td>

                                                    <td class="<?php
                                                                if ($ar->status == 'Sent') {
                                                                    echo 'text-success';
                                                                } elseif ($ar->status == 'Received') {
                                                                    echo 'text-primary';
                                                                } elseif ($ar->status == 'Proposed') {
                                                                    echo 'text-danger';
                                                                } else {
                                                                    echo 'text-default'; // fallback class
                                                                }
                                                                ?>">
                                                        <b><?php echo $ar->status; ?></b>
                                                    </td>

                                                    <td><a href="<?= base_url() . 'admin/affiliator/generate_deliveryreceipt/' . $ar->id; ?>" target="_blank"><i class="fa fa-print">Print</i></a></td>
                                                    <td>
                                                        <button type="button"
                                                            class="btn btn-sm btn-danger delete-affiliator"
                                                            data-id="<?php echo $ar->id; ?>">
                                                            <i class="fa fa-trash"></i> Delete
                                                        </button>
                                                    </td>
                                                </tr>
                                            <?php endforeach; ?>
                                        <?php else : ?>
                                            <tr>
                                                <td colspan="8">Tidak Ada Produk Yang Dikirim ke Affiliator</td>
                                            </tr>
                                        <?php endif; ?>
                                    </tbody>
                                </table>
                                <?php echo $this->pagination->create_links(); ?>
                            </div>
                        </div> <!-- end class col-sm-12 -->
                    </div> <!-- end class="row" -->
                </div>
            </div>
        </div>
        <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="deleteModalLabel">Confirm Delete</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        Are you sure you want to delete this record?
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                        <button type="button" class="btn btn-danger" id="confirmDelete">Delete</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="uploadModal Label" aria-hidden="true">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <?php echo form_open('admin/product_claim/update_claim_keterangan'); ?>
                    <div class="modal-header">
                        <h5 class="modal-title" id="keteranganModal Label">Upload Bukti Transfer</h5>
                        <br>
                        <p>Format : JPG/PNG</p>
                        <p>Maksimal : 500KB</p>
                    </div>
                    <div class="modal-body">
                        <input type="file" name="proof" value="">
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
                        <input type="submit" name="submit_keterangan" value="Simpan" class="btn btn-primary" />
                    </div>
                    <?php echo form_close(); ?>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function() {
        let deleteId = null;

        // When delete button is clicked
        $('.delete-affiliator').on('click', function() {
            deleteId = $(this).data('id');
            $('#deleteModal').modal('show');
        });

        // When confirm delete button is clicked
        $('#confirmDelete').on('click', function() {
            if (deleteId) {
                $.ajax({
                    url: '<?= base_url("admin/affiliator/delete_product/") ?>' + deleteId,
                    type: 'POST',
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: {
                        '<?= $this->security->get_csrf_token_name() ?>': '<?= $this->security->get_csrf_hash() ?>'
                    },
                    success: function(response) {
                        $('#deleteModal').modal('hide');
                        location.reload();
                    },
                    error: function(xhr, status, error) {
                        alert('Error deleting record. Please try again.');
                        console.error(error);
                    }
                });
            }
        });
    });
</script>

https://t.me/RX1948 - 2025