</div> <!-- /.col-md-8 --> <div class="col-md-4"> <div class="box_title turq"><span class="glyphicon glyphicon-leaf mr9"></span><?php lang('Amount'); ?> </div> <div class="alert alert-block <?php if ($product['amount'] < 0) { echo 'alert-danger'; } else { echo 'alert-success'; } ?> fade in"> <h4 style="font-size:40px;" class="text-center"><?php echo get_product_amount($product['amount']); ?> </h4> </div> <div class="box_title turq"><span class="glyphicon glyphicon-barcode mr9"></span><?php lang('Barcode Code'); ?> </div> <a href="javascript:;" class="img-thumbnail text-center" onclick="print_barcode();" style="width:100%;"> <div style="height:4px;"></div> <img src="<?php echo get_barcode($product['code']); ?> " class="img-responsive" /> </a>
function get_product_list($data = '') { $ci =& get_instance(); $ci->db->where('status', 1); $query = $ci->db->get('products')->result_array(); ?> <table cellpadding="0" cellspacing="0" border="0" class="table table-hover table-bordered table-condensed dataTable_noExcel_noLength_noInformation"> <thead> <tr> <th width="1"></th> <th><?php lang('Barcode Code'); ?> </th> <th><?php lang('Product Name'); ?> </th> <th><?php lang('Cost Price'); ?> </th> <th><?php lang('Sale Price'); ?> </th> <th><?php lang('Tax'); ?> </th> <th><?php lang('Price'); ?> </th> <th><?php lang('Amount'); ?> </th> </tr> </thead> <tbody> <?php foreach ($query as $product) { ?> <tr> <td width="1"> <a href="javascript:;" class="btn btn-xs btn-default btnSelected" data-product_id='<?php echo $product['id']; ?> ' data-product_code='<?php echo $product['code']; ?> ' data-product_name='<?php echo $product['name']; ?> ' data-product_cost_price='<?php echo $product['cost_price']; ?> ' data-product_sale_price='<?php echo $product['sale_price']; ?> ' data-product_tax_rate='<?php echo $product['tax_rate']; ?> ' data-product_tax='<?php echo $product['tax']; ?> ' data-product_price='<?php echo $product['price']; ?> ' data-product_amount='<?php echo $product['amount']; ?> ' data-serial='<?php echo $product['serial']; ?> ' > <?php lang('Choose'); ?> </a> </td> <td><?php echo $product['code']; ?> </td> <td><?php echo $product['name']; ?> </td> <td class="text-right"><?php echo get_cost_price($product['cost_price']); ?> </td> <td class="text-right"><?php echo $product['sale_price']; ?> </td> <td class="text-center"><?php if ($product['tax_rate'] > 0) { ?> <small>%(<?php echo $product['tax_rate']; ?> )</small> <?php echo $product['tax']; } ?> </td> <td class="text-right"><?php echo $product['price']; ?> </td> <td class="text-center"><?php echo get_product_amount($product['amount']); ?> </td> </tr> <?php } ?> </tbody> </table> <script> $('.btnSelected').click(function() { <?php if (isset($data['product_id'])) { ?> $('#<?php echo $data['product_id']; ?> ').val($(this).attr('data-product_id'));<?php } ?> <?php if (isset($data['product_code'])) { ?> $('#<?php echo $data['product_code']; ?> ').val($(this).attr('data-product_code'));<?php } ?> <?php if (isset($data['product_name'])) { ?> $('#<?php echo $data['product_name']; ?> ').val($(this).attr('data-product_name'));<?php } ?> <?php if (isset($data['product_cost_price'])) { ?> $('#<?php echo $data['product_cost_price']; ?> ').val($(this).attr('data-product_cost_price'));<?php } ?> <?php if (isset($data['product_sale_price'])) { ?> $('#<?php echo $data['product_sale_price']; ?> ').val($(this).attr('data-product_sale_price'));<?php } ?> <?php if (isset($data['product_tax_rate'])) { ?> $('#<?php echo $data['product_tax_rate']; ?> ').val($(this).attr('data-product_tax_rate'));<?php } ?> <?php if (isset($data['product_tax'])) { ?> $('#<?php echo $data['product_tax']; ?> ').val($(this).attr('data-product_tax'));<?php } ?> <?php if (isset($data['product_price'])) { ?> $('#<?php echo $data['product_price']; ?> ').val($(this).attr('data-product_price'));<?php } ?> <?php if (isset($data['product_amount'])) { ?> $('#<?php echo $data['product_amount']; ?> ').val($(this).attr('data-product_amount'));<?php } ?> <!-- RUN --> <?php if (isset($data['RUN'])) { ?> <?php echo $data['RUN']; ?> <?php } ?> $('.close').click(); if($(this).attr('data-serial') == 1) { $('#serial_box').show(); } else { $('#serial_box').hide(); } }); </script> <?php }