<?
class caesar_sozluk
{
var $sunucu;
var $kullanici;
var $sifre;
var $dbname;
function caesar_sozluk() {
$this->sunucu = 'localhost';
$this->kullanici = '*****';
$this->sifre = '*****';
$this->dbname = '*******';
}
function baglan() {
mysql_connect($this->sunucu,$this->kullanici,$this->sifre);
}
function k_sec() {
mysql_select_db($this->dbname);
}
function sorgu($query) {
$sorgu=mysql_query($query);
return $sorgu;
}
function sayfala() {
$tarih=date("d-m-Y");
$sayfa=$_GET['sayfa'];
if (!$sayfa) {
$sayfa=1;
}
$kontrol=$this->sorgu("select id from tanim where mod='0' and date='$tarih'");
$say=mysql_num_rows($kontrol);
$say2=$kontrol/50;
$say2=ceil($say);
if ($sayfa) {
printf("<center><div class='pagi'>günün ba\$liklari.. ($say ba\$lik)<br>sayfa ");
printf("<a class='but' href='bugun.php?sayfa=$say2'>$say2</a>");
}
printf("<select class='pagis' onchange=\"jm('self',this,0);\" name='sayfa'>");
for ($for=0; $for<=$say2; $for++) {
if ($sayfa==$for) {
$selected = "selected";
}
printf("<option value='bugun.php?sayfa=$for' $selected>$for</option>");
}
printf("<select>");
}
function listele() {
$tarih=date("d-m-Y");
$sayfa=$_GET['sayfa'];
$cumle = "
SELECT
id,
tanim,
(
SELECT count(id)
FROM entryler
WHERE tanim_id = tanim.id and mod = '0' and date='$tarih'
) AS say
FROM konular
WHERE date='$tarih'
ORDER BY date DESC
LIMIT $sayfa,50
";
$sorgu=$this->sorgu($cumle);
while ($oku=mysql_fetch_array($sorgu)) {
$duzen=str_replace(" ","+",$oku['tanim']);
echo "
<TR onmouseover=\"vi('m$oku[id]',true)\" onmouseout=\"vi('m$oku[id]',false)\">
<td>. </td>
<TD width='190'><A href='sozluk.php?process=word&q=$duzen'
target='main' title='$oku[tanim]'>$kayit[tanim]</A> ";
if ($oku['say']>1) {
echo "($oku[say]) ";
}
echo "<span id=\"m$oku[id]\" style=\"visibility:hidden\"><a href='sozluk.php?process=sword&q=$duzen' target='main'>...</a></span>";
echo " </td></tr>";
}
}
}
?>