<?php
//echo '<pre>';
//print_r($invoice_details);
$Language = @Session::getUserPreferences();
$url = explode('/', $_GET['url']);
$pos_fields_hide = smc_session()['default_setting']['pos_fields_to_hide'] != '' ? explode(",", smc_session()['default_setting']['pos_fields_to_hide']) : [];
//die('ok');
//if (count($url) == 1 || $url[1] =="" || (isset($invoice_details['main_invoice']) && array_key_exists('Close_ID',$invoice_details['main_invoice']) && $invoice_details['main_invoice']['Close_ID'] != Session::getUserID())) {
//    header('location:' . SITE_LINK . 'main_page');
//}
//if ( (smc_session()['default_setting']['activate_smart_diner'] ==  1 && ) && (count($url) == 1 || $url[1] =="" || (isset($invoice_details['main_invoice']) && array_key_exists('Close_ID',$invoice_details['main_invoice']) && $invoice_details['main_invoice']['Close_ID'] != Session::getUserID()))) {
//     header('location:' . SITE_LINK . 'main_page');
//}
?>
<link href="<?php echo SITE_LINK; ?>Views/files/styles<?php echo $Language == 'ar' ? '.rtl' : ''; ?>.css?v=<?php echo trusto_VERSION; ?>" rel="stylesheet">
<script src="<?php echo SITE_LINK; ?>Views/files/scroll-div.js"></script>
<script src="<?php echo SITE_LINK; ?>Views/files/scripts.js?v=<?php echo trusto_VERSION; ?>"></script>
<script src="<?php echo SITE_LINK; ?>Views/files/towords.js"></script>
<script src="<?php echo THEME_PATH; ?>plugins/jQuery-Scanner-Detection-master/jquery.scannerdetection.js"></script>
<script src="<?php echo THEME_PATH; ?>plugins/jQuery-Scanner-Detection-master/jquery.scannerdetection.compatibility.js">
</script>
<style type="text/css">
    @keyframes example {
        from {background-color: red;}
        to {background-color: white;}
    }
    .red-border{
        border:1.5px solid red;
    }
    .diff_class{
        width:200px!important;
    }
    .animateClass {
        width: 100px;
        height: 100px;
        background-color: red;
        /*animation-name: example;*/
        animation: example 1s infinite;
    }
    .cat{
        /*margin-top: -24px;*/
        background: #3B4752;
        width: 100%;
        height:61px;
        /*margin-left: -15px;*/
        padding: 0px;
    }
    .cat > h4{
        color:#fff;
        text-align:center;
    }
    ul.Categories > li {
        width: 20%;
    }
    .invoiceLOGO {
        width: 100px; 
        height: 50px;
    }
    #POSInvoiceDateContainer{
        width: 261px;
        text-align: left;
    }
    #InvoiceIDTag,#POSInvoiceDateContainer,#InvoiceIDBonTag{
        margin-left:30px;
        margin-top: 10px;
        font-size:22pt !important;
    }
    #InvoiceCurrentDay{
        /*float: right;*/
        display: inline-block;
        margin-right: 21px;
        margin-top: 0;
        font-size:15pt;
    }
    .hideme,.header {
        display: none;
    }
    .catli{
        border: 1px solid #e2e2e2;
        /*        background-color: #4c0870; */
        padding: 20px;
        text-align: center;
        width: 120px;
        cursor:pointer;
        /*margin-left: -53px;*/
    }
    /*
    .catli:nth-child(odd){
    background:#4b5a68
    }
    .catli:nth-child(even){
    background:#3B4752
    }
    */
    .catli.active{
        border: 2px Solid black;
        /*        background:#4c0870*/
    }
    .catli > a{
        color:#fff;
    }
    .borderStyle{
        border: 1px solid rgba(59,71,82,0.5) !important;
    }
    .quickerleft{
        text-align:left;
    }
    .paging_simple_numbers{
        display:flex;
    }
    #defineTagBtn{
        width:50%;
    }
    .zero-padding{
        padding:0 !important;
    }
    select.uom{
        width:70px;
    }
    .floors{
        padding-top:10px;
        cursor:pointer;
        background-color:#4c0870;
        padding-bottom: 10px;
    }
    .available{
        padding-bottom: 2em;
        cursor:pointer;
        background-color:#4c0870;
        padding-top:2em;
    }
    .reserved{
        padding-bottom: 2em;
        padding-top:2em;
        background-color:#ed9421;
        cursor:pointer;
    }
    input[name=transfer_quantity]{
        width: 50px;
    }
    .full-width{
        width:100% !important;
    }
    .payment-labels{
        padding:3px;
        cursor: pointer;
    }
    .payment-color-labels{
        background-color:#3b4752;
        color:#fff;
    }
    .posDrop2:before, .posDrop2:after {
        right: 116px!important;
    }
    .options_box{
        position: fixed;
        width: 98% !important;
        background-color: #f54e53;
        box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2);
        height:7.5%;
    }
    .page-container .page-content-wrapper .content {
        padding-bottom: 10px !important;
    }
    .header-button{
        border-bottom: 2px solid #292929;
        /*        float: right;*/
        height: 45px;
        padding-left: 5px;
        padding-right: 5px;
        font-size:larger;
        /*border-right: 1px solid #292929;*/
        border-left: 2px solid #292929;
        color: #DDD !important;
        line-height: 45px;
        text-align: center;
        cursor: pointer;
        -webkit-transition-property: background;
        -webkit-transition-duration: 0.2s;
        -webkit-transition-timing-function: ease-out;
    }
    .header-button a{
        font-weight: 600;
    }
    .header-button a,.dd-color{
        color: #DDD !important;
    }
    #select2-chosen-1 {
        color:#3B4752;
    }
    .m-t-8{
        margin-top:8px !important;
    }
    .del-tr{
        cursor:pointer;
    }
    .not-allowed{
        cursor: not-allowed;
    }
    /*
    #TagsTable{
    table-layout: fixed
    }
    #TagsTable .btn-style.inputDiv{
    padding: 2px;
    }
    */
    #TagsTable.table{
        margin-bottom: 5px;
    }
    /*#TagsTable.table tbody > tr > th, #TagsTable .table tbody > tr > td{
    padding:3px 3px;
    }
    #TagsTable .btn-style.inputDiv{
    padding: 16px;
    }*/
    /* The snackbar - position it at the bottom and in the middle of the screen */
    #snackbar ,#scan_bar_code_bar{
        visibility: hidden; /* Hidden by default. Visible on click */
        min-width: 350px; /* Set a default minimum width */
        margin-left: -175px; /* Divide value of min-width by 2 */
        background-color: red; /* Black background color */
        color: #fff; /* White text color */
        text-align: center; /* Centered text */
        border-radius: 2px; /* Rounded borders */
        padding: 16px; /* Padding */
        position: fixed; /* Sit on top of the screen */
        z-index: 1; /* Add a z-index if needed */
        left: 50%; /* Center the snackbar */
        top: 50%; /* Center in the bottom */
        opacity:0.9;
    }
    /* Show the snackbar when clicking on a button (class added with JavaScript) */
    #snackbar.show ,#scan_bar_code_bar.show{
        visibility: visible; /* Show the snackbar */
        opacity:0.7;
    }
    #open_online {
        padding: 7px 5px;
    }
    ul.ui-autocomplete li.ui-menu-item,li.ui-state-focus{
        line-height:1;
        font-size:12px;
        font-weight:bold;
        padding:2px !important;
        border-bottom:1px solid #ccc;
    }
    .expiry-icon,.prod-desc-icon,.product_description{
        font-size:18px;
        cursor:pointer;
    }
    .f-s-10{
        font-size:10px;
    }
    .f-s-3e{
        font-size: 1.3em; 
    }
    .header-second{
        margin:0.5%;
    }
    .language-pos .dropdown-menu{
        width:110px;
    }
    /*
    .available{
    background-color: #fff !important;
    }
    */
    .tr-return{
        background-color:#4c0870 !important;
    }
    .tr-gray{
        background-color:#e2e2e2 !important;
    }
    .tr-white{
        background-color:white !important;
    }
    #MainCat{
        margin-left: -34px;
    }
    .cash-cats-div{
        padding-right:0px !important;
        padding-left:0px !important;
    }
    .note-filled{
        color:rgb(16,207,189);
    }
    .InvoicesBtnRow .btn-info{
        width:100% !important;
    }
    .InvoicesBtnRow [class*=col-]{
        padding-right: 5px !important;
        padding-left: 5px !important;
    }
    .show_all_price_keypad_height{
        height:270px !important;
    }
    .primary-text{
        color:#ffffff !important;
    }
    .ui-autocomplete .ui-state-focus {
        font-weight: bold !important;
        border-bottom: 1px solid #ccc !important;
    }
    .tip{ 
        position: absolute;
        border: 1px solid #333;
        border-radius: 2px;
        padding: 3px;
        font-size:small;
        color:white;
        background-color: #333;
        z-index:1;
    }
    .style_btn{
        -webkit-animation: glowing 1500ms infinite;
        -moz-animation: glowing 1500ms infinite;
        -o-animation: glowing 1500ms infinite;
        animation: glowing 1500ms infinite;
    }
    @-webkit-keyframes glowing {
        0% { background-color: #B20000; -webkit-box-shadow: 0 0 3px #B20000; }
        50% { background-color: #FF0000; -webkit-box-shadow: 0 0 40px #FF0000; }
        100% { background-color: #B20000; -webkit-box-shadow: 0 0 3px #B20000; }
    }
    @-moz-keyframes glowing {
        0% { background-color: #B20000; -moz-box-shadow: 0 0 3px #B20000; }
        50% { background-color: #FF0000; -moz-box-shadow: 0 0 40px #FF0000; }
        100% { background-color: #B20000; -moz-box-shadow: 0 0 3px #B20000; }
    }
    @-o-keyframes glowing {
        0% { background-color: #B20000; box-shadow: 0 0 3px #B20000; }
        50% { background-color: #FF0000; box-shadow: 0 0 40px #FF0000; }
        100% { background-color: #B20000; box-shadow: 0 0 3px #B20000; }
    }
    @keyframes glowing {
        0% { background-color: #B20000; box-shadow: 0 0 3px #B20000; }
        50% { background-color: #FF0000; box-shadow: 0 0 40px #FF0000; }
        100% { background-color: #B20000; box-shadow: 0 0 3px #B20000; }
    }
    .spinner-icons > span{
        position: absolute;
        top: 5px;
        display: block;
        /* bottom: 0; */
        width: 25%;
        height: 35px;
        background: rgb(109,92,174);
        line-height: 2.5;
        text-align: center;
        color:white
            /*font-size: 21px;*/
            /*font-weight: bold;*/
    }
    .split-icons > span{
        top: 0 !important;
        width: 15% !important;
        background-color: #3b4752 !important;
    }
    .spinner-icons >span:first-child{
        /*        content: "-";*/
        left:0;
    }
    .spinner-icons >span:last-child{
        content: "+";
        right:0;
    }
    .spinner-icons{
        position:relative;
    }
    .spinner-icons input{
        padding-left:25%;
        padding-right:25%;
    }
    #hold_fire_table{
        min-height:40px !important;
        margin:0;
    }
    #hold_fire_table td{
        vertical-align: middle;
        text-align: center;
        font-weight:bold;
        cursor:pointer;
        font-size:15px!important;
        border-color: #bfbfbf;
    }
    #hold_fire_table .hold{
        background-color: rgb(10,124,113);
        color:white;
    }
    #hold_fire_table .fire{
        background-color: #cf3535;
        color:white;
    }
    #hold_fire_table .unhold{
        background-color: #e2e2e2;
        /*color:white;*/
    }
    .selected_hold{
        border:5px solid black !important;
    }
    .hold1{
        background-color: rgb(10,124,113) !important;
        color:white
    }
    .hold2{
        background-color: #cf3535 !important;
        color:white
    }
    .hold3{
        background-color: rgb(72,176,247) !important;
        color:white
    }
    .submit_main_div.stop_submit_div:after{
        position:absolute;
        display: block;
        content: "";
        top:0;
        bottom:0;
        right:0;
        left:0;
        background: rgba(255,255,255,0.8);
    }

    .pulsate {
        content: '';
        display: block;
        /*
        position: absolute;
        top: 0;
        */
        left: 0;
        right: 0;
        bottom: 0;
        animation: pulse 1s ease infinite;
        border-radius: 50%;
        border: 4px double lighten(red, 20%);
    }
    @keyframes pulse {
        0% {
            transform: scale(1);
            opacity: 1;
        }
        60% {
            transform: scale(1.3);
            opacity: 0.4;
        }
        100% {
            transform: scale(1.4);
            opacity: 0;
        }
    }
    .badge {
        background-color: red !important;
        border-radius: 50%;
        color: #fff;
    }
    #CurAvailableItemsContainer a.Product[data-disabled=true]{
        opacity:0.5;
        cursor: default;
    }
</style>
<section class="content " id="MainContainer" style="margin-top:-50px">
    <?php echo Forms::ModalLoader('main_pos_modal'); ?>
    <div class="row <?php echo (smc_session()['default_setting']['activate_cash_drawer'] == 1 && !isset(smc_session()['is_cash_drawer_active'])) ? "" : "hidden"; ?>">
        <?php if (empty($cash_drawer_logout)) { ?>
            <div class="col-md-12">
                <div class="alert alert-info ">
                    <?php echo CommonLanguage::getMessage('proceed_cash_drawer'); ?>&nbsp;&nbsp;<a role="button" data-toggle="modal" data-target="#cash-drawer-amount-modal"><?php echo CommonLanguage::getMessage('cash_drawer_amount'); ?></a>
                    <a href="<?= SITE_LINK; ?>smc/doLogout" class="pull-right"><?php print CommonLanguage::getMessage('logout'); ?></a>
                </div>
            </div>
        <?php } else { ?>
            <div class="col-md-12">
                <div class="alert alert-info ">
                    <span><?php echo CommonLanguage::getMessage('already_logged_to_cash_drawer'); ?></span>
                    <span class="red-star"><?php echo $cash_drawer_logout['cash_drawer_title']; ?></span>
                    <span><?php echo CommonLanguage::getMessage('Proceed_Delete'); ?></span>
                    <a role="button"  id="continue"><?php echo CommonLanguage::getMessage('continue'); ?></a>
                    <!-- here don't use logout_cash_drawer and logout cash drawer model as not yet 
    filled in session, must continue first then logout -->
                    <!--<a role="button" href="<?= SITE_LINK; ?>smc/doLogout" class="pull-right"><?php echo CommonLanguage::getMessage('logout'); ?></a>-->
                </div>
            </div>
        <?php } ?>
    </div>
    <?php if (!empty($err_msg)) {
        ?>
        <div class="alert alert-danger" role="alert">
            <button class="close" data-dismiss="alert"></button>
            <?php echo $err_msg; ?>
        </div>
        <?php
        die();
    }
    ?>
    <div class=" row <?php echo ((smc_session()['default_setting']['activate_cash_drawer'] == 1 && isset(smc_session()['is_cash_drawer_active'])) || smc_session()['default_setting']['activate_cash_drawer'] == 0) ? : "hidden"; ?>">
        <div class=" col-xs-12 col-sm-12 col-md-12 col-lg-12 Boxed m-b-5" style="background: #3B4752"  >
            <input type="hidden" id="invoice_auto_id"  value="<?php echo (isset($invoice_details['main_invoice']['Invoice_ID_Auto']) ? $invoice_details['main_invoice']['Invoice_ID_Auto'] : 0); ?>"/>
            <input type="hidden" id="is_printed_invoice"  value="<?php echo (isset($invoice_details['main_invoice']['is_printed']) && $invoice_details['main_invoice']['is_printed'] == 1) ? 1 : 0; ?>"/>
            <div class="row " style="min-height: 66px;">
                <?php // if (smc_session()['default_setting']['activate_smart_diner'] != 1 || $destination == 'delivery') { ?>
                <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 pull-left cust_dtl_class">
                    <div class="row">
                        <!--<div style="float:left;">-->
                        <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 m-t-8 ">
                            <button   class="btn-link sm-no-margin">
                                <!--data-type="1" => for invoice  data-type="2" => for return-->
                                <span  id="titleSpan" data-type="1" class="dd-color" style='font-size:19px;'> <b><?php echo (smc_session()['default_setting']['activate_smart_diner'] != 1 || $destination == 0) ? 'Invoice' : 'Table ' . $table_name; ?></b><?php echo $is_actual ? '<span class="red-star">*</span>' : '' ?></span>
                            </button>
                        </div>
                        <div class="col-xs-5 col-sm-5 col-md-5 col-lg-5 m-t-5 <?php echo $permissions->hasPermission('search_customer') ? '' : 'hidden'; ?>">
                            <input type="text" placeholder="<?php print CommonLanguage::getMessage('customer_name'); ?>" id="CustomerSearch" class="form-control borderStyle" style="min-height:25px;height:25px;" />
                        </div>
                        <?php
                        if ($permissions->hasPermission('add_customer')) {
                            if (smc_session()['default_setting']['add_pos_customer'] == 0) {
                                ?>
                                <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1 dd-color m-t-8">
                                    <span  class="fa fa-plus-circle fa-2x m-l-5 openFrame add_nonroad_pos_customer" data-src="Inventory/CustomerList?is_pop=1&new=1" style="color:#DDD;cursor:pointer"></span>
                                </div>
                                <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1 dd-color m-t-8">
                                    <span  class="fa fa-bars fa-2x m-l-5 openFrame " data-src="Inventory/CustomerList?is_pop=1" style="color:#DDD;cursor:pointer"></span>
                                </div>
                            <?php } else if (smc_session()['default_setting']['add_pos_customer'] == 1) { ?>
                                <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1 dd-color m-t-8">
                                    <span class="fa fa-plus-circle fa-2x m-l-5 add_pos_customer" style="color:#DDD;cursor:pointer"></span>
                                </div>
                                <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1 dd-color m-t-8">
                                    <span  class="fa fa-bars fa-2x m-l-5  " data-toggle="modal" data-target="#road_customer_list"  style="color:#DDD;cursor:pointer"></span>
                                </div>
                            <?php } else {
                                ?>
                                <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1 dd-color m-t-8">
                                    <span class="fa fa-plus-circle fa-2x m-l-5 add_both_customer" data-toggle="modal" data-target="#choose_cust_type_modal" style="color:#DDD;cursor:pointer"></span>
                                </div>
                                <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1 dd-color m-t-8">
                                    <span  class="fa fa-bars fa-2x m-l-5  both_customer_list" data-toggle="modal" data-target="#choose_cust_type_modal"  style="color:#DDD;cursor:pointer"></span>
                                </div> 
                                <?php
                            }
                        }
                        if ($permissions->hasPermission('view_caller_id')) {
                            ?>
                            <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1 dd-color m-t-8 ">
                                <span id="add_caller" class="fa fa-phone fa-2x m-l-5 "  style="color:#DDD;cursor:pointer"></span>
                            </div>
                        <?php } ?>
                    </div>
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <div  class=" dd-color" id="CurCustomerInfo" CurCustomerID="0" customer-pos-id="0" data-is-pos="0" data-tax="<?php echo smc_session()['default_setting']['activate_card_tax'] == 1 ? smc_session()['class_tax'] : 0 ?>">
                            </div>
                        </div>
                    </div>
                </div>
                <?php // } else {  ?>
                <!--                    <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 m-t-20 p-l-0">
<span  class="dd-color" style='font-size:20px;'> <strong>Table <?php echo $table_name; ?></strong></span>
</div>-->
                <?php // }  ?>
                <!--<div class="col-xs-<?php // echo (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination != 'delivery') ? '10' : '8';                                                                                                                                                                                                                         ?> col-sm-<?php // echo (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination != 'delivery') ? '10' : '8';                                                                                                                                                                                                                         ?> col-md-<?php // echo (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination != 'delivery') ? '10' : '8';                                                                                                                                                                                                                         ?>  col-lg-<?php // echo (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination != 'delivery') ? '10' : '8';                                                                                                                                                                                                                         ?>">-->
                <div class="col-xs-8 col-sm-8 col-md-8  col-lg-8">
                    <div class="row">
                        <div class="header-button">
                            <a href="javascript:;" onclick="doLogoutSystem()">
                                <span class="fa fa-2x fa-power-off m-t-8" style="color:red;" title="<?= CommonLanguage::getMessage('logout'); ?>"></span>
                            </a>
                        </div>
                        <!--<div class="header-button" id="open_functions_modal">
<a href="javascript:;" onclick="go_full_screen()" title="<?= CommonLanguage::getMessage('full_screen'); ?>">
<span class="fa fa-arrows"></span>
</a>
</div>-->
                        <div class="header-button" id="open_functions_modal">
                            <a href="javascript:;" >
                                <?php echo CommonLanguage::getMessage('functions'); ?>
                            </a>
                        </div>
                        <?php if ($permissions->hasPermission('administration')) { ?>
                            <div class="header-button">
                                <a href="<?php echo SITE_LINK . (smc_session()['default_setting']['activate_smart_diner'] == 1 ? 'main_page' : 'Inventory'); ?>">
                                    <?php echo CommonLanguage::getMessage(smc_session()['default_setting']['activate_smart_diner'] == 1 ? 'tables' : 'admin'); ?>
                                </a>
                            </div>
                            <?php
                        } if (($permissions->hasPermission('table_void_pos') && smc_session()['default_setting']['activate_smart_diner'] == 1 && isset($invoice_details['main_invoice']['Invoice_ID_Auto'])) || ($permissions->hasPermission('main_void_pos') && $destination == 0 )) {
                            ?>
                            <div class="header-button" id="refresh">
                                <a readonly="true">
                                    <?php echo CommonLanguage::getMessage('void'); ?>
                                </a>
                            </div>
                        <?php } if ((smc_session()['default_setting']['activate_smart_diner'] != 1 || $destination == 0) && $permissions->hasPermission('retrieve_list')) { ?>
                            <div class="header-button delivery_count" onclick="$('#retrieveSales:enabled').click()">
                                <a   >
                                    <i class="fa fa-bell" ><span class="badge badge-danger" id="delivery_count" ></span></i>   
                                </a>
                            </div>
                        <?php } ?>
                        <div class="header-button <?php echo ($permissions->hasPermission('change_pos_price_class')) ? '' : 'hidden' ?>  customer_class_div">
                            <select required id="Customer_Class_ID" name="Customer_Class_ID" class="full-width common-print " data-init-plugin="select2">
                                <?php foreach ($classes as $class): ?>
                                    <option value="<?php echo $class['Class_ID']; ?>"  <?php echo $class['Class_ID'] == smc_session()['pricing_class_id'] ? 'selected' : '' ?> data-currency="<?php echo $class['Currency_ID'] ?>"><?php echo $class['Class_Name']; ?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                        <?php if ($permissions->hasPermission('show_person_in_charge')) { ?>
                            <div class="header-button depot_pic_div" style="width:15% !important">
                                <input required id="Depot_PIC_ID" name="Depot_PIC_ID" class="full-width Depot_PIC_ID common-print" type="hidden"  />
                            </div>
                        <?php }if ((smc_session()['default_setting']['activate_smart_diner'] != 1 || (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination == 0)) && $permissions->hasPermission('park')) {
                            ?>
                            <div class="header-button park_div_btn"  onclick="$('#addtoPark:enabled').trigger('click')">
                                <a class="btn btn-primary btn-sm common-order-btn-to-disable">
                                    <?php echo CommonLanguage::getMessage((smc_session()['default_setting']['activate_smart_diner'] != 1 || $destination == 'delivery') ? 'park' : 'kitchen'); ?>   
                                </a>
                            </div>
                        <?php } if ($permissions->hasPermission('delivery') && $destination == 0) { ?>
                            <div class="header-button common_delivery_div_btn">
                                <a class="btn btn-primary btn-sm common_delivery">
                                    <?php echo CommonLanguage::getMessage('delivery'); ?>   
                                </a>
                            </div>
                        <?php }if ($permissions->hasPermission('order_pos') && $destination == 0) { ?>
                            <div class="header-button  order_pos_div_btn">
                                <a class="btn btn-primary btn-sm order_pos_btn" data-print-type="1">
                                    <?php echo CommonLanguage::getMessage('order'); ?>   
                                </a>
                            </div>
                        <?php }if ($permissions->hasPermission('order_pos_without_print') && $destination == 0) { ?>
                            <div class="header-button order_pos_div_btn">
                                <a class="btn btn-primary btn-sm order_pos_btn" data-print-type="0">
                                    <?php echo CommonLanguage::getMessage('order_no_print'); ?>   
                                </a>
                            </div>
                        <?php }if ($permissions->hasPermission('pos_request_transfer') && $destination == 0) { ?>
                            <div class="header-button transfer_pos_btn hidden">
                                <a class="btn btn-primary btn-sm " >
                                    <?php echo CommonLanguage::getMessage('transfer'); ?>   
                                </a>
                            </div>
                        <?php } if (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination != 0) { ?>
                            <div class="header-button spinner-icons">
                                <span class="fa fa-minus"></span>
                                <input type="text" name="Persons_Count" id="Persons_Count" class="form-control borderStyle m-t-5 common-print"  value="<?php echo isset($invoice_details['main_invoice']['Persons_Count']) ? $invoice_details['main_invoice']['Persons_Count'] : 0; ?>" placeholder="<?php print CommonLanguage::getMessage('persons_count'); ?>" style="width:90px;">
                                <span class="fa fa-plus"></span>
                            </div>
                        <?php } if (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination == 0 && smc_session()['default_setting']['is_sync_active'] == 1 && $permissions->hasPermission('delivery_list')) { ?>
                            <div class="header-button">
                                <a class="btn btn-primary " id="open_online">
                                    <?php print CommonLanguage::getMessage('online'); ?>
                                    <span class="badge float-right" id="online_orders_count">0</span>
                                </a> 
                                <div id="snackbar"></div>
                            </div>
                        <?php }if ($permissions->hasPermission('add_posponted_invoice') && $destination == 0) { ?>
                            <div class="header-button postponed_div_btn">
                                <button class="btn btn-primary btn-sm add_posponted_data_btn" data-toggle="modal" data-target="#add_posponted_data"><?php echo CommonLanguage::getMessage('posponted') ?></button>
                                <!--<input type="text" id="posponted_date" class="form-control" title="<?php echo CommonLanguage::getMessage('posponted_date') ?>"/>-->
                            </div>
                        <?php }if ($permissions->hasPermission('show_product_recipe')) { ?>
                            <div class="header-button ">
                                <i class="fa fa-book fa-2x show_product_recipe  m-t-8 "></i>
                            </div>
                        <?php } ?>
                        <div class="header-button language-pos">
                            <div class="dropdown " style="">
                                <a href="javascript:void(0);" id="" class="" data-toggle="dropdown" aria-expanded="true"><?php echo $Language === 'en' ? 'EN' : ($Language === 'fr' ? 'FR' : 'AR'); ?>
                                </a><div class="dropdown-menu notification-toggle" role="menu" aria-labelledby="notification-center">
                                    <div class="col-md-12" style="text-align:center">
                                        <div class="radio radio-success " id="Language">
                                            <input type="radio" value="en" <?php echo $Language === 'en' ? 'checked="checked"' : ''; ?>   name="User_language"  id="en">
                                            <label for="en"><?php print CommonLanguage::getMessage('english'); ?> </label>
                                            <input type="radio"  value="ar" <?php echo $Language === 'ar' ? 'checked="checked"' : ''; ?> name="User_language"  id="ar">
                                            <label for="ar"><?php print CommonLanguage::getMessage('arabic'); ?></label>
                                            <input type="radio"  value="fr" <?php echo $Language === 'fr' ? 'checked="checked"' : ''; ?> name="User_language"  id="fr">
                                            <label for="fr"><?php print CommonLanguage::getMessage('french'); ?></label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="scan_bar_code_bar"></div>
                        <div class="header-button transfer_split_action_submit transfer_items_details hidden">
                            <button class="btn btn-primary" data-content="2" id="transfer_action"><?php echo CommonLanguage::getMessage('transfer'); ?></button>
                            <button class="btn btn-default" id="cancel_transfer"><?php echo CommonLanguage::getMessage('cancel'); ?></button>
                        </div>
                        <div class="header-button <?php echo ( smc_session()['default_setting']['activate_pos_hold_fire'] == 1 && smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination > 0) ? '' : 'hidden' ?>">
                            <span id="show_fire_tab" class="fa fa-2x fa-fire" style="cyrsor:pointer"></span>     
                        </div>
                        <?php if (smc_session()['default_setting']['activate_pos_orders_notification'] == 1) { ?>
                            <div class=" header-button">
                                <a href="<?php echo SITE_LINK; ?>Inventory/quotationOrderList/order/sales" class="badge pulsate m-t-10" id="total_orders_pending"></a>
                            </div>
                        <?php } ?>

                    </div>
                    <!--                    <div class="row header-second">
<div class="col-md-2 pull-right < ?php echo $permissions->hasPermission('add_posponted_invoice') ? '' : 'hidden'?>">
<button class="btn btn-primary" data-toggle="modal" data-target="#add_posponted_data">< ?php echo CommonLanguage::getMessage('posponted') ?></button>
<input type="text" id="posponted_date" class="form-control" title="< ?php echo CommonLanguage::getMessage('posponted_date') ?>"/>
</div>
</div>-->
                </div>
            </div>
        </div>
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" >
            <div class="row is-flex">
                <div class="RightBox col-xs-6 col-sm-6 col-md-6 col-lg-6 " style="width:<?php echo 100 - smc_session()['default_setting']['pos_menu_width']; ?>%;">
                    <table id="hold_fire_table" class="table table-bordered hidden">
                        <tbody>
                            <tr>
                                <td class="hold" data-role="1"><?php echo CommonLanguage::getMessage('hold') ?>&nbsp;1</td>
                                <td class="hold" data-role="2"><?php echo CommonLanguage::getMessage('hold') ?> 2</td>
                                <td class="hold" data-role="3"><?php echo CommonLanguage::getMessage('hold') ?> 3</td>
                                <td class="fire" data-role="1"><?php echo CommonLanguage::getMessage('fire') ?> 1</td>
                                <td class="fire" data-role="2"><?php echo CommonLanguage::getMessage('fire') ?> 2</td>
                                <td class="fire" data-role="3"><?php echo CommonLanguage::getMessage('fire') ?> 3</td>
                                <td class="unhold"><?php echo CommonLanguage::getMessage('unhold') ?></td>
                            </tr>
                        </tbody>
                    </table>
                    <fieldset class="he">
                        <div class="LeftTableContainer col-xs-12 col-sm-12 col-md-12 col-lg-12  no-padding" >
                            <div class="table-responsive Boxed" >
                                <table class="table table-hover" cellpadding="0" cellspacing="0" id="OrderTable">
                                    <thead>
                                        <tr>
                                            <th class="hidden transfer_items_details" style="width: 2%"></th>
                                            <th style="width: 2%">#</th>
                                            <th style="width: 2%" class="<?php echo (smc_session()['default_setting']['activate_pos_hold_fire'] == 1 && smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination > 0) ? '' : 'hidden' ?>"></th>
                                            <th style="width: 15%"><?php print CommonLanguage::getMessage('Name'); ?></th>
                                            <th style="width: 10%"><?php print CommonLanguage::getMessage('qty'); ?></th>
                                            <th style="width: 10%" class="<?php echo smc_session()['default_setting']['activate_uom_in_pos'] == 1 ? '' : 'hidden'; ?>"><?php print CommonLanguage::getMessage('UOM'); ?></th>
                                            <th style="width: 10%" class="price_element <?php echo $permissions->hasPermission('show_all_prices') ? '' : 'hidden'; ?>"><?php print CommonLanguage::getMessage('Price'); ?></th>
                                            <th style="width: 5%" class="<?php echo (smc_session()['default_setting']['activate_discount_pos'] == 1 && $permissions->hasPermission('show_all_prices')) ? '' : 'hidden'; ?>"><?php print CommonLanguage::getMessage('disc'); ?></th>
                                            <th style="width: 10%" class="price_element <?php echo $permissions->hasPermission('show_all_prices') ? '' : 'hidden'; ?>"><?php print CommonLanguage::getMessage('total'); ?></th>
                                            <th style="width: 10%" class="<?php echo smc_session()['default_setting']['activate_pos_product_description'] == 1 ? '' : 'hidden'; ?>"><?php print CommonLanguage::getMessage('Description'); ?></th>
                                            <th style="width: 10%" class="<?php echo smc_session()['default_setting']['is_tag_active'] == 1 ? '' : 'hidden'; ?>"><?php print CommonLanguage::getMessage('tag'); ?></th>
                                            <th style="width: 5%" class="<?php echo smc_session()['default_setting']['activate_product_duration_reservation'] == 1 ? '' : 'hidden'; ?>"><?php print CommonLanguage::getMessage('reserve_date'); ?></th>
                                            <th style="width: 5%" class="<?php echo (smc_session()['default_setting']['activate_expiry_date'] == 1 || !in_array(0, $pos_fields_to_hide) || !in_array(1, $pos_fields_to_hide)) ? '' : 'hidden'; ?>"><i class="fa fa-info-circle"></i></th>
                                            <th style="width: 5%" class="<?php // echo $permissions->hasPermission('delete_row_pos') ? '' : 'hidden';                                                                                                                                                                                           ?>"></th>
                                            <th style="width: 5%" class=""></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </fieldset>
                    <div class="LeftTableContainer col-xs-12 col-sm-12 col-md-12 col-lg-12 no-padding" >
                        <div class="row is-flex p-l-5">
                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 m-t-5  totals_pos_btns_div">
                                <div class="row TotalTableRow Boxed price_element <?php echo $permissions->hasPermission('show_all_prices') ? '' : 'hidden'; ?>">
                                    <table class="table table-responsive full-height" cellpadding="0" cellspacing="0" id="TotalTable" >
                                        <tr>
                                            <td style="width: 65%;"><span class="TotalSpanInTable"><?php print CommonLanguage::getMessage('subtotal'); ?> </span></td>
                                            <td class="SubtotalVal">0</td>
                                        </tr>
                                        <tr data-discount="0" class="invoice-discount-tr-class">
                                            <td><span class="TotalSpanInTable discount-span-input-per" style="display:flex;"><?php print CommonLanguage::getMessage('disc'); ?><input id="DiscountInput" class="form-control <?php echo (!$permissions->hasPermission('discount_on_invoice')) ? 'initial_disable current_disable' : '' ?>" <?php echo (!$permissions->hasPermission('discount_on_invoice')) ? 'disabled' : '' ?> style="max-width:50px;display:flex;min-height:22px !important;height: 22px !important;padding:2px;margin-left:5px;"/> %
                                                <!--<span class="discount <?php echo (!$permissions->hasPermission('discount_on_invoice')) ? 'initial_disable current_disable' : '' ?>">0 %</span>-->
                                                </span></td>
                                            <!--<td class="DiscountVal">0</td>-->
                                            <td class="DiscountVal"><input type='text' style='background:#e5e5e5;border:none' class='DiscountValue <?php echo (!$permissions->hasPermission('discount_on_invoice')) ? 'initial_disable current_disable' : '' ?>'<?php echo (!$permissions->hasPermission('discount_on_invoice')) ? 'disabled' : '' ?> value='0'/> </td>
                                        </tr>
                                        <tr class="<?php echo smc_session()['default_setting']['activate_ttc'] ? '' : 'hidden' ?>">
                                            <td><span class="TotalSpanInTable"><?php print CommonLanguage::getMessage('ttc_discount'); ?>  </span></td>
                                            <!--<td class="DiscountVal">0</td>-->
                                            <td class="TTCDiscountVal"><input type='text' style='background:#e5e5e5;border:none' class='TTCDiscountValue <?php echo (!$permissions->hasPermission('discount_on_invoice')) ? 'initial_disable current_disable' : '' ?>'<?php echo (!$permissions->hasPermission('discount_on_invoice')) ? 'disabled' : '' ?> value='0'/> </td>
                                        </tr>
                                        <?php if (smc_session()['default_setting']['pos_service'] > 0) { ?>
                                            <tr>
                                                <td><span class="TotalSpanInTable"><?php print CommonLanguage::getMessage('service'); ?></span></td>
                                                <td class="ServiceVal"><span class="service" data-value="<?php echo smc_session()['default_setting']['pos_service']; ?>"><?php echo smc_session()['default_setting']['pos_service']; ?></span> %</td>
                                            </tr>
                                        <?php } ?>
                                        <tr>
                                            <td><span class="TotalSpanInTable"><?php print CommonLanguage::getMessage('vat'); ?></span></td>
                                            <td class="TVAVal">0 %</td>
                                        </tr>
                                        <tr class="<?php echo smc_session()['default_setting']['activate_card_tax'] == 0 ? 'hidden' : '' ?>">
                                            <td><span class="TotalSpanInTable"><?php print CommonLanguage::getMessage('card_tax'); ?></span></td>
                                            <td class="tax_amount">0</td>
                                        </tr>
                                        <tr>
                                            <td><span class="TotalSpanInTable"><?php print CommonLanguage::getMessage('delivery'); ?></span></td>
                                            <td class="shipping_val"></td>
                                        </tr>
                                        <tr class="">
                                            <td style="padding:0px !important;"><span class="TotalSpanInTable TotalItem"  style="font-size:21px !important;color:red;"><?php print CommonLanguage::getMessage('total'); ?></span></td>
                                            <td class="TotalVal" style="padding:0px !important;font-size:21px !important;color:red;">0</td>
                                        </tr>
                                        <tr class="TotalValue1">
                                            <td style="border-top: 0"><span class="TotalSpanInTable"></span></td>
                                            <td class="SecondCurrencyVal" style="border: 0;padding-top: 0;">0</td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="row InvoicesBtnRow">
                                    <div class=" col-md-12 submit_main_div"  >
                                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 ">
                                            <button id="CashInvBtn" type="submit" class="btn btn-info <?php echo!$permissions->hasPermission('cash_generate_invoice') ? 'hidden' : ((!isset($invoice_details['main_invoice']['Invoice_ID_Auto']) && (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination != 0) && smc_session()['default_setting']['open_table_cash'] == 0) ? 'hidden' : ''); ?>"><i class="fa fa-money"></i> <?php print CommonLanguage::getMessage('cash') ?></button>
                                        </div>
                                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 ">
                                            <button id="GInvBtn" type="submit" class="btn btn-info <?php echo!$permissions->hasPermission('cash_generate_invoice') ? 'hidden' : ((!isset($invoice_details['main_invoice']['Invoice_ID_Auto']) && (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination != 0) && smc_session()['default_setting']['open_table_cash'] == 0) ? 'hidden' : ''); ?>"><i class="fa fa-money"></i> <?php print CommonLanguage::getMessage('generate') ?></button>
                                        </div>
                                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6  m-t-5">
                                            <button id="CashWithoutPrintInvBtn" type="submit" class="btn btn-info <?php echo!$permissions->hasPermission('pos_cash_without_print') ? 'hidden' : ((!isset($invoice_details['main_invoice']['Invoice_ID_Auto']) && (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination != 0) && smc_session()['default_setting']['open_table_cash'] == 0) ? 'hidden' : ''); ?>"><i class="fa fa-money"></i> <?php print CommonLanguage::getMessage('cash_without_print') ?></button>
                                        </div>
                                        <?php if (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination != 0 && $permissions->hasPermission('pos_submit_to_kitchen')) { ?>
                                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6  m-t-5">
                                                <button id="table_kitchen_btn"  type="submit" class="btn btn-info" onclick="$('#addtoPark:enabled').trigger('click')" ><i class="fal fa-utensils"></i><?php print CommonLanguage::getMessage('kitchen') ?></button>
                                            </div>
                                        <?php } elseif ($permissions->hasPermission('delivery_takeaway_kitchen') && $permissions->hasPermission('pos_submit_to_kitchen')) { ?>
                                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6  m-t-5">
                                                <button  type="submit" class="btn btn-info" id="kitchen_delivery_takeaway" data-type="kitchen_takeaway_delivery" ><i class="fal fa-utensils"></i><?php print CommonLanguage::getMessage('kitchen') ?></button>
                                            </div>
                                        <?php } if ((smc_session()['user_details']['login_device'] != 2 && !empty($invoice_details['main_invoice']['table_status_id']) && $invoice_details['main_invoice']['table_status_id'] == 2) && $permissions->hasPermission('print_invoice_table_pos')) { ?>
                                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6  m-t-5">
                                                <button  type="submit" class="btn btn-info" id="print_table_invoice"  data-table-id="<?php echo isset($invoice_details['main_invoice']['table_id']) ? $invoice_details['main_invoice']['table_id'] : ''; ?>"><i class="fa fa-print"></i> <?php print CommonLanguage::getMessage('print') ?></button>
                                            </div>
                                        <?php } ?>
                                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6  m-t-5">
                                            <button  type="submit" class="btn btn-info <?php echo!$permissions->hasPermission('credit_card_generate_invoice') ? 'hidden' : ((!isset($invoice_details['main_invoice']['Invoice_ID_Auto']) && (smc_session()['default_setting']['activate_smart_diner'] == 1 && $destination != 0) && smc_session()['default_setting']['open_table_cash'] == 0) ? 'hidden' : ''); ?>" id="generate_credit_card" ><i class="fa fa-print"></i> <?php print CommonLanguage::getMessage('credit_card') ?></button>
                                        </div>
                                        <?php 
                                        
                                        function smc__extend_pos_buttons() {
                                            echo "
                                                <div class='col-xs-6 col-sm-6 col-md-6 col-lg-6  m-t-5'>
                                                    <button  type='submit' class='btn btn-info' onclick='if(!$(\"#CashInvBtn\").is(\":hidden\") && !$(\"#CashInvBtn\").is(\":disabled\")) $(\"#text_note\").val(\"على الطاولة\");$(\"#CashInvBtn\").click();' ><i class='fa fa-table'></i> Table Cash</button>
                                                </div>";
                                        }
                                        (function_exists('smc__extend_pos_buttons') ? smc__extend_pos_buttons() : ''); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 m-t-5 calculator_div">
                                <table id="keypad" style="<?php echo $permissions->hasPermission('show_all_prices') ? '' : 'height:270px;'; ?>" >
                                    <tr>
                                        <td class="key" tabindex="0">1</td>
                                        <td class="key" tabindex="0">2</td>
                                        <td class="key" tabindex="0">3</td>
                                        <td class="key1 all-caps" data-flag = "2" data-role="QTY"><?php print CommonLanguage::getMessage("qty") ?></td>
                                        <?php if ($permissions->hasPermission('delete_row_pos')) { ?>
                                            <td class="key" data-role="TRASH"><i class="fa fa-trash"></i></td>
                                        <?php } else { ?>
                                            <td class="key1 empty_key not-allowed"></td>
                                        <?php } ?>
<!--<td class="key1 " data-role="TAG" ><i class="fa fa-tags"></i></td>-->
                                    </tr>
                                    <tr>
                                        <td class="key" tabindex="0">4</td>
                                        <td class="key" tabindex="0">5</td>
                                        <td class="key" tabindex="0">6</td>
                                        <?php if (smc_session()['default_setting']['activate_discount_pos'] == 1 && $permissions->hasPermission('show_all_prices')) { ?>
                                            <td class="key1 all-caps <?php echo (!$permissions->hasPermission('discount_on_item')) ? 'initial_disable current_disable not-allowed' : '' ?>"  data-role="DISC"><?php print CommonLanguage::getMessage("disc") ?></td>
                                        <?php } else { ?>
                                            <td class="key1 empty_key not-allowed"></td>
                                        <?php } ?>
                                        <?php if ($permissions->hasPermission('show_all_prices')) { ?>
                                            <td class="key1 <?php echo (!$permissions->hasPermission('pos_scale') || !$permissions->hasPermission('change_pos_price')) ? 'empty_key not-allowed' : '' ?>" <?php echo ($permissions->hasPermission('change_pos_price') && $permissions->hasPermission('pos_scale') ) ? 'data-role="total_price"' : '' ?>><i class="fa fa-balance-scale"></i></td>
                                        <?php } else { ?>
                                            <td class="key1 empty_key not-allowed"></td>
                                        <?php } ?>
                                    </tr>
                                    <tr>
                                        <td class="key" tabindex="0">7</td>
                                        <td class="key" tabindex="0">8</td>
                                        <td class="key" tabindex="0">9</td>
                                        <?php if ($permissions->hasPermission('show_all_prices')) { ?>
                                            <td class="key1 fa-22 key-price <?php echo!$permissions->hasPermission('change_pos_price') ? 'not-allowed empty_key ' : '' ?>" <?php echo $permissions->hasPermission('change_pos_price') ? 'data-role="PRICE"' : '' ?>><i class="fa fa-money "></i></td>
                                        <?php } else { ?>
                                            <td class="key1 empty_key not-allowed"></td>
                                        <?php } ?>
                                        <td class="key1" data-role="open-cash-drawer"><i class="fa fa-print"></i></td>
                                    </tr>
                                    <tr >
                                        <td class="key" tabindex="0">.</td>
                                        <td class="key" tabindex="0">0</td>
                                        <td class="key1 all-caps" data-role="CLR" tabindex="0" ><?php print CommonLanguage::getMessage("clr") ?></td>
                                        <td class="key1" data-role="DEL" tabindex="0"><i class="fa fa-arrow-left"></i></td>
                                        <td class="key1 note-key"><i class="fa fa-sticky-note"></i></td>
                                    </tr>
                                    <tr>
                                        <?php if ($permissions->hasPermission('exchange_pos')) { ?>
                                            <td class="key1 empty not-allowed" data-role="neg">-</td>
                                        <?php } else { ?>
                                            <td class="key1 empty_key not-allowed"></td>
                                        <?php } ?>
                                        <?php if ($permissions->hasPermission('Inventory')) { ?>
                                            <td class="key1 empty_key "><a href="<?php echo SITE_LINK; ?>Inventory" class="text-black"><i class="fa fa-archive"></i></a></td>
                                        <?php } else { ?>
                                            <td class="key1 empty_key not-allowed"></td>
                                        <?php } ?>
                                        <td class="key1 empty_key not-allowed"></td>
                                        <td class="key1  <?php echo!$permissions->hasPermission('pos_split_discount_row') ? 'not-allowed empty_key ' : '' ?>" <?php echo $permissions->hasPermission('pos_split_discount_row') ? 'data-role="split_row"' : '' ?> ><i class="fa fa-cut fa-2x"></i></td>
                                        <?php if (smc_session()['default_setting']['is_tag_active'] == 1) { ?>
                                            <td class="key1 " data-role="TAG" ><i class="fa fa-tags"></i></td>
                                        <?php } else { ?>
                                            <td class="key1 empty_key not-allowed"></td>
                                        <?php } ?>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class=" col-xs-6 col-sm-6 col-md-6  col-lg-6 LeftBox <?php echo smc_session()['default_setting']['pos_menu_width'] == 0 ? 'hidden' : ''; ?>" style="text-align:right;width:<?php echo smc_session()['default_setting']['pos_menu_width']; ?>%;">
                    <div id="RightBoxContents" class="Boxed tab-content full-height" style="<?php !$permissions->hasPermission('show_scrolled_category') ? 'height:572px !important;' : ''; ?>">
                        <div class="tab-pane fade in active" id="Tab_1">
                            <div class="row p-b-5">
                                <?php if ($permissions->hasPermission('search_pos_product')) { ?>
                                    <div id="CategoriesSearch">
                                        <input type="text" placeholder="<?php print CommonLanguage::getMessage('search') ?>" id="product_search" class="form-control borderStyle common-print" />
                                        <i class="fa fa-search"></i>
                                    </div>
                                <?php }if ($permissions->hasPermission('search_pos_barcode')) { ?>
                                    <div id="BarcodeSearch">
                                        <input type="text" id="barcode_search_input" placeholder="<?php print CommonLanguage::getMessage('search_barcode') ?>"  class="form-control borderStyle common-print" />
                                        <i class="fa fa-barcode"></i>
                                    </div>
                                <?php } ?>
                                <ul id="CurCategory_Crumbs" class="<?php echo (smc_session()['activate_pos_select_cat'] == 1 ? "hidden" : ""); ?>"></ul>
                                <?php // if (smc_session()['activate_pos_select_cat'] == 1) { ?>
                                <div class="col-md-4 <?php echo smc_session()['activate_pos_select_cat'] == 1 ? '' : 'hidden' ?>" style="top:5px;display:inline-flex">   
                                    <a href="javascript:GotoCateg(-1);" ><i class="fa fa-home fa-2x"></i></a>&nbsp;&nbsp;
                                    <select  id="activate_cat_id" name="activate_cat_id" class="full-width " data-init-plugin="select2">
                                        <option value="0"  >Home</option>
                                        <?php foreach ($active_cat as $key => $cat_id): ?>
                                            <option value="<?php echo $cat_id[0]; ?>" <?php echo $default_cat_id == $cat_id[0] ? 'selected' : ''; ?>  ><?php echo $cat_id[1]; ?></option>
                                        <?php endforeach; ?>
                                    </select></div>
                                <?php // } ?>
                            </div>
                            <div class="row" id="CurAvailableItemsContainer">
                                <ul id="CurAvailableItems" class="Categories"></ul>
                            </div>
                            <ol id="PageIndicatorHandler" class="carousel-indicators" style="max-height:50px;overflow:hidden;width:100%;left:0;right:0;margin:0 auto;"></ol>
                        </div>
                    </div>
                    <?php if ($permissions->hasPermission('show_scrolled_category')) { ?>
                        <div id='scroll_div_main_cat'>
                            <div class="row m-t-5 scroll-div-scrollable dragscroll" style="overflow-x:scroll;">
                                <ul id="MainCat">
                                    <div class='scroll-div-contents' style="display:inline-flex;">
                                        <?php foreach ($categories as $category): ?>
                                            <div class="catli <?php echo!empty($category[2]) ? '' : 'not-allowed'; ?>"    style="background-color:<?php echo $category[4] ? $category[4] : 'rgb(16,207,189)'; ?>" >
                                                <span  data-id="<?php echo $category[0] ?>" data-name="<?php echo $category[1] ?>" class="text-white"><?php echo $category[1] ?>
                                                </span>
                                            </div>
                                        <?php endforeach; ?>
                                        <span class='scroll-div-active-item'></span>
                                    </div>
                                </ul>
                            </div>
                        </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>
    <?php if ($permissions->hasPermission('show_list_in_pos') && $destination == 0) { ?>
        <div class="row m-t-10 <?php echo ((smc_session()['default_setting']['activate_cash_drawer'] == 1 && isset(smc_session()['is_cash_drawer_active'])) || smc_session()['default_setting']['activate_cash_drawer'] == 0) ? : "hidden"; ?>">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 main_pos_invoice_list_div">
                <div class="table-responsive">
                    <table class="table table-hover demo-table-search" id="main_pos_invoice_list" >
                        <thead>
                            <tr>
                                <th class="text-center" style="width:1%" >#</th>
                                <th class="text-center" style="width:3%" ><?php echo CommonLanguage::getMessage('time'); ?></th>
                                <th class="text-center" style="width:4%" ><?php echo CommonLanguage::getMessage('customer'); ?></th>
                                <th class="text-center"><?php echo CommonLanguage::getMessage('address'); ?></th>
                                <th class="text-center" style="width:4%" ><?php echo CommonLanguage::getMessage('phone'); ?></th>
                                <th class="text-center" style="width:4%" ><?php echo CommonLanguage::getMessage('description'); ?></th>
                                <?php if (!in_array(5, $pos_fields_hide)) { ?>
                                    <th class="text-center" style="width:4%" ><?php echo CommonLanguage::getMessage('driver'); ?></th>

                                <?php } ?>
                                <th class="text-center" style="width:4%" ><?php echo CommonLanguage::getMessage('Type'); ?></th>
                                <th class="text-center" style="width:5%" ><?php echo CommonLanguage::getMessage('Action'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    <?php } ?>
</section>
<?php if ($permissions->hasPermission('show_delivery_notification')) { ?>
    <div class="quickview-wrapper   builder hidden-sm hidden-xs <?php echo ((smc_session()['default_setting']['activate_cash_drawer'] == 1 && isset(smc_session()['is_cash_drawer_active'])) || smc_session()['default_setting']['activate_cash_drawer'] == 0) ? : "hidden"; ?>" id="builder">
        <a class="builder-toggle" data-toggle="quickview" data-toggle-element="#builder"><i class="pg pg-theme"></i></a>
        <div class="tab-content m-t-10 quickerleft p-l-10 p-r-10" style="    overflow-x: scroll;">
            <div class="row">
                <div class="col-md-12 tabe-responsive">
                    <table class=" table table-bordered" id="RemindersTable">
                        <thead>
                            <tr>
                                <th class="text-center" style="width:5%" >#</th>
                                <th class="text-center" style="width:10%" ><?php print CommonLanguage::getMessage('customer_name'); ?></th>
                                <th class="text-center" style="width:10%" ><?php print CommonLanguage::getMessage('Date'); ?></th>
                                <th class="text-center" style="width:10%" ><?php print CommonLanguage::getMessage('Action'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                    </table>
                </div>
            </div>
        </div>
        <?php echo Forms::ModalLoader('delivery_notification_loader'); ?>
    </div>
<?php } ?>
<!-- uom select -->
<select required name="UOM_Select" class="full-width UOM_Select hidden " >
    <?php foreach ($all_uom as $uom): ?>
        <option value="<?php echo $uom['UOM_ID']; ?>"><?php echo $uom['UOM_Name']; ?></option>
    <?php endforeach; ?>
</select>
<script>
    var change_class_flag = false, primary_total = 0, customer_type = '',
            last_focsd_elmnt = null;
    function getAccBalance(current_target, customer_id = '', pos_customer_id = '') {
    if (current_target == '#rec_acc_balance'){
            
    var data = {account: $("#search_supplier").val(), currency: $("#CurrencyDropDownPOS button input").val(), is_actual: is_actual, pos_customer: $("#pay_pos_customers").val()};
    }

    }
</script>
<?php
include 'Views/POS/pos_modals.php';
include "Views/Inventory/allergy-intolerance-modal.php";
include "Views/POS/end-of-day-modal.php";
