function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"info":"";
  con.style.display=i==cursel?"block":"none";
 }
}

function showQuery(){
	$('#score_div').show();
	return false;
}

function queryScore(){
	var user_name = $('#user_name').val();
	var id_card = $('#id_card').val();
	var card_no = $('#card_no').val();

	    $.getJSON('/index.php?controller=queryscore&action=default',{user_name:user_name,id_card:id_card,card_no:card_no,in_ajax:'1'},function(data){
		var text = "";
		 $.each(data,function(idx,item){
			alert(data);
			if(idx == "errno"){
				if(item == "200"){

				
				}
			}
			if(idx == "data"){
				$.each(item,function(idx1,item1){
					if(idx1 == "card"){
						
						text = '<table style="border:0px;background: #ffffff;">\n';
						text += '\n';
						text += 	'<tr><td width="150">身份证号码</td><td>'+item1.id_card+'</td></tr>\n';
						text += 	'<tr><td width="150">会员姓名</td><td>'+item1.real_name+'</td></tr>\n';
						text += 	'<td width="150">积分</td><td>'+item1.score+'</td></tr>\n';
						text += 	'<td width="150">截止时间</td><td>'+item1.end_time+'</td></tr>\n';
						text += '</table><hr>';
					}

					if(idx1 == "data"){
						text += '<table style="border:0px;background: #ffffff;">\n';

						$.each(item1,function(idx2,item2){
							alert('aa');
							text += '\n';
							text += 	'<tr><td width="150">项目id</td><td>'+item2.item_id+'</td></tr>\n';
							text += 	'<tr><td width="150">项目id</td><td>'+item2.unit_time+'</td></tr>\n';
							text += 	'<tr><td width="150">项目id</td><td>1</td></tr>\n';
						});
						text += '</table>';

					}
				});
			};

		 });
		 text += "</table>\n";
		 $('#result_score').html(text);
	    });

}
