<?
date_default_timezone_set('Asia/Karachi'); 
error_reporting (E_ALL ^ E_NOTICE);

//newspaper information
$newspaper = "Daily Ghaznavi  ";
$meta = "Leading Urdu Newspaper of Rawalpindi, Lahore, Peshawar of Pakistan";
$editions = array("rawalpindi","lahore","peshawar");
//newspaper information end


//redirect function start
function redirect($url)
{
    if (!headers_sent())
    {    
        header('Location: '.$url);
        exit;
        }
    else
        {  
        echo '<script type="text/javascript">';
        echo 'window.location.href="'.$url.'";';
        echo '</script>';
        echo '<noscript>';
        echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
        echo '</noscript>'; exit;
    }
}
//redirect function end



//epaper start

function epaper()
{

if(isset($_GET['id']) && isset($_GET['dt'])&& file_exists('../assets/'.$_GET['edition'].'/'.$_GET['dt'].'/'.$_GET['id'].'.jpg')) //if the GET variable page and id is set and they exist in a folder with the same name as the id and a file with the same name as the GET page variable.
{
	
	


$filename = "../assets/".(''.$_GET['edition'].'/'.$_GET['dt'].'/'.$_GET['id'].'.jpg');

if (file_exists($filename)) {
   
  $file= "../assets/".(''.$_GET['edition'].'/'.$_GET['dt'].'/'.$_GET['id'].'.jpg');//we include it
echo "<img src=$file width='995' border=0 id='512' align='center' class='map' usemap='#FPMap0'>";	

} 
else
{


$filename = "../assets/".(''.$_GET['edition'].'/'.$_GET['dt'].'/'.$_GET['id'].'.JPG');

if (file_exists($filename)) {
   
  $file= "../assets/".(''.$_GET['edition'].'/'.$_GET['dt'].'/'.$_GET['id'].'.JPG');//we include it
echo "<img src=$file border=0 id='512' align='center' class='map' usemap='#FPMap0'>";	

} 
}






}
else //otherwise we
{
	
	
echo "
<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
  <tr>
    <td width=\"755\"><p align=\"center\"><br><br><br><img src=\"images/18.png\" width=\"400\" height=\"122\" /></p>
      <table width=\"461\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
        <tr>
          <td><div align=\"center\"><script type=\"text/javascript\">
<!--
function delayer(){
    window.location = \"index.php\"
}
//-->
</script>

<body onLoad=\"setTimeout('delayer()', 2500)\">
<h2 class=\"redirect\"><img src=\"images/gif/redirect.gif\" width=\"484\" height=\"60\" /></h2>

          </div></td>
        </tr>
      </table>
     
    </td>
  </tr>
</table>";


}

}
//epaper end



?>