<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<?php include(DDROOTPATH.'/cache/title/'.$pagetag.'_title.php');?>
<LINK rel=stylesheet type=text/css href="/template/<?=MOBAN?>/css/mall.css" />
<LINK rel=stylesheet type=text/css href="/template/<?=MOBAN?>/css/common.css" />
<LINK rel=stylesheet type=text/css href="css/colorbox.css" />
<script type="text/javascript" src="/template/<?=MOBAN?>/js/jquery-1.3.2.min.js"></script>
<SCRIPT type="text/javascript" src="/template/<?=MOBAN?>/js/function.js"></SCRIPT>
<SCRIPT type="text/javascript" src="/template/<?=MOBAN?>/js/jquery.colorbox.js"></SCRIPT>
<script language="javascript">
$.ajaxSetup ({
    cache: false //关闭AJAX相应的缓存
});
$(function(){
    $('.checkLogin').click(function(){
		url=$(this).attr('href');
		lay=$(this).attr('layer');
		index=$(this).attr('index');
		$('#jumpbox .detail').hide();
		$('#layer_mall').show();
		var ddusername='<?=$_SESSION['duoduouser']?>';
		var img=$('#left .malllogo img').attr('src');
		var price=$('#left .malljj .malldetail').find('font').html();
		$('#jump_pic').attr('src',img);
		$('#jump_href').attr('href',url);
		$('.jump_price').html(price);
		
	    if(ddusername!=''){
			window.open(url);
		}
		else{
		    $('.jumpbox').show();
		}
	return false;
	});
	
	$('#jump_href,#jumpclose').click(function(){
	    $('.jumpbox').hide();
	});
	
	$(".cxxq").colorbox({ innerWidth:700, innerHeight:450, iframe:true});

});

function saveComment(){
	    var fen = $('#qualityScore').val();
	    var comment = $('#comment').val();
	    if(comment==''){alert('您还没填写评论内容！')}
	    else {
	        $.post('ajax.php?fun=mall_comment', {'fen':fen,'comment':comment,'mall_name':'<?=$mall['name']?>','mall_id':'<?=$mall['id']?>', 'fresh':Math.random()}, function(data){//$('#comment').val(data);
			    if(data=='error1'){
				    alert('您今天已经评论过了！');
				}
				else if(data=='error2'){
				    alert('成功购物后才可评论！');
				}
				else{
				    alert('评论成功');
			        $("#mall_comment").prepend(data);
					$('#commenthide').show('slow');
				}
	        });
	    }
	    return false;
	}

function imgAuto(img, maxW, maxH) {
	var oriImg = document.createElement("img");
	oriImg.onload = function(){
		if (oriImg.width == 0 || oriImg.height == 0)
			return;
		var oriW$H = oriImg.width / oriImg.height;
		// var maxW$H = maxW / maxH;

		if (oriImg.height > maxH) {
			img.height = maxH;
			// img.removeAttribute("width");
			img.width = maxH * oriW$H;
		}
		if (img.width > maxW) {
			img.width = maxW;
			// img.removeAttribute("height");
			img.height = maxW / oriW$H;
		}

		if (maxH) {// if it defined the maxH argument
			if (img.height > 0)
				img.style.marginTop = (maxH - img.height) / 2 + "px";
		}
	};
	oriImg.src = img.src;
}

      qualityDwsc = new Array();
      qualityDwsc[1] = '别跟我提<?=$mall['name']?>，谁提我跟谁急';
      qualityDwsc[2] = '有那么一点小失望';
      qualityDwsc[3] = '还行吧，没什么值得说的';
      qualityDwsc[4] = '不错不错，不错不错';
      qualityDwsc[5] = '这地方太好了，下次一准还在这里买';
      function setstar(val, o, flag) {
        var x = document.getElementById(o);
        x.innerHTML = "";
        var i = 1;
        if (val < 3) {
          for (; i <= val; i++) {
            x.innerHTML = x.innerHTML + ('<div class="pl_11_xx" style="cursor:pointer" onmouseover="setdesc(' + i + ',\'' + o + '\',1)" onmouseup="setstar(' + i + ',\'' + o + '\',1)" ><img src="/template/<?=MOBAN?>/images/i_395.jpg" width="24" height="23" /></div>');
          }
        } else {
          for (; i <= val; i++) {
            x.innerHTML = x.innerHTML + ('<div class="pl_11_xx" style="cursor:pointer" onmouseover="setdesc(' + i + ',\'' + o + '\',1)" onmouseup="setstar(' + i + ',\'' + o + '\',1)" ><img src="/template/<?=MOBAN?>/images/i_394.jpg" width="24" height="23" /></div>');
          }
        }
        for (var j = i; j <= 5; j++) {
          var html = x.innerHTML;
          x.innerHTML = x.innerHTML + ('<div class="pl_11_xx" style="cursor:pointer" onmouseover="setdesc(' + j + ',\'' + o + '\',1)"  onmouseup="setstar(' + j + ',\'' + o + '\',1)"><img src="/template/<?=MOBAN?>/images/i_396.jpg" width="24" height="23" /></div>');
        }
        $('#qualityScore').val(val);
      }
	  function setdesc(val, o) {
        $('#' + o + '_desc').html(qualityDwsc[val]);
      }
    </script>
</head>

<body>
<?php
include("header.tpl.php");
?>
<?php
include("nav.tpl.php");
?>
<div id="weizhi">当前位置：<a href="index.php">首页</a> > <a href="malllist.php">商城返现</a> > <?=$mall['name']?></div>
<div id="main">
<div class="white_top"><div class="white_top_left"></div><div class="white_top_middle"></div><div class="white_top_right"></div></div>
<div class="white_bg">
<div>
<img usemap="#m" src="/template/<?=MOBAN?>/images/mall_top.gif" style="margin-bottom:10px; width:920px;">
</div>
	<div id="left_sb">
		<div class="malljj">
			<div class="malllogo"><span style="writing-mode: tb-rl;vertical-align: middle; height:150px"><img src="<?=$mall['logo']?>" width="140px" /></span></div>
			<div class="malldetail">
				<ul>
					<li style="height:30px; line-height:30px; font-size:14px; font-weight:bold; width:500px;"><div style="float:left"><?=$mall['name']?>最高返现 <font style="color:#f30; font-size:20px;  font-weight:bold; font-family:Georgia,"Times New Roman",Times,serif"><?=$mall['fan']?></font></div> <?php if($mall['renzheng']=='on'){?> <div style="float:left; margin-left:5px; padding-top:6px"><img alt="网站认证" src="/template/<?=MOBAN?>/images/renzheng.gif" /></div><?php }?></li>
					<li style="height:35px; line-height:35px; width:500px; overflow:hidden;"><font style="font-size:14px; font-weight:bold;">温馨提示：</font>返现额度根据您在<?=$mall['name']?>的下单金额而定，最高可以获得<?=$mall['fan']?>的返现！</li>
					<li style="border-bottom:1px dashed #ddd; width:500px;"></li>
					<li style=" height:10px; width:500px;"></li>
					<li style="height:30px; line-height:30px; width:500px;"><div style="float:left">满意度：</div><div title="满意度<?=(round($fen/5,2)*100).'%'?>" style="background:url(/template/<?=MOBAN?>/images/5bx.gif) 0px 0px no-repeat; width:128px; height:24px; float:left"><div style="background:url(/template/<?=MOBAN?>/images/5hx.gif) 0px 0px; width:<?=$x?>px; height:23px;"></div></div><div style="float:left">（<?=(round($fen/5,2)*100).'%'?>）</div></li>
<?php if($_SESSION["duoduouser"]==NULL){echo "<li style=\"height:30px; line-height:30px; width:500px; color:#FF0000;\">您尚未登录，请<a onclick=\"window.location='user/login.php?url='+encodeURIComponent(window.location.href)\" style=\"cursor:pointer;\">登录</a>后从本页进入$mall[name]购物才可获得返现！</li>"; }else{echo "<li style=\"height:30px; line-height:30px; width:500px; color:#006600;\">您已经登录，从本页进入糯米网购物即可获得返现！</li>";}?><li style=" height:42px; width:500px; text-align:left;"><a href="jump.php?mall_id=<?=$mall['id']?>" class="checkLogin"><img src="/template/<?=MOBAN?>/images/gomall.gif" /></a></li>
				</ul>
			</div>
		</div>
		<div class="jsbar">
          <div <?php if($act=='fxsm'){?> class="current"<?php }?>><a href="mall<?=$url_head_id?><?=$mall['id']?><?=$url_head_act?>fxsm<?=$url_end?>">返现说明</a></div>
          <div <?php if($act=='cxyh'){?> class="current"<?php }?>><a href="mall<?=$url_head_id?><?=$mall['id']?><?=$url_head_act?>cxyh<?=$url_end?>">促销优惠</a></div>
        </div>
        <?php if($act=='fxsm'){?>
		<div class="malldesc"><div class="js"><?=str_replace('../../upload','upload',$mall['js'])?></div></div>
    <div style="clear:both;"></div>
    <div style="border:#E9E9E9 1px solid; width:688px; height:70px">
      <div style="float:left; width:110px; height:50px; margin-left:80px; _margin-left:40px; margin-top:13px;">
        <div style="color:#333">商城打分</div>
        <div>
          <div style="float:left; font-size:32px; color:#F30"><?=$pjf?></div>
          <div style="float:left">
            <div>&nbsp;</div>
            <div style="text-align:left"><span style="color:#F60">(<?=$mall_comment_total?>)</span>次评价</div>
          </div>
        </div>
      </div>
      <div style="float:right; width:440px; margin-right:40px; margin-top:13px;">
        <div><div style=" width:30px; height:21px; background:url(/template/<?=MOBAN?>/images/youbiao.png) 30px 0px; text-align:center; color:#FFF; margin-left:<?=79*$pjf?>px"><?=$pjf?></div></div>
        <div style="width:400px; height:14px; background:url(/template/<?=MOBAN?>/images/youbiao.png); margin-left:15px"></div>
        <div style=" margin-left:15px">
          <ul>
            <li style="float:left; margin-left:48px; _margin-left:24px">非常不满意</li>
            <li style="float:left; margin-left:31px">不满意</li>
            <li style="float:left; margin-left:49px">一般</li>
            <li style="float:left; margin-left:59px">满意</li>
            <li style="float:left; margin-left:43px">非常满意</li>
          </ul>
        </div>
      </div>
    </div>
    <div id="mall_comment">
    <?php while($row=mysql_fetch_array($rs)){?>
    <div class="n_shang_3_4_101">
      <div class="t_p">
        <table width="738" cellspacing="0" cellpadding="0">
          <tr>
            <td width="50%" height="25" style="text-align:left"><?=$row['user_name']?></td>
            <td width="49%" height="25" style="text-align:right; padding-right:5px"><span class="color_19"><?=$row['time']?></span></td>
            <td width="1%"></td>
          </tr>
        </table>
      </div>
      <div class="t_p_t">
        <table width="628" cellspacing="0" cellpadding="0">
          <tr>
            <td colspan="2" style="width:628px;word-break : break-all; overflow:hidden;">
              评论内容：<?=$row['comment']?>
            </td>
          </tr>
          <tr>
            <td width="23" height="20">
              <img src="/template/<?=MOBAN?>/images/icon_151.gif" width="14" height="13" />
            </td>
            <td width="605" height="20">
              <span class="color_19">
                评分等级：
                <?php for($i=0;$i<$row['fen'];$i++){?>
				<img src="/template/<?=MOBAN?>/images/i_394.jpg" width="24" height="23" />
				<?php }?>
              </span>
            </td>
          </tr>
        </table>
      </div>
    </div>
    <?php }?>
    <div class="megas512" style="text-align:center; margin:15px 0"><?php 
				pageft($mall_comment_total,$pagesize,1,0,0,10,$page_mall);
				echo $pagenav;?>
		</div>
    </div>
    <div style="clear:both; height:1px"></div>
    <div style="width:648px; margin-top:10px;">
      <div style="float:left; width:134px;">
        <input type="button" name="Submit3" value="" onclick="window.location='#comm'" class="button_37" />
      </div>
      <div class="p1_11_1" style="width: 506px">
        <div class="p1_11_1_a" style="width: 506px; padding:0px;">
          <table width="506" cellspacing="0" cellpadding="0">
            <tr>
              <td width="21" height="25" align="right">
                <img src="/template/<?=MOBAN?>/images/icon_155.gif" width="19" height="19" />
              </td>
              <td width="159" height="25">
                <span class="color_4">
                  小提示：点击星星就能打分了
                </span>
              </td>
              <td width="146" height="25">
                <img src="/template/<?=MOBAN?>/images/i_393.jpg" width="96" height="19" />
              </td>
            </tr>
          </table>
        </div>
        <div class="p1_11_1_b" style="width: 506px; padding:0px;">
          <table>
            <tr>
              <td width="85" height="30" align="right"><span class="color_1">*</span>商城打分：</td>
              <td width="200" height="30" id="quality">
                <div class="pl_11_xx" style="cursor:pointer" onmouseover="setdesc(1,'quality')"
                onmouseup="setstar(1,'quality',0)">
                  <img src="/template/<?=MOBAN?>/images/i_396.jpg" width="24" height="23" />
                </div>
                <div class="pl_11_xx" style="cursor:pointer" onmouseover="setdesc(2,'quality')"
                onmouseup="setstar(2,'quality',0)">
                  <img src="/template/<?=MOBAN?>/images/i_396.jpg" width="24" height="23" />
                </div>
                <div class="pl_11_xx" style="cursor:pointer" onmouseover="setdesc(3,'quality')"
                onmouseup="setstar(3,'quality',0)">
                  <img src="/template/<?=MOBAN?>/images/i_396.jpg" width="24" height="23" />
                </div>
                <div class="pl_11_xx" style="cursor:pointer" onmouseover="setdesc(4,'quality')"
                onmouseup="setstar(4,'quality',0)">
                  <img src="/template/<?=MOBAN?>/images/i_396.jpg" width="24" height="23" />
                </div>
                <div class="pl_11_xx" style="cursor:pointer" onmouseover="setdesc(5,'quality')"
                onmouseup="setstar(5,'quality',0)">
                  <img src="/template/<?=MOBAN?>/images/i_396.jpg" width="24" height="23" />
                </div>
                </td>
                <td width="" height="30">
                  <span class="color_4" id="quality_desc">
                  </span>
                  <input type="hidden" id="qualityScore" name="qualityScore" value="5" />
                </td>
            </tr>
          </table>
          </div>
          </div>
          </div>
          <div style="clear:both"></div>
          <div class="n_shang_3_4_101" name="comment">
					    <table width="648" cellspacing="0" cellpadding="0" id="pmenu1">
                          <tr>
                            <td><div class="t_p_b" style="width:628px;">&nbsp;&nbsp;&nbsp;&nbsp;把您在【<?=$mall['name']?>】的购物经历写下来，请具体指出【<?=$mall['name']?>】做的好或不好之处，您真实的体会将给大家带来十分有价值的参考。</div></td>
                          </tr>
                          <tr><td><textarea name="comment" id="comment" class="input_53" style="width:638px;"></textarea></td></tr>
                        </table>
                        <table width="648" cellspacing="0" cellpadding="0" >
                         <tr>
                            <td height="80" align="center"><input <?php if($_SESSION['duoduouser']==''){?> onclick="alert('登陆后才能评论！');window.location='user/login.php?url='+encodeURIComponent(window.location.href)" <?php }else{?>onclick="saveComment()"<?php }?> type="submit" name="Submit2" value="提交评论"  class="button_36" /></td>
                          </tr>
                        </table>
					  </div>
         <?php }elseif($act=='cxyh'){?>
         <div class="dis sales_left" id="sh_tbc_04">
         <?php if($activity[0]['mallname']==''){?>
             <p style=" width:150px; text-align:center; margin:auto; margin-top:20px; color:#F00; font-size:16px"><b>暂无促销活动</b></p>
		 <?php }?>
								<?php foreach($activity as $row){?>
                                	<div class="sh_cx">
                                    	<div class="sh_cx_1">
                                        	<div class="sh_cx_1_p"><a target="_blank" href="jump.php?act_id=<?=$row['id']?>" title="<?=$row['name']?>"><img  onload="imgAuto(this,240,110);"  src="<?=$row['pic']?>" /></a></div>
                                            <div class="sh_cx_1_p_r">
 
                                           	  <div class="sh_cx_title"><a style="font-weight:bold; color:#03F" target="_blank" href="jump.php?act_id=<?=$row['id']?>" class="color_91"><?=$row['name']?></a></div>
                                                <div class="sh_cx_sj" style="margin-top:5px">所属商家：<a style="color:#F00; text-decoration:underline"><?=$row['mallname']?></a></div>
                                                <div class="sh_cx_sj" style="margin-top:5px">活动时间：<?=$row['stime']?>至<?=$row['etime']?>（<?=sjc(date('Y-m-d'),$row['etime'])?>）</div>
                                                <div class="sh_cx_jj" style="margin-top:5px">活动简介：<?=$row['des']?></div>
                                                <div style="clear:both"></div>
                                          	</div>
 
                                            <div class="sh_cx_p_r_r">
                                            	<a href="cuxiao<?=$url_head_id?><?=$row['id']?><?=$url_end?>" target="_blank" class="b_cx_xq" style="font-size:12px; color:#333">查看详情</a>
                                            </div>
                                            <div style="clear:both"></div>
                                        </div>
                                  </div>
                                  <?php }?>
                                  <div class="megas512" style="text-align:center; margin:5px"><?php 
				pageft($total,$pagesize,1,0,0,10,$page_mall);
				echo $pagenav;?>
		</div>
                              	</div>
                                <div style="height:10px">&nbsp;</div>
         <?php }?>
	</div>
	
	<div id="right_ohter">
    <div class="r_box">
			<div class="title"><span>热门优惠券</span></div>
			<div class="hc">
				<ul>
							</ul>
				<div class="clear"></div>
			</div>
			<div class="clear"></div>
	 </div>
    <div id="ad4"><?=AD(4)?></div>
   </div>
  </div>
    <div class="white_bottomm"><div class="white_bottom_left"></div><div class="white_bottom_middle"></div><div class="white_bottom_right"></div>
    </div> 
		
	</div>
	<?php include("footer.tpl.php");?>
</body>
</html>
