IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/5dcc74f2f6a6fbecc91d0e99a8c8e7bca4f96e85.php

<?php $__env->startSection('content'); ?>
<div class="container-fluid">
<div class="row clearfix">
<div class="col-lg-12">
<div class="tab-content">
<div role="tabpanel" class="tab-pane in active" id="details" aria-expanded="true">
<div class="card" id="details">
    <div class="body">                                
        <div class="row">
            <div class="col-md-6 col-sm-6">
                <address>
                    <strong><?php echo e($student->firstName); ?> <?php echo e($student->middleName); ?> <?php echo e($student->lastName); ?></strong><br>
                    <?php echo e($student->ecNo); ?> <br>
                    <?php echo e($student->father_fname); ?> <?php echo e($student->father_lname); ?><br>
                    <abbr title="Phone">Mobile:</abbr> <?php echo e($student->father_mobile); ?> 
                </address>
            </div>
            <div class="col-md-6 col-sm-6 text-right">
                <p class="m-b-0"><strong>Order Date: </strong> <?php echo date("d-m-Y");?></p>
                <p class="m-b-0"><strong>Order Status: </strong> <span class="badge bg-yellow">Pending</span></p>
            </div>
        </div>
        <div class="mt-40"></div>
        <div class="row">
            <div class="col-md-12">
                <div class="table-responsive">
                    <table class="table table-hover">
                        <thead>
                            <tr>
                                <th>#</th>                                                        
                                <th width="60px">Item</th>
                                <th></th>
                                <th>Quantity</th>
                                <th class="hidden-sm-down">Unit Cost</th>
                                <th>Total</th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $k =0; $subtotal = 0;$isBook = 1;$isUniform = 1;?>
                            <?php $__currentLoopData = $cart; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $det): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php 
                            $product =  \App\Product::where('idProduct',$det->idProduct)->first();

                            $k++; ?>
                            <tr>
                                <td><?php echo e($k); ?></td>
                                <td>
                                    <?php if(isset($product->productImage)): ?>
                                    <img src="<?php echo e(asset('storage/schools/'.$product->idSchool.'/products/'.$product->productImage)); ?>" width="40" alt="Product img">
                                    <?php endif; ?>
                                </td>
                                <td><?php echo e($product->productName); ?></td>
                                <td><?php echo e($det->qty); ?> Pcs</td>
                                <td class="hidden-sm-down">₹<?php echo e($product->salePrice); ?></td>
                                <?php
                                    $price = $product->salePrice * $det->qty;
                                    $subtotal = $subtotal + $price;
                                    if (str_contains($product->productName, 'Books') || str_contains($product->productName, 'BOOKS')) {
                                        $isBook = 2;
                                    }
                                    if (str_contains($product->productName, 'Uniform')) {
                                        $isUniform = 2;
                                    }
                                ?>
                                <td>₹<?php echo e($product->salePrice * $det->qty); ?></td>
                                <td><a class="btn btn-danger btn-round waves-effect" href="/student/checkout?removeItem=<?php echo e(base64_encode($det->idCart)); ?>">Remove Item</a></td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <hr>
        <div class="row">
            <div class="col-md-6">
            </div>
            <div class="col-md-6 text-right">
                <p class="m-b-0"><b>Total Amount</b> : ₹<?php echo e($subtotal); ?></p>   
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
            </div>
            <div class="col-md-6 text-right">
                <?php if($isBook == 2 && $isUniform == 2): ?>
                <p style="color:red;"><u>Note </u>: You have to buy book and uniform separately. Cannot process the order as both items are present in one cart.</p>
                <?php else: ?>
                <button class="btn btn-primary btn-round waves-effect" type="button" id="submit-btn">Pay Now  ₹<?php echo e($subtotal); ?></button>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>
</div>                  
</div>
</div>
</div>

<div class="modal" tabindex="-1" role="dialog" id="paymentModal" aria-labelledby="paymentModalLabel" aria-hidden="true" data-backdrop="">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-body">
        <div id="payment-form"></div>
      </div>
    </div>
  </div>
</div>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<?php if($mode == "cashfree"): ?>
<script src="https://sdk.cashfree.com/js/ui/1.0.26/dropinClient.prod.js"></script>
<script>
    document.getElementById('submit-btn').onclick = function (e) {
        e.preventDefault();
        $("#submit-btn").prop('disabled', true);
        $.ajax({
            method: 'post',
            beforeSend: function(request) {
                request.setRequestHeader("X-CSRF-TOKEN", "<?php echo e(csrf_token()); ?>");
            },
            url: "<?php echo url('student/shop/order'); ?>",
            success:function(result){
//               console.log(result);
               $('#paymentModal').modal('show')
               var orderToken = result["order_token"];
               const dropConfig = {
                    "components": [
                        "order-details",
                        "card",
                        "netbanking",
                        "app",
                        "upi"
                    ],
                    "orderToken": orderToken,
                    "onSuccess": function(data) {
                        //on payment flow complete
                        if (data.order && data.order.status == "PAID") {
                            $.ajax({
                                url: "<?php echo url('student/checkpaymentstatus-cashfree?order_id='); ?>" + data.order.orderId,
                                success: function(result) {
                                    window.location.href = "<?php echo e(url('student/shop-receipts')); ?>";
                                },
                            });
                        } else {
                            //order is still active
                            alert("Order is ACTIVE")
                        }
                    },
                    "onFailure": function(data) {
                        //on failure during payment initiation
                        alert(data.order.errorText);
                    },
                    "style": {
                        //to be replaced by the desired values
                        "backgroundColor": "#ffffff",
                        "color": "#11385b",
                        "fontFamily": "Lato",
                        "fontSize": "14px",
                        "errorColor": "#ff0000",
                        "theme": "light", //(or dark)
                    }
                }
                $('#submit-btn').hide();
                const cashfree = new Cashfree();
                const paymentElement = document.getElementById("payment-form");
                cashfree.initialiseDropin(paymentElement, dropConfig);
            }
        });
    }
</script>
<?php else: ?>
<script src="https://ebz-static.s3.ap-south-1.amazonaws.com/easecheckout/easebuzz-checkout.js"></script> 
<script>
    document.getElementById('submit-btn').onclick = function (e) {
        e.preventDefault();
        $("#submit-btn").prop('disabled', true);
        $.ajax({
            method: 'post',
            beforeSend: function(request) {
                request.setRequestHeader("X-CSRF-TOKEN", "<?php echo e(csrf_token()); ?>");
            },
            url: "<?php echo url('student/shop/order'); ?>",
            success:function(result){
//               console.log(result);
                $('#paymentModal').modal('show')
               var easebuzzCheckout = new EasebuzzCheckout(result["key"], 'prod')
               var options = {
                    access_key: result["token"], // access key received via Initiate Payment
                    onResponse: (response) => {
                        if (response.status == "success") {
                            $.ajax({
                                url: "<?php echo url('student/checkpaymentstatus-easebuzz?order_id='); ?>" + response.txnid,
                                success: function(result) {
                                    window.location.href = "<?php echo e(url('student/shop-receipts')); ?>";
                                },
                            });
                        } 
                    },
                    theme: "#11385b" // color hex
                }
                $('#submit-btn').hide();
                easebuzzCheckout.initiatePayment(options);
            }
        });
    }
</script>

<?php endif; ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('students.student_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7