Вход Регистрация
Файл: public_html/admin/statlinkreq.php
Строк: 80
<? include('checkcookie.php'); ?>
<h3>Заказы статических ссылок</h3>
<br>

<?
if (isset($_GET["id"]))
{
    
$id=$_GET["id"];
    
$option=$_GET["option"];
    
$urlsite=$_POST["urlsite"];
    
$description=$_POST["description"];
    
$wmid=$_POST["wmid"];
    
$lb=$_POST["leftblock"];
    
$plan=$_POST["plan"];
    
$t=time();
    
    
    if (
$option=="approve")
    {
        
$query "INSERT INTO tb_statlinks (url,description,wmid,leftblock,begindate,numdays) VALUES('$urlsite','$description','$wmid','$lb','$t','$plan')";
        
mysql_query($query) or die(mysql_error());

        
$queryz "DELETE FROM tb_statlinksreq WHERE id='$id'";
        
mysql_query($queryz) or die(mysql_error());

        
$sql="select * tb_statlinks order by id asc";
        
$res=mysql_query($sql);

        
$res=mysql_query("select * from tb_comp where param='7'");
        if(
mysql_num_rows($res)>0)
        {
            while(
$row=mysql_fetch_array($res))
            {
                
$id=$row["id"];
                
$lidertype=$row["lidername"];
                
$t=time();
                
$sd=strtotime($row["startdate"]);
                
$ed=strtotime($row["enddate"]);
                if(
$t>$sd && $t<$ed)
                {
                    if(
$lidertype=='0')
                    {
                        
$res1=mysql_query("select username from tb_users where wmid='$wmid'");
                        if(
mysql_num_rows($res1)>0){$res1=mysql_fetch_array($res1); $lidername=$res1["username"];}else{$lidername='';}
                    }else{
                        
$lidername=$wmid;
                    }
                    if(
$lidername!='')
                    {
                        
$res1=mysql_query("select * from tb_compdata where idk='$id' and user='$lidername'");
                        if(
mysql_num_rows($res1)>0)
                        {
                            
$res1=mysql_Fetch_array($res1);
                            
$resvalue=$res1["resvalue"]+$plan;
                            
$purse='';
                            
mysql_query("update tb_compdata set resvalue='$resvalue', purse='$purse' where id='".$res1["id"]."'");
                        }else{
                            
$purse='';
                            
mysql_query("insert into tb_compdata (idk,user,resvalue,purse) values ('$id','$lidername','$plan','$purse')");
                        }
                    }
                }
            }
        }

        echo 
"<font color="red"><b>Статическая ссылка добавлена.</b></font><br><br>";
    }

    if (
$option=="deny")
    {
        
$queryz "DELETE FROM tb_statlinksreq WHERE id='$id'";
        
mysql_query($queryz) or die(mysql_error());

        echo 
"<font color="#ff0000"><b>Заказ ссылки удален.</b></font><br><br>";
    
}
}
?>

<table>
    <tr>
        <th>№</th>
        <th>WMID</th>
        <th>URL сайта</th>
        <th>Текст ссылки</th>
        <th>Дней показа</th>
        <th>Разместить в левом блоке</th>
        <th></th>
        <th></th>
    </tr>
<?
$tabla 
mysql_query("SELECT * FROM tb_statlinksreq ORDER BY id ASC");
while (
$registro mysql_fetch_array($tabla)) {

echo 
"
<tr>
<td>"
$registro["id"] ."</td>
<td>"
$registro["wmid"] ."</td>
<td><a href="". 
$registro["url"] ."" target="_blank">"$registro["url"] ."</a></td>
<td>"
$registro["description"] ."</td>
<td>"
$registro["plan"] ."</td><td>";
if(
$registro["leftblock"]=='1') { echo "Да"; }else{ echo "Нет"; }
echo 
"</td><td>";
?>
<form method="post" action="adminmain.php?p=statlinkreq&id=<?= $registro["id"?>&option=approve">
<input type="hidden" name="urlsite" value="<?= $registro["url"?>">
<input type="hidden" name="description" value="<?= $registro["description"?>">
<input type="hidden" name="wmid" value="<?= $registro["wmid"?>">
<input type="hidden" name="leftblock" value="<?= $registro["leftblock"?>">
<input type="hidden" name="plan" value="<?= $registro["plan"?>">
<input type="submit" value="Добавить" class="button">
</form>
</td><td>
<form method="post" action="adminmain.php?p=statlinkreq&id=<?= $registro["id"?>&option=deny">
<input type="submit" value="Удалить" class="button">
</form>
</td>
</tr>

<?



?>
</table>
Онлайн: 4
Реклама