<link href="<{$config.weburl}>/templates/<{$config.temp}>/css/<{$smarty.get.m}>.css" rel="stylesheet" type="text/css" />
<script src="<{$config.weburl}>/script/jquery.niceforms.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
	$(".checkbox").dgStyle();
});
function remove_inquery()
{	
	var oid='';
	$(".basket").find("input[class='checkitem']:checked").each(function(i){
			oid+=$(this).val()+',';  								 
	});
	window.location='<{$config.weburl}>/?m=message&s=inquiry_basket&oid='+oid;
}
$(function(){
	/* 全选 */
	 $('.checkall').click(function(){
		var _self = this;
		$('.checkitem').each(function(){
			if (!this.disabled)
			{
				$(this).attr('checked', _self.checked);
				if(_self.checked)
				$(this).parent().css("backgroundPosition","left -"+"50px");
				else
				$(this).parent().css("backgroundPosition","left -"+"0");
			}
		});
		$('.checkall').attr('checked', this.checked);
	});
});
function chk()
{
	var myurl='<{$config.weburl}>/?m=message&s=inquiry_basket';
	var u='<{$smarty.cookies.USER}>';
	if(u=='')
	{
		alert('Please login first to collect this item.');
		window.location.href='<{$config.weburl}>/login.php?forward='+encodeURIComponent(myurl);
		return false;
	}
	var len=$(".basket").find("input[class='checkitem']:checked").length;
	if(len>0)
		return true;
	else
	{
		alert("Options cannot be empty!");
		return false;
	}
}
</script>
<div class="guide w">
    <a href="<{$config.weburl}>">Home</a>
    >
    <a href="<{$config.weburl}>/?m=message&s=inquiry_basket">Inquiry Basket</a>
</div>
<div class="w">
    <div class="basket">
		<h2>When you browse the web, if it is found that the more concerned about the products, suppliers, you can join the basket, then batch send inquiry information to them.</h2>
        <form onsubmit="return chk()" action="<{$config.weburl}>/?m=message&s=inquire" method="post">
        <table width="100%">
            <tr>
                <th width="10"><label class="checkbox"><input type="checkbox" class="checkall"></label></th>
                <th colspan="2">Product Name</th>
            </tr>
            <tbody>
            <{foreach item=list from=$infolist}>
            <tr>
                <td><label class="checkbox"><input type="checkbox" class="checkitem" name="offerid[]" value="<{$list.id}>"></label></td>
                <td width="100">
                <a target="_blank" href="<{$config.weburl}>/?m=offer&s=detail&id=<{$list.id}>"><img width="100" src="<{$list.pic}>" /></a>
                </td>
                <td>
                    <h3><a target="_blank" href="<{$config.weburl}>/?m=offer&s=detail&id=<{$list.id}>"><{$list.subject}></a></h3>
                    <p class="p-price"><strong><{$config.money}> <{$list.price}></strong></p>
                    <p><a target="_blank" href="<{geturl uid=$list.company_id user=$list.user com=$list.company}>"><{$list.company}></a></p>
                </td>
            </tr>
			<{foreachelse}>
            <tr>
            	<td colspan="99">Basket is empty</td>
            </tr>
            <{/foreach}>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="99">
                <input onClick="remove_inquery();" value="Delete" type="button">
                <input value="Send" name="inquire" type="submit">
                </td>
            </tr>
            </tfoot>
        </table>
        </form>
    </div>
</div>
