-
Notifications
You must be signed in to change notification settings - Fork 0
/
ketquatimkiem.php
109 lines (89 loc) · 3.11 KB
/
ketquatimkiem.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
$tukhoa=$_GET['tukhoa'];
if (@$pageNum<=0) $pageNum=1;
$offset=3;
$totalRows=0;
?>
<style>
.blog .tintrongloai img {width: 250px; height:200px; display: inline!important;}
.post .with_number a {width:330px;text-align:justify}
.post .post_details + p {text-align:justify}
.blog .post .post_content .post_details {float:right;}
.blog .post .post_content .post_details .date { background:#ddd;}
.page_header .page_header_right ul {float:left;}
</style>
Keyword: <?=$tukhoa?>
<div class="page_header clearfix page_margin_top">
<div class="page_header_left">
<h1 class="page_title"><?=$kq=$t->TimKiem($tukhoa,$totalRows, $pageNum, $pageSize); ?></h1>
</div>
<div class="page_header_right">
<ul class="bread_crumb">
<li>
Results found: <?=$totalRows?> tin
</li>
</ul>
</div>
</div>
<ul class="blog big">
<?php While ($row=$kq->fetch_assoc()) { ?>
<li class="post tintrongloai">
<a href="index.php?p=search&tukhoa=<?=$tukhoa?>" title="<?=$row['TieuDe']?>">
<img src="<?=$row['urlHinh']?>" onerror="this.src='/news/defaultImg.jpg'" alt='img'>
</a>
<div class="post_content">
<h2 class="with_number">
<a href="post.html" title="<?=$row['TieuDe']?> "><?=$row['TieuDe']?> </a>
</h2>
<ul class="post_details">
<li class="date">
<?=date('d-m-Y',strtotime($row['Ngay']))?>
</li>
</ul>
<p><?=$row['TomTat']?></p>
</div>
</li>
<?php } ?>
</ul>
<div class="page_margin_top_section" style="margin-top:30px!important"> aaaaaaa</div>
<?php
$totalPages = ceil($totalRows/$pageSize);
$from=$pageNum-$offset;
$to=$pageNum+$offset;
if ($from<=0) $from = 1;
if ($to>$totalPages) $to=$totalPages;
$pagePrev=$PageNum-1;
$pageNext=$PageNum+ 1;
?>
<?php if ($totalRows>$pageSize) { ?>
<ul class="pagination clearfix page_margin_top_section" >
<?php if($pageNum>1) { ?>
<li>
<a href="index.php?p=search&tukhoa=<?=$tukhoa?>">First</a>
</li>
<li>
<a href="index.php?p=search&tukhoa=<?=$tukhoa?>&pageNum=<?=$pagePrev?>" > < </a>
</li>
<?php } ?>
<?php //Hiện các con sô trong thanh phân trang?>
<?php for($j = $from; $j <= $to; $j++) { ?>
<?php if ($j!=$pageNum) { ?>
<li>
<a href="index.php?p=search&tukhoa=<?=$tukhoa?>&pageNum=<?=$j?>"><?=$j?></a>
</li>
<?php } else { ?>
<li class="selected" >
<a href="index.php?p=search&tukhoa=<?=$tukhoa?>&pageNum=<?=$j?>"><?=$j?></a>
</li>
<?php } //if ?>
<?php } //for?>
<?php if ($pageNum<$totalPages) { ?>
<li>
<a href="index.php?p=search&tukhoa=<?=$tukhoa?>&pageNum=<?=$pageNext?>" > > </a>
</li>
<li>
<a href="index.php?p=search&tukhoa=<?=$tukhoa?>&pageNum=<?=$totalPages?>"> End </a>
</li>
<?php } ?>
</ul>
<?php } ?>