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 :  /proc/self/root/var/www/laciasmara.com/public_html/shop/application/views/themes/3/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/var/www/laciasmara.com/public_html/shop/application/views/themes/3/product.php
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QG3RS04MK3"></script>
<script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
        dataLayer.push(arguments);
    }
    gtag('js', new Date());

    gtag('config', 'G-QG3RS04MK3');
</script>
<style>
    /*initial opacity for 1st attribute detail image */
    ul.blok_select li a.hasImage,
    ul.blok_select li a.noImage span {
        opacity: 0.4
    }

    ul.blok_select li:first-child a.hasImage,
    ul.blok_select li:first-child a.noImage span {
        opacity: 1
    }

    @media (max-width: 768px) {
        .productPrice span {
            display: none;
        }

        .productPrice h2 {
            font-size: 15px;
        }

        .total_box {
            position: -webkit-sticky;
            position: sticky;
            top: 0;
            padding-top: 20px;
            padding-bottom: 20px;
        }

        #row {
            flex-wrap: nowrap;
            top: unset !important;
        }

        .cart_intotal {
            margin-top: 23px;
            margin-left: 10px !important;
        }

        .title_intotal {
            text-align: center;
            line-height: 1.5;
        }

        .productPrice h2 {
            margin-left: -15px;
        }
    }

    @media (max-width: 768px) {
        .relative {
            text-align: center;
            /* Mengatur teks menjadi di tengah secara horizontal */
            display: flex;
            /* Membuat flex container */
            flex-direction: column;
            /* Menjadikan elemen di dalamnya menjadi satu kolom */
            align-items: center;
            /* Mengatur elemen di dalamnya berada di tengah secara vertikal */
        }
    }

    #row {
        top: -65px;
    }

    .product_browse_name h3 a:hover {
        color: <?= $primary_colortheme; ?> !important;
    }

    .product_detail_nv ul li:hover a,
    .product_detail_nv ul li a.active {
        color: <?= $primary_colortheme; ?>;
    }

    /*section.slider{
        height: 100%;
    }
    section.slider div#slider{
        height: 100%;
    } 
    section.slider div#slider div{
        height: 100%;
    }
    section.slider div#slider ul{
        height: 100%;
    }
    section.slider div#slider li{
        height: 100%;
    }
    section.slider div#slider img{
        height: 100%;
    }*/
</style>
<script src='<?= base_url(); ?>/themes/<?= $theme; ?>/js/productPage.js'></script>
<script>
    var baseUrl = '<?= base_url(); ?>';
    var productId = <?= $product->id_products; ?>;
    // alert(productId);
    var csrfHash = '<?= $this->security->get_csrf_hash(); ?>';
    var indentTime = '<?= $product->indent_time; ?>';
    var indentDp = <?= $product->indent_dp; ?>;
    var chosenVarianDetailArray = new Array(<?= count($initial_varian_detail_ids); ?>);
    <?php $count_varian_detail = 0; ?>
    <?php foreach ($initial_varian_detail_ids as $detail_id) : ?>
        chosenVarianDetailArray[<?= $count_varian_detail; ?>] = <?= $detail_id; ?>;
        <?php $count_varian_detail++; ?>
    <?php endforeach; ?>

    jQuery(document).ready(function() {
        initialProductDetail(chosenVarianDetailArray, productId, baseUrl, csrfHash, indentTime, indentDp,
            function(dsc) {
                dynamicStockCondition(dsc);
            }
        );
    });
</script>
<?php
$this->session->set_userdata("ses_product", $product);
$warehouse_id = 1;
$product_detail_ids = $this->db->select('id')
    ->from('product_details')
    ->where('product_id', $product->id_products)
    ->where('price !=', 0)
    ->order_by('price', 'ASC')
    ->get()
    ->result();

$product_detail_ids_array = array();
foreach ($product_detail_ids as $product_detail) {
    $product_detail_ids_array[] = $product_detail->id;
}

// $product_detail_ids_array akan berisi semua ID yang diperoleh

// get current stock and attribute detail for each product detail
$current_stock_array = array();
$varian_attribute_names = array();
foreach ($product_detail_ids_array as $product_detail_id) {
    $current_stock = $this->db->select('stock, stock_keep')
        ->from('stock')
        ->where('id_product', $product->id_products)
        ->where('id_product_detail', $product_detail_id)
        ->where('warehouse_id', $warehouse_id)
        ->get()
        ->row_array();

    $current_stock_array[] = $current_stock['stock'] - $current_stock['stock_keep'];

    // Get attribute detail for product detail
    $attribute_detail = $this->db->select('pad.attribute_detail')
        ->from('product_combination pc')
        ->join('product_attributes_detail pad', 'pc.attribute_detail_id = pad.id')
        ->where('pc.product_details_id', $product_detail_id)
        ->get()
        ->row();

    $varian_attribute_names[] = $attribute_detail->attribute_detail;
}
$restock = $this->db->select('restock')
    ->from('products')
    ->where('id_products', $product->id_products)
    ->get()
    ->row_array();

?>

<h1 hidden> <?= ucfirst($product->title); ?></h1>

<div class="home_sec2">

    <div class="total_box total_box_fix total_box_res" style="display:none;">
        <div class="wrapp2">
            <div class="wrapp3 no_pading_right">
                <div class="row">
                    <div class="col-md-6">
                        <div class="title_intotal">
                            <?= ucfirst($product->title); ?> <?= ucfirst($brand_name); ?>
                        </div>
                    </div>
                    <div class="col-md-6 relative">
                        <div class="total_price_intotal productPrice"></div>
                        <?php
                        $reseller_id = $this->db->select('reseller_id')->from('customers')->where('id_customers', $this->session->userdata('customer')['customer_id'])->get()->row()->reseller_id;
                        if ($reseller_id == NULL) : ?>
                            <div class="qty_intotal">
                                <span><?= ucfirst(lang('quantity')); ?></span>
                                <input id="qty1" type="text" value="1" />
                            </div>
                        <?php else : ?>
                            <div class="qty_intotal">
                                <span><?= ucfirst(lang('quantity')); ?></span>
                                <input id="qty1" type="text" value="" />
                                <span id="qty1Error" style="color: red; display: none;"><?= ucfirst(lang('warningcart')); ?></span>
                            </div>
                        <?php endif; ?>

                        <div class="cart_intotal">
                            <input class="submitToCart" id="submitToCart1" type="button" value="<?= ucfirst(lang('add_to_cart_demo2')); ?>" style="cursor:pointer;" data-toggle="modal" />
                            <?php
                            $reseller_id = $this->db->select('reseller_id')->from('customers')->where('id_customers', $this->session->userdata('customer')['customer_id'])->get()->row()->reseller_id;
                            if ($reseller_id == NULL) : ?>


                            <?php else : ?>
                                <?php
                                echo "<span>Stock :</span> <br>";
                                if (!empty($current_stock_array)) {
                                    foreach ($current_stock_array as $index => $stock) {
                                        echo "<span> " . $varian_attribute_names[$index] . ": </span> ";
                                        echo "<span>" . $stock . " ||</span> ";
                                    }
                                } else {
                                    echo "<span>No stock found for this product.</span>";
                                }
                                ?>
                            <?php endif; ?>
                        </div>

                        <script>
                            document.addEventListener("DOMContentLoaded", function() {
                                var qtyInput = document.getElementById("qty1");
                                var qtyError = document.getElementById("qty1Error");

                                // Function to check if the quantity is valid
                                function validateQuantity() {
                                    var quantity = qtyInput.value.trim();
                                    if (quantity === "" || quantity <= 0) {
                                        qtyError.style.display = "block";
                                        return false;
                                    }
                                    qtyError.style.display = "none";
                                    return true;
                                }

                                // Add event listener to the submit button
                                var submitButton = document.getElementById("submitToCart1");
                                submitButton.addEventListener("click", function() {
                                    if (!validateQuantity()) {
                                        return;
                                    }
                                });
                            });
                        </script>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="total_box  ">
        <div class="wrapp2">
            <div class="wrapp3 no_pading_right">
                <div class="row">
                    <div class="col-md-6">
                        <div class="title_intotal">
                            <?= ucfirst($product->title); ?> <?= ucfirst($brand_name); ?>
                        </div>
                    </div>
                    <div class="col-md-6 relative">
                        <div class="total_price_intotal productPrice"></div>
                        <?php
                        $reseller_id = $this->db->select('reseller_id')->from('customers')->where('id_customers', $this->session->userdata('customer')['customer_id'])->get()->row()->reseller_id;
                        if ($reseller_id == NULL) : ?>
                            <div class="qty_intotal">
                                <span><?= ucfirst(lang('quantity')); ?></span>
                                <input id="qty2" type="text" value="1" />
                            </div>
                        <?php else : ?>
                            <div class="qty_intotal">
                                <span><?= ucfirst(lang('quantity')); ?></span>
                                <input id="qty2" type="text" value="" />
                                <span id="qty2Error" style="color: red; display: none;"><?= ucfirst(lang('warningcart')); ?></span>
                            </div>
                        <?php endif; ?>

                        <div class="cart_intotal">
                            <input class="submitToCart" id="submitToCart2" type="button" value="ADD TO CART" style="cursor:pointer;" data-toggle="modal" data-target="#modalIndentTOC" />
                            <?php
                            $reseller_id = $this->db->select('reseller_id')->from('customers')->where('id_customers', $this->session->userdata('customer')['customer_id'])->get()->row()->reseller_id;
                            if ($reseller_id == NULL) : ?>


                            <?php else : ?>
                                <?php
                                echo "<span>Stock :</span> <br>";
                                if (!empty($current_stock_array)) {
                                    foreach ($current_stock_array as $index => $stock) {
                                        echo "<span> " . $varian_attribute_names[$index] . ": </span> ";
                                        echo "<span>" . $stock . " ||</span> ";
                                    }
                                } else {
                                    echo "<span>No stock found for this product.</span>";
                                }
                                ?>
                            <?php endif; ?>
                        </div>

                        <script>
                            document.addEventListener("DOMContentLoaded", function() {
                                var qtyInput = document.getElementById("qty2");
                                var qtyError = document.getElementById("qty2Error");

                                // Function to check if the quantity is valid
                                function validateQuantity() {
                                    var quantity = qtyInput.value.trim();
                                    if (quantity === "" || quantity <= 0) {
                                        qtyError.style.display = "block";
                                        return false;
                                    }
                                    qtyError.style.display = "none";
                                    return true;
                                }

                                // Add event listener to the submit button
                                var submitButton = document.getElementById("submitToCart2");
                                submitButton.addEventListener("click", function() {
                                    if (!validateQuantity()) {
                                        return;
                                    }
                                });
                            });
                        </script>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="wrapp2">
        <div class="product_browse product_detail">

            <div id="prdt_lis" class="height_48"></div>

            <div class="product_detail_nv_res">
                <ul class="product_detail_nv">
                    <ul class="clearfix">
                        <li class="apx0"><a href="#prdt_lis">Overview</a></li>
                        <!-- <li class="apx1"><a href="#prdt_desc">Description</a></li> -->
                        <li class="apx1"><a href="#prdt_details"><?= ucfirst(lang('rincian')); ?></a></li>
                        <?php if ($modules_setting->product_review == "yes") : ?>
                            <li class="apx1"><a href="#review"><?= ucfirst(lang('ulasan')); ?></a></li>
                        <?php endif; ?>
                    </ul>
                </ul>
            </div>

            <div class="wrapp3 no_pading_right">

                <div class="row product_main product_detail_overview">

                    <div class="col-md-5 product_main_image" id="productImageContainer"></div>

                    <div class="col-md-1"></div>
                    <div class="col-md-6 product_detail_desc" style="margin: 0px !important;">

                        <div class="dtl_list">
                            <div class="row">
                                <div class="col-md-12">
                                    <h3 style="color:<?= $primary_colortheme; ?>;"><?= ucfirst($product->title); ?></h3>
                                </div>
                                <div class="col-md-6"></div>
                            </div>
                            <div class="row">
                                <div class="col-md-6"><?= ucfirst($brand_name); ?></div>
                                <div class="col-md-6 gold"></div>
                            </div>
                            <?php
                            $reseller_id = $this->db->select('reseller_id')->from('customers')->where('id_customers', $this->session->userdata('customer')['customer_id'])->get()->row()->reseller_id;
                            if ($reseller_id == null) : ?>

                            <?php else : ?>
                                <div class="row" style="margin-top: 5px; margin-left: 3px;">
                                    <a target="_blank" href="<?= $product->media_file_link; ?>" class="btn btn-primary">
                                        <i class="fa fa-file"></i> Media File
                                    </a>
                                    <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#shareModal">
                                        <i class="fa fa-share"></i> Share
                                    </button>
                                </div>
                            <?php endif;
                            ?>
                        </div>
                        <style>
                            .copy-link {
                                color: <?= $primary_colortheme; ?>;
                                /* Primary color */
                            }

                            .copy-link:hover {
                                color: #0056b3;
                                /* Hover color */
                                text-decoration: none;
                            }
                        </style>
                        <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.8/clipboard.min.js"></script>
                        <script>
                            var clipboard = new ClipboardJS('.copy-link');
                        </script>
                        <div class="modal fade" id="shareModal" tabindex="-1" aria-labelledby="shareModalLabel" aria-hidden="true">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header" style="background-color: <?= $primary_colortheme; ?>;">
                                        <h5 class="modal-title" id="shareModalLabel" style="color:white;">Share This Content</h5>
                                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                                    </div>
                                    <div class="modal-body">
                                        <p>Click on a social media icon to share this content: </p>
                                        <ul class="list-unstyled">
                                            <li>
                                                <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($url); ?>" target="_blank">
                                                    <i class="fab fa-facebook fa-2x"></i>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="https://twitter.com/intent/tweet?url=<?php echo urlencode($url); ?>&amp;text=<?php echo urlencode($title); ?>&amp;via=<?php echo urlencode($via); ?>" target="_blank">
                                                    <i class="fab fa-twitter fa-2x"></i>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="https://www.linkedin.com/sharing/share-offsite/?url=<?php echo urlencode($url); ?>" target="_blank">
                                                    <i class="fab fa-linkedin fa-2x"></i>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="https://wa.me/?text=<?php echo urlencode($title); ?>%20<?php echo urlencode($url); ?>" target="_blank">
                                                    <i class="fab fa-whatsapp fa-2x"></i>
                                                </a>
                                            </li>
                                            <li>
                                                <button class="btn btn-link copy-link" data-clipboard-text="<?php echo $url; ?>">
                                                    <i class="far fa-copy fa-2x">Copy Link</i>
                                                </button>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="dtl_list">
                            <!-- <div class="row">
                                <div class="col-md-6"><strong><?= ucfirst(lang('estimated')); ?></strong></div>
                            </div>
                            <div class="row">
                                <div class="col-md-6" id="indentTime"></div>
                            </div>
                            <br> -->
                            <?php if ($modules_setting->product_review == "yes") : ?>
                                <div class="row">
                                    <?php
                                    if (count($product_reviews) > 0) {
                                        $total_sum = 0;
                                        foreach ($product_reviews as $product_review) {
                                            $total_sum = $total_sum + $product_review->rating;
                                        }

                                        $star_rating =  floor($total_sum / count($product_reviews));
                                    }
                                    ?>
                                    <?php if (count($product_reviews) > 0) : ?>
                                        <div class="col-md-6">
                                            <?php for ($i = 0; $i < $star_rating; $i++) : ?>
                                                <i class="fa fa-star" style="color:<?= $primary_colortheme; ?>"></i>
                                            <?php endfor; ?>
                                        </div>
                                    <?php endif; ?>
                                </div>
                                <span class="text-muted align-middle" style="font-size: 14px;"><?= count($product_reviews); ?> reviews</span><br>
                            <?php endif; ?>
                        </div>

                        <?php
                        //check if count varian details is more than 1
                        $count_varian_details = 0;
                        foreach ($varians as $varian) {
                            $varian_details = get_varian_data($varian->attribute_id, $product->id_products)['varian_details'];
                            $count_varian_details = $count_varian_details + count($varian_details);
                        }
                        ?>
                        <?php
                        $reseller_id = $this->db->select('reseller_id')->from('customers')->where('id_customers', $this->session->userdata('customer')['customer_id'])->get()->row()->reseller_id;
                        if ($reseller_id == NULL) : ?>


                        <?php else : ?>
                            <?php if ($restock['restock'] == 'no') {
                                echo "<span>Status Restock : Discontinued </span>";
                            } else if ($restock['restock'] == 'yes') {
                                echo "<span>Status Restock : Coming soon</span>";
                            } ?> <br>
                        <?php endif; ?>

                        <?php if ($count_varian_details > 1) : ?>

                            <?php $count_varian = 0; ?>
                            <?php foreach ($varians as $varian) : ?>

                                <?php
                                $varian_details = get_varian_data($varian->attribute_id, $product->id_products)['varian_details'];
                                $varian_name = get_varian_data($varian->attribute_id, $product->id_products)['varian_name'];
                                ?>

                                <?php if (count($varian_details) > 0) : ?>

                                    <?php $count_varian++; ?>

                                    <div class="dtl_select" id="varian<?= $varian->attribute_id; ?>">

                                        <strong><?= ucfirst(lang('select')); ?> <?= ucfirst($varian_name); ?></strong>


                                        <ul class="blok_select have_sst">
                                            <?php $count = 0; ?>

                                            <?php foreach ($varian_details as $varian_detail) : ?>
                                                <?php $count++; ?>
                                                <?php
                                                $query_product_attributes = $this->db->get_where('product_attributes', array('id' => $varian_detail->product_attribute_id));

                                                $is_color = $query_product_attributes->row()->is_color;

                                                $background_color = 'white';
                                                $text_color = 'black';

                                                if ($is_color == 'yes') {
                                                    $background_color = $varian_detail->color_hex;
                                                    $text_color = 'white';
                                                    if (strtolower($varian_detail->attribute_detail) == 'white' || strtolower($varian_detail->attribute_detail) == 'putih') {
                                                        $background_color = $varian_detail->color_hex;
                                                        $text_color = 'black';
                                                    }
                                                }

                                                ?>

                                                <li id="<?= $varian_detail->attribute_detail_id; ?>">

                                                    <?php if ($count == 1) : ?>
                                                        <div class="select" id="detailName<?= $varian->attribute_id; ?>" style="min-width: 200px;">
                                                            <?= ucfirst($varian_detail->attribute_detail); ?>
                                                        </div>
                                                    <?php endif; ?>

                                                    <?php if (!empty($varian_detail->image)) : ?>
                                                        <a id="a_varian_<?= strtolower($varian_detail->attribute_detail); ?>" class="hasImage" data="<?= $varian_detail->attribute_detail_id; ?>" href="" style="color:black;"><img alt="<?= ucfirst($varian_detail->attribute_detail); ?>" title="<?= ucfirst($varian_detail->attribute_detail); ?>" style="border:1px solid <?= $this->session->userdata('p_color'); ?>;" src="<?= base_url() . 'uploads/varian/' . $varian_detail->image; ?>">
                                                        </a>
                                                    <?php else : ?>
                                                        <a id="a_varian_<?= strtolower($varian_detail->attribute_detail); ?>" class="noImage" data="<?= $varian_detail->attribute_detail_id; ?>" href="">
                                                            <span style="line-height: 55px; 
                                                    color: <?= $text_color; ?>; 
                                                    background: <?= $background_color; ?>; 
                                                    border:1px solid <?= $this->session->userdata('p_color'); ?>; display: block;" title="<?= ucfirst($varian_detail->attribute_detail); ?>">
                                                                <!-- <?= ucfirst($varian_detail->attribute_detail); ?>   -->
                                                            </span>
                                                        </a>
                                                    <?php endif; ?>
                                                </li>

                                                <?php if (!empty($varian_detail->image)) : ?>
                                                    <?php $image_class = 'hasImage'; ?>
                                                    <?php $image_span = ''; ?>
                                                <?php else : ?>
                                                    <?php $image_class = 'noImage'; ?>
                                                    <?php $image_span = ' span'; ?>
                                                <?php endif; ?>

                                                <script>
                                                    changeVarian(<?= $varian->attribute_id; ?>, <?= $varian_detail->attribute_detail_id; ?>, '<?= $image_class; ?>', '<?= $image_span; ?>', <?= $count_varian; ?>);
                                                </script>

                                            <?php endforeach; ?>
                                        </ul>
                                    </div>
                                <?php endif; ?>
                            <?php endforeach; ?>

                        <?php endif; ?>




                        <p style="color:red" id="notAvailable"></p>
                        <br>
                        <h3 style="font-size: 22px;"><?= ucfirst(lang('description')); ?></h3>
                        <?php if ($this->session->userdata('site_lang') == 'english') : ?>
                            <?= ucfirst($product->description_en); ?>
                        <?php else : ?>
                            <?= ucfirst($product->description); ?>
                        <?php endif; ?>

                        <?php

                        $query_custom_info = $this->db->get("custom_info")->row();

                        if ($this->session->userdata('site_lang') == 'english') {

                            $query_custom_info->custom_info = str_replace("<p>", "", $query_custom_info->custom_info_en);
                            $query_custom_info->custom_info = str_replace("</p>", "", $query_custom_info->custom_info);

                            $query_custom_info->custom_info2 = str_replace("<p>", "", $query_custom_info->custom_info2_en);
                            $query_custom_info->custom_info2 = str_replace("</p>", "", $query_custom_info->custom_info2);

                            $query_custom_info->custom_info3 = str_replace("<p>", "", $query_custom_info->custom_info3_en);
                            $query_custom_info->custom_info3 = str_replace("</p>", "", $query_custom_info->custom_info3);
                        } else {

                            $query_custom_info->custom_info = str_replace("<p>", "", $query_custom_info->custom_info);
                            $query_custom_info->custom_info = str_replace("</p>", "", $query_custom_info->custom_info);

                            $query_custom_info->custom_info2 = str_replace("<p>", "", $query_custom_info->custom_info2);
                            $query_custom_info->custom_info2 = str_replace("</p>", "", $query_custom_info->custom_info2);

                            $query_custom_info->custom_info3 = str_replace("<p>", "", $query_custom_info->custom_info3);
                            $query_custom_info->custom_info3 = str_replace("</p>", "", $query_custom_info->custom_info3);
                        }
                        ?>

                        <div class="row">
                            <div style="margin: 5px;">
                                <a data-toggle="tooltip" data-placement="bottom" title="<?= $query_custom_info->custom_info; ?>" href="#" class="a_upper_menu1 btn" style="border:1px solid <?= $primary_colortheme; ?>; background:<?= $primary_colortheme; ?>; color:#FFF; padding: 2px; padding-left: 5px; padding-right: 5px; font-size: 13px;"><i class="fa fa-truck" aria-hidden="true"></i> <?php if ($this->session->userdata('site_lang') == 'english') {
                                                                                                                                                                                                                                                                                                                                                                                                        echo 'Free Shipping';
                                                                                                                                                                                                                                                                                                                                                                                                    } else {
                                                                                                                                                                                                                                                                                                                                                                                                        echo 'Gratis Ongkir';
                                                                                                                                                                                                                                                                                                                                                                                                    } ?> </a>
                            </div>
                            <div style="margin: 5px;">
                                <a data-toggle="tooltip" data-placement="bottom" title="<?= $query_custom_info->custom_info2; ?>" href="#" class="a_upper_menu2 btn" style="border:1px solid <?= $primary_colortheme; ?>; background:<?= $primary_colortheme; ?>; color:#FFF; padding: 2px; padding-left: 5px; padding-right: 5px;font-size: 13px;"><i class="fa fa-exclamation-circle" aria-hidden="true"></i> <?php if ($this->session->userdata('site_lang') == 'english') {
                                                                                                                                                                                                                                                                                                                                                                                                                    echo 'Packaging';
                                                                                                                                                                                                                                                                                                                                                                                                                } else {
                                                                                                                                                                                                                                                                                                                                                                                                                    echo 'Pengemasan ';
                                                                                                                                                                                                                                                                                                                                                                                                                } ?> </a>
                            </div>
                            <div style="margin: 5px;">
                                <a data-toggle="tooltip" data-placement="bottom" title="<?= $query_custom_info->custom_info3; ?>" href="#" class="btn" style="border:1px solid <?= $primary_colortheme; ?>; background:<?= $primary_colortheme; ?>; color:#FFF; padding: 2px; padding-left: 5px; padding-right: 5px;font-size: 13px;"><i class="fa fa-question-circle" aria-hidden="true"></i> <?php if ($this->session->userdata('site_lang') == 'english') {
                                                                                                                                                                                                                                                                                                                                                                                                    echo 'Guaranteed';
                                                                                                                                                                                                                                                                                                                                                                                                } else {
                                                                                                                                                                                                                                                                                                                                                                                                    echo 'Garansi';
                                                                                                                                                                                                                                                                                                                                                                                                } ?> </a>
                            </div>
                        </div>


                    </div>



                </div><!-- End Product Detail Overview -->
                <!-- Start Product Detail Description -->
                <div id="prdt_details" class="" tabindex="-1"></div>
                <div class="product_main product_detail_desc" style="color:white; background:<?= $primary_colortheme; ?>; padding: 30px;" id="">
                    <div class="product_detail_title">
                        <h3><?= ucfirst(lang('rincian')); ?></h3>
                        <h4><?= ucfirst($product->title); ?></h4>
                    </div>
                    <div class="row">

                        <div class="col-md-12 font_14">
                            <?php if ($this->session->userdata('site_lang') == 'english') : ?>
                                <?= ucfirst($product->long_description_en); ?>
                            <?php else : ?>
                                <?= ucfirst($product->long_description); ?>
                            <?php endif; ?>
                        </div>
                    </div>

                </div>
                <!-- End Product Detail Description -->

                <br>
                <div class="row">
                    <?php if (!empty($product->product_video_link)) : ?>
                        <div class="col-md-6 ">
                            <h3><?= ucfirst(lang('video_product')); ?></h3>
                            <iframe width="480" height="300" src="<?= $product->product_video_link; ?>" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
                        </div>
                    <?php endif; ?>
                    <?php if (!empty($product->product_guide_link)) : ?>
                        <div class="col-md-6 ">
                            <h3><?= ucfirst(lang('video_guide')); ?></h3>
                            <iframe width="480" height="300" src="<?= $product->product_guide_link; ?>" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
                        </div>
                    <?php endif; ?>

                </div>
                <br>
                <?= $this->session->flashdata('product_review'); ?>
                <?php if ($modules_setting->product_review == "yes") : ?>
                    <div id="review" class="" tabindex="-1" style="height:30px;"></div>
                    <div class="product_main product_detail_details padding_bot_140" id="">
                        <div class="product_detail_title">
                            <h3><?= ucfirst(lang('ulasan')); ?></h3>
                            <br>
                        </div>
                        <?php if (count($product_reviews) > 0) : ?>

                            <?php foreach ($product_reviews as $review) : ?>
                                <!-- Review-->
                                <div class="comment" style="border: 1px solid;padding: 20px;">
                                    <div class="comment-body">
                                        <div class="comment-header d-flex flex-wrap justify-content-between">
                                            <?php
                                            $reviewTitle = str_replace("?", "", $review->subject);
                                            ?>
                                            <h4 class="comment-title"><?= ucfirst($reviewTitle); ?> <small> ( <?= $review->display_name ?> ) </small> </h4>

                                            <div class="mb-2">
                                                <p><?= date('d-M-Y', strtotime($review->review_date));  ?></p>
                                                <div class="rating-stars">
                                                    <?php for ($i = 0; $i < $review->rating; $i++) : ?>
                                                        <i class="fa fa-star" style="color:<?= $primary_colortheme; ?>;"></i>
                                                    <?php endfor; ?>
                                                </div>
                                            </div>
                                        </div>
                                        <p class="comment-text">
                                            <?php
                                            $review = str_replace("?", "", $review->review);
                                            ?>
                                            <?= ucfirst($review); ?>
                                        </p>
                                        <?php
                                        //get customer name
                                        $this->db->select('name')->from('customers')->where('id_customers', $review->customer_id);
                                        $customer_name = $this->db->get()->row()->name;
                                        ?>
                                        <?php if ($review->display_name == "") : ?>

                                            <div class="comment-footer"><span class="comment-meta"><?= ucwords($customer_name); ?></span></div>

                                        <?php endif; ?>

                                        <div class="comment-footer"><span class="comment-meta"><?= $review->display_name; ?></span></div>

                                    </div>
                                </div>
                                <br>
                            <?php endforeach; ?>

                        <?php else : ?>
                            <p><?= ucfirst(lang('review_first')); ?></p>
                        <?php endif; ?>

                        <!-- Review Form-->
                        <br>
                        <br>
                        <h5 class="mb-30 padding-top-1x"><?= ucfirst(lang('add_review')); ?></h5>

                        <?php if ($this->session->userdata('customer')['customer_name']) : ?>

                            <?php
                            $attributes = array(
                                'class' => 'row'
                            );
                            echo form_open('product_review/add_review', $attributes);
                            ?>

                            <input type="hidden" name="product_alias" value="<?= $product->alias; ?>">
                            <input type="hidden" name="product_id" value="<?= $product->id_products; ?>">


                            <div class="col-sm-4 ">
                                <div class="form-group">
                                    <label for="display_name">Display Name (Optional)</label>
                                    <input name="display_name" class="form-control form-control-rounded" type="text" id="review_name">
                                </div>
                            </div>

                            <div class="col-sm-4 ">
                                <div class="form-group">
                                    <label for="subject"><?= ucfirst(lang('title_review')); ?></label>
                                    <input name="subject" required class="form-control form-control-rounded" type="text" id="review_subject" required>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <div class="form-group">
                                    <label for="review_rating"><?= ucfirst(lang('rating')); ?></label>
                                    <select name="rating" class="form-control form-control-rounded" id="review_rating">
                                        <option value="5">5 <?= ucfirst(lang('stars')); ?></option>
                                        <option value="4">4 <?= ucfirst(lang('stars')); ?></option>
                                        <option value="3">3 <?= ucfirst(lang('stars')); ?></option>
                                        <option value="2">2 <?= ucfirst(lang('stars')); ?></option>
                                        <option value="1">1 <?= ucfirst(lang('stars')); ?></option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-12">
                                <div class="form-group">
                                    <label for="review_text"><?= ucfirst(lang('ulasan')); ?> </label>
                                    <textarea name="review" class="form-control form-control-rounded" id="review_text" rows="8" required></textarea>
                                </div>
                            </div>
                            <div class="col-12 text-right">
                                <input type="submit" name="submit_review" class="btn btn-outline-primary" value="Kirim Ulasan"></input>
                            </div>
                            <?= form_close(); ?>

                        <?php else : ?>
                            <p><strong><?= ucfirst(lang('login_please')); ?> <a style="color:<?= $primary_colortheme; ?>" href="<?= base_url('login'); ?>"><?= ucfirst(lang('login')); ?></a> <?= lang('login_provide'); ?></strong></p>
                        <?php endif; ?>

                    </div>
                <?php endif; ?>
            </div>
        </div>

        <!-- <div style="width: 100%; border-bottom: 0.5px solid silver;"></div>
        <br><br> -->
        <!-- <h2 style="color:<?= $this->session->userdata('p_color'); ?>; text-align: center; font-size: 1.5rem; font-family: 'din_next_lt_prolight';"><img style="width:18px;" src="<?= base_url("themes/3/images/title-background.png"); ?>"> &nbsp;&nbsp;Bought Together &nbsp;&nbsp; <img style="width:18px;" src="<?= base_url("themes/3/images/title-background.png"); ?>"></h2> -->


        <div class="spacer"></div>
        <!-- start item -->
        <!-- Product Browse -->

        <?php
        // Modules::run('newarrival/frontpage/'.$product->id_products); 
        ?>
        <!-- store master3 -->

        <!-- end item -->

        <div class="product_detail_nv_box">
            <ul class="product_detail_nv">
                <ul class="clearfix">
                    <li class="apx0"><a href="#prdt_lis">Overview</a></li>
                    <!-- <li class="apx1"><a href="#prdt_desc">Description</a></li> -->
                    <li class="apx1"><a href="#prdt_details"><?= ucfirst(lang('rincian')); ?></a></li>
                    <?php if ($modules_setting->product_review == "yes") : ?>
                        <li class="apx1"><a href="#review"><?= ucfirst(lang('ulasan')); ?></a></li>
                    <?php endif; ?>
                </ul>
            </ul>
        </div>
    </div>
</div>
<?php
$this->load->module('newarrival');
echo $this->newarrival->frontpage($product->id_products);
?>

<div class="modal fade" id="modalIndentTOC" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">TERMS & CONDITIONS</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <?= ucfirst($toc_indent); ?>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="width:50%">NO</button>
                <a id="indentTOCAgree" class="btn btn-secondary" style="width:50%" href="#" data-toggle="modal" data-target="#cart_madal">AGREE</a>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="modalIndentTOC" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">TERMS & CONDITIONS</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <?= ucfirst($toc_indent); ?>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button type="button" class="btn btn-primary" data-dismiss="modal" style="width:50%">NO</button>
                <a id="indentTOCAgree" class="btn btn-secondary" style="width:50%" href="#" data-toggle="modal" data-target="#cart_madal">AGREE</a>
            </div>
        </div>
    </div>
</div>
<style>
    /* Base styles */
    .custom-div {
        padding: 10px;
        border-right: 1px solid #ccc;
        width: 50%;
        text-align: center;
    }


    .custom-ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }


    /* Responsive styles */
    @media only screen and (max-width: 600px) {
        .custom-div {
            border-right: none;
            text-align: center;
            width: 100%;

        }

        .custom-div2 {
            display: none;
        }
    }
</style>
<div class="modal fade" id="ModalAddtocartSukses" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">
                    <b id="cartMessage"></b>
                    <a href="#" style="position: absolute;top: 0; right: 0; padding: 15px; color: black;" data-dismiss="modal">X</a>
                </h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <!-- Bagian kiri dari modal body -->
                    <div class="custom-div">
                        <h5><?= $product->title; ?></h5>
                        <img style="width: 40vh;" src="<?= base_url() . 'uploads/product/' . $image_cart->image; ?>" alt="<?= $image_cart->alt; ?>">
                        <a id="opencart" class="btn btn-primary" style="width: 100%;" href="#" data-dismiss="modal" data-toggle="modal" data-target="#cart_madal"><?= ucfirst(lang('opencart')); ?></a>
                    </div>

                    <!-- Bagian kanan dari modal body -->
                    <div class="col-6 custom-div2">
                        <h2 style="color:black; text-align: center; font-size: 1.5rem;"><?php if ($this->session->userdata('site_lang') == 'english') {

                                                                                            echo "Frequently bought together with";
                                                                                        } else {

                                                                                            echo "Beli Barengan";
                                                                                        } ?></h2>
                        <ul class="custom-ul clearfix">
                            <?php foreach ($boughttogether as $item) : ?>
                                <!-- Product Item -->

                                <li style="display: inline-block;
                                    margin-right: 20px;
                                    vertical-align: top; list-style: none; width: 20vh; " id="li_product_id<?= $key; ?>" data-id="<?= $item->id_products; ?>">


                                    <div class="product_browse_img">
                                        <?php
                                        $this->load->helper('product');
                                        $thumbnail = get_product_thumbnail($item->id_products);
                                        ?>
                                        <img title="<?= $thumbnail['alt1']; ?>" alt="<?= $thumbnail['alt1']; ?>" src="<?= $thumbnail['image1']; ?>" /> <!-- Adjust width and height as needed -->
                                        <a href="<?= base_url() . 'product/' . strtolower($item->alias); ?>">
                                            <div class="product_browse_img_hover" style=" background: unset; background-image: url('<?= $thumbnail["image2"]; ?>'); background-repeat: no-repeat; background-size: cover;">
                                            </div>
                                        </a>
                                    </div>
                                    <div class="product_browse_name" style="text-align:center;">
                                        <h3>
                                            <a href="<?= base_url() . 'product/' . strtolower($item->alias); ?>"><?= ucwords($item->title); ?></a>
                                        </h3>
                                        <div class="dtl_price">
                                            <a href="<?= base_url() . 'product/' . strtolower($item->alias); ?>" class="btn btn-primary add-to-cart-btn" data-alias="<?= strtolower($item->alias); ?>">
                                                <?php if ($this->session->userdata('site_lang') == 'english') {
                                                    echo "View Product";
                                                } else {
                                                    echo "Lihat Produk";
                                                } ?>
                                            </a>
                                            <br>
                                            <ul>
                                                <?php
                                                $reseller_id = $this->db->select('reseller_id')->from('customers')->where('id_customers', $this->session->userdata('customer')['customer_id'])->get()->row()->reseller_id;

                                                if ($reseller_id == NULL) : ?>
                                                    <?php $lowest_price = get_lowest_price($item->id_products); ?>
                                                    <?php if ($lowest_price->discounted_price == 0) : ?>
                                                        <li><span><!-- <?= ucwords(lang('from')); ?> --></span> <?= number_format($lowest_price->price, 0, ',', '.'); ?> IDR</li>
                                                    <?php else : ?>
                                                        <li><span><!-- <?= ucwords(lang('from')); ?> --></span> <?= number_format($lowest_price->discounted_price, 0, ',', '.'); ?> IDR</li>
                                                        <li class="jrett"><?= number_format($lowest_price->price, 0, ',', '.'); ?> IDR</li>
                                                    <?php endif; ?>
                                                <?php else : ?>

                                                    <?php
                                                    $product_detail_id = $this->db->select('id')->from('product_details')->where('product_id', $item->id_products)->where('price !=', 0)->order_by('price', 'ASC')->limit(1)->get()->row()->id;

                                                    $reseller_price = $this->db->select('price')->from('resellers_price')->where('product_detail_id', $product_detail_id)->where('reseller_id', $reseller_id)->get()->row()->price;
                                                    ?>
                                                    <li><span><!-- <?= ucwords(lang('from')); ?> --></span> <?= number_format($reseller_price, 0, ',', '.'); ?> IDR</li>

                                                <?php endif; ?>

                                            </ul>
                                        </div>
                                    </div>
                                </li><!-- End Product Item -->

                            <?php endforeach; ?>
                        </ul>
                    </div>
                </div>

            </div>
            <div class="modal-footer" style="text-align: center;">
                <!-- Footer modal jika diperlukan -->
            </div>
        </div>
    </div>
</div>

https://t.me/RX1948 - 2025