<?session_start();
include("../config.php");

if(isset($_SESSION["username"])){
  $sql_auc = mysql_query("SELECT `stavok`, `tim_end`, `idpk`, `id` FROM `still_aukcion` WHERE `id` = '".intval($_GET["idlot"])."'");
  $row_a = mysql_fetch_assoc($sql_auc);

    $time_end = $row_a["tim_end"] - time();

    if($time_end <= 0){
     $tim = "Аукцион завершен";

    }else{
     $tim =  date("i:s", $time_end);

    }

    $stavok = $row_a["stavok"];

    $sql_pk = mysql_query("SELECT `username` FROM `tb_users` WHERE `id` = '".intval($row_a["idpk"])."'");
    $pk = mysql_fetch_assoc($sql_pk);

    if($_SESSION["username"] != $pk["username"]){
      $pobed = "Лидер аукциона: Жалко но это не Вы";$st = 0;

    }else{
      $pobed = "Лидер аукциона: Вы лидируете";$st = 1;

    }

}

header ("Content-Type: text/xml; charset=windows-1251");

?>
<root<?=$row_a["id"]?>>
  <time<?=$row_a["id"]?>><?=$tim?></time<?=$row_a["id"]?>>
  <stavok<?=$row_a["id"]?>><?=$stavok?></stavok<?=$row_a["id"]?>>
  <pobed<?=$row_a["id"]?>><?=$pobed?></pobed<?=$row_a["id"]?>>
  <bold<?=$row_a["id"]?>><?=$st?></bold<?=$row_a["id"]?>>
</root<?=$row_a["id"]?>>




