Thursday, 12 September 2013

get the id in div refresh

get the id in div refresh

I need to know how can I catch or get the id of the user in the page of
the refreshed div, I need to show only the data of user in his page and
not the data of all..
here is the data in honorario.php
<?php include('loader.php'); ?>
<?php include_once("configs.php"); ?>
<table class="table table-striped">
<thead>
<tr>
<th><?php $translate->__('Date'); ?></th>
<th><?php $translate->__('Income'); ?></th>
</tr>
</thead>
<tbody>
<?php
$sql = $conn->prepare("SELECT id, DATE_FORMAT(start, '%d %M %Y') AS start,
honorario FROM COMPRAS WHERE id_user=$_GET[id_user] order by start ASC");
$sql->execute();
while($row = $sql->fetch(PDO::FETCH_ASSOC)) {
?>
<tr>
<td><?php echo $row['start']; ?></td>
<td><span class="add-on">$ </span><?php echo $row['honorario']; ?><span
class="add-on">.00</span></td>
</tr><?php } ?>
</tbody>
</table>
This is the div in the page for each user:
<div class="box-content" id="honorario"></div>
and here is the script
<script type="text/javascript">
setInterval(function() {
$.get('includes/honorario.php', function(data) {
$('#honorario').html(data);
});
}, 1000);
</script>
the problem is the $_GET[id_user] not works in honorario.php and I don't
know how can I catch it

No comments:

Post a Comment