<meta name="csrf-token" content="<?php echo e(csrf_token()); ?>" />

<head>

    <link href="<?php echo e(asset('backend/plugins/select2/css/select2.min.css')); ?>" rel="stylesheet" />
    <link href="<?php echo e(asset('backend/plugins/select2/css/select2-bootstrap4.css')); ?>" rel="stylesheet" />

</head>


<!-- grant new privilage -->
<div class="modal fade" id="modalGrantPrivilege" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Grant Privilege For User</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <!-- method="post" action="<?php echo e(route('web.allotPackagePermission')); ?>" -->

            <form method="POST" name="customerData" action="<?php echo e(route('web.grantprivilegeforuser')); ?>" class="row g-3">
                <?php echo csrf_field(); ?>

                <div class="modal-body">

                    <label>Billing Address</label>

                    <div hidden class="row col-12">
                        <div class="col-6">
                            <input class="form-control" id="clientMethod" type="text" name="clientMethod" value=" " />
                        </div>
                    </div>

                    <div class="row col-12">
                        <div class="col-6">
                            <input class="form-control" id="clientName" type="text" name="clientName" value=" " />
                        </div>

                        <div class="col-6">
                            <input class="form-control" id="clientAddress" type="text" name="clientAddress" value=" " />
                        </div>
                    </div>

                    <br>

                    <div class="row col-12">
                        <div class="col-6">
                            <input class="form-control" id="clientCity" type="text" name="clientCity" value=" " />
                        </div>
                        <div class="col-6">
                            <input class="form-control" id="clientState" type="text" name="clientState" value="KERALA" />
                        </div>
                    </div>
                    <br>

                    <div hidden class="row col-12">
                        <div class="col-6">
                            <input class="form-control" id="clientPinCode" type="text" name="clientPinCode" value=" " />
                        </div>
                        <div class="col-6">
                            <input class="form-control" type="text" name="clientCountry" value="India" />
                        </div>
                    </div>


                    <div hidden class="row col-12">
                        <div class="col-6">
                            <input class="form-control" id="clientMobile" type="text" name="clientMobile" value=" " />
                        </div>
                        <div class="col-6">
                            <input class="form-control" id="clientEmail" type="text" name="clientEmail" value=" " />
                        </div>
                    </div>

                    <div class="row col-12">
                        <div class="col-6">
                            <label class="form-label">Client Id / User Id</label>
                            <input readonly id="clientClientUserID" required name="clientClientUserID" type="text" class="form-control">
                        </div>

                        <div class="col-6">
                            <label class="form-label">Package Id / Session Id</label>
                            <input readonly id="clientPackageSessionID" required name="clientPackageSessionID" type="text" class="form-control">
                        </div>
                    </div>

                    <br>


                    <div class="row col-12">
                        <div class="col-6">
                            <label class="form-label">Usage Mode</label>

                            <select id="clientUsageMode" name="clientUsageMode" class="form-control clientUsageMode" required>
                                <option value=""> Select one </option>
                                <option value="T"> Trial Version </option>
                                <option value="A"> Active Version </option>
                            </select>

                        </div>

                        <div class="col-6">
                            <label class="form-label">Billing Type</label>
                            <select id="clientBillingType" name="clientBillingType" class="form-control clientBillingType">
                                <option value=""> Select one </option>
                                <option value="M"> Monthly </option>
                                <option value="Y"> Yearly </option>
                            </select>
                        </div>

                    </div>

                    <br>

                    <div class="row col-12">

                        <div class="col-6">
                            <label class="form-label">Amount</label>
                            <input min="0" id="clientAmount" required name="clientAmount" type="text" class="form-control">
                        </div>

                        <div class="col-6">
                            <label class="form-label">Amount (Adjustment + or - ) </label>
                            <input id="clientAdjustment" step="any" name="clientAdjustment" type="number" pattern="{0-9}[5]" class="form-control">
                        </div>

                    </div>

                    <br>

                    <label id="clientAmountLabel" class="text-danger"> </label>

                    <br>
                    <br>

                    <div class="row col-12">

                        <div class="col-4">
                            <label class="form-label">From Date</label>
                            <input value="<?php echo date('Y-m-d'); ?>" id="clientPerFrom" required name="clientPerFrom" type="date" class="form-control">
                        </div>

                        <div class="col-4">
                            <label class="form-label">No Of Days</label>
                            <input min="0" id="clientNoOfDays" name="clientNoOfDays" type="number" class="form-control clientNoOfDays">
                        </div>

                        <div class="col-4">
                            <label class="form-label">To Date</label>
                            <input id="clientPerTo" required name="clientPerTo" type="date" class="form-control">

                        </div>
                    </div>

                    <br>

                    <div class="row col-12">
                        <div class="col-12">
                            <label class="form-label">Previous Remarks</label>
                            <input id="clientPreRemarks" name="clientPreRemarks" type="text" class="form-control" placeholder="Enter remarks">
                        </div>
                    </div>

                    <br>

                    <div class="row col-12">
                        <div class="col-12">
                            <label class="form-label">Remarks</label>
                            <input id="clientRemarks" required name="clientRemarks" type="text" class="form-control" placeholder="Enter remarks">
                        </div>
                    </div>

                    <br>

                    <label class="text-danger"> Amount that displayed is inclusive of all tax ( 18 % ) </label>

                    <!-- <br>

                    <div id="allotTrialDiv" class="col-12">
                        <input id="clientistrial" name="clientistrial" type="checkbox">
                        <label for="clientistrial" class="form-label">Trial Version</label>
                    </div>


                    <div id="allotTrialDiv" class="col-12">
                        <input checked id="clientisActive" name="clientisActive" type="checkbox">
                        <label for="clientisActive" class="form-label">Make the pack active</label>
                    </div> -->


                </div>
                <div class="modal-footer">

                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Allot</button>

                </div>
            </form>
        </div>
    </div>
</div>
<!-- grant new privilage close -->


































<div class="modal fade" id="modalViewUsersReport" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Users Report Search</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <form method="post" action="<?php echo e(route('web.viewUserReport')); ?>" class="row g-3">
                <?php echo csrf_field(); ?>
                <div class="modal-body">

                    <div id="showHistory" class="card-body">

                        <div class="col-12">
                            <label class="form-label">Package</label>
                            <select name="userPack" class="form-control clientBillingType">
                                <option value=""> Select one </option>
                                <option value="3"> Platinum </option>
                                <option value="2"> Gold </option>
                                <option value="1"> Silver </option>
                            </select>
                        </div>

                        <br>

                        <div class="col-12">
                            <label class="form-label">Pack Type</label>
                            <select name="userMode" class="form-control clientBillingType">
                                <option value=""> Select one </option>
                                <option value="1"> Live </option>
                                <option value="0"> Trial </option>
                            </select>
                        </div>

                        <br>

                        <div class="col-12">
                            <label class="form-label">Demo Account</label>
                            <select name="userDemo" class="form-control clientBillingType">
                                <option value=""> Select one </option>
                                <option value="1"> Demo Account </option>
                            </select>
                        </div>

                        <br>

                        <div class="col-12">
                            <label class="form-label">Billing Type</label>
                            <select name="userBillType" class="form-control clientBillingType">
                                <option value=""> Select one </option>
                                <option value="M"> Monthly </option>
                                <option value="Y"> Yearly </option>
                            </select>
                        </div>

                        <br>

                        <div class="col-12">
                            <label class="form-label">User</label>
                            <select name="userType" class="form-control clientBillingType">
                                <option value=""> Select one </option>
                                <option value="S"> Single User </option>
                                <option value="M"> Multi User </option>
                            </select>
                        </div>


                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                            <button type="submit" class="btn btn-primary">Search</button>

                        </div>

                    </div>

                </div>
            </form>

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



<div class="modal fade" id="UpdateUserDetailsModelView" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Update User Details</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>


            <div class="modal-body">

                <form method="post" action="<?php echo e(route('web.updateUserDetails')); ?>">
                    <?php echo csrf_field(); ?>
                    <div id="showHistory" class="card-body">

                        <div hidden class="row col-12">
                            <div class="col-12">
                                <label class="form-label">ID</label>
                                <input id="updateID" name="updateID" type="text" class="form-control" placeholder="Enter remarks">
                            </div>
                        </div>

                        <div class="row col-12">
                            <div class="col-12">
                                <label class="form-label">Name</label>
                                <input id="updateName" name="updateName" type="text" class="form-control" placeholder="Name">
                            </div>
                        </div>

                        <br>

                        <div class="row col-12">
                            <div class="col-12">
                                <label class="form-label">Email</label>
                                <input id="updateEmail" required name="updateEmail" type="email" class="form-control" placeholder="E-Mail">
                            </div>
                        </div>

                        <br>

                        <div class="row col-12">
                            <div class="col-12">
                                <label class="form-label">Mobile</label>
                                <input id="updateMobile" name="updateMobile" type="number" class="form-control" placeholder="Mobile">
                            </div>
                        </div>

                    </div>

                    <div class="modal-footer">

                        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                        <button type="submit" class="btn btn-primary">Update</button>

                    </div>

                </form>

            </div>


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







<div class="modal fade" id="modalShowUserHistory" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">User Package History</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <form method="post" action="<?php echo e(route('web.updatePermissionStatusWithFromTo')); ?>" class="row g-3">
                <?php echo csrf_field(); ?>
                <div class="modal-body">

                    <div id="showHistory" class="card-body">

                    </div>

                </div>
            </form>

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

<div class="modal fade" id="modalExtendTrialPack" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Extend Trial Package</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <form method="post" action="<?php echo e(route('web.extendtrialpackage')); ?>" class="row g-3">
                <?php echo csrf_field(); ?>
                <div class="modal-body">

                    <div hidden class="col-12">
                        <label class="form-label">Trial ID</label>
                        <input readonly id="trialRowID" required name="trialRowID" type="text" class="form-control">
                    </div>

                    <div hidden class="col-12">
                        <label class="form-label">Client</label>
                        <input readonly id="extClient" required name="extClient" type="text" class="form-control">
                    </div>

                    <div hidden class="col-12">
                        <label class="form-label">User</label>
                        <input readonly id="extUser" required name="extUser" type="text" class="form-control">
                    </div>

                    <div class="col-12">
                        <label class="form-label">From Date</label>
                        <input readonly min="<?php echo date('Y-m-d'); ?>" id="extFromDate" required name="extFromDate" type="date" class="form-control">
                    </div>


                    <div class="col-12">
                        <label class="form-label">To Date</label>
                        <input id="extToDate" required name="extToDate" type="date" class="form-control">
                    </div>
                    <!-- 
                    <div class="col-12 row mt-3 text-center">

                        <div class="col-sm">
                            <div onclick="calculateDays(7)" class="chip chip-md bg-info text-white"> 1 Week
                            </div>
                        </div>

                        <div class="col-sm">
                            <div onclick="calculateDays(14)" class="chip chip-md bg-info text-white">2 Week
                            </div>
                        </div>

                        <div class="col-sm">
                            <div onclick="calculateDays(21)" class="chip chip-md bg-info text-white">3 Week
                            </div>
                        </div>

                    </div> -->

                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                        <button type="submit" class="btn btn-primary">Extend</button>

                    </div>

                </div>
            </form>

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

<script>
    function extendTrialPack(client, user, from, to, trialID) {
        // alert(client + " - " + user + " - " + from + " - " + to);

        document.getElementById('extFromDate').value = from;
        document.getElementById('extToDate').value = to;

        document.getElementById('extClient').value = client;
        document.getElementById('extUser').value = user;
        document.getElementById('trialRowID').value = trialID;

        $('#modalExtendTrialPack').modal('show');

    }
</script>

<div class="modal fade" id="modalStockReport" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Stock Report</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <form method="post" action="<?php echo e(route('web.viewStockReport')); ?>" class="row g-3">
                <?php echo csrf_field(); ?>
                <div class="modal-body">
                    <label class="form-label">Choose Shop</label>
                    <select name="shop" id="allShops" class="form-select mb-3" aria-label="Default select example">
                        <option selected>Select one</option>
                    </select>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Search</button>

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


<div class="modal fade" id="modalSaleReport" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Sale Report</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <form method="GET" action="<?php echo e(route('web.viewSaleReport')); ?>" class="row g-3">
                <!-- <form id="salesForm" class="row g-3"> -->

                <div class="modal-body">


                    <div class="col-12">

                        <label class="form-label">Choose Shop</label>
                        <select required name="shop" id="shopSales" class="form-select mb-3" aria-label="Default select example">
                            <option selected>Select one</option>
                        </select>

                    </div>

                    <div class="col-12">
                        <label class="form-label">From Date</label>
                        <input id="dateFrom" required name="from" type="date" class="form-control">
                    </div>

                    <div class="col-12">
                        <label class="form-label">To Date</label>
                        <input id="dateTo" required name="to" type="date" class="form-control">
                    </div>



                </div>
                <div class="modal-footer">

                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Search</button>

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




<div class="modal fade" id="modalPurchaseReport" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Purchase Report</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <form method="GET" action="<?php echo e(route('web.viewPurchaseReport')); ?>" class="row g-3">
                <!-- <form id="salesForm" class="row g-3"> -->

                <div class="modal-body">

                    <div class="col-12">

                        <label class="form-label">Choose Shop</label>
                        <select required name="purShop" id="purchaseReport" class="form-select mb-3" aria-label="Default select example">
                            <option selected>Select one</option>
                        </select>

                    </div>


                    <div style="display: none;" id="showSupplier" class="col-12">
                        <label class="form-label">Choose Supplier</label>
                        <select name="supplier" id="supplierList" class="form-select mb-3" aria-label="Default select example">
                            <option selected>Select one</option>
                        </select>

                    </div>

                    <div class="col-12">
                        <label class="form-label">From Date</label>
                        <input id="dateFrom" required name="from" type="date" class="form-control">
                    </div>

                    <div class="col-12">
                        <label class="form-label">To Date</label>
                        <input id="dateTo" required name="to" type="date" class="form-control">
                    </div>

                    <div class="col-12">
                        <br>
                        <input id="supplierCheckBox" class="excludeSupplier" type="checkbox" checked>
                        <label for="supplierCheckBox" class="form-label"> Exclude supplier </label>
                    </div>

                </div>
                <div class="modal-footer">

                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Search</button>

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




<div class="modal fade" id="modalEditReport" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Edit Report</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <form method="GET" action="<?php echo e(route('web.viewEditReport')); ?>" class="row g-3">
                <!-- <form id="salesForm" class="row g-3"> -->

                <div class="modal-body">

                    <div class="col-12">

                        <label class="form-label">Choose Shop</label>
                        <select required name="editShop" id="editReport" class="form-select mb-3" aria-label="Default select example">
                            <option selected>Select one</option>
                        </select>

                    </div>

                    <div class="col-12">

                        <label class="form-label">Report Type</label>
                        <select required name="rptType" id="editReport" class="form-select mb-3" aria-label="Default select example">
                            <option selected>Select one</option>
                            <option value="purchase">Purchase</option>
                            <option value="sale">Sale</option>
                        </select>

                    </div>

                    <div class="col-12">
                        <label class="form-label">From Date</label>
                        <input id="dateFrom" required name="from" type="date" class="form-control">
                    </div>

                    <div class="col-12">
                        <label class="form-label">To Date</label>
                        <input id="dateTo" required name="to" type="date" class="form-control">
                    </div>
                </div>
                <div class="modal-footer">

                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Search</button>

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


<!-- denomination -->
<div class="modal fade" id="modalDenominationReport" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Cash Closing Report</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <form method="GET" class="row g-3">
                <!-- <form id="salesForm" class="row g-3"> -->

                <div class="modal-body">

                    <div class="col-12">

                        <label class="form-label">Choose Shop</label>
                        <select required name="denoShop" id="denominationReport" class="form-select mb-3" aria-label="Default select example">
                            <option selected>Select one</option>
                        </select>

                    </div>

                    <div class="col-12">
                        <label class="form-label">From Date</label>
                        <input id="dateFrom" required name="from" type="date" class="form-control">
                    </div>

                    <div class="col-12">
                        <label class="form-label">To Date</label>
                        <input id="dateTo" required name="to" type="date" class="form-control">
                    </div>
                </div>
                <div class="modal-footer">

                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Search</button>

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

<!-- denomination close -->


<!-- login report -->
<div class="modal fade" id="modalLoginReport" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Login Report</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <form method="GET" action="<?php echo e(route('web.loginReport')); ?>" class="row g-3">
                <!-- <form id="salesForm" class="row g-3"> -->
                <div class="modal-body">
                    <div class="col-12">

                        <label class="form-label">Choose Shop</label>
                        <select required name="loginShop" id="loginReport" class="form-select mb-3" aria-label="Default select example">
                            <option selected>Select one</option>
                        </select>

                    </div>

                    <div class="col-12">
                        <label class="form-label">From Date</label>
                        <input id="dateFrom" required name="from" type="date" class="form-control">
                    </div>

                    <div class="col-12">
                        <label class="form-label">To Date</label>
                        <input id="dateFrom" required name="to" type="date" class="form-control">
                    </div>

                </div>
                <div class="modal-footer">

                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Search</button>

                </div>
            </form>
        </div>
    </div>
</div>
<!-- login report close -->


<!-- modal warning for client delete -->
<div class="modal fade" id="modalDeleteClient" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <form action="<?php echo e(route('web.deleteclient')); ?>" method="post">
                <?php echo csrf_field(); ?>
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Are you sure ?</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <input hidden name="clientID" type="text" id="deleteClientID" required>
                    Do you want to delete this client ?
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Delete</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- modal warning for client delete close -->


<!-- delete client from db -->
<div class="modal fade" id="modalDeleteClientFromDB" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <form action="<?php echo e(route('web.deleteFromDatabase')); ?>" method="post">
                <?php echo csrf_field(); ?>
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Are you sure ?</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <p>Enter profile password to delete this client from database ?</p>

                    <input hidden required name="clientID" type="text" id="DBdeleteClientID" required>
                    
                    <input required name="delReason" type="text" id="delReason" class="form-control">
                    <br>

                    <input autocomplete="off" class="form-control" name="proPassword" type="password" id="myInput" placeholder="enter profile password" required>
                    <br>
                    <input type="checkbox" class="showPassword" id="visiblePassword">
                    <label for="visiblePassword">Show password</label>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary deleteClicked">Delete</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- delete client from db close -->



<!-- manage max user connection  -->
<div class="modal fade" id="modalManageMaxConnection" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <form action="<?php echo e(route('web.updateMaxUserCOunt')); ?>" method="post">
                <?php echo csrf_field(); ?>
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Manage Max User Connection</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <input hidden required name="clientID" type="text" id="maxConClientID" required>

                    <input autocomplete="off" hidden class="form-control" name="clientid" type="number" pattern="{0-9}[2]" id="maxclientid" placeholder="enter max user connection" required>
                    <input autocomplete="off" hidden class="form-control" name="userid" type="number" pattern="{0-9}[2]" id="maxuserid" placeholder="enter max user connection" required>
                    <input autocomplete="off" class="form-control" name="maxconnection" type="number" pattern="{0-9}[2]" id="maxConn" placeholder="enter max user connection" required>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Delete</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- manage max user connection close -->



<!-- show image large -->
<div class="modal fade" id="exampleLargeBanner" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title"> </h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <img style="align-items:center ;" width="50%" height="50%" id="bannerLargeImage">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
<!-- show image large close -->

<!-- ----------------------------------------------------------------------------------------- -->


<!-- copy permission from user  -->
<div class="modal fade" id="modalCopyPermission" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Copy user permission</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <form method="post" action="<?php echo e(route('web.copyUserPermission')); ?>" class="row g-3">
                <?php echo csrf_field(); ?>
                <div class="modal-body">

                    <div hidden class="col-12">
                        <label class="form-label">To User</label>
                        <input id="toUserID" required name="touser" type="text" class="form-control">
                    </div>

                    <div hidden class="col-12">
                        <label class="form-label">To Client</label>
                        <input id="toClientID" required name="toclient" type="text" class="form-control">
                    </div>

                    <div hidden class="col-12">
                        <label class="form-label">To Package</label>
                        <input id="toPackageID" required name="topackage" type="text" class="form-control">
                    </div>



                    <div class="col-12">

                        <label class="form-label">Choose Users</label>
                        <select required name="fromuser" id="perUsers" class="form-select mb-3" aria-label="Default select example">
                            <option selected>Select one</option>
                        </select>

                    </div>

                    <div class="col-12">
                        <label class="form-label">From Date</label>
                        <input id="dateFrom" required name="from" type="date" class="form-control">
                    </div>

                    <div class="col-12">
                        <label class="form-label">To Date</label>
                        <input id="dateFrom" required name="to" type="date" class="form-control">
                    </div>

                </div>
                <div class="modal-footer">

                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Grant</button>

                </div>
            </form>
        </div>
    </div>
</div>
<!-- copy permission from user close -->


<!-- allot existing package permissions  -->
<div class="modal fade" id="modalAllotExistPackagePermission" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Allot existing permissions</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>

            <!-- method="post" action="<?php echo e(route('web.allotPackagePermission')); ?>" -->

            <form method="POST" name="customerData" action="<?php echo e(route('web.readytopay')); ?>" class="row g-3">
                <?php echo csrf_field(); ?>
                <!-- <form id="salesForm" class="row g-3"> -->

                <div class="modal-body">

                    <input hidden id="allottid" required name="tid" type="text" class="form-control">
                    <input hidden value=" " id="allotmarchantid" required name="merchant_id" type="text" class="form-control">
                    <input hidden value=" " id="allotorderid" required name="order_id" type="text" class="form-control">
                    <input hidden value="INR" id="currency" required name="currency" type="text" class="form-control">
                    <input hidden value="https://api.digitronicsindia.com/aswas/public/uploads/ccavResponseHandler.blade.php" id="redirect_url" required name="redirect_url" type="text" class="form-control">
                    <input hidden value="https://api.digitronicsindia.com/aswas/public" id="cancel_url" required name="cancel_url" type="text" class="form-control">
                    <input hidden value="EN" id="language" required name="language" type="text" class="form-control">

                    <label>Billing Address</label>

                    <div class="row col-12">
                        <div class="col-6">
                            <input class="form-control" id="allotbilling_name" type="text" name="billing_name" value=" " />
                        </div>
                        <div class="col-6">
                            <input class="form-control" id="allotbilling_address" type="text" name="billing_address" value=" " />
                        </div>
                    </div>

                    <br>

                    <div class="row col-12">
                        <div class="col-6">
                            <input class="form-control" id="allotbilling_city" type="text" name="billing_city" value=" " />
                        </div>
                        <div class="col-6">
                            <input class="form-control" id="allotbilling_state" type="text" name="billing_state" value="KERALA" />
                        </div>
                    </div>
                    <br>

                    <div class="row col-12">
                        <div class="col-6">
                            <input class="form-control" id="allotbilling_zip" type="text" name="billing_zip" value=" " />
                        </div>
                        <div class="col-6">
                            <input class="form-control" type="text" name="billing_country" value="India" />
                        </div>
                    </div>

                    <br>
                    <div class="row col-12">
                        <div class="col-6">
                            <input class="form-control" id="allotbilling_tel" type="text" name="billing_tel" value=" " />
                        </div>
                        <div class="col-6">
                            <input class="form-control" id="allotbilling_email" type="text" name="billing_email" value=" " />
                        </div>
                    </div>

                    <br>

                    <div class="row col-12">

                        <div class="col-6">
                            <label class="form-label">Amount</label>
                            <input id="allotamount" required name="amount" type="text" class="form-control">
                        </div>

                        <div class="col-6">
                            <label class="form-label">Amount (Adjustment + or - ) </label>
                            <input id="allotamount" step="any" name="adjustment" type="number" pattern="{0-9}[5]" class="form-control">
                        </div>

                    </div>

                    <br>

                    <div class="row col-12">
                        <div class="col-6">
                            <label class="form-label">Client</label>
                            <input readonly id="allotm1" required name="merchant_param1" type="text" class="form-control">
                        </div>

                        <div class="col-6">
                            <label class="form-label">User ID</label>
                            <input readonly id="allotm2" required name="merchant_param2" type="text" class="form-control">
                        </div>
                    </div>

                    <br>

                    <div class="row col-12">
                        <div class="col-4">
                            <label class="form-label">From Date</label>
                            <input value="<?php echo date('Y-m-d'); ?>" id="merchant_param3" required name="merchant_param3" type="date" class="form-control">
                        </div>

                        <div class="col-4">
                            <label class="form-label">No Of Days</label>
                            <input id="noDaysCount" name="noDaysCount" type="number" class="form-control noDaysCount">
                        </div>

                        <div class="col-4">
                            <label class="form-label">To Date</label>
                            <input id="merchant_param4" required name="merchant_param4" type="date" class="form-control">
                        </div>
                    </div>

                    <div hidden class="col-12">
                        <label class="form-label">Type</label>
                        <input id="merchant_param5" required name="merchant_param5" value="allot" type="text" class="form-control">
                    </div>

                    <br>

                    <div class="row col-12">
                        <div class="col-12">
                            <label class="form-label">Previous Remarks</label>
                            <input id="allotPreRemarks" required name="allotPreRemarks" type="text" class="form-control" placeholder="Enter remarks">
                        </div>
                    </div>

                    <br>

                    <div class="row col-12">
                        <div class="col-12">
                            <label class="form-label">Remarks</label>
                            <input id="allotRemarks" required name="allotRemarks" type="text" class="form-control" placeholder="Enter remarks">
                        </div>
                    </div>

                    <br>

                    <label class="text-danger"> Amount that displayed is inclusive of all tax ( 18 % ) </label>

                    <br>

                    <div id="allotTrialDiv" class="col-12">
                        <input id="istrial" name="istrial" type="checkbox">
                        <label for="istrial" class="form-label">Trial Version</label>
                    </div>


                    <div id="allotTrialDiv" class="col-12">
                        <input checked id="isActive" name="isActive" type="checkbox">
                        <label for="isActive" class="form-label">Skip the payment and make the pack active</label>
                    </div>


                </div>
                <div class="modal-footer">

                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary">Allot</button>

                </div>
            </form>
        </div>
    </div>
</div>
<!-- allot existing package permissions close -->



<script>
    function showPleaseWait() {
        if (document.querySelector("#pleaseWaitDialog") == null) {
            var modalLoading = '<div class="modal" id="pleaseWaitDialog" data-backdrop="static" data-keyboard="false" role="dialog">\
            <div class="modal-dialog">\
                <div class="modal-content">\
                    <div class="modal-header">\
                        <h4 class="modal-title">Please wait it will take longer that usual...</h4>\
                    </div>\
                    <div class="modal-body">\
                        <div class="progress">\
                          <div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar"\
                          aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%; height: 40px">\
                          </div>\
                        </div>\
                    </div>\
                </div>\
            </div>\
        </div>';
            $(document.body).append(modalLoading);
        }

        $("#pleaseWaitDialog").modal("show");
    }

    function hidePleaseWait() {
        $("#pleaseWaitDialog").modal("hide");
    }


    $(".deleteClicked").click(function() {

        showPleaseWait();

    });





    $(document).ready(function() {

        $(".UpdateUserDetailsModel").on('click', function() {

            var id = $(this).data("id");
            var Name = $(this).data("name");
            var Email = $(this).data("email");
            var Mobile = $(this).data("mobile");

            document.getElementById("updateID").value = id;
            document.getElementById("updateName").value = Name;
            document.getElementById("updateEmail").value = Email;
            document.getElementById("updateMobile").value = Mobile;

            $('#UpdateUserDetailsModelView').modal('show');

        });

        const isDate = (str) => {
            return (new Date(str) !== "Invalid Date") && !isNaN(new Date(str));
        }

        // calculate date 
        $(".noDaysCount").change(function() {

            const start = new Date(document.getElementById('merchant_param3').value);
            const end = new Date(document.getElementById('merchant_param4').value);

            // alert(end);

            if (isDate(end)) {
                const count = document.getElementById('noDaysCount').value;
                end.setDate(end.getDate() + parseInt(count));
                document.getElementById('merchant_param4').value = end.toISOString().slice(0, 10);
            } else {
                const count = document.getElementById('noDaysCount').value;
                start.setDate(start.getDate() + parseInt(count));
                document.getElementById('merchant_param4').value = start.toISOString().slice(0, 10);
            }

        });
        // calculate date close


        $(".clientNoOfDays").change(function() {

            const start = new Date(document.getElementById('clientPerFrom').value);
            const end = new Date(document.getElementById('clientPerTo').value);

            if (isDate(end)) {
                const count = document.getElementById('clientNoOfDays').value;
                end.setDate(end.getDate() + parseInt(count));
                document.getElementById('clientPerTo').value = end.toISOString().slice(0, 10);
            } else {
                const count = document.getElementById('clientNoOfDays').value;
                start.setDate(start.getDate() + parseInt(count));
                document.getElementById('clientPerTo').value = start.toISOString().slice(0, 10);
            }

        });


        $.ajax({
            type: "GET",
            dataType: "json",
            url: "<?php echo e(route('web.getAllPermissionUsers')); ?>",

            success: function(data) {

                $("#perUsers").empty();

                $('#perUsers')
                    .append($("<option></option>")
                        .attr("value", "")
                        .text("Choose one"));

                $.each(data, function(index, value) {

                    $('#perUsers')
                        .append($("<option></option>")
                            .attr("value", value.id + ',' + value.userid)
                            .text(value.Name));
                });

            }
        });

        $("#mySelectIs").select2({
            dropdownParent: "#modalSaleReport"
        });

        $(".showPassword").on('click', function(event) {

            var x = document.getElementById("myInput");

            if ($(this).prop("checked") == true) {

                x.type = "text";

            } else if ($(this).prop("checked") == false) {

                x.type = "password";
            }

        });


        $(".excludeSupplier").on('click', function(event) {

            if ($(this).prop("checked") == true) {

                document.getElementById("showSupplier").style.display = "none";

            } else if ($(this).prop("checked") == false) {

                document.getElementById("showSupplier").style.display = "block";



            }

        });

        $.ajax({
            type: "GET",
            dataType: "json",
            url: "<?php echo e(route('web.getAllClients')); ?>",

            success: function(data) {

                // stock
                $("#allShops").empty();

                $('#allShops')
                    .append($("<option></option>")
                        .attr("value", "")
                        .text("Choose one"));

                // sales
                $("#shopSales").empty();

                $('#shopSales')
                    .append($("<option></option>")
                        .attr("value", "")
                        .text("Choose one"));

                // purchase report
                $("#purchaseReport").empty();

                $('#purchaseReport')
                    .append($("<option></option>")
                        .attr("value", "")
                        .text("Choose one"));


                // edit report
                $("#editReport").empty();

                $('#editReport')
                    .append($("<option></option>")
                        .attr("value", "")
                        .text("Choose one"));

                // denomination report
                $("#denominationReport").empty();

                $('#denominationReport')
                    .append($("<option></option>")
                        .attr("value", "")
                        .text("Choose one"));

                // loginReport

                $("#loginReport").empty();

                $('#loginReport')
                    .append($("<option></option>")
                        .attr("value", "")
                        .text("Choose one"));



                $.each(data, function(index, value) {

                    $('#allShops')
                        .append($("<option></option>")
                            .attr("value", value.ClientID)
                            .text(value.ClientName + "|" + value.ClientID + "|" + value.Area + "|" + value.Location));

                    $('#shopSales')
                        .append($("<option></option>")
                            .attr("value", value.ClientID)
                            .text(value.ClientName + "|" + value.ClientID + "|" + value.Area + "|" + value.Location));

                    $('#purchaseReport')
                        .append($("<option></option>")
                            .attr("value", value.ClientID)
                            .text(value.ClientName + "|" + value.ClientID + "|" + value.Area + "|" + value.Location));

                    $('#editReport')
                        .append($("<option></option>")
                            .attr("value", value.ClientID)
                            .text(value.ClientName + "|" + value.ClientID + "|" + value.Area + "|" + value.Location));

                    $('#denominationReport')
                        .append($("<option></option>")
                            .attr("value", value.ClientID)
                            .text(value.ClientName + "|" + value.ClientID + "|" + value.Area + "|" + value.Location));

                    $('#loginReport')
                        .append($("<option></option>")
                            .attr("value", value.ClientID)
                            .text(value.ClientName + "|" + value.ClientID + "|" + value.Area + "|" + value.Location));

                });

            }
        });


        $('#purchaseReport').on('change', function() {

            var client = this.value;

            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                }
            });

            $.ajax({
                type: 'POST',
                url: "<?php echo e(route('web.getSupplierByClient')); ?>",
                data: {
                    client: client
                },
                success: function(data) {

                    $("#supplierList").empty();

                    $('#supplierList')
                        .append($("<option></option>")
                            .attr("value", "")
                            .text("Choose one"));

                    data.forEach(function(number) {

                        $('#supplierList')
                            .append($("<option></option>")
                                .attr("value", number['Supplier_Name'])
                                .text(number['Supplier_Name']));

                    });

                }
            });


        });


        // $('#purchaseReport').change(function() {

        //     var clientid = $(this).val();

        //     $.ajax({
        //         type: "GET",
        //         dataType: "json",
        //         url: "/getSupplierByClient/" + clientid,

        //         success: function(data) {

        //             alert(data)

        //             $.each(data, function(index, value) {

        //                 alert(value);

        //             });

        //         }
        //     });


        // });


    });
</script>

<script src="<?php echo e(asset('backend/plugins/select2/js/select2.min.js')); ?>"></script>
<script src="<?php echo e(asset('backend/js/form-select2.js')); ?>"></script><?php /**PATH /home/digitronicsindia/public_html/aswas/resources/views/Admin/Layouts/modals.blade.php ENDPATH**/ ?>