Пример #1
0
</td>
						<?php 
    } else {
        echo '<td align="center" colspan="2" ><font color="green">Liên hệ trực tiếp</font></td>';
    }
    ?>
						<td align="center" style="width:120px"><?php 
    echo $duan["linhvuc"]["tenlinhvuc"];
    ?>
</td>
						<td align="center" style="width:50px"><?php 
    echo $duan["duan"]["views"];
    ?>
</td>
						<td align="center" style="width:110px"><?php 
    echo getDaysFromSecond($duan["duan"]["active"] == 1 ? $duan[""]["timeleft"] : 0);
    ?>
</td>
					</tr>
					<?php 
}
?>
			</tbody>
		</table>
	</div>
	<div  class="ui-widget-header ui-helper-clearfix" style="border:none;padding-left: 5px">các dự án vừa kết thúc</div>
	<div id="datagrid2" style="padding-bottom:10px;">
		<table width="100%">
			<thead>
				<tr class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" style="font-weight:bold;height:20px;text-align:center;">
					<td>Tên dự án</td>
Пример #2
0
 function viewmore($page = 2)
 {
     $this->setModel("duan");
     $this->duan->showHasOne(array('linhvuc'));
     $this->duan->orderBy('duan.timeupdate', 'desc');
     $this->duan->setPage($page);
     $this->duan->setLimit(15);
     $this->duan->where(" and active = 1 and approve = 1 and nhathau_id is null and ngayketthuc>now()");
     $data = $this->duan->search("duan.id,tenduan,alias,linhvuc_id,tenlinhvuc,averagecost,ngaypost,prior,views,bidcount,UNIX_TIMESTAMP(ngayketthuc)-UNIX_TIMESTAMP(now()) as timeleft,duan.active,approve");
     $jsonResult = "{";
     $i = 0;
     $len = count($data);
     while ($i < $len) {
         $linkduan = BASE_PATH . "/duan/view/" . $data[$i]["duan"]["id"] . "/" . $data[$i]["duan"]["alias"];
         $linkduan = mysql_real_escape_string($linkduan);
         $tenduan = mysql_real_escape_string($data[$i]['duan']['tenduan']);
         $tenlinhvuc = mysql_real_escape_string($data[$i]['linhvuc']['tenlinhvuc']);
         $averagecost = formatMoney($data[$i]['duan']['averagecost']);
         $views = $data[$i]['duan']['views'];
         $bidcount = $data[$i]['duan']['bidcount'];
         $lefttime = mysql_real_escape_string(getDaysFromSecond($data[$i]["duan"]["active"] == 1 && $data[$i]["duan"]["approve"] == 1 ? $data[$i][""]["timeleft"] : 0));
         $jsonResult = $jsonResult . "{$i}:{'views':{$views},'bidcount':{$bidcount},'linkduan':'{$linkduan}','tenduan':'{$tenduan}','tenlinhvuc':'{$tenlinhvuc}','averagecost':'{$averagecost}','lefttime':'{$lefttime}'},";
         $i++;
     }
     $jsonResult = substr($jsonResult, 0, -1);
     $jsonResult = $jsonResult . "}";
     print $jsonResult;
     //$this->set("lstData1",$data);
 }