View file mobilink_wap/home.php

File size: 6.12Kb
<?php
define('path', dirname(__FILE__));
require path.'/moduls/config.php';
require path.'/moduls/functions.php';
$cid = htmlspecialchars($_GET['cid']);
$cid = $mcr->decode($cid);

$c = explode("::",$cid);
$id = $c[0];
$ps = $c[1];

$error = false;
$select = @Mysql_Query("select * from `users` where `id`='". mysql_escape_string($id) ."'");
if(!mysql_affected_rows()){
    header("location: http://".$site_url."/index.php?err=$ps");
} else {
    $row = @mysql_fetch_array($select);
    if($row['pass']!=$ps){
        header("location: http://".$site_url."/index.php?err=101");
    } elseif($row['banned'] == 1){
        header("location: http://".$site_url."/");
    } else {
        $cid = $mcr->encode($row['id']."::".$row['pass']);
        $takep = "&amp;cid=".$cid;
        //mysql_query("update `users` set `time` = '".time()."' where `id` = '".mysql_escape_string($id)."';");
    }
}

require path.'/moduls/header.php';

$case = trim($_GET['case']);

switch($case){
default:
echo '<div class="title">&#304;lk sehife';
if($row['id']==1)echo ' &#8226; <a href="admin.php?'.$takep.'">&#304;dare paneli</a>';
echo '</div>';

echo '<br />';
echo 'Login: <b>'.$row['login'].'</b><br />';
echo '<br />';
echo 'Reklam balans&#305;: '. sprintf("%01.2f", $row['rek_balance']/100).'$<br/>';
echo 'Sayt qazanc&#305;: '. sprintf("%01.2f", $row['balance']/100).'$<br/>';
echo '<br />';

/*if ($id == 1) {
$select = @mysql_query ("select `id`,`time` from `users` where `id` = '1';");
if (mysql_affected_rows() != 0){
$inf = mysql_fetch_array ($select);
$time = $inf["time"];

if ($time > time() - 300) {
    $status = "<img src=\"img/icon/online.png\" alt=\"ON\"/>";
}else {
    $status = "<img src=\"img/icon/offline.png\" alt=\"OFF\"/>";
}
echo $status.' <a href="home.php?case=support'.$takep.'">Texniki destek</a> (0)<br/>';
echo "<br/>";
}
}*/

echo '<a href="advertisers.php?'.$takep.'">Reklamlar</a><br />';
echo '<i>Sayt&#305;n&#305; reklam et ve istifade&#231;ilerini art&#305;r</i><br />';
echo '<br />';

echo '<a href="sites.php?'.$takep.'">Saytlar</a><br />';
echo '<i>Sayt&#305;ndan real pul qazan</i><br />';
echo '<br />';

echo '<a href="balance.php?'.$takep.'">Balans</a><br />';
echo '<i>Hesaba pul qoymaq ve diger emeliyyatlar</i><br />';
echo '<br />';

echo '<a href="home.php?case=setting'.$takep.'">Qur&#287;ular</a><br />';
echo '<i>&#350;exsi melumatlar&#305;n&#305;z</i><br />';
echo '<br />';
echo '<a href="index.php?action=exit">&#199;&#305;x&#305;&#351;</a><br />';
break;

/*case 'support':
echo '<div class="title">Texniki destek</div>';
echo '<br />';
echo '<form method="post" action="home.php?case=support'.$takep.'">';
echo 'Mesaj&#305;n&#305;z:<br/>';
echo '<textarea name="message" cols="20" rows="3"></textarea><br/>';
echo '<input name="send" value="G&#246;nder" type="submit"/><br/>';
echo '</form>';

if ($_POST['send']) {
    @mysql_query("insert into `support` set
            `usid`='". mysql_escape_string($row['id']) ."',
            `admin`='1',
            `user`='0',
            `message`='". trim(mysql_escape_string($_POST['message'])) ."',
            `time`='". time() ."'
            ");
}

$items = mysql_result(mysql_query("select count(*) from `support` where `usid` = '".$id."'"), 0);
if ($items != 0)echo '<br />';
$query = mysql_query("select * from `support` where `usid` = '".$row['id']."' order by `time` desc;");
while($arr = mysql_fetch_array($query)) {
$message = $arr['message'];
$time = $arr['time'];
$user = $arr['user'];
if ($user == 0) {
$author = $row['login'];
} else {
$author = "Texniki destek";
}
echo "(".date("H:i",$time).") ".$author.":<br />".$message."<br/>";
}
break;*/

case 'setting':
echo '<div class="title">Qur&#287;ular</div>';
echo '<br />';
if(!isset($_POST['ok'])){
echo '<form action="home.php?case=setting'.$takep.'" method="post">';
echo '&#350;ifre:<br />';
echo '<input type="text" name="new_pass" value="'.$row[pass].'"><br />';
echo '<br />';
echo 'Ad, Soyad:<br />';
echo '<input type="text" name="new_names" value="'.$row[names].'"><br />';
echo '<br />';
echo 'Telefon n&#246;mreniz:<br />';
echo '+994 <input format="N*" name="new_mb_number" value="'.$row[number].'"><br />';
echo '<br />';
echo 'E-mail:<br />';
echo '<input type="text" name="new_email" value="'.$row[email].'"><br />';
echo '<br />';
echo '<input type="submit" name="ok" value="Deyi&#351;">';
echo '</form>';
}else{
    $pass = htmlspecialchars($_POST['new_pass']);
    $names = htmlspecialchars($_POST['new_names']);
    $mb_number = htmlspecialchars($_POST['new_mb_number']);
    $mb_number  = ereg_replace(" +"," ",$mb_number);
    $email = htmlspecialchars($_POST['new_email']);
    $email  = ereg_replace(" +"," ",$email);
    $n = explode(',', $names);

    if(empty($pass) || empty($names) || empty($mb_number) || empty($email)){
        $err = "Xanalari tam doldurun..";
    } elseif(empty($n[0])){
        $err = "Ad, Soyad adini duzgun yazin..";
    } elseif(strlen($pass)<=5){
        $err = "Sifre 4 simvoldan az olmamalidir..";
    } elseif(!preg_match("!^[a-z0-9]+$!i",$pass)){
        $err = "&#350;ifrede icazesiz simvollar var..";
    } elseif(!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)){
        $err = "E-mail unvaninizi duzgun yazin..";
    } elseif(strlen($mb_number)<9 || strlen($mb_number)>9){
        $err = "Mobil n&#246;mrenizi d&#252;zg&#252;n yaz&#305;n..";
    }

    if($err){
        echo $err.'<br/>';
    } else {
        @mysql_query("update `users` set
            `pass`='". mysql_escape_string($pass) ."',
            `names`='". mysql_escape_string($names) ."',
            `number`='". mysql_escape_string($mb_number) ."',
            `email`='". mysql_escape_string($email) ."' where id='".$row['id']."'
        ");
        echo 'Melumatlar u&#287;urla deyi&#351;dirildi.<br/>';
        echo '<br/>';
        $cid = $row['id']."::".$pass;
        echo '<a href="home.php?case=setting&amp;cid='.$mcr->encode($cid).'">Geri Qay&#305;t</a><br/>';
    }
}
break;
}

if ($case)echo '<br /><a href="home.php?'.$takep.'">&#304;lk sehife</a><br />';

require path.'/moduls/footer.php';
?>