<style type="text/css">

</style>
<div id="content" style="background-color:#FFF">
  <div class="c1">
    <div class="pos">
      <div id="pos">
        <form action="#" data-toggle="validator" role="form" id="pos-sale-form" name="pos-sale-form" method="post" accept-charset="utf-8">
          <input type="hidden" name="token" value="d6c35d2aebf0b3b14b4016c954dd2786" style="display:none;" />
          <div id="leftdiv" class="ui-widget quick-menu">
            <div id="printhead">
              <h4 style="text-transform:uppercase;">Stock Manager Advance</h4>
              <h5 style="text-transform:uppercase;">Order List</h5>
              Date 31/12/2015 22:14 </div>
            <div id="left-top" class="quick-menu">
              <div class="no-print">
                <div style="display:none" id="input_panel" class="form-group">
                  <!--<select name="poswarehouse" id="poswarehouse" class="search-select" data-placeholder="Select Warehouse">-->
                    <!--<option value="">-select-</option>-->
                  <!--  <?php foreach ($get_warehouse as $value) { ?>-->
                  <!--  <option value="<?php echo $value->id; ?>" <?php if($this->session->userdata('ss_warehouse_id') == $value->id ) echo 'selected' ?>><?php echo $value->name; ?> | <?php echo $value->code; ?></option>-->
                  <!--  <?php } ?>-->
                  <!--</select>-->
                </div>
                
                <!-- start sales term -->
                <div class="col-sm-12" style="padding: 0;" >
                  <div class="form-group" style="background-color:#FFF">
                    <div class="input-group">
                      <div class="col-sm-12"> <span class="col-sm-1" style="padding: 0;"> Sale Type:</span> <span class="col-sm-11" style="display: table">
                        <?php //print_r($invoice_type_list);
				  $checked = "";
				  foreach($invoice_type_list as $in_type){
					  if($in_type['invoice_type_id'] == 2)continue;
					  $inv_type_name = $in_type['invoice_type_name'];
					  if($inv_type_name == "CASH")
					    {
					        $inv_type_name = "RETAIL";
					        $checked = "checked";
					    }else $checked = "";
					  
					  echo "<label for=\"tp_".$in_type['invoice_type_id']."\" class=\"".$in_type['class_name']."\"  style=\"display:table-cell\">
					  	<input type=\"radio\" name=\"invoice_type\" id=\"tp_".$in_type['invoice_type_id']."\" value=\"".$in_type['invoice_type_id']."\" ".$checked.">
								
                      ".$inv_type_name."</label>";
					  }
				  ?>
                        </span> </div>
                      <div class="col-sm-12 pt_list" style="display:none"> <span class="col-sm-1" style="padding: 0;"> Price Type:</span> <span class="col-sm-11" style="display: table">
                        <label for="price_type_1" class="btn btn-success" style="display:none">
                          <input type="radio" checked name="price_type" id="price_type_1" value="retail_cash" lable="cash" style="display:none">
                          CASH </label>
                        <label for="price_type_3" class="btn btn-warning" style="display:none">
                          <input type="radio" name="price_type" id="price_type_3" value="retail_credit" lable="credit" style="display:none">
                          CREDIT </label>
                        <label for="price_type_2" class="btn btn-info" style="display:none"><!-- style="display:table-cell" -->
                          <input type="radio" name="price_type" id="price_type_2" value="retail_wholesale" lable="wholesale" style="display:none">
                          WHOLESALE </label>
                        </span> 
                        <!--<label for="cash" class="btn btn-success">
                      <input type="radio" name="price_type" id="price_type_2" value="product_cost">
                      COST
                    </label>--> 
                        
                      </div>
                      <!--<label for="cash" class="btn btn-success">
                      <input type="radio" name="sales_term" id="cash" value="Cash">
                      Cash</label>
                    &nbsp;&nbsp;
                    <label for="credit" class="btn btn-warning">
                      <input type="radio" name="sales_term" id="credit" value="Credit">
                      Credit</label>-->
                      <div class="collapse">
                      <label for="credit" class="btn ">
                        <input type="text" id="cash_cus_name" class="form-control" name="cash_cus_name" value="Cash Customer Name" onClick="this.select()">
                      </label>
                      <label for="" onClick="get_cus_tot_credit()"> Outstanding : <span class="btn-danger" style="text-align:right; padding: 3px;
border-radius: 7px;" id="customer_outstanding">0.00</span> </label>
<label for="credit" class="btn " style="display:none;"><select id="broker_id" name="broker_id" class="form-control search-select" data-placeholder="Select Broker">
                        <option selected value="">Select Broker</option>
                        <?php foreach ($broker_list as $value) { ?>
                        <option value="<?php echo $value->broker_id; ?>"><?php echo $value->broker_name.' / '.$value->broker_contact_no; ?></option>
                        <?php } ?>
                      </select>
                        </label></div>




                    </div>
                  </div>
                </div>
                
                <!-- end sales term -->
                
                <?php  //print_r($get_customer); ?>
                <div class="col-sm-12" style="padding: 0">
                  <div class="form-group" style="background-color:#FFF">
                    <div class="input-group">
                      <select style="margin-top:1px" id="poscustomer" name="poscustomer" class="search-select" data-placeholder="Select customer" onChange="get_cus_tot_credit()">
                         <option value="1">walk-in</option>
                        <?php foreach ($get_customer as $value) { ?>
                        <option value="<?php echo $value->cus_id; ?>"><?php echo $value->cus_name.' / '.$value->cus_phone; ?></option>
                        <?php } ?>
                      </select>
                      <input name="base_url" type="hidden" id="base_url" value="<?php echo base_url();?>">
                      <input type="hidden" id="customer_mobile" value="" />
                      <div class="input-group-addon pos-tip btn" style="padding: 2px 8px; border-left: 0; height:34px" title="Add Customer" data-toggle="modal" data-target="#add_customer_model"> 
                        <i class="fa fa-plus-circle" id="addIcon" style="font-size: 1.2em;"></i>
                      </div>
                    </div>
                  </div>
                </div>
                
                
                
                 <input name="uniq_id" type="hidden" id="uniq_id" value="<?php echo $this->session->userdata('ss_cashier_float_id').strtotime("now").rand(101,999);?>">
                <!-- 
                <div class="col-sm-6">
                     <div class="input-group">
                         <label for="credit" class="btn">
                    Outstanding : <span style="text-align:right" id="customer_outstanding">0.00</span>
                    </lable>
                    </div>
                    </div>
                <div class="col-sm-12"></div>
                
                -->
                
                
                <div class="form-group" id="ui">
                  <div class="input-group">
                    <input type="text" name="add_item" value="" class="form-control pos-tip keyboard" id="add_item" data-placement="top" data-trigger="focus" style="background-color:#FFF" minlength="2" maxlength="30" />
                    <!--title="Please start typing code/name for suggestions"-->
                    <div class="input-group-addon" style="padding: 2px 8px; border-left: 0;"><i class="fa fa-search" style="font-size: 1em;"></i> </div>
                  </div>
                  <div style="clear:both;"></div>
                </div>
              </div>
            </div>
            <div id="print" class="no-print">
              <div id="left-middle">
                <div id="product-list" class="ps-container ps-active-y">
                  <table style="margin-bottom: 0;" id="posTable" class="table items table-striped table-bordered table-condensed table-hover">
                    <thead>
                      <tr>
                      	<th style="width:1%;display:none;">w1</th>
                        <th style="width:1%;display:none;">w2</th>
                        <th style="width:1%;display:none;">w3</th>
                        <th style="width:40%">Product</th>
                        <th style="width:10%">Price</th>
                        <th style="width:15%">Qty</th>
                        <th style="width:15%">Discount</th>
                        <th style="width:20%">Subtotal</th>
                        <th style="width: 10%; text-align: center;"><i style="opacity:0.5; filter:alpha(opacity=50);" class="fa fa-trash-o"></i></th>
                      </tr>
                    </thead>
                    <tbody>
                    </tbody>
                  </table>
                  <div style="clear:both;"></div>
                  <div class="ps-scrollbar-x-rail" style="width: 436px; display: none; left: 0px; bottom: 3px;">
                    <div class="ps-scrollbar-x" style="left: 0px; width: 0px;"></div>
                  </div>
                  <div class="ps-scrollbar-y-rail" style="top: 0px; height: 319px; display: none; right: 3px;">
                    <div class="ps-scrollbar-y" style="top: 0px; height: 0px;"></div>
                  </div>
                </div>
              </div>
              <div style="clear:both;"></div>
              <div id="left-bottom">
              <table style="width:100%; float:right; padding:5px; color:#000; background: #FFF;" id="totalTable">
                <tbody>
                  <tr>
                    <td style="padding: 5px 10px;border-top: 1px solid #DDD;">Items</td>
                    <td style="padding: 5px 10px;font-size: 14px; font-weight:bold; border-top: 1px solid #DDD;" class="text-right"><span id="titems">0</span></td>
                    <td style="padding: 5px 10px;border-top: 1px solid #DDD;">Total</td>
                    <td style="padding: 5px 10px;font-size: 14px; font-weight:bold; border-top: 1px solid #DDD;" class="text-right"><span id="total">0.00</span></td>
                  </tr>
                  <tr>
                    <td style="padding: 5px 10px;border-top: 1px solid #DDD;">Discount &nbsp;<!--<a id="ppdiscount" href="#"> <i class="fa fa-edit"></i> </a>--></td>
                    <td style="padding: 5px 10px;font-size: 14px; font-weight:bold; border-top: 1px solid #DDD;" class="text-right"><span id="tds">0.00</span></td>
                    <td style="padding: 5px 10px;border-top: 1px solid #DDD;"><span class=""> Delivery &nbsp;<!--<a href="#" id="pshipping"> <i class="fa fa-plus-square"></i> </a>--></span></td>
                    <td style="padding: 5px 10px;font-size: 14px; font-weight:bold; border-top: 1px solid #DDD;" class="text-right"><span class=""><span id="tship">0.00</span></span></td>
                  </tr>
                  <tr>
                    <td colspan="1" style="padding: 5px 10px; border-top: 1px solid #666; font-weight:bold; background:#333; color:#FFF;"> Paying Amount :
                      <input onkeyup="grand_total_cal()" type="number" name="cash_en" value="" class="form-control" id="cash_en" style="background-color:#FFF; height: 60px; font-size: 2.5em; width: 208px; text-align: right;" onClick=this.select() autocomplete="off" required></td>
                    <td colspan="3" style="disbplay:none;padding:5px 10px 5px 10px; font-size: 14px;border-top: 1px solid #666; font-weight:bold; background:#333; color:#FFF;"> 
                      <div style="display:none"> <span>NO BILL</span>
                       <input type="checkbox" name="is_phone_bill" value="1" id="is_phone_bill" style="width:50px; float:left; margin-left:30px; display:none;" title="POS Bill ">
                      </div>
                      <div  style="display:none"><span>STN</span>
                       <input type="checkbox" name="print_stn" value="0" id="print_stn" style="width:50px; float:left; margin-left:30px; display:none;" title="STN" >
                      </div>
                      <br/>
                      Total &nbsp;:<span id="gtotal" style=" font-size:25px">0.00</span> <br />
                      Balance &nbsp;:<span id="cash_balance" style="font-size:25px"></span>
                    </td>
                  </tr>
                </tbody></div>
              </table>
              <input type="hidden" value="3" id="biller" name="biller">
              <div class="clearfix"></div>
              <div id="botbuttons" class="col-xs-12 text-center">
                <div class="row">
                  <div class="col-xs-12" style="padding: 0;">
                    <div class="col-xs-12" style="padding: 0;">
                      <button type="button" class="btn btn-primary btn-block" id="save" style="height:50px;" tabindex="-1"> <i class="fa fa-hand-paper-o" style="margin-right: 5px;"></i>SAVE INVOICE</button>
                    </div>
                    <div class="col-xs-6" style="padding: 0;">
                      <button type="button" class="btn btn-danger btn-block btn-flat cancel" id="reset" tabindex="-1" style="height:50px;"> Cancel </button>
                    </div>
                    <div class="col-xs-6" style="padding: 0;">
                      <button type="button" class="btn btn-success btn-block" id="payment" style="height:50px;" tabindex="-1"> <i class="fa fa-money" style="margin-right: 5px;"></i>Change Payment Type </button>
                    </div>
                    <div class="col-xs-6" id="print_button_container"></div>
                  </div>
                </div>
              </div>
              <div style="clear:both; height:5px;"></div>
              <div id="num">
                <div id="icon"></div>
              </div>
              <span id="hidesuspend"></span>
              <?php if($sale_id) {?>
              <input type="hidden" name="sale_id" id="sale_id" value="<?php echo $sale_id; ?>">
              <input type="hidden" name="sale_reference_no" id="sale_reference_no" value="<?php echo $sale_details[0]['sale_reference_no']; ?>">
              <?php } ?>
              <input type="hidden" name="posshipping" id="posshipping" value="<?php if($sale_id){if($sale_details[0]['sale_shipping']) echo $sale_details[0]['sale_shipping'];}else echo '0.00'; ?>">
              <input type="hidden" name="shipping_address" id="shipping_address" value="<?php if($sale_id){if($sale_details[0]['shipping_address']) echo $sale_details[0]['shipping_address'];}else echo ''; ?>">
              <input type="hidden" name="rowCount" id="rowCount" value="0">
              <!--keyboard input-->
              <input type="hidden" id="id-name" value="" />
              <!--end keyboard input-->
              <input type="hidden" name="sale_datetime" id="sale_datetime" value="0">
              <input type="hidden" name="discount" id="posdiscount" value="0">
              <input type="hidden" name="pos_discount_input1" id="pos_discount_input1" value="0">
              <input type="hidden" name="pay_amount" id="pay_amount" value="" />
              <input type="hidden" name="balance_amount" id="balance_amount_1" value="" />
              <input type="hidden" name="grand_total" id="grand_total" value="">
              <input type="hidden" name="paid_by" id="paid_by_val_1" value="cash" />
              <input type="hidden" name="cc_name" id="cc_name" value="" />
              <input type="hidden" name="cc_no" id="cc_no" value="" />
              <input type="hidden" name="pcc_holder" id="pcc_holder" value="" />
              <input type="hidden" name="pcc_type" id="pcc_type" value="visa" />
              <input type="hidden" name="payment_note" id="pos_note" value="" />
              <input type="hidden" name="extra_charges" id="extra_charges" value="" />
              <input type="hidden" name="extra_charges_amount" id="extra_charges_amount" value="" />
              <input type="hidden" name="total_item_discount" id="total_item_discount" value="0" />
              <input type="hidden" name="total_cost_val" id="total_cost_val" value="0" />
              
              
              <input type="hidden" name="stnn1" id="stnn1" value="0" />
              <input type="hidden" name="stnn1_code" id="stnn1_code" value="0" />
              <input type="hidden" name="stnn1_wh" id="stnn1_wh" value="0" />
              
              <input type="hidden" name="stnn2" id="stnn2" value="0" />
              <input type="hidden" name="stnn2_code" id="stnn2_code" value="0" />
              <input type="hidden" name="stnn2_wh" id="stnn2_wh" value="0" />
              
              <input type="hidden" name="stnn3" id="stnn3" value="0" />
              <input type="hidden" name="stnn3_code" id="stnn3_code" value="0" />
              <input type="hidden" name="stnn3_wh" id="stnn3_wh" value="0" />
              
              
              <input type="hidden" name="cc_charges" id="cc_charges" value="0" />
              <?php /**/?>
              <input type="hidden" name="poswarehouse" id="poswarehouse" value="<?php echo $this->session->userdata('ss_warehouse_id') ?>" />
              <?php ?>
            </div>
          </div>
        </form>
      </div>
      <ul class="nav nav-tabs navbar-nav tab-green no-print" id="myTab2" style="width:12%;border-bottom: none; overflow-x: hidden; margin-right:-10px;">
        <li <?php echo 'class="active btn btn-icon btn-block"' ?>> <a data-toggle="tab" href="#cat_<?php echo 1000; ?>" style="background: rgba(0,0,0,0); border: none; margin:0px; ">FEATURED </a>
          <?php foreach ($category as $key => $cat) { ?>
        <li  class="btn btn-icon btn-block" > <a onClick="show_brand_list(<?php echo $cat->cat_id; ?>)" style="background: rgba(0,0,0,0); border: none; font-size:20px; margin:0px;"><?php echo $cat->cat_name; ?> </a></li>
        <li class="dinmic" id="cat_<?php echo $cat->cat_id;?>">
          <ul class="list-group" >
            <?php foreach($get_brand_list as $bk) {
              if($bk['cat_id']!=$cat->cat_id){continue;}
				  ?>
            <li onClick="refresh_products(<?php echo $cat->cat_id; ?>,<?php echo $bk['brand_id']?>,0)" class="list-group-item"><?php echo $bk['brand_name']; ?> <span class="badge">&nbsp;</span></li>
            <?php }?>
          </ul>
        </li>
        <?php } ?>
      </ul>
      <div id="cp">
        <div id="cpinner"> 
          <!-- Tab Start -->
          
          <!--<div class="">-->
          <!--  <div id="">-->
          <!--    <div id="">-->
                <div id="item-list" style="overflow:scroll" class="dragscroll">
                  <div class="tabbable tabs-top">
                    <div class="tab-content">
                      <input name="selected_catogory"  id="selected_catogory" type="hidden" value="" readonly>
                      <input name="selected_sub_catogory"  id="selected_sub_catogory" type="hidden" value=""  readonly>
                      <input name="selected_brand_catogory"  id="selected_brand_catogory" type="hidden" value="" readonly>
                      <!-- ---------------------------------page start --> 
                      <!-- <button onClick="hide_all_div()"> click</button>
		<button onClick="show_all_div()"> click</button>-->
                      
                      <div id="list_sub_category_set_1"> </div>
                      <div id="list_product_set_1"> </div>
                      <!-- ---------------------------------page end --> 
                      
                    </div>
                  </div>
                </div>
                <div style="clear:both;"></div>
          <!--    </div>-->
          <!--  </div>-->
          <!--</div>-->
          <div style="clear:both;"></div>
          <!-- Tab End -->
          
          <?php $this->load->view("bar/numberpad") ?>
          
          <div style="clear:both;"></div>
        </div>
        <div style="clear:both;"></div>
      </div>
      <div style="clear:both;"></div>
    </div>
  </div>
</div>
</div>
<div id="drawer"></div>
<input type="hidden" id="cash_en_tot" value="0" readonly>
<input type="hidden" id="qty_en_tot" value="">
<input type="hidden" id="dis_en_tot" value="">
<input type="hidden" id="last_qty_en_tot" value="">
<input type="hidden" id="last_dis_en_tot" value="">
