<?php
include('../config.php');
set_time_limit(0);
//$dataFileName = 'data.txt';
while ( true )
{
$row = $db->get_row("SELECT * FROM `test` WHERE `id` = 6");
$requestedTimestamp = isset ( $_GET [ 'timestamp' ] ) ? (int)$_GET [ 'timestamp' ] : null;
clearstatcache();
$modifiedAt = $row->laiks;
if ( $requestedTimestamp == null || $modifiedAt > $requestedTimestamp )
{
$image_name = basename($row->foto).PHP_EOL;
//$row2 = $db->get_row("SELECT * FROM `forums_user` WHERE `card_id` = '$row->name'");
//$data = '
//<div style="background:#343642;width:100%;height:100vh;color:#fff;">
// <center>
// <h1>'.$row2->vards.' '. $row2->uzvards.'</h1>
// <center>
// <img style="width:50%;"src="image.php/'. $image_name .'?width=300&height=300&cropratio=4:5&image=/'. $row2->foto.'" />
// </center><br/><br/>
// '. $row2->sia .' <br/>
// '. $row2->amats.'<br/>
// </center>
//
// </div>
//';
$id = $row->name;
$row2 = $db->get_row("SELECT * FROM `forums_user` WHERE `card_id` = '$id'");
$image_name = basename($row2->foto).PHP_EOL;
$dati = '<h1>'.$row2->vards.' '. $row2->uzvards.'</h1>
<br/>
<img src="image.php/'. $image_name .'?width=300&height=300&cropratio=4:5&image=/'. $row2->foto.'" />
<br/><br/>
'. $row2->sia .' <br/>
'. $row2->amats.'<br/>
'.$id.';
';
$arrData = array(
'content' => $dati,
'timestamp' => $modifiedAt
);
$json = json_encode( $arrData );
echo $json;
break;
}
else
{
sleep( 1 );
continue;
}
}
?>