MINI MINI MANI MO
<?
header("Content-type: application/vnd.ms-excel; charset=euc-kr");
header("Content-Disposition: attachment; filename=excel_".date("Y-m-d").".xls");
header("Expires: 0");
header("Content-Description: PHP4 Generated Data");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: public");
@ini_set('memory_limit',-1);
@session_start();
function dbconn(){
$connect = mysql_connect("localhost","autoweb2","q1w2e3r4") or die("¿¡·¯ : µðºñ ¿¬°á ¿À·ù ÀÔ´Ï´Ù.");
mysql_select_db("autoweb2",$connect) or die("¿¡·¯ : µ¥ÀÌÅÍ º£À̽º ¼±Åà ¿À·ù ÀÔ´Ï´Ù.");
return $connect;
}
function dbclose(){
mysql_close();
}
function Row_string($str){
global $connect;
//echo $str;
$result = mysql_query($str, $connect);
$row = mysql_fetch_assoc($result);
return $row;
}
function Query_string($str){
global $connect;
//echo $str;
$result = mysql_query($str, $connect);
return $result;
}
function Fetch_string($str){
global $connect;
//echo $str;
$result = mysql_query($str, $connect);
for($i=0;$i<=$arr=mysql_fetch_array($result);$i++){
$ret_file[$i] = $arr;
}
return $ret_file;
}
include_once ($_SERVER['DOCUMENT_ROOT']."/lib/code.php");
$connect = dbconn();
$tb_name = "tow";
$view_article = 15; // ÇÑȸ鿡 ³ªÅ¸³¯ °Ô½Ã¹°ÀÇ ÃÑ °³¼ö
if (!$page) $page = 1; // ÇöÀç ÆäÀÌÁö ÁöÁ¤µÇÁö ¾Ê¾ÒÀ» °æ¿ì 1·Î ÁöÁ¤
$start = ($page-1)*$view_article;
$nowDate = date("Y-m-d");
$YesterDate = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d")-1, date("Y") ));
$arr_towresult=array('','¿¹Á¤','ÁøÇà','Á¾°á');
$exstart_date = $start_date;
if(!$tow_result) $tow_result="2";
$href = "&step=$step&sear4=$sear4&tow_result=$tow_result&s_year=$s_year";
$href1 = "&page=$page".$href;
$where = " 1 ";
if($step){
$where .= " and step = '$step'";
}
if($tow_result!="4"){
$where .= " and tow_result = '".$arr_towresult[$tow_result]."'";
}
if($sear4){
$where .= " and ( car_num like '%$sear4%' or car_name like '%$sear4%' or area 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' ";
}
if($s_year){
$where .= " and substring(tow_date, 1, 4) = '$s_year' ";
}
$query = "select count(*) from $tb_name where $where ";
$result = mysql_query($query);
$temp = mysql_fetch_array($result);
$total_article = $temp[0]; // ÇöÀç Äõ¸®ÇÑ °Ô½Ã¹°ÀÇ ÃÑ °³¼ö¸¦ ±¸ÇÔ
?>
<table width="100%" border="0" cellpadding="0" cellspacing="1" style="border-top:1px solid #0066CC;">
<tr align="center" class="sbtitle">
<td colspan="7" height="28" >°ßÀÎÇöȲ</td>
</tr>
<tr align="center" class="sbtitle">
<td height="28">°ßÀοäûÀϽÃ</td>
<td >ÁøÇà»çÇ×</td>
<td >±¸ºÐ</td>
<td >°ßÀÎÀ§Ä¡</td>
<td >Â÷¸í¹×¿¬½Ä</td>
<td >°Å·¡Ã³</td>
<td >»ó´ãÀÚ</td>
</tr>
<?
$query = mysql_query("SELECT * FROM $tb_name WHERE $where order by idx desc ");
while($row = mysql_fetch_array($query)) {
$num = $total_article-$i-(($page-1)*$view_article);
($i%2 == 0) ? $bgCol = "#ffffff" : $bgCol = "#ffffff";
$info = mysql_fetch_array(mysql_query("SELECT * FROM woojung_member WHERE userId = '".$row[wc_mem_id]."'"));
?>
<tr align="center">
<td height="28"><?=$row[tow_date]?></td>
<td ><?=$ArrTowStep[$row[step]]?></td>
<td ><?=$row[type]?></td>
<td ><?=$row[area]?></td>
<td ><?=$row[car_name]?></td>
<td ><?=$row[custom]?></td>
<td ><?=$row[seller]?></td>
</tr>
<?
}
?>
<!-- ¹Ýº¹µÇ´Â ÁÙ ³¡ -->
</form>
</table>
OHA YOOOO