<?php

function add_tocart($btntxt,$prid){ ?>
    <form id="thecartform_da" onsubmit="return ajaxsubmitform('<?=base_url('e_com/add_to_cart')?>',this,'error_div','loder_div','#','1','cart');" action="<?=base_url('e_com/add_to_cart')?>" method="post">

    	<table class="table table-borderless"><tr>
    		<td><div class="qty-plus-minus">
	            <input class="qty-input" type="text" name="ec_qtybtn" min="1" minlength="1" value="1">
	        </div>
	        </td>
	        <td>
	        	<div class="ec-single-cart">
	        		<input type="hidden" name="pid" value="<?=$prid?>">
		    		<button class="btn btn-primary" title="Add to Cart" type="submit"><span><?=$btntxt?></span></button>
		        </div>
	        </td>
    	</tr></table>
    </form>
<?php }

function add_tocart2($btntxt,$prid){ ?>
    <form id="thecartform_da" onsubmit="return ajaxsubmitform('<?=base_url('e_com/add_to_cart')?>',this,'error_div','loder_div','#','1','cart2');" action="<?=base_url('checkout')?>" method="post">

    	<table class="table table-borderless"><tr>
	        <td>
	        	<input class="qty-input" type="hidden" name="ec_qtybtn" min="1" minlength="1" value="1">
	        	<div class="ec-single-cart">
	        		<input type="hidden" name="pid" value="<?=$prid?>">
		    		<button class="btn theme_bg btn-primary" title="Buy Now" type="submit"><span><?=$btntxt?></span></button>
		        </div>
	        </td>
    	</tr></table>
    </form>
<?php }


function generate_order_id(){
    $theordrid=date('MHIS').rand();
    return $theordrid;
}
 
?>