<?php
  include_once('conn.php');
  include_once('smarty.php');
  include_once('page.class.php');
  $newsQuery="select * from news order by newsId desc ";
  $url="admin.php?act=viewNews&";
  $pagesize=10;
  if(!isset($_GET['page'])||$_GET['page']==null){
  	$page=1;
  }else{
  	$page=$_GET['page'];
  }
  $pager=new page($newsQuery,$pagesize,$url,$page,$conn);
  $smarty->assign('row',$pager->getPage());
  $smarty->assign('pageBar',$pager->pageBar());
  $smarty->display('viewNews.html');
?>