<?php
include "/config.php";
//Set the page size
$StartRow = 0;
$PageSize = 100;
//Set the page no
if(empty($_GET['PageNo'])){
if($StartRow == 0){
$PageNo = $StartRow + 1;
}
}else{
$PageNo = $_GET['PageNo'];
$StartRow = ($PageNo - 1) * $PageSize;
}
//Set the counter start
if($PageNo % $PageSize == 0){
$CounterStart = $PageNo - ($PageSize - 1);
}else{
$CounterStart = $PageNo - ($PageNo % $PageSize) + 1;
}
//Counter End
$CounterEnd = $CounterStart + ($PageSize - 1);
?>
<html>
<head>
<title>BGinfo</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<style type="text/css">
BODY {
FONT-SIZE: 8pt; COLOR: #526ba5; FONT-FAMILY: Arial
BACKGROUND-COLOR: #000000
}
H3 {
COLOR: #526ba5
}
H4 {
COLOR: #526ba5
}
.Issue {
BACKGROUND-COLOR: #11111
}
.NormalField {
FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Verdana;BACKGROUND-COLOR: #ffffff
}
.NormalFieldTwo {
FONT-SIZE: 7pt;
FONT-FAMILY: Verdana;
background : #E4E4E4;
font-weight : bold
}
.NormalFieldThree {
FONT-SIZE: 10pt;
COLOR: Yellow;
FONT-FAMILY: Verdana;
background : #0C79B4;
font-weight : bold;
text-align : center;
}
.NormalFieldFour {
FONT-SIZE: 10pt;
COLOR: Yellow;
FONT-FAMILY: Verdana;
background : Black;
font-weight : bold;
text-align : center;
}
.NormalFieldFive {
FONT-WEIGHT: bold;
FONT-SIZE: 10pt;
COLOR: Navy;
FONT-FAMILY: Verdana;
BACKGROUND-COLOR: #ffffff
}
.NormalFieldSix {
FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #526ba5; FONT-FAMILY: Arial
}
.TableText {
FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Arial
}
.TableBorder{
border-color : #00000;
}
.NormalTable {
BACKGROUND-COLOR: #ffffff
}
.NormalTableTwo {
BACKGROUND-COLOR: #eeeeee
}
.UsePageBG {
BACKGROUND-COLOR: #cccccc
}
.UseTableBG {
BACKGROUND-COLOR: #526ba5
}
.UseDialogBG {
BACKGROUND-IMAGE: url(../Graphics/Images/DialogBackGround.gif)
}
.ReadOnlyField {
FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #526000; FONT-FAMILY: Arial
}
.InternalHeader {
FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #ffffff; FONT-FAMILY: Arial; BACKGROUND-COLOR: #526ba5;
}
.AttachedFiles {
BACKGROUND-COLOR: #00000;
color : #00000
}
.SpecialAnchor {
FONT-FAMILY: Arial; TEXT-DECORATION: none
}
UNKNOWN {
FONT-WEIGHT: lighter; FONT-SIZE: 8pt; TEXT-TRANSFORM: capitalize; COLOR: navy; FONT-STYLE: normal; FONT-FAMILY: 'Arial', Times New Roman, Verdana; FONT-VARIANT: normal; TEXT-DECORATION: underline
}
.SearchResults {
FONT-WEIGHT: normal; FONT-SIZE: 8pt; COLOR: #000000; FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}
.MandatoryFields {
FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: #ff0000; FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}
.tab-above-heading {
FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #000000; FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}
.textareaLabel {
FONT-WEIGHT: bolder; FONT-SIZE: 10pt; COLOR: #526ba5; FONT-FAMILY: Arial
}
.linkStyle {
TEXT-DECORATION: none
}
.PageTitle {
FONT-WEIGHT: bold; FONT-SIZE: 16pt; COLOR: #526ba5; FONT-FAMILY: Tahoma
}
.smallfont {
FONT-SIZE: 7.5pt; COLOR: #000000; FONT-FAMILY: Arial
}
A {
COLOR: Red;
TEXT-DECORATION: none
}
#nav {
background-color: #D5D5D5;
border: 1px solid #B8B8B8;
padding-top: 8px;
height: 21px;
padding-left: 3px;
}
#nav a {
border: 1px solid #B7B7B7;
padding: 4px;
background-color: #F3F3F3;
color: #0077B4;
font-weight: bold;
text-decoration: none;
font-family: Verdana, Sans-Serif;
font-size: 12px;
}
#nav a:hover {
color: #00A8FF;
background-color: #00000;
border: 1px solid #727272;
border-bottom: 1px solid #ffffff;
}
</style>
</head>
<body class="UsePageBg">
<form method="GET" action="">
<table cellpadding="0" cellspacing="0" width="300px" align="center" cellpadding="0" >
<input type="text" name="q" size="25">
<tr>
<td align="right" width="200px"> </td>
<td align="right" width="100px"><input type="submit" value="Òúðñåíå"></td>
</tr>
</table>
</form>
<?php
$tarsene = $_GET['q'];
if($_GET['q'])
{
$trimmed = trim($tarsene);
$var = explode(" ",$trimmed);
$count = count($var);
for($i = $count-1;$i < sizeof($var); $i++) {
$abc = $var[$i];
mysql_connect($server, $dbusername, $dbpassword)or die("Ñàéòúò íå ìîæå äà ñå ñâúðæå êúì áàçàòà äàííè");
@mysql_select_db($db_name) or die("Ãðåøíà áàçà äàííè");
$TRecord = mysql_query("SELECT * FROM `linkove` WHERE `files` LIKE '%$abc%'");
$result = mysql_query("SELECT * FROM `linkove` WHERE `files` LIKE '%$abc%' ORDER BY `id` DESC LIMIT $StartRow,$PageSize");
//Total of record
$RecordCount = mysql_num_rows($TRecord);
//Set Maximum Page
$MaxPage = $RecordCount % $PageSize;
if($RecordCount % $PageSize == 0){
$MaxPage = $RecordCount / $PageSize;
}else{
$MaxPage = ceil($RecordCount / $PageSize);
}
?>
<table width="100%" border="0" class="InternalHeader">
<tr>
<td width="24%"></td>
<td width="76%">
<div align="right">
<?php print "$RecordCount çàïèñ(à) íàìåðåí(è) - Âèå ñòå íà ñòðàíèöà $PageNo îò $MaxPage" ?></div>
</td>
</tr>
</table>
<br>
<table width="100%" border="0" class="NormalTableTwo">
<tr>
<td class="InternalHeader" width="5%">Íîìåð</td>
<td class="InternalHeader" width="60%">Èìå</td>
<td class="InternalHeader" width="20%">Òèï</td>
<td class="InternalHeader" width="15%">Äîáàâåí</td>
</tr>
<?php
$i = 1;
while($row = mysql_fetch_array($result))
{
$id=$row[id];
$data=$row[data];
$fulllinks=$row[fulllinks];
$files=$row[files];
$tipfail=$row[tipfail];
$bil = $i + ($PageNo-1)*$PageSize;
?>
<tr>
<td class="NormalFieldTwo" width="5%"><?php echo $bil ?></td>
<td class="NormalFieldTwo" width="60%"><a href="s.php?id=<?php echo $id; ?>" target="_new"><?php echo $files ?></a></td>
<td class="NormalFieldTwo" width="20%"><?php echo $tipfail ?></td>
<td class="NormalFieldTwo" width="15%"><?php echo $data ?></td>
</tr>
<?php
$i++;
}?>
</table><br>
<table width="100%" border="0" class="InternalHeader">
<tr>
<td>
<div align="center">
<?php
//Print First & Previous Link is necessary
if($CounterStart != 1){
$PrevStart = $CounterStart - 1;
print "<a href=?q=$tarsene&PageNo=1>Ïúðâè </a>: ";
print "<a href=?q=$tarsene&PageNo=$PrevStart>Ïðåäèøíè $PageSize </a>";
}
print " [ ";
$c = 0;
//Print Page No
for($c=$CounterStart;$c<=$CounterEnd;$c++){
if($c < $MaxPage){
if($c == $PageNo){
if($c % $PageSize == 0){
print "$c ";
}else{
print "$c ,";
}
}elseif($c % $PageSize == 0){
echo "<a href=?q=$tarsene&PageNo=$c>$c</a> ";
}else{
echo "<a href=?q=$tarsene&PageNo=$c>$c</a> ,";
}//END IF
}else{
if($PageNo == $MaxPage){
print "$c ";
break;
}else{
echo "<a href=?q=$tarsene&PageNo=$c>$c</a> ";
break;
}//END IF
}//END IF
}//NEXT
echo "] ";
if($CounterEnd < $MaxPage){
$NextPage = $CounterEnd + 1;
echo "<a href=?q=$tarsene&PageNo=$NextPage>Ñëåäâàùè $PageSize</a>";
}
//Print Last link if necessary
if($CounterEnd < $MaxPage){
$LastRec = $RecordCount % $PageSize;
if($LastRec == 0){
$LastStartRecord = $RecordCount - $PageSize;
}
else{
$LastStartRecord = $RecordCount - $LastRec;
}
print " : ";
echo "<a href=?q=$tarsene&PageNo=$MaxPage>Ïîñëåäíè</a>";
}
?>
</div>
</td>
</tr>
</table>
<?php
mysql_free_result($result);
mysql_free_result($TRecord);
}}
?>
</body>
</html>