Просмотр файла banners.ru/www/admin/newacc.php

Размер файла: 6.47Kb
<?
session_start();
require ('../data/config.php');
require ('../data/mysql.php');
require ('../data/functions.php');
require ('../data/mail.php');
if ($cookie_user<>$admin_login and $cookie_passwd<>$admin_passw)
        {
        header("Location:/index.php?err=falce");
        exit();
        }
$result= mysql_query("SELECT * FROM accounts WHERE status=0 ORDER BY date ASC");
if (mysql_num_rows($result)==0)
        {
        header("Location:index.php");
        exit();
        }

?>
<html>
<head> <meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml" charset="utf-8"/>
<title>Администраторская - <?print "$site_title";?></title>
<?require ('../html/style.php');?>
</head>

<BODY BGCOLOR=#D3DDF4 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<center>
<?require ('../html/up_admin.php');?>
<br><Br>
<?

if ($action=="editaccountyes")
        {
        $result= mysql_query("UPDATE accounts SET
                                name='$name',
                                email='$email',
                                user_login='$user',
                                user_pass='$password',
                                url='$url',
                                host='$host',
                                name_site='$name_site',
                                status='1'
                                WHERE id='$id'");
        $result= mysql_query("INSERT INTO komissia (id_account) VALUES ('$id')");
        $text_mail="  ($name_site)<br><br>
		Vash akkaunt dobavlen, vse OK!
               <br>";
        send_mail($email,"RealBannSystem",$text_mail,$admin_email,$site_title,$http_address);

        for ($i=1;$i<=$view;$i++)
                {
                $result= mysql_query("INSERT INTO view (id_account) VALUES ('$id')");
                }

        print "<br><font color=green><b>изменения внесены</b><br>";

        }

if ($action=="delaccount")
        {
        $result= mysql_query("DELETE FROM accounts WHERE id='$id'");
        $text_mail="
		Vash akkaunt udalen, vozmozhno Vi narushili odno iz pravil!<br><br/>";
        send_mail($email,"RealBannSystem",$text_mail,$admin_email,$site_title,$http_address);

        print "<br><font color=green><b>изменения внесены</b><br>";

        }

        $result= mysql_query("SELECT * FROM accounts WHERE status=0 ORDER BY date ASC");
        $row = mysql_fetch_array($result);
        print "
        <center>
        <TABLE WIDTH=600 BORDER=0 CELLPADDING=2 CELLSPACING=2>
        <form action=$PHP_SELF method=post>
                <tr>
                        <td width=35% align=left valign=top class=p>
                        <b>дата:</td>
                        <td width=65% align=left valign=top class=p>";
                        print date("H:i / d.m.Y",$row[date]);
                        print "
                        </td>
                </tr>

                <tr>
                        <td width=35% align=left valign=top class=p>
                        <b>Ваше имя:</td>
                        <td width=65% align=left valign=top class=p>
                        <input type=text name=name size=40 class=p value=\"$row[name]\"></td>
                </tr>
                <tr>
                        <td align=left valign=top class=p>
                        <b>Ваш e-mail:</td>
                        <td align=left valign=top class=p>
                        <input type=text name=email size=40 class=p value=\"$row[email]\"></td>
                </tr>
                <tr>
                        <td align=left valign=top class=p>
                        <b>Ваш логин:</td>
                        <td align=left valign=top class=p>
                        <input type=text name=user size=40 class=p value=\"$row[user_login]\"></td>
                </tr>
                <tr>
                        <td align=left valign=top class=p>
                        <b>пароль:</td>
                        <td align=left valign=top class=p>
                        <input type=text name=password size=40 class=p value=\"$row[user_pass]\"></td>
                </tr>
                <tr>
                        <td align=left valign=top class=p>
                        <b>Название wap-сайта:</td>
                        <td align=left valign=top class=p>
                        <input type=text name=name_site size=40 class=p value=\"$row[name_site]\"></td>
                </tr>
                <tr>
                        <td align=left valign=top class=p>
                        <b>адрес wap-сайта:</td>
                        <td align=left valign=top class=p>
                        <input type=text name=url size=40 class=p value=\"$row[url]\"><br>
                        <a href=$row[url] target=_blank class=p>$row[url]</a></td>
                </tr>
                <tr>
                        <td align=left valign=top class=p>
                        <b>(!!!) хост:</b></td>
                        <td align=left valign=top class=p>
                        <input type=text name=host size=40 class=p value=\"$row[host]\"><br>
                        пример: <br>
                        http://www.viafree.ru -> viafree.ru<br>
                        http://www.moysite.ru -> moysite.ru</td>
                </tr>
                <tr>
                        <td align=left valign=top class=p>
                        <b>подъемные:</td>
                        <td align=left valign=top class=p>
                        <input type=text name=view size=40 class=p value=\"$bonus\"></td>
                </tr>
                <tr>
                        <td align=left valign=top class=p>
                        <input type=hidden name=id value=$row[id]>
                        <input type=hidden name=action value=editaccountyes></td>
                        <td align=left valign=top class=p><br><br>
                        <input type=submit value=\"изменить и добавить\" class=p></td>
                </tr>
        </form>
        </table>
        <form action=$PHP_SELF>
        <input type=hidden name=id value=$row[id]>
        <input type=hidden name=email size=40 class=p value=\"$row[email]\">
        <input type=hidden name=action value=delaccount>
        <input type=submit value=\"удалить\" class=p></form>

        </center>";
?>
</center>
</body>
</html>