ok

Mini Shell

Direktori : /home2/selectio/public_html/mm-tailor-billing/themes/default/views/pos/
Upload File :
Current File : /home2/selectio/public_html/mm-tailor-billing/themes/default/views/pos/index.php

<?php (defined('BASEPATH')) or exit('No direct script access allowed'); ?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title><?= $page_title . ' | ' . $Settings->site_name; ?></title>
    <link rel="shortcut icon" href="<?= $assets ?>images/icon.png"/>
    <link href="<?= $assets ?>dist/css/styles.css" rel="stylesheet" type="text/css" />
    <?= $Settings->rtl ? '<link href="' . $assets . 'dist/css/rtl.css" rel="stylesheet" />' : ''; ?>
    <script src="<?= $assets ?>plugins/jQuery/jQuery-2.1.4.min.js"></script>
</head>
<body class="skin-<?= $Settings->theme_style; ?> sidebar-collapse sidebar-mini pos">
    <div class="wrapper rtl rtl-inv">

        <header class="main-header">
            <a href="<?= site_url(); ?>" class="logo">
                <?php if ($store) { ?>
                <span class="logo-mini"><?= $store->code; ?></span>
                <span class="logo-lg"><?= $store->name == 'SimplePOS' ? 'Simple<b>POS</b>' : $store->name; ?></span>
                <?php } else { ?>
                <span class="logo-mini">POS</span>
                <span class="logo-lg"><?= $Settings->site_name == 'SimplePOS' ? 'Simple<b>POS</b>' : $Settings->site_name; ?></span>
                <?php } ?>
            </a>
            <nav class="navbar navbar-static-top" role="navigation">
                <ul class="nav navbar-nav pull-left">
                    <!--<li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="<?= $assets; ?>images/<?= $Settings->selected_language; ?>.png" alt="<?= $Settings->selected_language; ?>"></a>
                        <ul class="dropdown-menu">
                            <?php $scanned_lang_dir = array_map(function ($path) {
                                return basename($path);
                            }, glob(APPPATH . 'language/*', GLOB_ONLYDIR));
                            foreach ($scanned_lang_dir as $entry) { ?>
                            <li><a href="<?= site_url('pos/language/' . $entry); ?>"><img
                                src="<?= $assets; ?>images/<?= $entry; ?>.png"
                                class="language-img"> &nbsp;&nbsp;<?= ucwords($entry); ?></a>
                            </li>
                                <?php } ?>
                            </ul>
                        </li>-->
                        <!-- Quick Links Starts Here -->
                <div class="box-body">
                    <?php if ($this->session->userdata('store_id')) { ?>
                    <a class="btn btn-quick" href="<?= site_url('pos'); ?>" title="<?= lang('pos'); ?>">
                        <i class="fa fa-th"></i>
                    </a>
                    <?php } ?>
                    <a class="btn btn-quick" href="<?= site_url('customers'); ?>" title="<?= lang('customers'); ?>">
                        <i class="fa fa-users"></i>
                    </a>
                    <a class="btn btn-quick" href="<?= site_url('sales'); ?>" title="<?= lang('sales'); ?>">
                        <i class="fa fa-shopping-cart"></i>
                    </a>
                    <a class="btn btn-quick" href="<?= site_url('incomes'); ?>" title="<?= lang('incomes'); ?>">
                        <i class="fa fa-inr"></i> <b>Inc</b>
                    </a>
                    <a class="btn btn-quick" href="<?= site_url('expenses'); ?>" title="<?= lang('expenses'); ?>">
                        <i class="fa fa-inr"></i> <b>Exp</b>
                    </a>
                    
                    <a class="btn btn-quick" href="<?= site_url('material_usage'); ?>" title="<?= lang('material_usage'); ?>">
                        <i class="fa fa-scissors"></i>
                    </a>
                    
                    <!--<a class="btn btn-quick" href="<?= site_url('products'); ?>" title="<?= lang('products'); ?>">
                        <i class="fa fa-barcode"></i>
                    </a>
                    
                    <a class="btn btn-quick" href="<?= site_url('categories'); ?>" title="<?= lang('categories'); ?>">
                        <i class="fa fa-folder-open"></i>
                    </a>-->
                    
                    <?php if ($Admin) { ?>
                    <a class="btn btn-quick" href="<?= site_url('reports'); ?>" title="<?= lang('reports'); ?>">
                        <i class="fa fa-bar-chart-o"></i>
                    </a>
                    <?php } ?>
                </div>
                <style>
                    .btn-quick {
                        position: relative;
                        padding: 4px 0px;
                        margin: 0px 0 0px 2px;
                        min-width: 47px;
                        height: 30px;
                        text-align: center;
                        color: #666;
                        border: 1px solid #ddd;
                        background-color: #f4f4f4;
                        font-size: 15px;
                    }
                </style>
                <!-- Quick Links Ends Here -->
                    </ul>
                    <div class="navbar-custom-menu">
                        <ul class="nav navbar-nav">
                            <li><a href="#" class="clock"></a></li>
                            <li><a href="<?= site_url(); ?>"><i class="fa fa-dashboard"></i></a></li>
                            <?php if ($Admin) { ?>
                            <li><a href="<?= site_url('settings'); ?>"><i class="fa fa-cogs"></i></a></li>
                            <?php } ?>
                            <?php if ($this->db->dbdriver != 'sqlite3') { ?>
                            <li><a href="<?= site_url('pos/view_bill'); ?>" target="_blank"><i class="fa fa-desktop"></i></a></li>
                            <?php } ?>
                            <li class="hidden-xs hidden-sm"><a href="<?= site_url('pos/shortcuts'); ?>" data-toggle="ajax"><i class="fa fa-key"></i></a></li>
                            <li><a href="<?= site_url('pos/register_details'); ?>" data-toggle="ajax"><?= lang('register_details'); ?></a></li>
                            <?php if ($Admin) { ?>
                            <li><a href="<?= site_url('pos/today_sale'); ?>" data-toggle="ajax"><?= lang('today_sale'); ?></a></li>
                            <?php } ?>
                            <li><a href="<?= site_url('pos/close_register'); ?>" data-toggle="ajax"><?= lang('close_register'); ?></a></li>
                            <?php if ($suspended_sales) { ?>
                            <li class="dropdown notifications-menu" id="suspended_sales">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="fa fa-bell-o"></i>
                                    <span class="label label-warning"><?=sizeof($suspended_sales);?></span>
                                </a>
                                <ul class="dropdown-menu">
                                    <li class="header">
                                        <input type="text" autocomplete="off" data-list=".list-suspended-sales" name="filter-suspended-sales" id="filter-suspended-sales" class="form-control input-sm kb-text clearfix" placeholder="<?= lang('filter_by_reference'); ?>">
                                    </li>
                                    <li>
                                        <ul class="menu">
                                            <li class="list-suspended-sales">
                                                <?php
                                                foreach ($suspended_sales as $ss) {
                                                    echo '<a href="' . site_url('pos/?hold=' . $ss->id) . '" class="load_suspended">' . $this->tec->hrld($ss->date) . ' (' . $ss->customer_name . ')<br><div class="bold">' . $ss->hold_ref . '</div></a>';
                                                }
                                                ?>
                                            </li>
                                        </ul>
                                    </li>
                                    <li class="footer"><a href="<?= site_url('sales/opened'); ?>"><?= lang('view_all'); ?></a></li>
                                </ul>
                            </li>
                            <?php } ?>
                            <li class="dropdown user user-menu">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <img src="<?= base_url('uploads/avatars/thumbs/' . ($this->session->userdata('avatar') ? $this->session->userdata('avatar') : $this->session->userdata('gender') . '.png')) ?>" class="user-image" alt="Avatar" />
                                    <span><?= $this->session->userdata('first_name') . ' ' . $this->session->userdata('last_name'); ?></span>
                                </a>
                                <ul class="dropdown-menu">
                                    <li class="user-header">
                                        <img src="<?= base_url('uploads/avatars/' . ($this->session->userdata('avatar') ? $this->session->userdata('avatar') : $this->session->userdata('gender') . '.png')) ?>" class="img-circle" alt="Avatar" />
                                        <p>
                                            <?= $this->session->userdata('email'); ?>
                                            <small><?= lang('member_since') . ' ' . $this->session->userdata('created_on'); ?></small>
                                        </p>
                                    </li>
                                    <li class="user-footer">
                                        <div class="pull-left">
                                            <a href="<?= site_url('users/profile/' . $this->session->userdata('user_id')); ?>" class="btn btn-default btn-flat"><?= lang('profile'); ?></a>
                                        </div>
                                        <div class="pull-right">
                                            <a href="<?= site_url('logout'); ?>" class="btn btn-default btn-flat<?= $this->session->userdata('register_id') ? ' sign_out' : ''; ?>"><?= lang('sign_out'); ?></a>
                                        </div>
                                    </li>
                                </ul>
                            </li>
                            <li>
                                <a href="#" data-toggle="control-sidebar" class="sidebar-icon"><i class="fa fa-folder sidebar-icon"></i></a>
                            </li>
                        </ul>
                    </div>
                </nav>
            </header>

            <aside class="main-sidebar">
                <section class="sidebar">
                    <ul class="sidebar-menu">
                        <li class="mm_welcome"><a href="<?= site_url(); ?>"><i class="fa fa-dashboard"></i> <span><?= lang('dashboard'); ?></span></a></li>
                        <?php if ($Settings->multi_store && !$this->session->userdata('store_id')) { ?>
                        <li class="mm_stores"><a href="<?= site_url('stores'); ?>"><i class="fa fa-building-o"></i> <span><?= lang('stores'); ?></span></a></li>
                        <?php } ?>
                        <li class="mm_pos"><a href="<?= site_url('pos'); ?>"><i class="fa fa-th"></i> <span><?= lang('pos'); ?></span></a></li>

                        <?php if ($Admin) { ?>
                        
                        <!-- New Sidebar Starts Here -->
                        <li id="mm_customers"><a href="<?= site_url('customers'); ?>"><i class="fa fa-users"></i></a></li>
                
                <li id="sales_index"><a href="<?= site_url('sales'); ?>"><i class="fa fa-shopping-cart"></i></a></li>
                
                
                
                <li class="treeview mm_expenses mm_incomes">
                    <a href="#">
                        <i class="fa fa-inr"></i>
                        <span>Incomes & Expenses</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <li id="incomes_index"><a href="<?= site_url('incomes'); ?>"><i class="fa fa-circle-o"></i> <?= lang('incomes'); ?></a></li>
                        <li class="divider"></li>
                        <li id="expenses_index"><a href="<?= site_url('expenses'); ?>"><i class="fa fa-circle-o"></i> <?= lang('expenses'); ?></a></li>
                    </ul>
                </li>
                
                <!-- Material Usage Starts Here -->
                <li class="treeview mm_material_usage">
                    <a href="#">
                        <i class="fa fa-exchange"></i>
                        <span><?= lang('material_usage'); ?></span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <li id="material_usage_index"><a href="<?= site_url('material_usage'); ?>"><i class="fa fa-circle-o"></i> <?= lang('material_usage'); ?></a></li>
                         <li id="material_usage_units"><a href="<?= site_url('material_usage/units'); ?>"><i class="fa fa-circle-o"></i> <?= lang('units'); ?></a></li>
                    </ul>
                </li>
                <!-- Material Usage Ends Here -->
                
                <li class="treeview mm_products mm_purchases mm_suppliers mm_categories">
                    <a href="#">
                        <i class="fa fa-folder-open"></i>
                        <span>Product Management</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <li id="products_index"><a href="<?= site_url('products'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_products'); ?></a></li>
                        <li id="purchases_index"><a href="<?= site_url('purchases'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_purchases'); ?></a></li>
                        <li id="suppliers_index"><a href="<?= site_url('suppliers'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_suppliers'); ?></a></li>
                        <li id="categories_index"><a href="<?= site_url('categories'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_sectors'); ?></a></li>
                    </ul>
                </li>
                
                <li class="treeview mm_mmcategories mm_extra_option">
                    <a href="#">
                        <i class="fa fa-bars"></i>
                        <span>Item Management</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <li id="mmcategories_index"><a href="<?= site_url('mmcategories'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_mmcategories'); ?></a></li>
                        <li id="mmcategories_sub_list"><a href="<?= site_url('mmcategories/sub_list'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_mmsubcategories'); ?></a></li>
                        <li id="extra_option_index"><a href="<?= site_url('extra_option'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_extra_option'); ?></a></li>
                    </ul>
                </li>
                
                <li class="treeview mm_auth">
                    <a href="#">
                        <i class="fa fa-users"></i>
                        <span><?= lang('users'); ?></span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <li id="auth_users"><a href="<?= site_url('users'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_users'); ?></a></li>
                        <li id="auth_add"><a href="<?= site_url('users/add'); ?>"><i class="fa fa-circle-o"></i> <?= lang('add_user'); ?></a></li>
                    </ul>
                </li>
                
                
                <li class="treeview mm_settings">
                    <a href="#">
                        <i class="fa fa-cogs"></i>
                        <span><?= lang('settings'); ?></span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <li id="settings_index"><a href="<?= site_url('settings'); ?>"><i class="fa fa-circle-o"></i> <?= lang('settings'); ?></a></li>
                        <li class="divider"></li>
                        <li id="settings_stores"><a href="<?= site_url('settings/stores'); ?>"><i class="fa fa-circle-o"></i> <?= lang('stores'); ?></a></li>
                        <?php if ($Settings->multi_store) { ?>
                        <li id="settings_add_store"><a href="<?= site_url('settings/add_store'); ?>"><i class="fa fa-circle-o"></i> <?= lang('add_store'); ?></a></li>
                        <li class="divider"></li>
                        <?php } ?>
                        <li id="settings_printers"><a href="<?= site_url('settings/printers'); ?>"><i class="fa fa-circle-o"></i> <?= lang('printers'); ?></a></li>
                        <li id="settings_add_printer"><a href="<?= site_url('settings/add_printer'); ?>"><i class="fa fa-circle-o"></i> <?= lang('add_printer'); ?></a></li>
                        <li class="divider"></li>
                        <?php if ($this->db->dbdriver != 'sqlite3') { ?>
                        <li id="settings_backups"><a href="<?= site_url('settings/backups'); ?>"><i class="fa fa-circle-o"></i> <?= lang('backups'); ?></a></li>
                        <?php } ?>
                        <!-- <li id="settings_updates"><a href="<?= site_url('settings/updates'); ?>"><i class="fa fa-circle-o"></i> <?= lang('updates'); ?></a></li> -->
                    </ul>
                </li>
                <li class="treeview mm_reports">
                    <a href="#">
                        <i class="fa fa-bar-chart-o"></i>
                        <span><?= lang('reports'); ?></span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <!--<li id="reports_daily_sales"><a href="<?= site_url('reports/daily_sales'); ?>"><i class="fa fa-circle-o"></i> <?= lang('daily_sales'); ?></a></li>
                        <li id="reports_monthly_sales"><a href="<?= site_url('reports/monthly_sales'); ?>"><i class="fa fa-circle-o"></i> <?= lang('monthly_sales'); ?></a></li>-->
                        <li id="reports_index"><a href="<?= site_url('reports'); ?>"><i class="fa fa-circle-o"></i> <?= lang('sales_report'); ?></a></li>
                        <!--<li class="divider"></li>
                        <li id="reports_payments"><a href="<?= site_url('reports/payments'); ?>"><i class="fa fa-circle-o"></i> <?= lang('payments_report'); ?></a></li>
                        <li class="divider"></li>
                        <li id="reports_registers"><a href="<?= site_url('reports/registers'); ?>"><i class="fa fa-circle-o"></i> <?= lang('registers_report'); ?></a></li>
                        <li class="divider"></li>
                        <li id="reports_top_products"><a href="<?= site_url('reports/top_products'); ?>"><i class="fa fa-circle-o"></i> <?= lang('top_products'); ?></a></li>
                        <li id="reports_products"><a href="<?= site_url('reports/products'); ?>"><i class="fa fa-circle-o"></i> <?= lang('products_report'); ?></a></li>-->
                    </ul>
                </li>
                        <!-- New Sidebar Ends Here -->
                        
                        
                        
                        
                        <?php } else { ?>
                        <li class="mm_products"><a href="<?= site_url('products'); ?>"><i class="fa fa-barcode"></i> <span><?= lang('products'); ?></span></a></li>
                        <li class="mm_categories"><a href="<?= site_url('categories'); ?>"><i class="fa fa-folder-open"></i> <span><?= lang('categories'); ?></span></a></li>
                        <?php if ($this->session->userdata('store_id')) { ?>
                        <li class="treeview mm_sales">
                            <a href="#">
                                <i class="fa fa-shopping-cart"></i>
                                <span><?= lang('sales'); ?></span>
                                <i class="fa fa-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li id="sales_index"><a href="<?= site_url('sales'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_sales'); ?></a></li>
                            </ul>
                        </li>
                        <li class="treeview mm_purchases">
                            <a href="#">
                                <i class="fa fa-plus"></i>
                                <span><?= lang('expenses'); ?></span>
                                <i class="fa fa-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li id="purchases_expenses"><a href="<?= site_url('expenses'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_expenses'); ?></a></li>
                            </ul>
                        </li>
                        <?php } ?>
                        
                        <li class="treeview mm_customers">
                            <a href="#">
                                <i class="fa fa-users"></i>
                                <span><?= lang('customers'); ?></span>
                                <i class="fa fa-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li id="customers_index"><a href="<?= site_url('customers'); ?>"><i class="fa fa-circle-o"></i> <?= lang('list_customers'); ?></a></li>
                                <li id="customers_add"><a href="<?= site_url('customers/add'); ?>"><i class="fa fa-circle-o"></i> <?= lang('add_customer'); ?></a></li>
                            </ul>
                        </li>
                        <?php } ?>
                    </ul>
                </section>
            </aside>

            <div class="content-wrapper">

                <div class="col-lg-12 alerts">
                <?php if ($error) { ?>
                    <div class="alert alert-danger alert-dismissable">
                        <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                        <h4><i class="icon fa fa-ban"></i> <?= lang('error'); ?></h4>
                        <?= $error; ?>
                    </div>
                    <?php } if ($message) { ?>
                    <div class="alert alert-success alert-dismissable">
                        <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                        <h4><i class="icon fa fa-check"></i> <?= lang('Success'); ?></h4>
                        <?= $message; ?>
                    </div>
                    <?php } ?>
                </div>
                <div id="pos">
                    <?=form_open('pos', 'id="pos-sale-form"'); ?>
                   <!-- <form action="https://mm-tailor.firstmatrix.in.net/pos1" id="pos-sale-forms" method="get" accept-charset="utf-8">-->
                <table style="width:100%;" class="layout-table">
                    <tr>
                        <td style="width: 40%;">

                            
                                <div class="well well-sm" id="leftdiv">
                                    <div id="lefttop" style="margin-bottom:5px;">
                                        <div class="form-group" style="margin-bottom:5px;">
                                            <div class="input-group">
                                                
                                                
                                                   <select name="customer_id" id="spos_customer"  class="form-control select2" required="required">
                                                       <option value="">Choose a Customer</option>
                                                        <?php $f=1; foreach($customers as $customer){   {?>  
                                                    <option value="<?=$customer->id?>"><?=$customer->name.' - '.$customer->phone?></option>
                                                        <?php } $f++;} ?>
                                                    </select> 

                                               <!-- <input type="hidden" name="date" id="date" class="form-control" required="required" value="<?php echo date('Y-m-d')?>" />-->
                                                
                                                <div class="input-group-addon no-print" style="padding: 2px 5px;">
                                                    <?php if($_GET["clone"] || $_GET["edit"]){ } else{?>
                                                    <a href="#" id="clone" class="external btn btn-primary btn-xs" data-toggle="modal" data-target="#myModal" style="margin-top: -11px;"><span>History</span></a>
                                                    <?php } ?> 
                                                    <a href="#" id="add-customer" class="external" data-toggle="modal" data-target="#myModal"><i class="fa fa-2x fa-plus-circle" id="addIcon"></i></a>
                                                </div>
                                            </div>
                                            <div style="clear:both;"></div>
                                        </div>
                                        
                                        
                                        
                                    <?php if ($eid) { ?>
                                        <div class="form-group" style="margin-bottom:5px;">
                                            <div class="col-md-6" style="margin-bottom: 5px; padding: 0px 5px 0px 0px;">
                                              <input type="date" name="sale_date" id="sale_date" class="form-control" required="required" value="<?=$sale->sale_date?>" />
                                           </div>
                                            <div class="col-md-6" style="margin-bottom: 5px; padding: 0px;">
                                                <span class="btn btn-primary btn-sm" style="width: 95%" id="add_notes"><i class="fa fa-plus"></i>  Add Notes</span>
                                            </div>
                                            <input type="hidden" name="clone_no" value="<?= $_GET['clone']; ?>" id="clone_no" class="form-control kb-text" placeholder="Clone Number" />
                                            <div class="col-md-12" style="text-align: center;"><span id="dc_check"></span></div>
                                        </div>
                                    <?php }else{ ?>
                                        
                                        <div class="form-group" style="margin-bottom:5px;">
                                            <div class="col-md-6" style="margin-bottom: 5px; padding: 0px 5px 0px 0px;">
                                              <input type="date" name="sale_date" id="sale_date" class="form-control" required="required" value="" />
                                              <input type="hidden" name="date" id="date" class="form-control" required="required" value="<?php echo date('Y-m-d')?>" />
                                           </div>
                                            <div class="col-md-6" style="margin-bottom: 5px; padding: 0px;">
                                                <span class="btn btn-primary btn-sm" style="width: 95%" id="add_notes"><i class="fa fa-plus"></i>  Show/Hide Notes</span>
                                            </div>
                                            <input type="hidden" name="clone_no" value="<?= $_GET['clone']; ?>" id="clone_no" class="form-control kb-text" placeholder="Clone Number" />
                                            <div class="col-md-12" style="text-align: center;"><span id="dc_check"></span></div>
                                        </div>
                                    <?php } ?>
                                        
                          <!--  ******************************************* Start Notes*******************************************-->
                             <div class="form-group" style="margin-bottom:5px;">          
                                <div id="add_notes_menu">
                    			   <textarea name="snote" id="snote" placeholder="Notes" class="pa form-control kb-text"><?=$sale->note?></textarea>
                    			</div>
                    		</div>
                          <!--  *******************************************End Notes*******************************************-->                
                                        <?php 
                                        
                                        if($eid){
                                            $phmeasurement=json_decode($sale->pant_measure, true);
                                            $shmeasurement=json_decode($sale->shirt_measure, true);
                                            
                                            $extra_pant_measure=json_decode($sale->another_pant_measure, true);
                                            $extra_shirt_measure=json_decode($sale->another_shirt_measure, true);
                                            //print_r($phmeasurement);
                                            //print_r($shmeasurement);
                                        }
                                        
                                        ?>
                                        
                                        
                                        
                                        <?php $clone_id = $_GET['clone']; $clone_id.=$_GET['edit']; ?>
                                        <!--<?php if ($eid && $Admin) { ?>
                                        <?php  ?>
                                        <div class="form-group" style="margin-bottom:5px;">
                                            <?= form_input('date', set_value('date', $sale->date), 'id="date" required="required" class="form-control"'); ?>
                                        </div>
                                        <?php } ?>-->
                                        <div class="form-group" style="margin-bottom:5px;">
                                            <div class="col-md-4" style="margin-bottom: 5px; padding: 0px 5px 0px 0px;">
                                                <input type="text" name="hold_ref" value="<?= $reference_note; ?>" id="dc_number" class="form-control kb-text" placeholder="DC Number" required />
                                            </div>
					   <div class="col-md-4" style="margin-bottom: 5px; padding: 0px 5px 0px 0px;">
                                                <input type="text" name="reference_no" value="<?= $mm_no; ?>" id="reference_no" class="form-control kb-text" placeholder="Suiting Reference No" />
                                            </div>
                                            <div class="col-md-4" style="margin-bottom: 5px; padding: 0px;">
                                                <select name="sells" id="sells" class="form-control" required>
                                                    <option value="1" <?php if($eid){if($sale->sells==1){echo "selected";}}?>>Sales</option>
                                                    <option value="2" <?php if($eid){if($sale->sells==2){echo "selected";}}?>>Trails</option>
                                                     <option value="3" <?php if($eid){if($sale->sells==3){echo "selected";}}?>>Trail Ready</option>
                                                    <option value="4" <?php if($eid){if($sale->sells==4){echo "selected";}}?>>Trail Completed</option>
                                                </select>
                                            </div>
                                            <input type="hidden" name="clone_no1" value="<?= $clone_id; ?>" id="clone_no1" class="form-control kb-text" placeholder="Clone Number" />
                                            <div class="col-md-12" style="text-align: center;"><span id="dc_check"></span></div>
                                        </div>
                                        
                                        <div class="form-group" style="margin-bottom:5px;">
                                            <input type="text" name="code" id="add_item" class="form-control" placeholder="<?=lang('search__scan')?>" />
                                        </div>
                                    </div>
                                    <div id="printhead" class="print">
                                        <?= $Settings->header; ?>
                                        <p><?= lang('date'); ?>: <?=date($Settings->dateformat)?></p>
                                    </div>
                                    <div id="print" class="fixed-table-container">
                                        <div id="list-table-div">
                                            <div class="fixed-table-header">
                                                <table class="table table-striped table-condensed table-hover list-table" style="margin:0;">
                                                    <thead>
                                                        <tr class="success">
                                                            <th><?=lang('product')?></th>
                                                            <th style="width: 15%;text-align:center;"><?=lang('price')?></th>
                                                            <th style="width: 15%;text-align:center;"><?=lang('units')?></th>
                                                            <th style="width: 15%;text-align:center;"><?=lang('qty')?></th>
                                                            <th style="width: 20%;text-align:center;"><?=lang('subtotal')?></th>
                                                            <th style="width: 20px;" class="satu"><i class="fa fa-trash-o"></i></th>
                                                        </tr>
                                                    </thead>
                                                </table>
                                            </div>
                                            <table id="posTable" class="table table-striped table-condensed table-hover list-table" style="margin:0px;" data-height="100">
                                                <thead>
                                                    <tr class="success">
                                                        <th><?=lang('product')?></th>
                                                        <th style="width: 15%;text-align:center;"><?=lang('price')?></th>
                                                        <th style="width: 15%;text-align:center;"><?=lang('qty')?></th>
                                                        <th style="width: 20%;text-align:center;"><?=lang('subtotal')?></th>
                                                        <th style="width: 20px;" class="satu"><i class="fa fa-trash-o"></i></th>
                                                    </tr>
                                                </thead>
                                                <tbody></tbody>
                                            </table>
                                        </div>
                                        <div style="clear:both;"></div>
                                        <div id="totaldiv">
                                            <table id="totaltbl" class="table table-condensed totals" style="margin-bottom:10px;">
                                                <tbody>
                                                    <tr class="info">
                                                        <td width="25%"><?=lang('total_items')?></td>
                                                        <td class="text-right" style="padding-right:10px;"><span id="count">0</span></td>
                                                        <td width="25%"><?=lang('total')?></td>
                                                        <td class="text-right" colspan="2"><span id="total">0</span></td>
                                                    </tr>
                                                    <tr class="info">
                                                        <td width="25%"><a href="#" id="add_discount"><?=lang('discount')?></a></td>
                                                        <td class="text-right" style="padding-right:10px;"><span id="ds_con">0</span></td>
                                                        <td width="25%"><a href="#" id="add_tax"><?=lang('order_tax')?></a></td>
                                                        <td class="text-right"><span id="ts_con">0</span></td>
                                                    </tr>
                                                    <tr class="success">
                                                        <td colspan="2" style="font-weight:bold;">
                                                            <?=lang('total_payable')?>
                                                        </td>
                                                        <td class="text-right" colspan="2" style="font-weight:bold;"><span id="total-payable" style="color: #ff8d00; font-size: 28px; font-weight: 900;">0</span></td>
                                                    </tr>
                                                    <tr class="success">
                                                        <td colspan="2" style="font-weight:bold;">Due Date:</td>
                                                        <td class="text-right" colspan="2" style="font-weight:bold;">
                                                            <?php //Current Date echo date('Y-m-d')?>
                                                            <input type="date" name="due_date" id="due_date" class="form-control" required="required" value="<?=$sale->due_date?>" />
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div id="botbuttons" class="col-xs-12 text-center">
                                        <div class="row">
                                            <!--<div class="col-xs-4" style="padding: 0;">
                                                <div class="btn-group-vertical btn-block">
                                                    <button type="button" class="btn btn-warning btn-block btn-flat"
                                                    id="suspend"><?= lang('hold'); ?></button>
                                                    <button type="button" class="btn btn-danger btn-block btn-flat"
                                                    id="reset"><?= lang('cancel'); ?></button>
                                                </div>

                                            </div>-->
                                            <!--<div class="col-xs-4" style="padding: 0 5px;">
                                                <div class="btn-group-vertical btn-block">
                                                    <button type="button" class="btn bg-purple btn-block btn-flat" id="print_order"><?= lang('print_order'); ?></button>

                                                    <button type="button" class="btn bg-navy btn-block btn-flat" id="print_bill"><?= lang('print_bill'); ?></button>
                                                </div>
                                            </div>-->
                                            <div class="col-xs-12" style="padding: 0;">
                                                <button type="button" class="btn btn-success btn-block btn-flat" id="<?= $eid ? 'submit-sale' : 'payment'; ?>" style="height:67px;"><?= $eid ? lang('submit') : lang('SUBMIT'); ?></button>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="clearfix"></div>
                                    <span id="hidesuspend"></span>
                                    <input type="hidden" name="spos_note" value="" id="spos_note">

                                    <div id="payment-con">
                                        <input type="hidden" name="amount" id="amount_val" value="<?= $eid ? $sale->paid : ''; ?>"/>
                                        <input type="hidden" name="balance_amount" id="balance_val" value=""/>
                                        <input type="hidden" name="paid_by" id="paid_by_val" value="cash"/>
                                        <input type="hidden" name="cc_no" id="cc_no_val" value=""/>
                                        <input type="hidden" name="paying_gift_card_no" id="paying_gift_card_no_val" value=""/>
                                        <input type="hidden" name="cc_holder" id="cc_holder_val" value=""/>
                                        <input type="hidden" name="cheque_no" id="cheque_no_val" value=""/>
                                        <input type="hidden" name="cc_month" id="cc_month_val" value=""/>
                                        <input type="hidden" name="cc_year" id="cc_year_val" value=""/>
                                        <input type="hidden" name="cc_type" id="cc_type_val" value=""/>
                                        <input type="hidden" name="cc_cvv2" id="cc_cvv2_val" value=""/>
                                        <input type="hidden" name="balance" id="balance_v" value=""/>
                                        <input type="hidden" name="payment_note" id="payment_note_val" value=""/>
                                        <input type="date" name="payment_date" id="payment_date_val" value="" hidden/>
                                    </div>
                                    <input type="hidden" name="customer" id="customer" value="<?=$Settings->default_customer?>" />
                                    <input type="hidden" name="order_tax" id="tax_val" value="" />
                                    <input type="hidden" name="order_discount" id="discount_val" value="" />
                                    <input type="hidden" name="count" id="total_item" value="" />
                                    <input type="hidden" name="did" id="did_delete" value="<?=$sid;?>" />
                                    <input type="hidden" name="eid" id="eid_delete" value="<?=$eid;?>" />
                                    <input type="hidden" name="total_items" id="total_items" value="0" />
                                    <input type="hidden" name="total_quantity" id="total_quantity" value="0" />
                                    <input type="submit" id="submit" value="Submit Sale" style="display: none;" />
                                </div>
                                

                        </td>
                        <td style="width: 60%;">
                            <div class="contents" id="right-col">
                                <div class="well well-sm" id="item-list" style="overflow-y: scroll;height: 100%;">
                                <center><h5><b><i class="fa fa-user"></i> PANT MEASUREMENT DETAILS:</b></h5></center>
                                <table width="100%">
                    			    <tr>
                    			        <th width="12.5%" style="padding-bottom: 10px;">HE</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">HIP</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">BAC</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">INN</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">FL</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">THI</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">KNEE</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">BOTT</th>
                    			    </tr>
                    			    <tr>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['pf1'];} ?>" name="pf1" id="pf1"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['pf2'];} ?>" name="pf2" id="pf2"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['pf3'];} ?>" name="pf3" id="pf3"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['pf4'];} ?>" name="pf4" id="pf4"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['pf5'];} ?>" name="pf5" id="pf5"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['pf6'];} ?>" name="pf6" id="pf6"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['pf7'];} ?>" name="pf7" id="pf7"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['pf8'];} ?>" name="pf8" id="pf8"></td>
                    			    </tr>
                    			    <tr>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['ps1'];} ?>" name="ps1" id="ps1"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['ps2'];} ?>" name="ps2" id="ps2"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['ps3'];} ?>" name="ps3" id="ps3"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['ps4'];} ?>" name="ps4" id="ps4"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['ps5'];} ?>" name="ps5" id="ps5"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['ps6'];} ?>" name="ps6" id="ps6"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['ps7'];} ?>" name="ps7" id="ps7"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['ps8'];} ?>" name="ps8" id="ps8"></td>
                    			    </tr>
                    			    <tr>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $phmeasurement[0]['pt1'];} ?>" name="pt1" id="pt1"></td>
                    			        <td colspan="5"></td>
                    			        <td colspan="2" style="vertical-align: bottom;"><!--<span class="btn btn-primary btn-sm" style="width: 95%" id="add_another_pant"><i class="fa fa-plus"></i>  Add Another Measurement</span>--></td>
                    			    </tr>
                    			    
                    			    <tr>
                    			        <td colspan="8" width="100%">
                    			            <label for="" class="control-label">Select Pant Model Items:  <!--<span class="btn btn-info btn-xs add_pant_model" style="width: 150px;margin-left: 40px;" ><i class="fa fa-plus"></i> Add Pant Model Items</span><span class="btn btn-info btn-xs" style="width: 150px;margin-left: 40px;" id="modelBtnClick">Submit</span>--></label>
                    			            <!--<select class="form-control select2" name="pant_ext[]" id="pant_ext" multiple > 
                						       <?php $f=1; $pant_extra = explode(',', $sale->pant_extra); foreach($pant_extra_option as $pant){ ?>  
                                                <option value="<?=$pant->id?>" <?php if(in_array($pant->id,$pant_extra)){ echo "selected";} ?>><?=$pant->name?> - <?=$pant->tamil_name?></option>
                                                <?php $f++;} ?>
                                			</select>-->
                                			<select class="form-control select2" name="pant_ext[]" id="pant_ext"> 
                                			<option value="">Select a Model Items</option>
                						       <?php $f=1; $pant_extra = explode(',', $sale->pant_extra); foreach($pant_extra_option as $pant){ ?>  
                                                <option value="<?=$pant->tamil_name?>" ><?=$pant->name?> - <?=$pant->tamil_name?></option>
                                                <?php $f++;} ?>
                                			</select>
                    			        </td>
                    			    </tr>
                    			    
                    			</table>
                    			<!--<div id="add_pant_section">
                    			    <div class="row" style="padding-top: 5px;">
                    			        <div class="col-md-2"></div>
                    			        <div class="col-md-6"><input name="pant_model" id="pant_model" class="form-control" /></div>
                    			        <div class="col-md-4"><span class="btn btn-success btn-sm">Submit</span></div>
                    			    </div>
                    			</div>-->
                    			<table width="100%">
                    			    <tr>
                    			        <td colspan="8" width="100%;">
                    			             <textarea name="pant_text" class="form-control" id="pant_model_textarea" cols="70" rows="5" style="margin-top: 5px;"><?=$sale->pant_text?></textarea>
                    			        </td>
                    			    </tr>
                    			</table>
                    		<!--	<div id="pant_section" style="border: 2px dashed gray; border-radius: 10px; padding: 3px 0px 7px 14px;margin-top: 5px;">
                    			    <center><h5><b><i class="fa fa-user"></i> JEANS PANT MEASUREMENT DETAILS:</b></h5></center>
                    			    <table width="100%">
                    			    <tr>
                    			        <th width="12.5%" style="padding-bottom: 10px;">HE</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">HIP</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">BAC</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">INN</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">FL</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">THI</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">KNEE</th>
                    			        <th width="12.5%" style="padding-bottom: 10px;">BOTT</th>
                    			    </tr>
                    			    <tr>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['pf1'];} ?>" name="extra_pf1" id="extra_pf1"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['pf2'];} ?>" name="extra_pf2" id="extra_pf2"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['pf3'];} ?>" name="extra_pf3" id="extra_pf3"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['pf4'];} ?>" name="extra_pf4" id="extra_pf4"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['pf5'];} ?>" name="extra_pf5" id="extra_pf5"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['pf6'];} ?>" name="extra_pf6" id="extra_pf6"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['pf7'];} ?>" name="extra_pf7" id="extra_pf7"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['pf8'];} ?>" name="extra_pf8" id="extra_pf8"></td>
                    			    </tr>
                    			    <tr>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['ps1'];} ?>" name="extra_ps1" id="extra_ps1"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['ps2'];} ?>" name="extra_ps2" id="extra_ps2"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['ps3'];} ?>" name="extra_ps3" id="extra_ps3"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['ps4'];} ?>" name="extra_ps4" id="extra_ps4"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['ps5'];} ?>" name="extra_ps5" id="extra_ps5"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['ps6'];} ?>" name="extra_ps6" id="extra_ps6"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['ps7'];} ?>" name="extra_ps7" id="extra_ps7"></td>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['ps8'];} ?>" name="extra_ps8" id="extra_ps8"></td>
                    			    </tr>
                    			    <tr>
                    			        <td width="12.5%" style="padding-bottom: 10px;"><input type="text" style="width:50%" value="<?php if(isset($eid)){ echo $extra_pant_measure[0]['pt1'];} ?>" name="extra_pt1" id="extra_pt1"></td>
                    			   </tr>
                    			    
                    			    
                    			</table>
                    			</div>-->
                    			
                    	<style>
                    	    .select2-container .select2-selection--multiple{
                    	        min-height: 65px;
                    	    }
                    	</style>
                    			
                    			
                    			<center><h5><b><i class="fa fa-user"></i> SHIRT MEASUREMENT DETAILS:</b></h5></center>
                                <table width="100%">
                    			    <tr>
                    			        <th width="9%"style="padding-bottom: 10px;">HE</th>
                    			        <th width="9%"style="padding-bottom: 10px;">SOL</th>
                    			        <th width="9%"style="padding-bottom: 10px;">HA-HD.LEN</th>
                    			        <th width="9%"style="padding-bottom: 10px;">HA-LOOSE</th>
                    			        <th width="9%"style="padding-bottom: 10px;">BODY</th>
                    			        <th width="9%"style="padding-bottom: 10px;">COLLAR</th>
                    			        <th width="9%"style="padding-bottom: 10px;">SIDE LOW</th>
                    			        <th width="9%"style="padding-bottom: 10px;">SIDE FHED</th>
                    			        <th width="9%"style="padding-bottom: 10px;">SIDE HEIGHT</th>
                    			        <th width="9%"style="padding-bottom: 10px;">CHEST</th>
                    			        <th width="10%"style="padding-bottom: 10px;">SAMPLE</th>
                    			    </tr>
                    			    <tr>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf1'];} ?>" name="sf1" id="sf1"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf2'];} ?>" name="sf2" id="sf2"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf3'];} ?>" name="sf3" id="sf3"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf4'];} ?>" name="sf4" id="sf4"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf5'];} ?>" name="sf5" id="sf5"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf6'];} ?>" name="sf6" id="sf6"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf7'];} ?>" name="sf7" id="sf7"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf8'];} ?>" name="sf8" id="sf8"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf9'];} ?>" name="sf9" id="sf9"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf10'];} ?>" name="sf10" id="sf10"></td>
                    			        <td width="10%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['sf11'];} ?>" name="sf11" id="sf11"></td>
                    			    </tr>
                    			    <tr>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss1'];} ?>" name="ss1" id="ss1"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss2'];} ?>" name="ss2" id="ss2"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss3'];} ?>" name="ss3" id="ss3"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss4'];} ?>" name="ss4" id="ss4"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss5'];} ?>" name="ss5" id="ss5"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss6'];} ?>" name="ss6" id="ss6"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss7'];} ?>" name="ss7" id="ss7"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss8'];} ?>" name="ss8" id="ss8"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss9'];} ?>" name="ss9" id="ss9"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss10'];} ?>" name="ss10" id="ss10"></td>
                    			        <td width="10%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['ss11'];} ?>" name="ss11" id="ss11"></td>
                    			    </tr>
                    			    <tr>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['st1'];} ?>" name="st1" id="st1"></td>
                    			    </tr>
                    			    
                    			    <tr>
                    			        <td colspan="2" width="9%"style="padding-bottom: 10px;"><b>FULL HAND SHIRT :</b></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['fhf1'];} ?>" name="fhf1" id="fhf1"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['fhf2'];} ?>" name="fhf2" id="fhf2"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['fhf3'];} ?>" name="fhf3" id="fhf3"></td>
                    			        
                    			    </tr>
                    			    <tr>
                    			        <td colspan="2" width="9%"style="padding-bottom: 10px;"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['fhs1'];} ?>" name="fhs1" id="fhs1"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['fhs2'];} ?>" name="fhs2" id="fhs2"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $shmeasurement[0]['fhs3'];} ?>" name="fhs3" id="fhs3"></td>
                    			        <td colspan="3"></td>
                    			        <td colspan="3" style="vertical-align: bottom;"><!--<span class="btn btn-primary btn-sm" style="width: 95%" id="add_another_shirt"><i class="fa fa-plus"></i>  Add Another Measurement</span>--></td>
                    			    </tr>
                    			    <tr>
                    			        <td colspan="11" width="100%">
                    			            <label for="" class="control-label">Select Shirt Model Items: </label>
                    			            <?php //if(in_array($ext_option->id,$shirt)){ echo "selected";} ?>
                						    <select name="shirt_ext[]" id="shirt_ext" class="form-control select2">
                						        <option value="">Select a Model Items</option>
                                              <?php $f=1; $shirt = explode(',', $sale->shirt_extra); foreach($shirt_extra_option as $ext_option){ ?> 
                                                <option value="<?=$ext_option->tamil_name?>"><?=$ext_option->name?>-<?=$ext_option->tamil_name?></option>
                                                <?php $f++; } ?>
                                            </select>
                    			        </td>
                    			    </tr>
                    			</table>
                    			<table width="100%">
                    			    <tr>
                    			        <td colspan="8" width="100%;">
                    			             <textarea name="shirt_text" class="form-control" id="shirt_model_textarea" cols="70" rows="5" style="margin-top: 5px;"><?=$sale->shirt_text?></textarea>
                    			        </td>
                    			    </tr>
                    			</table>
                    			
                    			<!--<div id="extra_shirt_section" style="border: 2px dashed gray; border-radius: 10px; padding: 3px 0px 7px 14px;margin-top: 5px;">
                    			    <center><h5><b><i class="fa fa-user"></i> SAFARI MEASUREMENT DETAILS:</b></h5></center>
                                <table width="100%">
                    			    <tr>
                    			        <th width="9%"style="padding-bottom: 10px;">HE</th>
                    			        <th width="9%"style="padding-bottom: 10px;">SOL</th>
                    			        <th width="9%"style="padding-bottom: 10px;">HA-HD.LEN</th>
                    			        <th width="9%"style="padding-bottom: 10px;">HA-LOOSE</th>
                    			        <th width="9%"style="padding-bottom: 10px;">BODY</th>
                    			        <th width="9%"style="padding-bottom: 10px;">COLLAR</th>
                    			        <th width="9%"style="padding-bottom: 10px;">SIDE LOW</th>
                    			        <th width="9%"style="padding-bottom: 10px;">SIDE FHED</th>
                    			        <th width="9%"style="padding-bottom: 10px;">SIDE HEIGHT</th>
                    			        <th width="9%"style="padding-bottom: 10px;">CHEST</th>
                    			        <th width="10%"style="padding-bottom: 10px;">SAMPLE</th>
                    			    </tr>
                    			    <tr>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf1'];} ?>" name="extra_sf1" id="extra_sf1"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf2'];} ?>" name="extra_sf2" id="extra_sf2"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf3'];} ?>" name="extra_sf3" id="extra_sf3"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf4'];} ?>" name="extra_sf4" id="extra_sf4"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf5'];} ?>" name="extra_sf5" id="extra_sf5"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf6'];} ?>" name="extra_sf6" id="extra_sf6"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf7'];} ?>" name="extra_sf7" id="extra_sf7"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf8'];} ?>" name="extra_sf8" id="extra_sf8"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf9'];} ?>" name="extra_sf9" id="extra_sf9"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf10'];} ?>" name="extra_sf10" id="extra_sf10"></td>
                    			        <td width="10%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['sf11'];} ?>" name="extra_sf11" id="extra_sf11"></td>
                    			    </tr>
                    			    <tr>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss1'];} ?>" name="extra_ss1" id="extra_ss1"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss2'];} ?>" name="extra_ss2" id="extra_ss2"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss3'];} ?>" name="extra_ss3" id="extra_ss3"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss4'];} ?>" name="extra_ss4" id="extra_ss4"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss5'];} ?>" name="extra_ss5" id="extra_ss5"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss6'];} ?>" name="extra_ss6" id="extra_ss6"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss7'];} ?>" name="extra_ss7" id="extra_ss7"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss8'];} ?>" name="extra_ss8" id="extra_ss8"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss9'];} ?>" name="extra_ss9" id="extra_ss9"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss10'];} ?>" name="extra_ss10" id="extra_ss10"></td>
                    			        <td width="10%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['ss11'];} ?>" name="extra_ss11" id="extra_ss11"></td>
                    			    </tr>
                    			    <tr>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['st1'];} ?>" name="extra_st1" id="extra_st1"></td>
                    			    </tr>
                    			    
                    			    <tr>
                    			        <td colspan="2" width="9%"style="padding-bottom: 10px;"><b>FULL HAND SHIRT :</b></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['fhf1'];} ?>" name="extra_fhf1" id="extra_fhf1"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['fhf2'];} ?>" name="extra_fhf2" id="extra_fhf2"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['fhf3'];} ?>" name="extra_fhf3" id="extra_fhf3"></td>
                    			        
                    			    </tr>
                    			    <tr>
                    			        <td colspan="2" width="9%"style="padding-bottom: 10px;"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['fhs1'];} ?>" name="extra_fhs1" id="extra_fhs1"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['fhs2'];} ?>" name="extra_fhs2" id="extra_fhs2"></td>
                    			        <td width="9%"style="padding-bottom: 10px;"><input type="text" style="width:70%" value="<?php if(isset($eid)){ echo $extra_shirt_measure[0]['fhs3'];} ?>" name="extra_fhs3" id="extra_fhs3"></td>
                    			        <td colspan="6"></td>
                    			    </tr>
                    			</table>
                    			</div>-->
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                    <?=form_close();?>
                </div>
                
            </div>
        </div>

        <aside class="control-sidebar control-sidebar-dark" id="categories-list">
            <div class="tab-content sb">
                <div class="tab-pane active sb" id="control-sidebar-home-tab">
                    <div id="filter-categories-con">
                        <input type="text" autocomplete="off" data-list=".control-sidebar-menu" name="filter-categories" id="filter-categories" 
                        class="form-control sb col-xs-12 kb-text" placeholder="<?= lang('filter_categories'); ?>" style="margin-bottom: 20px;">
                    </div>
                    <div class="clearfix sb"></div>
                    <div id="category-sidebar-menu">
                        <ul class="control-sidebar-menu">
                            <?php
                            foreach ($categories as $category) {
                                echo '<li><a href="#" class="category' . ($category->id == $Settings->default_category ? ' active' : '') . '" id="' . $category->id . '">';
                                if ($category->image) {
                                    echo '<div class="menu-icon"><img src="' . base_url('uploads/thumbs/' . $category->image) . '" alt="" class="img-thumbnail img-responsive"></div>';
                                } else {
                                    echo '<i class="menu-icon fa fa-folder-open bg-red"></i>';
                                }
                                echo '<div class="menu-info"><h4 class="control-sidebar-subheading">' . $category->code . '</h4><p>' . $category->name . '</p></div>
                            </a></li>';
                            }
                            ?>
                        </ul>
                    </div>
                </div>
            </div>
        </aside>
    <div class="control-sidebar-bg sb"></div>
</div>
</div>
<div id="order_tbl" style="display:none;"><span id="order_span"></span>
    <table id="order-table" class="prT table table-condensed" style="width:100%;margin-bottom:0;"></table>
</div>
<div id="bill_tbl" style="display:none;"><span id="bill_span"></span>
    <table id="bill-table" width="100%" class="prT table table-condensed" style="width:100%;margin-bottom:0;"></table>
    <table id="bill-total-table" width="100%" class="prT table table-condensed" style="width:100%;margin-bottom:0;"></table>
</div>
<div style="width:435px;background:#FFF;display:block">
    <div id="order-data" style="display:none;" class="text-center">
        <h1><?= $store->name; ?></h1>
        <h2><?= lang('order'); ?></h2>
        <div id="preo" class="text-left"></div>
    </div>
    <div id="bill-data" style="display:none;" class="text-center">
        <h1><?= $store->name; ?></h1>
        <h2><?= lang('bill'); ?></h2>
        <div id="preb" class="text-left"></div>
    </div>
</div>

<div id="ajaxCall"><i class="fa fa-spinner fa-pulse"></i></div>

<div class="modal" data-easein="flipYIn" id="gcModal" tabindex="-1" role="dialog" aria-labelledby="mModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                <h4 class="modal-title" id="myModalLabel"><?= lang('sell_gift_card'); ?></h4>
            </div>
            <div class="modal-body">
                <p><?= lang('enter_info'); ?></p>

                <div class="alert alert-danger gcerror-con" style="display: none;">
                    <button data-dismiss="alert" class="close" type="button">×</button>
                    <span id="gcerror"></span>
                </div>
                <div class="form-group">
                    <?= lang('card_no', 'gccard_no'); ?> *
                    <div class="input-group">
                        <?php echo form_input('gccard_no', '', 'class="form-control" id="gccard_no"'); ?>
                        <div class="input-group-addon" style="padding-left: 10px; padding-right: 10px;"><a href="#" id="genNo"><i class="fa fa-cogs"></i></a></div>
                    </div>
                </div>
                <input type="hidden" name="gcname" value="<?= lang('gift_card') ?>" id="gcname"/>
                <div class="form-group">
                    <?= lang('value', 'gcvalue'); ?> *
                    <?php echo form_input('gcvalue', '', 'class="form-control" id="gcvalue"'); ?>
                </div>
                <div class="form-group">
                    <?= lang('price', 'gcprice'); ?> *
                    <?php echo form_input('gcprice', '', 'class="form-control" id="gcprice"'); ?>
                </div>
                <div class="form-group">
                    <?= lang('expiry_date', 'gcexpiry'); ?>
                    <?php echo form_input('gcexpiry', '', 'class="form-control" id="gcexpiry"'); ?>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?=lang('close')?></button>
                <button type="button" id="addGiftCard" class="btn btn-primary"><?= lang('sell_gift_card') ?></button>
            </div>
        </div>
    </div>
</div>

<div class="modal" data-easein="flipYIn" id="dsModal" tabindex="-1" role="dialog" aria-labelledby="dsModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                <h4 class="modal-title" id="dsModalLabel"><?= lang('discount_title'); ?></h4>
            </div>
            <div class="modal-body">
                <input type='text' class='form-control input-sm kb-pad' id='get_ds' onClick='this.select();' value=''>

                <label class="checkbox" for="apply_to_order">
                    <input type="radio" name="apply_to" value="order" id="apply_to_order" checked="checked"/>
                    <?= lang('apply_to_order') ?>
                </label>
                <label class="checkbox" for="apply_to_products">
                    <input type="radio" name="apply_to" value="products" id="apply_to_products"/>
                    <?= lang('apply_to_products') ?>
                </label>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm pull-left" data-dismiss="modal"><?=lang('close')?></button>
                <button type="button" id="updateDiscount" class="btn btn-primary btn-sm"><?= lang('update') ?></button>
            </div>
        </div>
    </div>
</div>

<div class="modal" data-easein="flipYIn" id="tsModal" tabindex="-1" role="dialog" aria-labelledby="tsModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                <h4 class="modal-title" id="tsModalLabel"><?= lang('tax_title'); ?></h4>
            </div>
            <div class="modal-body">
                <input type='text' class='form-control input-sm kb-pad' id='get_ts' onClick='this.select();' value=''>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm pull-left" data-dismiss="modal"><?=lang('close')?></button>
                <button type="button" id="updateTax" class="btn btn-primary btn-sm"><?= lang('update') ?></button>
            </div>
        </div>
    </div>
</div>

<div class="modal" data-easein="flipYIn" id="noteModal" tabindex="-1" role="dialog" aria-labelledby="noteModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                <h4 class="modal-title" id="noteModalLabel"><?= lang('note'); ?></h4>
            </div>
            <div class="modal-body">
                <textarea name="snote1" id="snote" class="pa form-control kb-text"></textarea>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm pull-left" data-dismiss="modal"><?=lang('close')?></button>
                <button type="button" id="update-note" class="btn btn-primary btn-sm"><?= lang('update') ?></button>
            </div>
        </div>
    </div>
</div>

<div class="modal" data-easein="flipYIn" id="proModal" tabindex="-1" role="dialog" aria-labelledby="proModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 50%;">
        <div class="modal-content">
            <div class="modal-header modal-primary">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                <h4 class="modal-title" id="proModalLabel">
                    <?=lang('payment')?>
                </h4>
            </div>
            <div class="modal-body">
                <table class="table table-bordered table-striped">
                    <tr>
                        <th style="width:25%;"><?= lang('net_price'); ?></th>
                        <th style="width:25%;"><span id="net_price"></span></th>
                        <th style="width:25%;"><?= lang('product_tax'); ?></th>
                        <th style="width:25%;"><span id="pro_tax"></span> <span id="pro_tax_method"></span></th>
                    </tr>
                </table>
                <input type="hidden" id="row_id" />
                <input type="hidden" id="item_id" />
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <?=lang('unit_price', 'nPrice')?>
                            <input type="text" class="form-control input-sm kb-pad" id="nPrice" onClick="this.select();" placeholder="<?=lang('new_price')?>">
                        </div>
                        <div class="form-group">
                            <?=lang('discount', 'nDiscount')?>
                            <input type="text" class="form-control input-sm kb-pad" id="nDiscount" onClick="this.select();" placeholder="<?=lang('discount')?>">
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <?=lang('quantity', 'nQuantity')?>
                            <input type="text" class="form-control input-sm kb-pad" id="nQuantity" onClick="this.select();" placeholder="<?=lang('current_quantity')?>">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-12">
                        <div class="form-group">
                            <?=lang('comment', 'nComment')?>
                            <textarea class="form-control kb-text" id="nComment"></textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?=lang('close')?></button>
                <button class="btn btn-success" id="editItem"><?=lang('update')?></button>
            </div>
        </div>
    </div>
</div>

<div class="modal" data-easein="flipYIn" id="susModal" tabindex="-1" role="dialog" aria-labelledby="susModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                <h4 class="modal-title" id="susModalLabel"><?= lang('suspend_sale'); ?></h4>
            </div>
            <div class="modal-body">
                <p><?= lang('type_reference_note'); ?></p>

                <div class="form-group">
                    <?= lang('reference_note', 'reference_note'); ?>
                    <?php echo form_input('reference_note', $reference_note, 'class="form-control kb-text" id="reference_note"'); ?>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default pull-left" data-dismiss="modal"> <?=lang('close')?> </button>
                <button type="button" id="suspend_sale" class="btn btn-primary"><?= lang('submit') ?></button>
            </div>
        </div>
    </div>
</div>



<div class="modal" data-easein="flipYIn" id="saleModal" tabindex="-1" role="dialog" aria-labelledby="saleModalLabel" aria-hidden="true"></div>
<div class="modal" data-easein="flipYIn" id="opModal" tabindex="-1" role="dialog" aria-labelledby="opModalLabel" aria-hidden="true"></div>

<div class="modal" data-easein="flipYIn" id="payModal" tabindex="-1" role="dialog" aria-labelledby="payModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-success" style="width: 50%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                <h4 class="modal-title" id="payModalLabel">
                    <?=lang('payment')?>
                </h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-xs-9">
                        <div class="font16">
                            <table class="table table-bordered table-condensed" style="margin-bottom: 0;">
                                <tbody>
                                    <tr>
                                        <td width="25%" style="border-right-color: #FFF !important;"><?= lang('total_items'); ?></td>
                                        <td width="25%" class="text-right"><span id="item_count">0.00</span></td>
                                        <td width="25%" style="border-right-color: #FFF !important;"><?= lang('total_payable'); ?></td>
                                        <td width="25%" class="text-right"><span id="twt">0.00</span></td>
                                    </tr>
                                    <tr>
                                        <td style="border-right-color: #FFF !important;"><?= lang('total_paying'); ?></td>
                                        <td class="text-right"><span id="total_paying">0.00</span></td>
                                        <td style="border-right-color: #FFF !important;"><?= lang('balance'); ?></td>
                                        <td class="text-right"><span id="balance">0.00</span></td>
                                    </tr>
                                </tbody>
                            </table>
                            <div class="clearfix"></div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <?= lang('note', 'note'); ?>
                                    <textarea name="note" id="note" class="pa form-control kb-text"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <label>Date</label>
                                    <input type="date" name="payment_date" id="payment_date" class="pa form-control kb-pad payment_date">
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-6">
                                <div class="form-group">
                                    <?= lang('amount', 'amount'); ?>
                                    <input name="amount" type="text" id="amount"
                                    class="pa form-control kb-pad amount"/>
                                </div>
                            </div>
                            <div class="col-xs-6">
                                <div class="form-group">
                                    <?= lang('paying_by', 'paid_by'); ?>
                                    <select id="paid_by" class="form-control paid_by select2" style="width:100%;">
                                        <option value="cash"><?= lang('cash'); ?></option>
                                        <option value="gpay">Gpay</option>
                                        <option value="net_banking">Net Banking</option>
                                        <option value="CC"><?= lang('cc'); ?></option>
                                        <option value="other"><?= lang('other'); ?></option>
                                        <!--<option value="cheque"><?= lang('cheque'); ?></option>
                                        <option value="gift_card"><?= lang('gift_card'); ?></option>
                                        <?= isset($Settings->stripe) ? '<option value="stripe">' . lang('stripe') . '</option>' : ''; ?>
                                        <option value="other"><?= lang('other'); ?></option>-->
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="form-group gc" style="display: none;">
                                    <?= lang('gift_card_no', 'gift_card_no'); ?>
                                    <input type="text" id="gift_card_no"
                                    class="pa form-control kb-pad gift_card_no gift_card_input"/>

                                    <div id="gc_details"></div>
                                </div>
                                <div class="pcc" style="display:none;">
                                    <div class="form-group">
                                        <input type="text" id="swipe" class="form-control swipe swipe_input"
                                        placeholder="<?= lang('focus_swipe_here') ?>"/>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-6">
                                            <div class="form-group">
                                                <input type="text" id="pcc_no"
                                                class="form-control kb-pad"
                                                placeholder="<?= lang('cc_no') ?>"/>
                                            </div>
                                        </div>
                                        <div class="col-xs-6">
                                            <div class="form-group">

                                                <input type="text" id="pcc_holder"
                                                class="form-control kb-text"
                                                placeholder="<?= lang('cc_holder') ?>"/>
                                            </div>
                                        </div>
                                        <div class="col-xs-3">
                                            <div class="form-group">
                                                <select id="pcc_type"
                                                class="form-control pcc_type select2"
                                                placeholder="<?= lang('card_type') ?>">
                                                <option value="Visa"><?= lang('Visa'); ?></option>
                                                <option
                                                value="MasterCard"><?= lang('MasterCard'); ?></option>
                                                <option value="Amex"><?= lang('Amex'); ?></option>
                                                <option
                                                value="Discover"><?= lang('Discover'); ?></option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-xs-3">
                                        <div class="form-group">
                                            <input type="text" id="pcc_month"
                                            class="form-control kb-pad"
                                            placeholder="<?= lang('month') ?>"/>
                                        </div>
                                    </div>
                                    <div class="col-xs-3">
                                        <div class="form-group">

                                            <input type="text" id="pcc_year"
                                            class="form-control kb-pad"
                                            placeholder="<?= lang('year') ?>"/>
                                        </div>
                                    </div>
                                    <div class="col-xs-3">
                                        <div class="form-group">

                                            <input type="text" id="pcc_cvv2"
                                            class="form-control kb-pad"
                                            placeholder="CVV<?//= lang('cvv2') ?>"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="pcheque" style="display:none;">
                                <div class="form-group"><?= lang('cheque_no', 'cheque_no'); ?>
                                    <input type="text" id="cheque_no"
                                    class="form-control cheque_no kb-text"/>
                                </div>
                            </div>
                            <div class="pcash">
                                <div class="form-group"><?= lang('payment_note', 'payment_note'); ?>
                                    <input type="text" id="payment_note"
                                    class="form-control payment_note kb-text"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xs-3 text-center">
                    <!-- <span style="font-size: 1.2em; font-weight: bold;"><?= lang('quick_cash'); ?></span> -->

                    <div class="btn-group btn-group-vertical" style="width:100%;">
                        <button type="button" class="btn btn-info btn-block quick-cash" id="quick-payable">0.00
                        </button>
                        <button type="button" class="btn btn-info btn-block quick-cash" id="quick-payable_1">01</button>
                        <?php
                        foreach (lang('quick_cash_notes') as $cash_note_amount) {
                            echo '<button type="button" class="btn btn-block btn-warning quick-cash">' . $cash_note_amount . '</button>';
                        }
                        ?>
                        <button type="button" class="btn btn-block btn-danger"
                        id="clear-cash-notes"><?= lang('clear'); ?></button>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default pull-left" data-dismiss="modal"> <?=lang('close')?> </button>
            <button class="btn btn-primary" id="<?= $eid ? '' : 'submit-sale'; ?>"><?=lang('submit')?></button>
        </div>
    </div>
</div>
</div>


<!-- Clone Details Starts Here -->
<div class="modal" data-easein="flipYIn" id="customerCloneSales" tabindex="-1" role="dialog" aria-labelledby="cModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width:60%;">
        <div class="modal-content">
            <div class="modal-header modal-primary">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                <h4 class="modal-title" id="cModalLabel">
                    Customer Sales History List
                </h4>
            </div>
            <div class="modal-body">
                <div id="c-alert" class="alert alert-danger" style="display:none;"></div>
                <div class="row">
                    <div class="col-xs-12">
                        <div id="clone_details"></div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-6"></div>
                    <div class="col-xs-6"></div>
                </div>

            </div>
            <div class="modal-footer" style="margin-top:0;">
                <button type="button" class="btn btn-default pull-left" data-dismiss="modal"> <?=lang('close')?> </button>
            </div>
        </div>
    </div>
</div>
<!-- Clone Details Ends Here -->
<div class="modal" data-easein="flipYIn" id="customerModal" tabindex="-1" role="dialog" aria-labelledby="cModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 70%;">
        <div class="modal-content">
            <div class="modal-header modal-primary">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
                <h4 class="modal-title" id="cModalLabel">
                    <?=lang('add_customer')?>
                </h4>
            </div>
            <?= form_open('pos/add_customer', 'id="customer-form"'); ?>
            <div class="modal-body">
                <div id="c-alert" class="alert alert-danger" style="display:none;"></div>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label" for="code">
                                <?= lang('name'); ?>
                            </label>
                            <?= form_input('name', '', 'class="form-control input-sm kb-text" style="height: 45px; font-size: 25px;" id="cname"'); ?>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-6">
                        <div class="form-group">
                            <label class="control-label" for="phone">
                                <?= lang('phone'); ?>
                            </label>
                            <input type='text' class='form-control input-sm kb-pad' style='height: 45px; font-size: 25px;' id='cphone' name='phone' onkeypress="if(this.value.length==10) return false;return isNumber(event)" />
                        </div>
                    </div>
                    <div class="col-xs-6">
                        <div class="form-group">
                            <label class="control-label" for="cf1">
                                <?= lang('address'); ?>
                            </label>
                            <?= form_input('cf1', '', 'class="form-control input-sm kb-text" style="height: 45px; font-size: 25px;" id="cf1"'); ?>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-6">
                        <div class="form-group">
                            <label class="control-label" for="cf2">
                                <?= lang('additional_phone_no'); ?>
                            </label>
                            <input type='text' class='form-control input-sm kb-text' id='cf2' name='cf2' style="height: 45px; font-size: 25px;" onkeypress="if(this.value.length==10) return false;return isNumber(event)" />
                        </div>
                    </div>
                    <div class="col-xs-6">
                        <div class="form-group">
                            <label class="control-label" for="cemail">
                                <?= lang('email_address'); ?>
                            </label>
                            <?= form_input('email', '', 'class="form-control input-sm kb-text" style="height: 45px; font-size: 25px;" id="cemail"'); ?>
                        </div>
                    </div>
                </div>

            </div>
            <div class="modal-footer" style="margin-top:0;">
                <button type="button" class="btn btn-default pull-left" data-dismiss="modal"> <?=lang('close')?> </button>
                <button type="submit" class="btn btn-primary" id="add_customer"> <?=lang('add_customer')?> </button>
            </div>
            <?= form_close(); ?>
        </div>
    </div>
</div>

<div class="modal" data-easein="flipYIn" id="printModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width:400px;">
    <div class="modal-content">
        <div class="modal-header np">
            <button type="button" class="close" id="print-modal-close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
            <button type="button" class="close mr10" onclick="window.print();"><i class="fa fa-print"></i></button>
            <h4 class="modal-title" id="print-title"></h4>
        </div>
        <div class="modal-body">
            <div id="print-body"></div>
        </div>
    </div>
    </div>
</div>
<div class="modal" data-easein="flipYIn" id="posModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
<div class="modal" data-easein="flipYIn" id="posModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true"></div>

<script type="text/javascript">
    var base_url = '<?=base_url();?>', assets = '<?= $assets ?>';
    var dateformat = '<?=$Settings->dateformat;?>', timeformat = '<?= $Settings->timeformat ?>';
    <?php unset($Settings->protocol, $Settings->smtp_host, $Settings->smtp_user, $Settings->smtp_pass, $Settings->smtp_port, $Settings->smtp_crypto, $Settings->mailpath, $Settings->timezone, $Settings->setting_id, $Settings->default_email, $Settings->version, $Settings->stripe, $Settings->stripe_secret_key, $Settings->stripe_publishable_key); ?>
    var Settings = <?= json_encode($Settings); ?>;
    var sid = false, username = '<?=$this->session->userdata('username');?>', spositems = {};
    $(window).load(function () {
        $('#mm_<?=$m?>').addClass('active');
        $('#<?=$m?>_<?=$v?>').addClass('active');
    });
    var pro_limit = <?=$Settings->pro_limit?>, java_applet = 0, count = 1, total = 0, an = 1, p_page = 0, page = 0, cat_id = <?=$Settings->default_category?>, tcp = <?=$tcp?>;
    var gtotal = 0, order_discount = 0, order_tax = 0, protect_delete = <?= ($Admin) ? 0 : ($Settings->pin_code ? 1 : 0); ?>;
    var order_data = {}, bill_data = {};
    var csrf_hash = '<?= $this->security->get_csrf_hash(); ?>';
    <?php
    if ($Settings->remote_printing == 2) {
        ?>
        var ob_store_name = "<?= printText($store->name, (!empty($printer) ? $printer->char_per_line : '')); ?>\r\n";
        order_data.store_name = ob_store_name;
        bill_data.store_name = ob_store_name;

        ob_header = "";
        ob_header += "<?= printText($store->name . ' (' . $store->code . ')', (!empty($printer) ? $printer->char_per_line : '')); ?>\r\n";
        <?php
        if ($store->address1) { ?>
            ob_header += "<?= printText($store->address1, (!empty($printer) ? $printer->char_per_line : ''));?>\r\n";
            <?php
        }
        if ($store->address2) { ?>
            ob_header += "<?= printText($store->address2, (!empty($printer) ? $printer->char_per_line : ''));?>\r\n";
            <?php
        }
        if ($store->city) { ?>
            ob_header += "<?= printText($store->city, (!empty($printer) ? $printer->char_per_line : ''));?>\r\n";
            <?php
        } ?>
        ob_header += "<?= printText(lang('tel') . ': ' . $store->phone, (!empty($printer) ? $printer->char_per_line : '')); ?>\r\n\r\n";
        ob_header += "<?= printText(str_replace(["\n", "\r"], ['\\n', '\\r'], $store->receipt_header), (!empty($printer) ? $printer->char_per_line : '')); ?>\r\n\r\n";

        order_data.header = ob_header + "<?= printText(lang('order'), (!empty($printer) ? $printer->char_per_line : '')); ?>\r\n\r\n";
        bill_data.header = ob_header + "<?= printText(lang('bill'), (!empty($printer) ? $printer->char_per_line : '')); ?>\r\n\r\n";
        order_data.totals = '';
        order_data.payments = '';
        bill_data.payments = '';
        order_data.footer = '';
        bill_data.footer = "<?= lang('merchant_copy'); ?> \n";
        <?php
    }
    ?>
    var lang = new Array();
    lang['code_error'] = '<?= lang('code_error'); ?>';
    lang['r_u_sure'] = '<?= lang('r_u_sure'); ?>';
    lang['please_add_product'] = '<?= lang('please_add_product'); ?>';
    lang['paid_less_than_amount'] = '<?= lang('paid_less_than_amount'); ?>';
    lang['x_suspend'] = '<?= lang('x_suspend'); ?>';
    lang['discount_title'] = '<?= lang('discount_title'); ?>';
    lang['update'] = '<?= lang('update'); ?>';
    lang['tax_title'] = '<?= lang('tax_title'); ?>';
    lang['leave_alert'] = '<?= lang('leave_alert'); ?>';
    lang['close'] = '<?= lang('close'); ?>';
    lang['delete'] = '<?= lang('delete'); ?>';
    lang['no_match_found'] = '<?= lang('no_match_found'); ?>';
    lang['wrong_pin'] = '<?= lang('wrong_pin'); ?>';
    lang['file_required_fields'] = '<?= lang('file_required_fields'); ?>';
    lang['enter_pin_code'] = '<?= lang('enter_pin_code'); ?>';
    lang['incorrect_gift_card'] = '<?= lang('incorrect_gift_card'); ?>';
    lang['card_no'] = '<?= lang('card_no'); ?>';
    lang['value'] = '<?= lang('value'); ?>';
    lang['balance'] = '<?= lang('balance'); ?>';
    lang['unexpected_value'] = '<?= lang('unexpected_value'); ?>';
    lang['inclusive'] = '<?= lang('inclusive'); ?>';
    lang['exclusive'] = '<?= lang('exclusive'); ?>';
    lang['total'] = '<?= lang('total'); ?>';
    lang['total_items'] = '<?= lang('total_items'); ?>';
    lang['order_tax'] = '<?= lang('order_tax'); ?>';
    lang['order_discount'] = '<?= lang('order_discount'); ?>';
    lang['total_payable'] = '<?= lang('total_payable'); ?>';
    lang['rounding'] = '<?= lang('rounding'); ?>';
    lang['grand_total'] = '<?= lang('grand_total'); ?>';
    lang['register_open_alert'] = '<?= lang('register_open_alert'); ?>';
    lang['discount'] = '<?= lang('discount'); ?>';
    lang['order'] = '<?= lang('order'); ?>';
    lang['bill'] = '<?= lang('bill'); ?>';
    lang['print'] = '<?= lang('print'); ?>';
    lang['merchant_copy'] = '<?= lang('merchant_copy'); ?>';

    $(document).ready(function() {
        <?php if ($this->session->userdata('rmspos')) { ?>
            if (get('spositems')) { remove('spositems'); }
            if (get('spos_discount')) { remove('spos_discount'); }
            if (get('spos_tax')) { remove('spos_tax'); }
            if (get('spos_note')) { remove('spos_note'); }
            if (get('spos_customer')) { remove('spos_customer'); }
            if (get('amount')) { remove('amount'); }
            <?php $this->tec->unset_data('rmspos'); } ?>

            if (get('rmspos')) {
                if (get('spositems')) { remove('spositems'); }
                if (get('spos_discount')) { remove('spos_discount'); }
                if (get('spos_tax')) { remove('spos_tax'); }
                if (get('spos_note')) { remove('spos_note'); }
                if (get('spos_customer')) { remove('spos_customer'); }
                if (get('amount')) { remove('amount'); }
                remove('rmspos');
            }
            <?php if ($sid) { ?>

                store('spositems', JSON.stringify(<?=$items;?>));
                store('spos_discount', '<?=$suspend_sale->order_discount_id;?>');
                store('spos_tax', '<?=$suspend_sale->order_tax_id;?>');
                store('spos_customer', '<?=$suspend_sale->customer_id;?>');
                $('#spos_customer').select2().select2('val', '<?=$suspend_sale->customer_id;?>');
                store('rmspos', '1');
                $('#tax_val').val('<?=$suspend_sale->order_tax_id;?>');
                $('#discount_val').val('<?=$suspend_sale->order_discount_id;?>');
                <?php } elseif ($eid) { ?>
                    $('#date').inputmask("y-m-d h:s:s", { "placeholder": "YYYY/MM/DD HH:mm:ss" });
                    store('spositems', JSON.stringify(<?=$items;?>));
                    store('spos_discount', '<?=$sale->order_discount_id;?>');
                    store('spos_tax', '<?=$sale->order_tax_id;?>');
                    store('spos_customer', '<?=$sale->customer_id;?>');
                    store('sale_date', '<?=$sale->date;?>');
                    $('#spos_customer').select2().select2('val', '<?=$sale->customer_id;?>');
                    $('#date').val('<?=$sale->date;?>');
                    store('rmspos', '1');
                    $('#tax_val').val('<?=$sale->order_tax_id;?>');
                    $('#discount_val').val('<?=$sale->order_discount_id;?>');
                    <?php } else { ?>
                        if (! get('spos_discount')) {
                            store('spos_discount', '<?=$Settings->default_discount;?>');
                            $('#discount_val').val('<?=$Settings->default_discount;?>');
                        }
                        if (! get('spos_tax')) {
                            store('spos_tax', '<?=$Settings->default_tax_rate;?>');
                            $('#tax_val').val('<?=$Settings->default_tax_rate;?>');
                        }
                        <?php } ?>

                        if (ots = get('spos_tax')) {
                            $('#tax_val').val(ots);
                        }
                        if (ods = get('spos_discount')) {
                            $('#discount_val').val(ods);
                        }
                        bootbox.addLocale('bl',{OK:'<?= lang('ok'); ?>',CANCEL:'<?= lang('no'); ?>',CONFIRM:'<?= lang('yes'); ?>'});
                        bootbox.setDefaults({closeButton:false,locale:"bl"});
                        <?php if ($eid) { ?>
                            $('#suspend').attr('disabled', true);
                            $('#print_order').attr('disabled', true);
                            $('#print_bill').attr('disabled', true);
                            <?php } ?>
                        });
                    </script>

                    <script type="text/javascript">
                        var socket = null;
                        <?php
                        if ($Settings->remote_printing == 2) {
                            ?>
                            try {
                                socket = new WebSocket('ws://127.0.0.1:6441');
                                socket.onopen = function () {
                                    console.log('Connected');
                                    return;
                                };
                                socket.onclose = function () {
                                    console.log('Connection closed');
                                    return;
                                };
                            } catch (e) {
                                console.log(e);
                            }
                            <?php
                        }
                        ?>
                        function printBill(bill) {
                            if (Settings.remote_printing == 1) {
                                Popup($('#bill_tbl').html(), 'bill');
                            } else if (Settings.remote_printing == 2) {
                                if (socket.readyState == 1) {
                                    if (Settings.print_img == 1) {
                                        $('#bill-data').show();
                                        $('#preb').html(
                                            '<pre style="background:#FFF;font-size:20px;margin:0;border:0;color:#000 !important;">' +
                                            bill_data.info +
                                            bill_data.items +
                                            '\n' +
                                            bill_data.totals +
                                            '</pre>'
                                            );
                                        var element = $('#bill-data').get(0);
                                        html2canvas(element, {scrollY: 0, scale: 1.7}).then(function(canvas) {
                                            var dataURL = canvas.toDataURL();
                                            var socket_data = {
                                                'printer': <?= $Settings->local_printers ? "''" : json_encode($printer); ?>,
                                                'text': dataURL, 'cash_drawer': 0
                                            };
                                            socket.send(JSON.stringify({
                                                type: 'print-img',
                                                data: socket_data
                                            }));
                                            // return Canvas2Image.saveAsPNG(canvas);
                                        });
                                        setTimeout(function() {
                                            $('#bill-data').hide();
                                        }, 500);
                                    } else {
                                        var socket_data = {'printer': <?= $Settings->local_printers ? "''" : json_encode($printer); ?>, 'logo': '<?= !empty($store->logo) ? base_url('uploads/' . $store->logo) : ''; ?>', 'text': bill};
                                        socket.send(JSON.stringify({
                                            type: 'print-receipt',
                                            data: socket_data
                                        }));
                                    }
                                    return false;
                                } else {
                                    bootbox.alert('<?= lang('pos_print_error'); ?>');
                                    return false;
                                }
                            }
                        }
                        var order_printers = <?= $Settings->local_printers ? "''" : json_encode($order_printers); ?>;
                        function printOrder(order) {
                            if (Settings.remote_printing == 1) {
                                Popup($('#order_tbl').html(), 'order');
                            } else if (Settings.remote_printing == 2) {
                                if (socket.readyState == 1) {
                                    if (Settings.print_img == 1) {
                                        $('#order-data').show();
                                        $('#preo').html(
                                            '<pre style="background:#FFF;font-size:20px;margin:0;border:0;color:#000 !important;">' + order_data.info + order_data.items + '</pre>'
                                            );
                                        var element = $('#order-data').get(0);
                                        html2canvas(element, {scrollY: 0, scale: 1.7}).then(function(canvas) {
                                            var dataURL = canvas.toDataURL();
                                            var socket_data = {
                                                'printer': <?= $Settings->local_printers ? "''" : json_encode($printer); ?>,
                                                'text': dataURL, 'order': 1, 'cash_drawer': 0
                                            };
                                            socket.send(JSON.stringify({
                                                type: 'print-img',
                                                data: socket_data
                                            }));
                                            // return Canvas2Image.saveAsPNG(canvas);
                                        });
                                        setTimeout(function() {
                                            $('#order-data').hide();
                                        }, 500);
                                    } else {
                                        if (order_printers == '') {
                                            var socket_data = { 'printer': false, 'order': true,
                                            'logo': '<?= !empty($store->logo) ? base_url('uploads/' . $store->logo) : ''; ?>',
                                            'text': order };
                                            socket.send(JSON.stringify({type: 'print-receipt', data: socket_data}));
                                        } else {
                                            $.each(order_printers, function() {
                                                var socket_data = {'printer': this, 'logo': '<?= !empty($store->logo) ? base_url('uploads/' . $store->logo) : ''; ?>', 'text': order};
                                                socket.send(JSON.stringify({type: 'print-receipt', data: socket_data}));
                                            });
                                        }
                                    }
                                    return false;
                                } else {
                                    bootbox.alert('<?= lang('pos_print_error'); ?>');
                                    return false;
                                }
                            }
                        }
                    </script>
                    <?php
                    if (isset($print) && !empty($print)) {
                        /* include FCPATH.'themes'.DIRECTORY_SEPARATOR.$Settings->theme.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'pos'.DIRECTORY_SEPARATOR.'remote_printing.php'; */
                        include 'remote_printing.php';
                    }
                    ?>

                    <script src="<?= $assets ?>dist/js/libraries.min.js" type="text/javascript"></script>
                    <script src="<?= $assets ?>dist/js/scripts.min.js" type="text/javascript"></script>
                    <script src="<?= $assets ?>dist/js/pos-4.js" type="text/javascript"></script>
                    <?php if ($Settings->remote_printing != 1 && $Settings->print_img) { ?>
                    <script src="<?= $assets ?>dist/js/htmlimg.js"></script>
                    <?php } ?>
                </body>
                </html>

<script>
<?php $clone_id = $_GET['clone']; ?>
var clone_id=$('#clone_no').val();

console.log("Clone ID: "+clone_id);

    if(!clone_id==0)
    {
        $( window ).on( "load", function() {
        console.log( "Windows Loaded" );
        console.log('Sales Details Function Working:');
          var sale_id=$('#clone_no').val();
          console.log('Clone Number:'+sale_id);
            $.ajax({
			type: "get",
			url: base_url + "pos/cloneSaleDetails",
			data : {sale_id:sale_id},
			dataType: "json",
			success: function(t) {
			    console.log('response:'+t['customer_id']);
			    console.log('response:'+t['customer_phone_no']);
			    console.log('response:'+t['pant_measure']);
			    
			    
			    var pant_measure = JSON.parse(t['pant_measure']);
			    var shirt_measure = JSON.parse(t['shirt_measure']);
			    
			    console.log('pf1:'+pant_measure[0]['pf1']);
			    
			    /*$("#sale_date").val(t['sale_date']);*/
			    $("#pant_model_textarea").val(t['pant_text']);
			    $("#shirt_model_textarea").val(t['shirt_text']);
			    $("#spos_customer").val(t['customer_id']).trigger('change');
			    /*$("#clone_customer").val(t['customer_id']).trigger('change');*/
			    
			    
			    // Pant Measurements Here
			    for(var a=1;a<=8;a++)
			    {
			        var pf='pf'+a;
			        $('#pf'+a).val(pant_measure[0][pf]);
			    }
			    for(var b=1;b<=8;b++)
			    {
			        var ps='ps'+b;
			        $('#ps'+b).val(pant_measure[0][ps]);
			    }
		        $('#pt1').val(pant_measure[0]['pt1']);
		        
		        
		        
		        // Shirt Measurements Here
			    for(var c=1;c<=11;c++)
			    {
			        var sf='sf'+c;
			        $('#sf'+c).val(shirt_measure[0][sf]);
			    }
			    for(var d=1;d<=11;d++)
			    {
			        var ss='ss'+d;
			        $('#ss'+d).val(shirt_measure[0][ss]);
			    }
		        $('#st1').val(shirt_measure[0]['st1']);
		        
		        for(var e=1;e<=3;e++)
			    {
			        var fhf='fhf'+e;
			        $('#fhf'+e).val(shirt_measure[0][fhf]);
			    }
			    for(var f=1;f<=3;f++)
			    {
			        var fhs='fhs'+f;
			        $('#fhs'+f).val(shirt_measure[0][fhs]);
			    }
			}
		});
    });
    function customerDetails(){}
    }
    
    else if(clone_id==0)
    {
       
    }
    
</script>
<script>
    
</script>
<script type="text/javascript">
    $(function () {
        $("#clone").click(function () {
            
            var customer_cus_id=$('#spos_customer').val();
            console.log('customer id:'+customer_cus_id);
            
            console.log('customerDetails inside Function Working:');
            var customer_id=$('#spos_customer').val();
            console.log('Customer Id:'+customer_id);
            $.ajax({
			type: "get",
			url: base_url + "pos/saleHistoryByCustomers",
			data : {customer_id:customer_id},
			dataType: "json",
			success: function(t) {
			    console.log('response:'+t['customer_name']);
			    console.log('response:'+t['customer_phone_no']);
			}
		    });
		    $.ajax({
			type: "get",
			url: '<?=site_url('pos/get_all_sale_items');?>',
			data : {customer_id:customer_id},
			dataType: "text",
			success: function(t) {
			    console.log('response:'+t['customer_name']);
			    $("#customerCloneSales").modal("show");
			    $('#clone_details').append(t);
			},
			error:function(err){
			    alert(err);
			}
		    });
		    $('#clone_details').empty();
        });
    });
</script>
<script>
    function isNumber(evt) {
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        return false;
    }
    return true;
}
</script>
<script>
      /*$(document).on('click', '.remove_product', function() {
        $(this).closest('.row').remove();
      });
    $('#add_another_pant').on('click', function() {
        html = '<div class="row"><div class="col-md-12">'+
        'Helllo</div></div>';
        $('#pant_section').append(html);
    });*/
</script>
<script>
      /*$(document).ready(function(){
          $("#pant_section").hide();
          
          $("#add_another_pant").click(function(){
                $("#pant_section").show();
                $(this).closest('#pant_section').remove();
        });
      });*/
      $(document).on('change', '#sale_date', function() {
          var sale_date = $('#sale_date').val();
            $('#payment_date').val(sale_date);
            $('#payment_date_val').val(sale_date);
            
      });
</script>
<script>
    $(document).ready(function(){
        
        /************** New Model Items Starts Here ************************/
        
        /*$("#pant_ext").onchange(function () {
            var model = $("#pant_ext").val();
            $("#pant_model_textarea").val(model);
        });*/
        
        
        $("#pant_ext").on("select2:select", function (e) { 
          var select_val = $(e.currentTarget).val();
          console.log(select_val);
          var p=$('#pant_model_textarea').val();
          if(p==''){
              $('#pant_model_textarea').val('*'+p+select_val);
          }else{
              $('#pant_model_textarea').val(p+'\n*'+select_val);
          }
        });
        
        $("#shirt_ext").on("select2:select", function (e) { 
          var select_val = $(e.currentTarget).val();
          console.log(select_val);
          var s=$('#shirt_model_textarea').val();
          if(s==''){
              $('#shirt_model_textarea').val('*'+s+select_val);
          }else{
              $('#shirt_model_textarea').val(s+'\n*'+select_val);
          }
        });


        /************** New Model Items Endss Here ************************/
        /*$('#pant_section').hide();
        $('#add_another_pant').click(function(){
            $("#pant_section").slideToggle();
            return false;
        });
        $('#add_pant_section').hide();
        $('.add_pant_model').click(function(){
            $("#add_pant_section").slideToggle();
            return false;
        });
        
        $('#extra_shirt_section').hide();
        $('#add_another_shirt').click(function(){
            $("#extra_shirt_section").slideToggle();
            return false;
        });*/
         $('#add_notes_menu').hide();
        $('#add_notes').click(function(){
            $("#add_notes_menu").slideToggle();
            return false;
        });
    });
</script>
<script>
$(document).ready(function(){
      $("#dc_number").keyup(function(){
             get_data();
            });
            
            
            function get_data()
            {
              var dc_number=$('#dc_number').val();
              $.ajax({
                  type:'get',
                  url: '<?=site_url('pos/get_dc_check');?>',
                  data:{dc_number:dc_number,type:'get_dc'},
                   dataType: 'json',
                    beforeSend: function() {
                        $("#dc_check").text(''); 
                        $('#fa_icon').addClass('fa fa-spinner fa-spin');
                    },
                  success:function(response){
                      $("#fa_icon").removeClass("fa fa-spinner fa-spin");
                      if(response[0]['error']=='0')
                      {
                          $("#dc_check").css('color','green'); 
                         $("#dc_check").text(response[0]['txt']); 
                         $("#payment").prop('disabled', false);
                         
                      }
                      else
                      {
                          $("#dc_check").css('color','red'); 
                         $("#dc_check").text(response[0]['txt']);
                         $("#payment").prop('disabled', true);
                      }
                  }
                });
            }
            
});
</script>

Zerion Mini Shell 1.0