<div class="pageTitle">
	<div class="title">拦截房源申诉</div>
</div>
<ul class="optionList">
<?php if ($_GET['deal']==1) : ?>
    <li><a href="/365frame/index.php?ctrl=broker_sell&method=appeal"><span class="icon-finger"></span>未处理的申诉</a></li>
<?php else : ?>
    <li><a href="/365frame/index.php?ctrl=broker_sell&method=appeal&deal=1"><span class="icon-finger"></span>已处理的申诉</a></li>
<?php endif; ?>
</ul>

<ul class="optionList">	
	<li>
		<select id="cond" name="cond">
			<option value="houseId" <?php echo !empty($searchArg['cond']) && $searchArg['cond'] == 'houseId' ? 'selected' : '' ;?>>房源ID

			<option value="username" <?php echo !empty($searchArg['cond']) && $searchArg['cond'] == 'username' ? 'selected' : '' ;?>>经纪人账号

			<option value="truename" <?php echo !empty($searchArg['cond']) && $searchArg['cond'] == 'truename' ? 'selected' : '' ;?>>经纪人姓名
		</select>

		<input type="text" id="keyword" name="keyword" value="<?php echo !empty($searchArg['keyword']) ? $searchArg['keyword'] : '';?>">
	</li>
	<li>
		<input id="searchButton" type="button" value="提交">	
	</li>
</ul>

<div class="container clearfix" style="margin:0;">
    
	<div class="box mt20">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-a">
			<tr>
                <th>房源ID</th>
				<th>区属</th>
				<th>小区</th>
				<th>户型</th>
				<th>面积</th>
				<th>楼层</th>
				<th>总价</th>
				<th>经纪人</th>
				<th>账号</th>
				<th>电话</th>
				<th>申诉时间</th>
				<th>申诉材料</th>
				<th>操作</th>
			</tr>
			<?php foreach ($appeals as $_a) : ?>
			<tr>
                <td ><?=$sells[$_a['id']]['id']?></td>
                <td ><?=$sells[$_a['id']]['district']?></td>
                <td ><?=$sells[$_a['id']]['blockshowname']?></td>
                <td ><?=$sells[$_a['id']]['room']?>室<?=$sells[$_a['id']]['hall']?>厅<?=$sells[$_a['id']]['toilet']?>卫</td>
                <td ><?=$sells[$_a['id']]['buildarea']?>平</td>
                <td ><?=$sells[$_a['id']]['floor']?>/<?=$sells[$_a['id']]['totalfloor']?></td>
                <td ><?=$sells[$_a['id']]['price']?>万</td>
                <td ><?=$sells[$_a['id']]['contactor']?$sells[$_a['id']]['contactor']:$sells[$_a['id']]['telno']?></td>
                <td ><?=$sells[$_a['id']]['uname']?></td>
                <td ><?=$sells[$_a['id']]['telno']?></td>
                <td ><?=$_a['add_time']?></td>
                <td >
                    <?=$_a['content']?>
                    
                    <?php 
                    if($_a['attach']){
                        $attaches = explode(',',$_a['attach']);
                        foreach ($attaches as $att){
                            $att_big = preg_replace('/_[0-9]{3}x[0-9]{3}/','',$att);
                            echo '<br><a href="'.$att_big.'" target="_blank"><image src="'.$att.'" style="max-height:100px;max-width:100px"></a>';
                        }
                    }
                    ?>
                </td>
                <td >
                    <?php if ($_a['result']==0) :?>
                    <a class="operate" href="/365frame/index.php?ctrl=broker_sell&method=appeal_pass&id=<?=$_a['id']?>">通过</a> | 
                    <a class="operate" href="/365frame/index.php?ctrl=broker_sell&method=appeal_refuse&id=<?=$_a['id']?>">不通过</a>
                    <?php elseif ($_a['result']==10) :?>
                    申诉审核通过
                    <?php elseif ($_a['result']==20) :?>
                    <span style="color:Red">申诉审核失败</span>
                    <?endif;?>
                    
                </td>
			</tr>
			<?php endforeach; ?>
		</table>
	</div>
	<div style="margin-top:3px;">
	   <?=$pagenations['pagenation'];?>
	</div>
</div>

<script>
	var url = 'http://esfadmin.house365.com/365frame/index.php?ctrl=broker_sellwang&method=appeal';
	var deal = "<?php echo !empty($_GET['deal']) ? $_GET['deal'] : '';?>";

	if(deal)
	{
		url += '&deal='+deal;
	}

	$('#searchButton').click(function(){
		var cond = $('#cond').val();
		var keyword = $('#keyword').val();

		window.location.href = url+"&cond="+cond+"&keyword="+keyword;
	});
	

</script>