<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
    <meta name="keywords" content="Djoedes by enambelasapp.my.id">
    <meta name="author" content="Suroto">
    <meta name="description" content="Djoedes by enambelasapp.my.id">
    <meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=yes" />

    <title>Invoice</title>
    <link href="<?php echo base_url() . 'assets/img/logo.png' ?>" rel="shortcut icon" type="image/x-icon">

    <link type="text/css" rel="stylesheet" href="<?php echo base_url() . 'mobile/css/jquery.mmenu.all.css' ?>" />
    <link type="text/css" rel="stylesheet" href="<?php echo base_url() . 'mobile/css/style.css' ?>" />

    <!--bootstrap-->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>


    <link rel="apple-touch-icon" href="img/apple-touch-icon.png">
    <link rel="apple-touch-startup-image" href="img/apple-touch-startup-image.png">

    <script type="text/javascript" src="<?php echo base_url() . 'mobile/js/jquery.min.js' ?>"></script>
    <script type="text/javascript" src="<?php echo base_url() . 'mobile/js/jquery.mmenu.min.all.js' ?>"></script>
    <script type="text/javascript" src="<?php echo base_url() . 'mobile/js/jquery.easy-pie-chart.js' ?>"></script>
    <script type="text/javascript" src="<?php echo base_url() . 'mobile/js/o-script.js' ?>"></script>

</head>
<meta http-equiv="refresh" content="60" />

<body class="o-page" style="background-color:#fff;">
    <?php
    $b = $data->row_array();
    $kopel = $this->session->userdata('kopel');
    $ab = $this->db->query("select * from tbl_pelanggan where plg_id='$kopel'");
    $i = $ab->row_array();
    $kdcabang = $i['kdtoko'];
    $ab1 = $this->db->query("select * from tabel_toko where kd_toko='$kdcabang'");
    $u = $ab1->row_array();

    ?>
    <p hidden id="fb"><?= $b['feedback'] ?></p>
    <?php 
        if($b['feedback'] == 1){
            $l = '#2E55E5';
            $dl = '#6B6B6C';
            $komentar = $b['comment_detail'];
            $komentar1 = '';
        }elseif($b['feedback'] == 2){
            $dl = '#2E55E5';
            $l = '#6B6B6C';
            $komentar = '';
            $komentar1 = $b['comment_detail'];
        }else{
            $l = '#6B6B6C';
            $dl = '#6B6B6C';
            $komentar = '';
            $komentar1 = '';
        }
    ?>
    <!--<div id="page">-->
    <div id="header">
        <div class="header-content">
            <a href="#menu" class="p-link-home"><i class="fa fa-bars"></i></a>
            <a href="<?= base_url('mobile/member/berhasillogin') ?>" class="p-link-back"><i class="fa fa-arrow-left"></i></a>
        </div>
    </div>
    <!--</div>-->
    <div class="bannerPane banner-bg">
        <div class="overlay"></div>
        <div class="s-banner-content;">
            <h5 class="text-center mt-1" style="font-size:35px;color:white;font-family: Segoe UI, Arial, sans-serif;font-weight:bold;">Terima Kasih</h5>
            <h5 class="text-center mt-1" style="font-size:18px;color:white;font-family: Segoe UI, Arial, sans-serif;font-weight:bold;">Orderan Sudah Diterima</h5>
        </div>
    </div>
    <div class="text-center" style="margin-bottom: 20px;line-height:5">
        <table width="100%" align="center" style="border-top:20px solid #f6f6f6; text-align: center;" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="2" style="background:#B61B1B; color:#d8d8d8; text-align:center;">
                    <div style=" padding:10px 20px; font-size:20px;" id="pendapat">Berikan pendapat kalian</div>
                </td>
            </tr>
            <tr>
                <td style="padding:10px 0; border-right:1px solid #ddd; border-bottom:1px solid #ddd; border-left:1px solid #ddd; background:#fff;">
                    <div class="text-center" style="margin-bottom: 20px;line-height:5">
                        <button type="button" style="border:none;color:<?= $l?>" class="btn" data-bs-toggle="modal" data-bs-target="#like">
                            <i class="fa fa-smile-o" style="font-size:100px" aria-hidden="true"></i>
                        </button>
                    </div>
                </td>
                <td style="padding:10px 0; border-right:1px solid #ddd; border-bottom:1px solid #ddd; background:#fff; ">
                    <div class="text-center" style="margin-bottom: 20px;line-height:5">
                        <button type="button" style="border:none;color:<?= $dl?>" class="btn" data-bs-toggle="modal" data-bs-target="#dislike">
                            <i class="fa fa-frown-o" style="font-size:100px" aria-hidden="true"></i>
                        </button>
                    </div>
                </td>
            </tr>
        </table>


    </div>
    <div id="content">
        <article>
            <div class="prod-single-content">
                <table style="border:none;padding:0px;font-size:3px;">
                    <tr style="background-color:#fff;">
                        <td>Kedai</td>
                        <td>:</td>
                        <td><?php echo $u['nm_toko'] ?></td>
                    </tr>
                    <tr style="background-color:#fff;">
                        <td>No Pesanan</td>
                        <td>:</td>
                        <td><?php echo $b['inv_no'] ?></td>
                    </tr>
                    <tr style="background-color:#fff;">
                        <td>Tanggal</td>
                        <td>:</td>
                        <td><?php echo $b['tanggal'] ?></td>
                    </tr>
                    <tr style="background-color:#fff;">
                        <td>Customer</td>
                        <td>:</td>
                        <td><?php echo $b['inv_plg_nama'] ?></td>
                    </tr>
                    <tr style="background-color:#fff;">
                        <td>Status Order</td>
                        <td>:</td>
                        <td><?php echo $b['inv_status'] ?></td>
                    </tr>
                </table>
                <table style="width:100%;border:none;padding:0px;">
                    <thead>
                        <tr>
                            <th style="text-align:center;">Menu</th>
                            <th style="text-align:center;">Harga</th>
                            <th style="text-align:center;">Porsi</th>
                            <th style="text-align:center;">Subtotal</th>
                        </tr>
                        <thead>
                        <tbody>
                            <?php foreach ($data->result_array() as $a) {
                                $menu = $a['detail_menu_nama'];
                                $harga = $a['detail_harjul'];
                                $porsi = $a['detail_porsi'];
                                $subtotal = $a['detail_subtotal'];
                            ?>
                                <tr>
                                    <td><?php echo $menu; ?></td>
                                    <td style="text-align:center;"><?php echo number_format($harga); ?></td>
                                    <td style="text-align:center;"><?php echo $porsi; ?></td>
                                    <td style="text-align:right;"><?php echo number_format($subtotal); ?></td>
                                </tr>

                            <?php
                                $total += $subtotal;
                            } ?>
                        </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="3">Total</td>
                            <td style="text-align:right;"><?php echo number_format($total) ?></td>
                        </tr>
                        <tr>
                            <td colspan="3">Pajak</td>
                            <td style="text-align:right;"><?php echo number_format(($total * (10 / 100))) ?></td>
                        </tr>
                        <tr>
                            <td colspan="3">Grand Total</td>
                            <td style="font-size:15px;font-family: Segoe UI, Arial, sans-serif;font-weight:bold;text-align:right;"><?php echo number_format(($total * 1.1)) ?></td>
                        </tr>
                    </tfoot>
                </table>

                </form>
            </div>
            <div class="s-banner-content;" style="text-align:center;">
                <h5 class="text-center mt-1" style="font-size:35px;color:red;font-family: Segoe UI, Arial, sans-serif;font-weight:bold;">Bayar di <?php echo $u['nm_toko'] ?> </h5>
                <i class="text-center" style="text-align:center;font-size:15px;color:red;font-family: Segoe UI, Arial, sans-serif;"><?php echo $u['almt_toko'] ?></i>
            </div>
            <div class="s-banner-content;" style="text-align:center;line-height:3">
                <i class="text-center" style="text-align:center;font-size:20px;color:red;font-family: Segoe UI, Arial, sans-serif;font-weight:bold;">"Cintai Produk Anak Negeri"</i>
            </div>
        </article>
        <div class="text-center" style="margin-bottom: 20px;line-height:5">
            <a href="https://www.instagram.com/miedjoedes/?hl=id"><img src="<?php echo base_url('assets/') ?>/img/ig.png" style="width: 35px;"></a>
            <a href="https://www.facebook.com/miedjoedesdjoeranyapedes/"><img src="<?php echo base_url('assets/') ?>/img/fb.png" style="width: 35px;"></a>
            <a href="https://www.tiktok.com/@miedjoedes.id"><img src="<?php echo base_url('assets/') ?>/img/tiktok.png" style="width: 35px;"></a>
        </div>
        <div class="text-center" style="margin-bottom: 20px;line-height:5">
            <a href="<?php echo base_url('mobile/member/berhasillogin1') ?>" style="background-color:#e03939;border-radius:10px;color:white;padding:10px;text-decoration:none;"><b>Pesan Lagi</b></a>
            <a href="<?php echo base_url() . 'mobile/myfood/myfood1' ?>" style="background-color:#3962e0;border-radius:10px;color:white;padding:10px;text-decoration:none;"><b>Pesanan Saya</b></a>
        </div>
        <?= $u['map_frame'] ?>
    </div>
    <!-- Menu navigation -->
    <nav id="menu">
        <ul>
            <li class="Selected">
                <a href="#close">
                    <i class="fa fa-times-circle"></i>
                </a>
            </li>
            <li>
                <a href="<?php echo base_url() . 'mobile/member/berhasillogin' ?>">
                    <i class="fa fa-home"></i>Home
                </a>
            </li>
            <li>
                <a href="<?php echo base_url() . 'mobile/menu/belanja1' ?>">
                    <i class="fa fa-shopping-cart"></i>Keranjang Belanja (0)
                </a>
            </li>
            <li>
                <a href="<?php echo base_url() . 'mobile/tracker/tracker1' ?>">
                    <i class="fa fa-crosshairs"></i>Tracker
                </a>
            </li>
            <li>
                <a href="<?php echo base_url() . 'mobile/gallery/gallery1' ?>">
                    <i class="fa fa-camera-retro"></i>Gallery
                </a>
            </li>
            <?php if ($this->session->userdata('online') == TRUE) : ?>
                <li>
                    <a href="<?php echo base_url() . 'mobile/konfirmasi/konfirmasi1' ?>">
                        <i class="fa fa-exchange"></i>Konfirmasi
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url() . 'mobile/myfood/myfood1' ?>">
                        <i class="fa fa-cutlery"></i>My Food
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url() . 'mobile/member/logout' ?>">
                        <i class="fa fa-sign-out"></i>Logout
                    </a>
                </li>
            <?php else : ?>
                <li>
                    <a href="<?php echo base_url() . 'mobile/member' ?>">
                        <i class="fa fa-sign-in"></i>Login
                    </a>
                </li>
            <?php endif; ?>
        </ul>
    </nav>
</body>
<div class="modal fade" id="like" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <form action="<?php echo base_url('mobile/menu/feedback') ?>" method="post">
                <div class="modal-body">
                    <input type="hidden" name="no" value="<?= $b['inv_no'] ?>">
                    <input type="hidden" name="feedback" value="1">
                    <div class="text-center" style="margin-bottom: 20px;line-height:5">
                        <i class="fa fa-smile-o" style="font-size:100px;color:<?= $l?>" aria-hidden="true"></i>
                        <h3>Kirim Pendatapat Anda</h3>
                    </div>
                    <?php 
                    if($b['comment'] === 'waktu'){
                    $waktu = 'checked';
                    $kualitas = '';
                    $service = '';
                    $lainnya = '';
                    }elseif($b['comment'] === 'kualitas'){
                        $waktu = '';
                        $kualitas = 'checked';
                        $service = '';
                        $lainnya = '';
                    }elseif($b['comment'] === 'service'){
                        $waktu = '';
                        $kualitas = '';
                        $service = 'checked';
                        $lainnya = '';
                    }else{
                        $waktu = '';
                        $kualitas = '';
                        $service = '';
                        $lainnya = 'checked';
                    }
                    ?>
                    <table style="margin-left: auto; margin-right: auto;">
                        <tr>
                            <td></td>
                            <td>
                                
                                <div class="form-check mt-3">
                                    <input name="comment" class="form-check-input" onclick="myFunction()" type="radio" value="waktu" <?= $waktu ?>  />
                                    <label class="form-check-label" for="defaultRadio1"> Waktu Pelayanan </label>
                                </div>
                                <div class="form-check">
                                    <input name="comment" class="form-check-input" onclick="myFunction()" type="radio" value="kualitas" <?= $kualitas ?> />
                                    <label class="form-check-label" for="defaultRadio2"> Kualitas Makanan </label>
                                </div>
                                <div class="form-check">
                                    <input name="comment" class="form-check-input" onclick="myFunction()" type="radio" value="service" <?= $service ?> />
                                    <label class="form-check-label" for="defaultRadio2"> Customer Service </label>
                                </div>
                                <div class="form-check">
                                    <input name="comment" id="lain" onclick="myFunction()" class="form-check-input" type="radio" value="lainnya" <?=$lainnya?> />
                                    <label class="form-check-label" for="defaultRadio2"> Lainnya </label>
                                </div>
                            </td>
                            <td></td>
                        </tr>
                    </table>
                    <div class="mb-3">
                        <textarea class="form-control" name="komentar" placeholder="Tinggalkan komentar" id="mytextarea" rows="2"><?= $komentar?></textarea>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary">SIMPAN</button>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="modal fade" id="dislike" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-dialog-lg">
        <div class="modal-content">
            <div class="modal-body">
                <form action="<?php echo base_url('mobile/menu/feedback') ?>" method="post" style="font-size:14px">
                    <div class="modal-body">
                        <input type="hidden" name="no" value="<?= $b['inv_no'] ?>">
                        <input type="hidden" name="feedback" value="2">
                        <div class="text-center" style="margin-bottom: 20px;line-height:5">
                            <i class="fa fa-frown-o" style="font-size:100px;color:<?= $dl?>" aria-hidden="true"></i>
                            <h3>Kirim Pendatapat Anda</h3>
                        </div>
                        <table style="margin-left: auto; margin-right: auto;">
                            <tr>
                                <td></td>
                                <td>
                                    <div class="form-check mt-3">
                                        <input name="comment" class="form-check-input" onclick="myFunction1()" type="radio" value="waktu" <?= $waktu ?>/>
                                        <label class="form-check-label" for="defaultRadio1">Waktu Pelayanan</label>
                                    </div>
                                    <div class="form-check">
                                        <input name="comment" class="form-check-input" onclick="myFunction1()" type="radio" value="kualitas" <?= $kualitas ?> />
                                        <label class="form-check-label" for="defaultRadio2"> Kualitas Makanan </label>
                                    </div>
                                    <div class="form-check">
                                        <input name="comment" class="form-check-input" onclick="myFunction1()" type="radio" value="servive" <?= $service ?> />
                                        <label class="form-check-label" for="defaultRadio2"> Customer Service </label>
                                    </div>
                                    <div class="form-check">
                                        <input name="comment" id="lain1" onclick="myFunction1()" class="form-check-input" type="radio" value="lainnya" <?= $lainnya ?> />
                                        <label class="form-check-label" for="defaultRadio2"> Lainnya </label>
                                    </div>
                                </td>
                                <td></td>
                            </tr>
                        </table>

                        <div class="mb-3">
                            <textarea class="form-control" name="komentar" placeholder="Tinggalkan komentar" id="mytextarea1" rows="2"><?= $komentar1 ?></textarea>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" class="btn btn-primary">SIMPAN</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    // $(document).ready(function() {
    //     var checkBox = document.getElementById("fb");
    //     // Get the output text
    //     let element = document.getElementById("pendapat");
    //     let x = document.getElementById("tombol");

    //     // If the checkbox is checked, display the output text
    //     if (checkBox.innerHTML == 0) {
    //         x.removeAttribute("hidden");
    //     } else {
    //         x.setAttribute("hidden", "hidden");
    //         element.innerHTML = 'Pendapat Kamu Telah Terkirim';
    //     }
    // });

    // function myFunction() {
    //     // Get the checkbox
    //     var checkBox = document.getElementById("lain");
    //     // Get the output text
    //     let element = document.getElementById("mytextarea");

    //     // If the checkbox is checked, display the output text
    //     if (checkBox.checked == true) {
    //         element.removeAttribute("hidden");
    //         element.setAttribute("required", "required");
    //     }
    //     if (checkBox.checked == false) {
    //         element.setAttribute("hidden", "hidden");
    //         element.removeAttribute("required");
    //     }
    // }

    // function myFunction1() {
    //     // Get the checkbox
    //     var checkBox = document.getElementById("lain1");
    //     // Get the output text
    //     let element = document.getElementById("mytextarea1");

    //     // If the checkbox is checked, display the output text
    //     if (checkBox.checked == true) {
    //         element.removeAttribute("hidden");
    //         element.setAttribute("required", "required");
    //     }
    //     if (checkBox.checked == false) {
    //         element.setAttribute("hidden", "hidden");
    //         element.removeAttribute("required");
    //     }
    // }
</script>

</html>