<?php $__env->startSection('content'); ?>
    <style>
        .user-info {
            margin: 0 auto;
            max-width: 48%;
            background-color: #ffffff;
            border: 1px solid #e7e6e6;
            border-radius: 5px;
            padding: 10px;
            margin: 1% 1% 1% 1%;
        }

        .user-info p {
            font-size: 14px;
            margin-bottom: 0px;
        }

        .user-info .id {
            color: #888;
        }

        .user-info .mobile {
            font-weight: bold;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .buttons-container {
            display: flex;
            gap: 10px;
            /* Adjust the gap as needed */
        }


        .pres-info {
            margin: 0 auto;
            max-width: 100%;
            background-color: #f9f9f9;
            border: 1px solid #ddd;
            border-radius: 5px;
            padding: 10px;
            margin: 0 0 20px 0;
        }

        .pres-info p {
            font-size: 14px;
            margin-bottom: 0px;
        }


        /* Image Slider Section */
        .image-slider-container {
            display: flex;
            justify-content: flex-end;
        }

        .swiper-container {
            position: relative;
        }

        .swiper-button-prev,
        .swiper-button-next,
        .swiper-pagination-bullet {
            color: #696cff !important;
        }

        .swiper-pagination-bullet-active {
            background: #696cff !important;
        }

        /* Image Slider Section */

        .containers {
            width: 100%;
            height: 250px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            text-align: right;
        }

        .label {
            width: 300px;

            float: right;
            font-weight: bold;
        }

        .values {
            width: 80px;
            float: right;
        }

        .line {
            width: 100%;
            border-top: 1px solid #ccc;
            margin: 20px 0;
            align-self: flex-end;
        }

        .confirm-btn {
            padding: 10px 20px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
        }

        .spacer {
            flex-grow: 1;
        }

        .after-meal {
            color: blue;
        }

        .before-meal {
            color: green;
        }
    </style>

    <div class="container-fluid px-4">

        <div class="card mt-4">
            <div class="card-header">
                <?php if(session('status')): ?>
                    <div class="alert alert-success"><?php echo e(session('status')); ?></div>
                <?php endif; ?>

                <h1 class=""><?php echo e(__('calender')); ?></h1>


                <div style=" display: flex; align-items: center; padding: 20px 0 20px 0;">

                    <div style="padding: 0 20px 0 0;">

                        <select class="form-select w-auto" id="selectTimes" aria-label="SelectDays">
                            <?php if($id == 30): ?>
                                <option selected="0" value="3">30<?php echo e(__('remainingDays')); ?></option>
                                <option value="1">2 <?php echo e(__('remainingDays')); ?></option>
                                <option value="2">7 <?php echo e(__('remainingDays')); ?></option>
                                <option value="4"> <?php echo e(__('all')); ?></option>
                            <?php elseif($id == 7): ?>
                                <option selected="0" value="2">7 <?php echo e(__('remainingDays')); ?></option>
                                <option value="1">2 <?php echo e(__('remainingDays')); ?></option>
                                <option value="3">30 <?php echo e(__('remainingDays')); ?></option>
                                <option value="4"><?php echo e(__('all')); ?></option>
                            <?php elseif($id == 2): ?>
                                <option selected="0" value="1">2 <?php echo e(__('remainingDays')); ?></option>
                                <option value="2">7 <?php echo e(__('remainingDays')); ?></option>
                                <option value="3">30 <?php echo e(__('remainingDays')); ?></option>
                                <option value="4"><?php echo e(__('all')); ?></option>
                            <?php else: ?>
                                <option selected="0" value="4"><?php echo e(__('all')); ?></option>
                                <option value="2">7 <?php echo e(__('remainingDays')); ?></option>
                                <option value="3">30 <?php echo e(__('remainingDays')); ?></option>
                                <option value="1">2<?php echo e(__('remainingDays')); ?></option>
                            <?php endif; ?>
                            
                        </select>

                    </div>

                    <button data-bs-toggle="modal" data-bs-target="#medicineallModal" type="button"
                        class="btn btn-primary"><?php echo e(__('notifyAll')); ?></button>


                </div>



                
                <div class="table-responsive text-nowrap">
                    
                    <table id="CalenderDataTable" class="table" width="100%" cellspacing="0">
                        <thead>
                            <tr>
                                <th><?php echo e(__('orderNo')); ?></th>
                                <th><?php echo e(__('userName')); ?></th>
                                <th><?php echo e(__('userNumber')); ?></th>
                                <th><?php echo e(__('medicineName')); ?></th>
                                <th><?php echo e(__('status')); ?></th>
                                <th><?php echo e(__('preview')); ?></th>
                                <th><?php echo e(__('action')); ?></th>

                            </tr>
                        </thead>
                        <div id="orderDetailsTable">
                            <tbody class="table-border-bottom-0">
                                <?php $__currentLoopData = $order_details; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $details): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($details->prescription_order): ?>
                                        
                                        <?php if($details->prescription_order->o_status == 2): ?>
                                        
                                        
                                    


                                        <?php
                                            $updatedAt = $details->prescription_order->updated_at ?? null;

                                            if ($updatedAt) {
                                                $createdAt = strtotime($updatedAt);
                                                $currentDate = time();
                                                $timeDifference = $currentDate - $createdAt;
                                                $totaldays = ceil($timeDifference / (60 * 60 * 24)); // Days since updated
                                                $remaining = max($totaldays-$details->m_days, 0);  // Days remaining
                                            } else {
                                                $totaldays = 0;
                                                $remaining = 0;
                                            }
                                        ?>
                                        

                                            <?php if(($remaining > 0) && ($remaining <= $id)): ?>
                                                

                                                <tr>
                                                <td><?php echo e($details->prescription_order->id); ?></td>
                                                <td><?php echo e($details->prescription_order->user->fname . ' ' . $details->prescription_order->user->lname ?? 'N/A'); ?>

                                                </td>
                                                <td><?php echo e($details->prescription_order->user->mobile ?? 'N/A'); ?></td>
                                                <td><?php echo e($details->m_title ?? 'N/A'); ?></td>
                                                <td>
                                                    
                                                        <span class="remaining-days"><?php echo e(__('daysLeftText1')); ?><?php echo e($details->m_days - $totaldays); ?><?php echo e(__('daysLeftText2')); ?></span>
                                                </td>
                                                <td>
                                                    <button data-bs-toggle="modal"
                                                        onclick="prescription_info(<?php echo e($details->prescription_order); ?>) "
                                                        data-bs-target="#exampleModal"
                                                        type="button"class="btn btn-primary"><?php echo e(__('preview')); ?></button>

                                                </td>
                                                <td>
                                                    <a data-bs-toggle="modal" href="" data-bs-target="#addModal"
                                                        title="Remind User"
                                                        onclick="sendmessages(<?php echo e($details); ?>,<?php echo e($remaining); ?>)"
                                                        class="btn btn-primary">
                                                        <i class="menu-icon fas  fa-bell"></i>
                                                        
                                                    </a>

                                                    <?php if(isset($botIds[$details->prescription_order->user->id]) &&
                                                            $botIds[$details->prescription_order->user->id] !== '-' &&
                                                            $botIds[$details->prescription_order->user->id] !== null): ?>
                                                        <a href="https://connect.littlehelp.co.jp/24321469/line/inbox/1/<?php echo e($botIds[$details->prescription_order->user->id]); ?>"
                                                            class="btn" target="_blank" data-toggle="tooltip"
                                                            data-placement="bottom" style="background-color: #3498db;"
                                                            title="Send Messages">
                                                            <img src="<?php echo e(asset('assets/img/icons/chat.png')); ?>"
                                                                alt="New Icon"
                                                                style="filter: invert(100%); width: 20px; height: 20px;">
                                                        </a>
                                                    <?php else: ?>
                                                        <span class="btn disabled" data-toggle="tooltip"
                                                            data-placement="bottom"
                                                            style="background-color: #3498db; opacity: 0.6; cursor: not-allowed;"
                                                            title="Send Messages">
                                                            <img src="<?php echo e(asset('assets/img/icons/chat.png')); ?>"
                                                                alt="New Icon"
                                                                style="filter: invert(100%); width: 20px; height: 20px;">
                                                        </span>
                                                    <?php endif; ?>
                                                </td>
                                                </tr>
                                            <?php endif; ?>
                                    <?php endif; ?>
                                    <?php else: ?>
                                        
                                    <?php endif; ?>
                                    


                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>

                        </div>



                    </table>



                </div>
            </div>
            <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
            <script>
                var userid;
                var orderid;

                function createTableRow(item) {

                    var instructionText;
                    if (item.m_instruction == 0) {
                        // instructionText = '<span style="color: blue;">After</span>';
                        instructionText = '<?php echo e(__('after')); ?>';
                    } else if (item.instruction == 1) {
                        // instructionText = '<span style="color: green;">Before</span>';
                        instructionText = '<?php echo e(__('before')); ?>';
                    } else {
                        // instructionText = '<span style="color: palevioletred;">Any</span>';
                        instructionText = '<?php echo e(__('any')); ?>';
                    }

                    var notesText = item.m_notes;
                    var truncatedText = "";
                    if (notesText) {
                        // truncatedText = notesText.length > 6 ? notesText.slice(0, 30) + '...' : notesText;
                        truncatedText = notesText;
                    }

                    var row = document.createElement("tr");
                    var total_price = item.m_price * item.quantity;
                    var cell = document.createElement("td");
                    cell.innerHTML = `
<div style="display: flex; align-items: start;">

                                <div>
                                <div style="display: flex; align-items: center;" >
                                    <div style="font-weight: bold;">${item.quantity}x</div>
                                    <div style="width:5px;"></div>
                                    <div style="color:palevioletred;">${item.m_title} (1<?php echo e(__('times')); ?>${item.m_piese_per_dose}${item.m_types})</div>
                                </div>


                                    <div style="color: gray;">1<?php echo e(__('day')); ?>${item.m_daily_dose}<?php echo e(__('times')); ?> ${item.m_times}${instructionText} (${item.m_days}<?php echo e(__('cartDays')); ?>)

                                        </div>

                                        <div >
                                    ${truncatedText}
                                    </div>

                                </div>
                                <div style="font-weight: bold; font-size: 18px;margin-left: auto; align-items: center;">
                                    ¥${total_price}
                                    </div>

                            </div>
`;

                    row.appendChild(cell);
                    return row;
                }


                function transaction_process(order) {
                    if (order.pay_type_id == null) {
                        document.getElementById('payment').textContent = "<?php echo e(__('payment')); ?> : UNPAID";

                    } else {

                        const trnsction = <?php echo json_encode($trnsction ?? [], 15, 512) ?>;
                        trnsction.forEach(transaction => {
                            if (transaction.p_id === order.id) {
                                // Display the transaction details
                                if (transaction.pay_type === 0) {
                                    console.log("Cash on Delivery 33");
                                    document.getElementById('payment').textContent =
                                        "<?php echo e(__('payment')); ?> : Cash on Delivery";
                                } else if (transaction.pay_type === 1) {
                                    console.log("PayPal");
                                    console.log(transaction.trxn_id);
                                    document.getElementById('payment').textContent = "<?php echo e(__('payment')); ?> : PayPal (" +
                                        transaction.trxn_id + ")";
                                } else {
                                    console.log("Stripe");
                                    console.log(transaction.trxn_id);
                                    document.getElementById('payment').textContent = "<?php echo e(__('payment')); ?> : Stripe (" +
                                        transaction.trxn_id + ")";
                                }

                            }
                        });

                    }

                }

                function StatusCart(order) {

                    document.getElementById('status_bar').textContent = "<?php echo e(__('orderCompleted')); ?>";

                }

                function genericStatus(order) {
                    if (order.gen_status == 1) {
                        document.getElementById('gen_status').textContent = "<?php echo e(__('genericMedicine')); ?> <?php echo e(__('yes')); ?>";
                    } else if (order.gen_status == 0) {
                        document.getElementById('gen_status').textContent = "<?php echo e(__('genericMedicine')); ?> <?php echo e(__('no')); ?>";
                    } else {
                        document.getElementById('gen_status').textContent = "<?php echo e(__('genericMedicine')); ?> --";
                    }
                }


                function prescription_info(order) {
                    console.log("the orders" + order);

                    var groupImage = document.getElementById('group-image');
                    var images = groupImage.querySelector('.images');
                    var imgList = order.p_image.split(';');
                    while (images.firstChild) {
                        images.removeChild(images.firstChild);
                    }
                    document.getElementById('order_id').textContent = "<?php echo e(__('id')); ?> : " + order.id;
                    document.getElementById('fname').textContent = " <?php echo e(__('name')); ?> : " + order.user.fname + " " + order.user
                        .lname;

                        document.getElementById("idTechnicalFee").innerText = order.technicalInput + "¥";
                     document.getElementById("idManagementFee").innerText = order.managementInput + "¥";
                     document.getElementById("idMaterialCost").innerText = order.materialInput + "¥";

                    document.getElementById('usernumber').textContent = "<?php echo e(__('number')); ?> : " + order.user.mobile;
                    document.getElementById("idSubtotal").innerText = order.subtotal + "¥";
                    document.getElementById("idIns").innerText = order.insurance_total + "¥";
                    // document.getElementById("idTax").innerText = order.tax + "¥";
                    document.getElementById("idTotal").innerText = order.total + "¥";
                    transaction_process(order)

                    imgList.forEach(function(imgSrc) {
                        var imgLink = document.createElement('a');
                        imgLink.href = "<?php echo e(url('')); ?>/" + imgSrc;
                        imgLink.setAttribute('data-fancybox', 'gallery');
                        imgLink.style.margin = "10px";
                        var img = document.createElement('img');
                        img.src = "<?php echo e(url('')); ?>/" + imgSrc;
                        img.style.width = '250px';
                        imgLink.appendChild(img);
                        images.appendChild(imgLink);
                    });


                    var swiperWrapper = document.querySelector('.swiper-wrapper');

                    // Clear the existing contents of swiper-wrapper
                    swiperWrapper.innerHTML = '';

                    // Loop through the imgList and create HTML elements for each image
                    imgList.forEach(function(imgPath) {
                        var swiperSlide = document.createElement('div');
                        swiperSlide.classList.add('swiper-slide');

                        var link = document.createElement('a');
                        link.href = "<?php echo e(url('')); ?>/" + imgPath;
                        link.setAttribute('data-fancybox', 'gallery');
                        // link.setAttribute('href', imgPath);

                        var image = document.createElement('img');

                        image.src = "<?php echo e(url('')); ?>/" + imgPath;
                        image.style.width = '100%';



                        link.appendChild(image);
                        swiperSlide.appendChild(link);
                        swiperWrapper.appendChild(swiperSlide);
                    });

                    var order_id = order.id;

                    $.ajax({
                        url: "<?php echo e(route('orderdetails')); ?>",
                        type: 'GET',
                        data: {
                            order_id: order_id
                        },
                        success: function(response) {
                            console.log(response);

                            var tbody = document.querySelector('#cart-table tbody');

                            tbody.innerHTML = '';

                            for (var i = 0; i < response.length; i++) {
                                var item = response[i];
                                var row = createTableRow(response[i]);
                                tbody.appendChild(row);
                            }

                            // for (var i = 0; i < response.length; i++) {
                            //     var row = document.createElement('tr');


                            //     var titleCell = document.createElement('td');
                            //     titleCell.textContent = response[i].m_title;
                            //     row.appendChild(titleCell);
                            //     var quantityCell = document.createElement('td');
                            //     quantityCell.textContent = response[i].quantity;
                            //     row.appendChild(quantityCell);

                            //     var daysCell = document.createElement('td');
                            //     daysCell.textContent = response[i].m_days;
                            //     row.appendChild(daysCell);

                            //     var doseCell = document.createElement('td');
                            //     doseCell.textContent = response[i].m_daily_dose;
                            //     row.appendChild(doseCell);

                            //     var piecesCell = document.createElement('td');
                            //     piecesCell.textContent = response[i].m_piese_per_dose;
                            //     row.appendChild(piecesCell);

                            //     var instructionCell = document.createElement('td');

                            //     if (response[i].m_instruction === 0) {
                            //         instructionCell.classList.add('after-meal');
                            //         instructionCell.textContent = "After Meal";
                            //     } else if (response[i].m_instruction === 1) {
                            //         instructionCell.classList.add('before-meal');
                            //         instructionCell.textContent = "Before Meal";
                            //     }
                            //     row.appendChild(instructionCell);
                            //     var notesCell = document.createElement("td");
                            //     // var notesText = response[i].notes;
                            //     var notesText = response[i].m_notes;
                            //     var truncatedText = "";
                            //     if (notesText) {
                            //         truncatedText = notesText.length > 6 ? notesText.slice(0, 6) + '...' : notesText;
                            //     }
                            //     notesCell.textContent = truncatedText;
                            //     // notesCell.textContent = item.notes;
                            //     notesCell.style.whiteSpace = "nowrap";
                            //     row.appendChild(notesCell);


                            //     var priceCell = document.createElement('td');
                            //     priceCell.textContent = response[i].tottal_price;
                            //     row.appendChild(priceCell);

                            //     // Append the row to the tbody
                            //     tbody.appendChild(row);
                            // }
                        },
                        error: function(xhr) {
                            // Handle any errors
                            console.log(xhr.responseText);
                        }
                    });

                    if (order.cart_status == 2) {
                        showingCompleteInfo()

                    } else if (order.cart_status == 1) {
                        showingCompleteInfo()
                    } else {

                        document.getElementById("after_order_details").style.display = "none";
                        document.getElementById("whit_hospital_details").style.display = "none";
                        document.getElementById("costView").style.display = "none";
                        document.getElementById('PrescriptionInfo').classList.replace('col-md-8', 'col-md-12');

                        document.getElementById("cart-section").style.display = "none";
                        document.getElementById("group-image").style.display = "block";
                        StatusCart(order)
                        genericStatus(order)

                    }

                    function showingCompleteInfo() {
                        document.getElementById("cart-section").style.display = "block";
                        document.getElementById("costView").style.display = "block";
                        document.getElementById('PrescriptionInfo').classList.replace('col-md-12', 'col-md-8');
                        document.getElementById("group-image").style.display = "none";
                        //insurance info call if the data is submitted to the database
                        document.getElementById("after_order_details").style.display = "block";
                        document.getElementById("whit_hospital_details").style.display = "block";
                        InsuranceInfo()
                        StatusCart(order)
                        genericStatus(order)

                    }

                    function InsuranceInfo() {
                        var ins_type = [
                            "<?php echo e(__('none')); ?>",
                            "<?php echo e(__('nationalHealth')); ?>",
                            "<?php echo e(__('socialInsurance')); ?>",
                            "<?php echo e(__('nationalPublic')); ?>",
                            "<?php echo e(__('mutualAid')); ?>",
                            "<?php echo e(__('fedarationHealth')); ?>",
                            "<?php echo e(__('selfDefence')); ?>",
                            "<?php echo e(__('welfarePension')); ?>",
                        ];

                        if (order.ins_type > 0) {
                            document.getElementById("insurance_limit").style.display = "block";
                            document.getElementById("insurance_code").style.display = "block";
                            document.getElementById('insurance_type').textContent =
                                "<?php echo e(__('insurance')); ?> <?php echo e(__('type')); ?> : " +
                                ins_type[order.ins_type];
                            document.getElementById('insurance_limit').textContent =
                                "<?php echo e(__('insurance')); ?> <?php echo e(__('limit')); ?> : " +
                                order.ins_limit + "%";

                            document.getElementById('insurance_code').textContent =
                                "<?php echo e(__('insurance')); ?> <?php echo e(__('id')); ?> : " +
                                order.ins_code;

                        } else {
                            document.getElementById('insurance_type').textContent =
                                "<?php echo e(__('insurance')); ?> <?php echo e(__('type')); ?> : " +
                                ins_type[order.ins_type];
                            document.getElementById('insurance_limit').textContent =
                                "<?php echo e(__('insurance')); ?> <?php echo e(__('limit')); ?> : " +
                                order.ins_limit + "%";
                            document.getElementById("insurance_limit").style.display = "none";
                            document.getElementById("insurance_code").style.display = "none";

                        }
                        document.getElementById('dept_name').textContent = "<?php echo e(__('departmentName')); ?> : " + order.department;
                        document.getElementById('hospital').textContent = "<?php echo e(__('hospitalName')); ?> : " + order.hospital;
                        document.getElementById('doctor_name').textContent = "<?php echo e(__('doctorName')); ?> : " + order.doctor_name;
                        console.log("order made")
                        console.log(order.ins_limit)
                    }



                    $('.images a').fancybox({
                        // Set the options for Fancybox
                        buttons: [
                            'zoom',
                            // 'slideShow',
                            'fullScreen',
                            'thumbs',
                            'close'
                        ],
                        animationEffect: "fade",
                        transitionEffect: "slide",
                        loop: true,
                        clickContent: true,
                        afterLoad: function(instance, current) {
                            // Set the z-index of the Fancybox container
                            $(current.$content).css('z-index', 99999);
                        }
                    });



                }

                function sendnotification() {
                    var notes = document.getElementById('addNote').value;

                    console.log(userid);
                    console.log(orderid);

                    $.ajax({
                        url: "<?php echo e(url('/admin/reminder')); ?>",
                        method: 'GET',
                        data: {
                            notes: notes,
                            userid: userid,
                            orderid: orderid,
                            notification_title: '<?php echo e(__('medicineReminder')); ?>'

                        },
                        success: function(response) {

                            console.log(response.message);

                            //document.getElementById('addModal').style.display="none";
                            window.location.href = "/admin/reminder_sts?" + response.message;


                            // Handle the success response here
                        },
                        error: function(jqXHR, textStatus, errorThrown) {
                            console.log(jqXHR);


                            //window.alert("Id not saved to database");

                            // Handle the error response here
                        }
                    });

                }

                function sendmessages(details, remaining) {
                    var shopname = "<?php echo e(Auth::user()->shopname); ?>";

                    document.getElementById('notes').textContent = "<?php echo e(__('msgsendTo')); ?>" + " " + details.prescription_order.user
                        .fname + " " + details.prescription_order.user.lname;
                    // document.getElementById('addNote').textContent = remaining + " days" + " " + "<?php echo e(__('remaningFor')); ?>" + " " +
                    //     details.m_title;

                    ///commented for adding remindertextnew1
                    // document.getElementById('addNote').textContent = details.prescription_order.user.fname + " " + details
                    //     .prescription_order.user.lname + "<?php echo e(__('remindertext1')); ?>「" + details.m_title +
                    //     "」<?php echo e(__('remindertext2')); ?>" + remaining + "<?php echo e(__('remindertext3')); ?>" + shopname +
                    //     "<?php echo e(__('remindertext4')); ?>";

                    document.getElementById('addNote').textContent = details.prescription_order.user.fname + " " + details
                        .prescription_order.user.lname + "<?php echo e(__('remindertextnew1')); ?>" + remaining + "<?php echo e(__('remindertextnew2')); ?>";

                    userid = details.prescription_order.user.id;
                    orderid = details.prescription_order.id;


                }
                $(document).ready(function() {
                    // Function to filter rows based on selected time period
                    function filterRows(selectedValue) {

                        switch (selectedValue) {
                            case "1":
                                window.location.href = "<?php echo e(url('admin/pages-calender?page_id=')); ?>" + selectedValue;
                                break;

                            case "2":
                                window.location.href = "<?php echo e(url('admin/pages-calender?page_id=')); ?>" + selectedValue;
                                break;

                            case "3":
                                window.location.href = "<?php echo e(url('admin/pages-calender?page_id=')); ?>" + selectedValue;
                                break;
                            case "4":
                                window.location.href = "<?php echo e(url('admin/pages-calender?page_id=')); ?>" + selectedValue;
                                break;

                            default:

                                break;
                        }

                    }

                    // Initial filtering based on the default "All" option
                    filterRows("0");

                    // Bind onchange event to the select element
                    $("#selectTimes").on("change", function() {

                        var selectedValue = $(this).val();
                        filterRows(selectedValue);
                    });
                });

                function sendallmessages() {
                    var page_id = <?php echo json_encode($id); ?>;
                    $.ajax({
                        url: "<?php echo e(url('/admin/reminderall')); ?>",
                        method: 'GET',
                        data: {
                            page_id: page_id,
                        },
                        success: function(response) {

                            console.log(response.message);
                        },
                        error: function(jqXHR, textStatus, errorThrown) {
                            console.log(jqXHR);

                        }
                    });


                }
            </script>
        </div>

        <div class="modal fade" id="addModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel"><?php echo e(__('reminderOneUser')); ?></h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                    </div>

                    <div class="modal-body">


                        <div class="form-popup-inputs">
                            <label for="addNote"><?php echo e(__('addmsg')); ?> :</label>
                        </div>
                        <textarea class="form-control" id="addNote" rows="3"> </textarea>

                        <div class="form-popup-inputs">
                            <label id="notes" for="addNote"></label>
                        </div>

                    </div>

                    <div class="modal-footer">
                        <a onclick="sendnotification()" class="btn btn-success"
                            style="color: white;"><?php echo e(__('send')); ?></a>

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

        <div class="modal fade" id="medicineallModal" tabindex="-1" aria-labelledby="exampleModalLabel"
            aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel"><?php echo e(__('reminderMesg')); ?></h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"> </button>
                    </div>

                    <div class="modal-body">


                        <div class="form-popup-inputs">
                            <label for="addNote"><?php echo e(__('reminderMesgAll')); ?></label>
                        </div>
                        <div class="form-popup-inputs">
                            <label id="notes" for="addNote"></label>
                        </div>

                    </div>

                    <div class="modal-footer">

                        <a href="" onclick="sendallmessages()" class="btn btn-primary"><?php echo e(__('send')); ?></a>

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

        <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel"
            aria-hidden="true">

            <div class="modal-dialog modal-xl modal-dialog-centered">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel"><?php echo e(__('prescriptionOrderPreview')); ?></h5>
                        <div class="buttons-container">
                            <button type="button" class="btn btn-primary"
                                id="printButton"><?php echo e(__('print')); ?></button>
                            <button type="button" class="btn-close" data-bs-dismiss="modal"
                                aria-label="Close"></button>
                        </div>
                    </div>

                    <div class="modal-body">
                        <div class="card" style="padding: 0 10px">
                            <div class="row row-bordered">

                                <div class="col-md-8" id="PrescriptionInfo">
                                    <div>
                                        <div class="row row-bordered">
                                            <div class="user-info">

                                                <p class="id" id="order_id">ID: ----</p>
                                                <p id="fname">Name: ----e</p>
                                                <p class="fname" id="usernumber"><?php echo e(__('userNumber')); ?>: ----</p>
                                            </div>

                                            <div class="user-info">

                                                <span class="badge rounded-pill bg-success"
                                                    id="status_bar"><?php echo e(__('waitingForDecision')); ?></span>
                                                <span class="badge rounded-pill bg-primary" id="gen_status"> ---- </span>
                                                <p class="payment" id="payment">Payment: ----</p>
                                            </div>
                                        </div>
                                        
                                        <div class="row row-bordered">
                                            <div class="user-info" id="after_order_details">
                                                <p class="fname" id="insurance_type"><?php echo e(__('insurance')); ?>

                                                    <?php echo e(__('type')); ?>: ----
                                                </p>
                                                <p class="fname" id="insurance_limit"><?php echo e(__('insurance')); ?>

                                                    <?php echo e(__('limit')); ?>: ----
                                                </p>
                                                <p class="fname" id="insurance_code"><?php echo e(__('insurance')); ?>

                                                    <?php echo e(__('id')); ?>: ----
                                                </p>
                                            </div>
                                            <div class="user-info" id="whit_hospital_details">
                                                <p class="fname" id="hospital"><?php echo e(__('hospitalName')); ?>: ----</p>
                                                <p class="fname" id="dept_name"><?php echo e(__('enterDepartmentName')); ?>: ----
                                                </p>
                                                <p class="fname" id="doctor_name"><?php echo e(__('doctorName')); ?>: ----</p>
                                            </div>
                                        </div>

                                        <div id="group-image">
                                            <div class="images">

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

                                    <div class="card">

                                        <div class="table-wrapper">
                                            <table class="table" id="cart-table">

                                                <thead>
                                                    <tr>
                                                        <th>
                                                        </th>
                                                    </tr>
                                                </thead>

                                                <tbody class="table-border-bottom-0">
                                                </tbody>
                                            </table>
                                        </div>
                                        
                                    </div>
                                    <div id="costView">
                                        <h3 style="padding: 10px;  border-bottom: 1px solid #ccc;"></h3>

                                        <div class="containers">

                                            <div class="Ins-container">
                                                <div class="values" id="idTechnicalFee">0¥</div>
                                                <div class="label">(+) <?php echo e(__('technicalFee')); ?>:</div>

                                            </div>
                                            <div class="Ins-container">
                                                <div class="values" id="idManagementFee">0¥</div>
                                                <div class="label">(+) <?php echo e(__('managementFee')); ?>:</div>

                                            </div>
                                            <div class="Ins-container">
                                                <div class="values" id="idMaterialCost">0¥</div>
                                                <div class="label">(+) <?php echo e(__('materialCost')); ?>:</div>

                                            </div>


                                            <div class="sub-container">
                                                <div class="values" id="idSubtotal">0¥</div>
                                                <div class="label"><?php echo e(__('subTotal')); ?>:</div>

                                            </div>
                                            <div class="Ins-container">
                                                <div class="values" id="idIns">0¥</div>
                                                <div class="label">(-) <?php echo e(__('insurance')); ?>:</div>

                                            </div>

                                            <div class="sub-container">
                                                

                                            </div>
                                            <div class="line"></div>
                                            <div class="sub-container">
                                                <div class="values" id="idTotal">0¥</div>
                                                <div class="label"><?php echo e(__('total')); ?>:</div>

                                            </div>
                                            <div class="spacer"></div>
                                            <!-- <button onclick="confirm()" class="confirm-btn">Confirm</button> -->
                                        </div>
                                    </div>

                                </div>

                                <div class="col-md-4"id="cart-section">

                                    <h3 style="padding: 20px 0; text-align: center; border-bottom: 1px solid #ccc;">
                                        Prescriptions
                                    </h3>

                                    <div class="image-slider-container">
                                        <div class="swiper-container">
                                            <div class="swiper-wrapper">

                                            </div>
                                            <div class="swiper-button-prev"></div>
                                            <div class="swiper-button-next"></div>
                                            <div class="swiper-pagination"></div>
                                        </div>


                                    </div>



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

            </div>
        </div>



    </div>


<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/xorgeekc/public_html/medishop/resources/views/admin/calender/viewcalender.blade.php ENDPATH**/ ?>