Создание web-узла по продаже услуг игрокам World Of Warcraft, страница 7

                <td style='font-size: 10pt; background-color:#fbfbfb; border-bottom:1px dashed blue;'>$r[text]</td>

            </tr>           

            ";

        }

        echo "</table><br>";           

    }

    if ($act=="new_reviews")  //просмотр новых отзывов

    {

        if (isset($_GET['accept']))

        {

            $num=$_GET['accept'];

            $q = mysql_query("UPDATE reviews SET moderated=1 WHERE id='$num'");

        }

        if (isset($_GET['delete']))

        {

            $num=$_GET['delete'];

            $q = mysql_query("DELETE FROM reviews WHERE id='$num'");

        }       

        echo "<div class=ord_text>";

        $q = mysql_query("SELECT * FROM reviews WHERE (moderated='0') ORDER BY date DESC");

        echo "<table width=80% align=center border=0 cellpadding=1 cellspacing=2 style='border:1px solid #4f9fa8;'>";

        while($r = mysql_fetch_array($q))

        {

            echo"

            <tr>

                <td style='font-size: 10pt; background-color:#f1f1f1'>$r[date]</td>

                <td width=100 style='border: 1px dotted black;' rowspan=3 align=center>

                    <a href='index.php?act=new_reviews&accept=". $r[id] ." ' class=main_lnk>добавить</td>

                <td width=100 style='border: 1px dotted black;' rowspan=3 align=center>

                    <a href='index.php?act=new_reviews&delete=". $r[id] ." ' class=main_lnk>удалить</td>

            </tr>

            <tr>

                <td style='background-color:#ecf6f5'>$r[text]</td>

            </tr>

            <tr>

                <td align=right style='font-size: 10pt; background-color:#fbfbfb; border-bottom:1px dashed blue;'><a class=main_lnk href=\"mailto:$r[mail]\">$r[name]</a></td>

            </tr>

            ";

        }

        echo "</table><br>";   

    }

    if ($act=="add_reviews")  //добавление отзывов

    {

        if (isset($_GET['part']))

        {

            if ($_GET['part']==2)

            {

                $name = strip_tags(stripslashes(substr($_POST['data']['0'],0,20)));

                $mail = strip_tags(stripslashes(substr($_POST['data']['1'],0,30)));

                $text = strip_tags(stripslashes(substr($_POST['data']['2'],0,300)));

                $date = strip_tags(stripslashes(substr($_POST['data']['3'],0,20)));

                if($_POST['add'] != '') {

                    if($name != '') {

                            if($text != '') {

                //$tek_date=date( 'l d F', time());

                $query = "INSERT INTO reviews (name,mail,date,text,moderated) VALUES ('$name','$mail','$date','$text','1')";

                if(mysql_query($query)) { echo "Запись добавлена <br><br>";}

                 else {echo "Ошибка записи";};

                 }

                 else {echo "Введите коментарий";}

                 }

                 else {

                 echo "Введите имя";           

                }

            }

            }

        }

        echo    "    <form action='index.php?act=add_reviews&part=2' method=POST>

        <input type=hidden name=ordersend value=true>

        <table align=center valign=bottom width=500 cellpadding=0 cellspacing=2 style='border: 2px dotted #93969f; background-color: #f3f5f9; font-size:11pt;'>

            <tr>

                <td width=200 weight=35>Имя:</td>

                <td width=250><input type=text name=data[0]></td>

            </tr>

            <tr valign=middle>

                <td width=150 height=25>E-mail:</td>

                <td width=250><input type=text name=data[1]></td>

            </tr>

            <tr>