Ejemplo n.º 1
0
">
                </div>
            </div>
    
                              
        </div> <!-- /.col-md-4 -->
        <div class="col-md-4">
            <div class="form-group">
                <label for="cost_price" class="control-label ff-1 fs-16"><?php 
lang('Cost Price');
?>
</label>
                <div class="input-prepend input-group">
                    <span class="input-group-addon"><span class="glyphicon glyphicon-usd"></span></span>
                    <input type="text" id="cost_price" name="cost_price" class="form-control input-lg ff-1 number" placeholder="0.00" value="<?php 
echo get_cost_price($product['cost_price']);
?>
">
                </div>
            </div> <!-- /.form-group -->
            <div class="form-group">
                <label for="sale_price" class="control-label ff-1 fs-16"><?php 
lang('Sale Price');
?>
</label>
                <div class="input-prepend input-group">
                    <span class="input-group-addon"><span class="glyphicon glyphicon-usd"></span></span>
                    <input type="text" id="sale_price" name="sale_price" class="form-control input-lg ff-1 number" placeholder="0.00" value="<?php 
echo $product['sale_price'];
?>
">
Ejemplo n.º 2
0
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 
}