$('.buy').click(function(){
price = $(this).data('price'),
product = $(this).data('product'),
photo = $(this).data('photo'),
vibor = $(this).data('vibor');
price_check = $(this).data('price');
$('#price').val(price);
$('#product').val(product);
$('#photo').val(photo);
$('#vibor').val(vibor);
$('#cart').modal();
$sm_read = file("templates/events.php");
$sm_read = implode("",$sm_read);
preg_match("/\[_while\](.*?)\[_while\]/s",$sm_read,$tamp_while);
$result_index = mysql_query("SELECT * FROM events ORDER BY id DESC");
$myrow_index = mysql_fetch_array($result_index);
if($myrow_index != ""){
do
{
$copy_tamp = $tamp_while[1];
$copy_tamp = str_replace("[_id]",$myrow_index[id],$copy_tamp);
$copy_tamp = str_replace("[_admin]",$myrow_index[admin],$copy_tamp);
$copy_tamp = str_replace("[_page]",$myrow_index[page],$copy_tamp);
$copy_tamp = str_replace("[_event]",$myrow_index[event],$copy_tamp);
$copy_tamp = str_replace("[_date]",$myrow_index[date],$copy_tamp);
$list .= $copy_tamp;
}
while($myrow_index = mysql_fetch_array($result_index));
}
else $news = "<p align='center'>Нет записей в базе данных</p>";
$sm_read = preg_replace("/\[_while\].*?\[_while\]/s",$list,$sm_read);
return $sm_read;
}
<table align="center">
<tr>
<th height="30px" valign="top" style="font-weight:bold;font-size: 16px;text-align: center;">Администратор</th>
<th height="30px" valign="top" style="font-weight:bold;font-size: 16px;text-align: center;">Страница с действием</th>
<th height="30px" valign="top" style="font-weight:bold;font-size: 16px;text-align: center;">Действие администратора</th>
<th height="30px" valign="top" style="font-weight:bold;font-size: 16px;text-align: center;">Дата и время</th>
</tr>
[_while]
<tr>
<td height="30px" valign="top" style="font-size: 14px;text-align: center;">[_admin]</td>
<td height="30px" valign="top" style="font-size: 14px;text-align: center;"><a href="[_page]">[_page]</a></td>
<td height="30px" valign="top" style="font-size: 14px;text-align: center;">[_event]</td>
<td height="30px" valign="top" style="font-size: 14px;text-align: center;">[_date]</td>
</tr>
[_while]
</table>
<ul>
<?php if($pageNum > 1) { ?>
<li><a href="/index.php?page=events&page_ev="><<</a></li>
<li><a href="/index.php?page=events&page_ev=<?=$pageNum-1;?>"><</a></li>
<?php } ?>
<?php for($i = 1; $i<=$lastPage; $i++) { ?>
<li <?=($i == $pageNum) ? 'class="current"' : '';?>> <a href="/index.php?page=events&page_ev=<?=$i;?>"><?=$i;?></a> </li>
<?php } ?>
<?php if($pageNum < $lastPage) { ?>
<li><a href="/index.php?page=events&page_ev=<?=$pageNum+1;?>">></a></li>
<li><a href="/index.php?page=events&page_ev=<?=$lastPage;?>">>></a></li>
<?php } ?>
</ul>