묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
검색기능에 관하여..
2003.07.28 13:09
<?
//데이터 베이스 연결하기
include "db.php";
$page_size=20;
$page_list_size = 10;
if (!$no || $no < 0) $no=0;
$query = "select id,cop,cus,pass,cusno,rdate,car,caryear,won,cars,carno,copno,chano,cuspno,comment,DATE_FORMAT(wdate,'%Y-%m-%d') as date,see from deallone order by id desc limit $no,$page_size";
$result = mysql_query($query, $conn);
$result_count=mysql_query("select count(*) from deallone",$conn);
$result_row=mysql_fetch_row($result_count);
$total_row = $result_row[0];
if ($total_row <= 0) $total_row = 0;
$total_page = floor($total_row / $page_size);
$current_page = floor($no/$page_size);
?>
<html>
<head>
<title>할부현황</title>
<link rel="stylesheet" href="7bok.css" type="text/css">
</head>
<body topmargin=0 leftmargin=0 text=#464646>
<center>
<BR>
<font size=2> </a>
<BR>
<BR>
<table width=800 border=0 cellpadding=2 cellspacing=1 bgcolor=#777777>
<tr height=20 bgcolor=#999999>
<td width=30 align=center>
<font color=white>번호</font>
</td>
<td width=30 align=center>
<font color=white>신청일</font>
</td>
<td width=170 align=center>
<font color=white>상 사</font>
</td>
<td width=50 align=center>
<font color=white>신청자</font>
</td>
<td width=160 align=center>
<font color=white>차 명</font>
</td>
<td width=140 align=center>
<font color=white>할부금</font>
</td>
</tr>
<?
while($row=mysql_fetch_array($result))
{
?>
<tr>
<td height=20 bgcolor=white align=center>
<a href=read.php?id=<?=$row[id]?>&no=<?=$no?>><?=$row[id]?></a>
</td>
<td height=20 bgcolor=white align=center>
<a href=read.php?id=<?=$row[id]?>&no=<?=$no?>><?=$row[rdate]?></a>
</td>
<td height=20 bgcolor=white>
<a href=read.php?id=<?=$row[id]?>&no=<?=$no?>><?=strip_tags($row[cop], '<b><i>');?></a>
</td>
<td align=center height=20 bgcolor=white>
<font color=black>
<a href="mailto:<?=$row[email]?>"><?=$row[cus]?></a>
</font>
</td>
<td align=center height=20 bgcolor=white>
<font color=black><?=$row[car]?></font>
</td>
<td align=center height=20 bgcolor=white>
<font color=black><?=$row[won]?></font>
</td>
</tr>
<?
}
mysql_close($conn);
?>
</table>
<table border=0>
<tr>
<td width=600 height=20 align=center rowspan=4>
<font color=gray>
<?
$start_page = (int)($current_page / $page_list_size) * $page_list_size;
$end_page = $start_page + $page_list_size - 1;
if ($total_page < $end_page) $end_page = $total_page;
if ($start_page >= $page_list_size) {
$prev_list = ($start_page - 1)*$page_size;
echo "<a href="$PHP_SELF?no=$prev_list">◀</a>n";
}
for ($i=$start_page;$i <= $end_page;$i++) {
$page=$page_size*$i;
$page_num = $i+1;
if ($no!=$page){
echo "<a href="$PHP_SELF?no=$page">";
}
echo " $page_num ";
if ($no!=$page){
echo "</a>";
}
}
if($total_page > $end_page)
{
$next_list = ($end_page + 1)* $page_size;
echo "<a href=$PHP_SELF?no=$next_list>▶</a><p>";
}
?>
</font>
</td>
</tr>
</table>
<a href=write.php>글쓰기</a>
</center><br>
</body>
</html>
이곳 저곳에서 필요한것만 뽑아서 만든 게시판형식의 대장관리 플그램입니다..
완전 초짜라서.. 여기까지만 하는데에도 꽤 긴 시간이 걸렸습니다.
헌데 검색기능이 절실히 필요한지라.. 검색기능을 넣으려고 하는데..
도무지 어떻게 해야할지 엄두조차 안나네요..
이곳저곳 알아보러 다니는데만 3일정도가 걸리네요..
도움주시면 감사하겠습니다.. (__)
//데이터 베이스 연결하기
include "db.php";
$page_size=20;
$page_list_size = 10;
if (!$no || $no < 0) $no=0;
$query = "select id,cop,cus,pass,cusno,rdate,car,caryear,won,cars,carno,copno,chano,cuspno,comment,DATE_FORMAT(wdate,'%Y-%m-%d') as date,see from deallone order by id desc limit $no,$page_size";
$result = mysql_query($query, $conn);
$result_count=mysql_query("select count(*) from deallone",$conn);
$result_row=mysql_fetch_row($result_count);
$total_row = $result_row[0];
if ($total_row <= 0) $total_row = 0;
$total_page = floor($total_row / $page_size);
$current_page = floor($no/$page_size);
?>
<html>
<head>
<title>할부현황</title>
<link rel="stylesheet" href="7bok.css" type="text/css">
</head>
<body topmargin=0 leftmargin=0 text=#464646>
<center>
<BR>
<font size=2> </a>
<BR>
<BR>
<table width=800 border=0 cellpadding=2 cellspacing=1 bgcolor=#777777>
<tr height=20 bgcolor=#999999>
<td width=30 align=center>
<font color=white>번호</font>
</td>
<td width=30 align=center>
<font color=white>신청일</font>
</td>
<td width=170 align=center>
<font color=white>상 사</font>
</td>
<td width=50 align=center>
<font color=white>신청자</font>
</td>
<td width=160 align=center>
<font color=white>차 명</font>
</td>
<td width=140 align=center>
<font color=white>할부금</font>
</td>
</tr>
<?
while($row=mysql_fetch_array($result))
{
?>
<tr>
<td height=20 bgcolor=white align=center>
<a href=read.php?id=<?=$row[id]?>&no=<?=$no?>><?=$row[id]?></a>
</td>
<td height=20 bgcolor=white align=center>
<a href=read.php?id=<?=$row[id]?>&no=<?=$no?>><?=$row[rdate]?></a>
</td>
<td height=20 bgcolor=white>
<a href=read.php?id=<?=$row[id]?>&no=<?=$no?>><?=strip_tags($row[cop], '<b><i>');?></a>
</td>
<td align=center height=20 bgcolor=white>
<font color=black>
<a href="mailto:<?=$row[email]?>"><?=$row[cus]?></a>
</font>
</td>
<td align=center height=20 bgcolor=white>
<font color=black><?=$row[car]?></font>
</td>
<td align=center height=20 bgcolor=white>
<font color=black><?=$row[won]?></font>
</td>
</tr>
<?
}
mysql_close($conn);
?>
</table>
<table border=0>
<tr>
<td width=600 height=20 align=center rowspan=4>
<font color=gray>
<?
$start_page = (int)($current_page / $page_list_size) * $page_list_size;
$end_page = $start_page + $page_list_size - 1;
if ($total_page < $end_page) $end_page = $total_page;
if ($start_page >= $page_list_size) {
$prev_list = ($start_page - 1)*$page_size;
echo "<a href="$PHP_SELF?no=$prev_list">◀</a>n";
}
for ($i=$start_page;$i <= $end_page;$i++) {
$page=$page_size*$i;
$page_num = $i+1;
if ($no!=$page){
echo "<a href="$PHP_SELF?no=$page">";
}
echo " $page_num ";
if ($no!=$page){
echo "</a>";
}
}
if($total_page > $end_page)
{
$next_list = ($end_page + 1)* $page_size;
echo "<a href=$PHP_SELF?no=$next_list>▶</a><p>";
}
?>
</font>
</td>
</tr>
</table>
<a href=write.php>글쓰기</a>
</center><br>
</body>
</html>
이곳 저곳에서 필요한것만 뽑아서 만든 게시판형식의 대장관리 플그램입니다..
완전 초짜라서.. 여기까지만 하는데에도 꽤 긴 시간이 걸렸습니다.
헌데 검색기능이 절실히 필요한지라.. 검색기능을 넣으려고 하는데..
도무지 어떻게 해야할지 엄두조차 안나네요..
이곳저곳 알아보러 다니는데만 3일정도가 걸리네요..
도움주시면 감사하겠습니다.. (__)