MINI MINI MANI MO

Path : /home/lhcar/www/admin/sub01/
File Upload :
Current File : /home/lhcar/www/admin/sub01/exldown.php

<?
require "$_SERVER[DOCUMENT_ROOT]/config/config.php"; 
include ($_SERVER['DOCUMENT_ROOT']."/_common/common.php");
$connect = dbconn();

	if($loginUsort != "superadmin" && $loginUsort != "admin"){
		movepage("/");
		exit;
	}


header( "Content-type: application/vnd.ms-excel; charset=euc-kr" ); 
header( "Content-Disposition: attachment; filename=ÆóÂ÷½Åû.xls" ); 
header( "Content-Description: PHP4 Generated Data" );


	$tb_name = "counsel";

	$view_article = 15; // ÇÑÈ­¸é¿¡ ³ªÅ¸³¯ °Ô½Ã¹°ÀÇ ÃÑ °³¼ö  
	if (!$page) $page = 1; // ÇöÀç ÆäÀÌÁö ÁöÁ¤µÇÁö ¾Ê¾ÒÀ» °æ¿ì 1·Î ÁöÁ¤  
	$start = ($page-1)*$view_article; 

	$href = "&type=$type&step=$step&sear4=$sear4&sdate=$sdate&edate=$edate"; 
	$href1 = "&page=$page".$href;

	$where = " 1 ";

	if($sdate){  		 
		$where .= " and regdate >= '$sdate'";  
	}
	if($edate){  		 
		$where .= " and regdate <= '$edate 23:59:59'";  
	}
	if($type){  		 
		$where .= " and type  = '$type'";  
	}
	if($step){  		 
		$where .= " and step  = '$step'";  
	}
	if($wc_model){  		 
		$where .= " and wc_model  = '$wc_model'";  
	}
	if($wc_model2){  		 
		$where .= " and wc_model  = '$wc_model'";  
	}

	if($calltype){  		 
		$where .= " and calltype  = '$calltype'";  
	}  

	if($sear4){
		$where .= " and ( title  like '%$sear4%' or name like '%$sear4%' or phone like '%$sear4%') ";  	

	}

	if($car_cate){
		$where .= " and wc_prog_etc  = '$car_cate'";
	}

	if($start_date && $end_date){		
		$where .= " and substring(wc_regdate, 1, 10)  >= '$start_date' and substring(wc_regdate, 1, 10) <= '$end_date'";
	}
	if($start_date && !$end_date){
		$where .= " and substring(wc_regdate, 1, 10) >= '$start_date' ";
	}
	if(!$start_date && $end_date){
		$where .= " and substring(wc_regdate, 1, 10) <= '$end_date' ";
	}
	//echo $where;
	$query = "select count(*) from $tb_name where $where ";  
	//echo $query;
	$result = mysql_query($query, $connect);  
	//echo $result;
	$temp = mysql_fetch_array($result);  
	$total_article = $temp[0]; // ÇöÀç Äõ¸®ÇÑ °Ô½Ã¹°ÀÇ ÃÑ °³¼ö¸¦ ±¸ÇÔ	


?>
<table >
      <tr>
        <td ><strong>no</strong></td>
        <td ><strong>µî·ÏÀÏ</strong></td>
        <td ><strong>±¸ºÐ</strong></td>
        <td ><strong>¼Ò±¸ºÐ</strong></td>
        <td ><strong>µî·ÏÀÚ</strong></td>
        <td ><strong>¿¬¶ôó</strong></td>
        <td ><strong>Â÷·®¹øÈ£</strong></td>
        <td ><strong>À̸ÞÀÏ</strong></td>
      </tr>


<?
$Qry = "SELECT * FROM $tb_name WHERE $where order by idx  desc ";
//echo $Qry;
$arr = Fetch_string($Qry);
for($i=0;$i<count($arr);$i++){
	$num = $total_article-$i-(($page-1)*$view_article);

?>

<tr >
<td ><?=$num?></td>
<td ><?=substr($arr[$i][regdate],0,10)?></td>
<td ><?=$arr[$i][type]?></td>
<td ><?=$arr[$i][type2]=="±âŸ"?$arr[$i][title]:$arr[$i][type2]?></td>
<td ><?=$arr[$i][name]?></td>
<td ><?=$arr[$i][phone]?></td>
<td ><?=$arr[$i][type2_etc]?></td>
<td ><?=$arr[$i][email]?></td>
</tr>

<?
}
?>
</table>

OHA YOOOO