Файл: template/func/status.php
Строк: 15
<?
function status($log)
{
    global $id;
    if($log!="")
    {$ank=$log;}
    else
    {$ank=$id;}
    if(mysql_query("select * from `prof` where `id`='$ank'"))
    {
        
        if(isset($_POST['st']))
        {
            mysql_query("update `prof` set `status`='".$_POST['st']."' where `id`='$id'");
        }
        
        $st = mysql_fetch_array(mysql_query("select * from `prof` where `id`='$ank'")) or die(mysql_error());
        if(isset($_GET['st']))
        {
        ?>
                <form action="?" class="oneline qsearch" method="post">
                    <table>
                        <tr>
                            <td width="100%">
                                <div class="iwrap">
                                    <input id="qsearch_fld" type="text" class="text" name="st" value="" placeholder="Введите новый статус..">
                                </div>
                            </td>
                            <td class="last">
                                <input id="qsearch_btn" class="btn" type="submit" value="Обновить" />
                            </td>
                        </tr>
                    </table>
                </form>
        <?
        }
        else
        {
            if($st[status]=="")
            {
                if($st[id]==$id){echo'<p><a href="/?st">Статус</a><p>';}
            }
            else
            {
                if($st[id]==$id){echo'<p><a href="?st">'.check($st[status]).'</a><p>';}else{echo'<p>'.check($st[status]).'<p>';}
            }
        }
    }
}
?>