<?php
@ini_set('display_errors',"0");
@header('Content-type: text/html;charset=windows-1256');
include('functions_hijridate.php');
$yearss= hdate('_D _d _M _Y -h:i A');
$w1="PM";
$w2="مساء";
$w3="AM";
$w4="صباحا";
$yearss = str_replace($w1, $w2, $yearss);
$yearss = str_replace($w3, $w4, $yearss);
//$string = "AM,PM";
//$str = array("AM" => "صباحا");
//$st2 = array("PM" => "مساء");
//$yearss = strtr($string, $str);
echo $yearss;
//require("functions_hijridate.php");
//ArDate.class.php
//hijri.class.php
// Prayer Times Calculator, Sample Usage
// By: Hamid Zarrabi-Zadeh
// Inputs : $method, $year, $latitude, $longitude, $timeZone
extract($_POST,EXTR_PREFIX_ALL,'p');
//extract($_POST['method'];, EXTR_PREFIX_ALL,'p');
//import_request_variables("p");
include('PrayTime.php');
//extract($request);
extract($_POST);
//extract(("p")$post);
extract(('array'),$post);
extract(('array'),$method);
$soo = date('Y');
if (!isset($method) || !isset($year))
list($method, $year, $latitude, $longitude, $timeZone) = array(4,$soo, 24.633333, 46.716667,3);
?>
<html>
<head>
<title>اوقات الصلاة الرياض</title>
</head>
<style>
pre {font-family: courier, serif, size: 10pt; margin: 0px 8px;}
.header { font-family: 'Open Sans', sans-serif; font-weight: 50; letter-spacing: .14em; line-height: 1em; color: #3333; font-style: normal; font-size: 50px; text-transform: uppercase; }
</style>
<body>
<h1></h1>
<form name="form" method="post" action="<?php echo $PHP_SELF ?>">
<div style="padding:10px; background-color: #F8F7F4; border: 1px dashed #EAE9CD;">
Latitude: <input type="text" value="<?php echo $latitude; ?>" name="latitude" size="4">
Longitude: <input type="text" value="<?php echo $longitude;?>" name="longitude" size="4">
Time Zone: <input type="text" value="<?php echo $timeZone;?>" name="timeZone" size="2">
Year: <input type="text" value="<?php echo $year; ?>" name="year" size="4">
<br>
Method:
<select id="method" name="method" size="1" onchange="document.form.submit()">
<option value="0">Shia Ithna-Ashari</option>
<option value="1">University of Islamic Sciences, Karachi</option>
<option value="2">Islamic Society of North America (ISNA)</option>
<option value="3">Muslim World League (MWL)</option>
<option value="4">Umm al-Qura, Makkah</option>
<option value="5">Egyptian General Authority of Survey</option>
<option value="7">Institute of Geophysics, University of Tehran</option>
</select>
<select id="method" name="months">
<?php $months= array("January" => "1",
"February" => "2",
"March" => "3",
"April" => "4",
"May" => "5",
"June" => "6",
"July" => "7",
"August" => "8",
"September" => "9",
"October" => "10",
"November" => "11",
"December" => "12");
foreach ($months as $key => $value) { ?>
<option value="<?php echo $value; ?>">
<?php echo $key; ?>
</option>
<?php } ?> </select> <input type="submit" value="Make Timetable">
</div>
</form>
<pre>
Date arabdate Fajr Sunrise Dhuhr Asr Sunset Maghrib Isha
-------------------------------------------------------------
<?php
/*$prayTime = new PrayTime($method);
$date = strtotime($year. 'm d');
$endDate = strtotime(($year)."+$dd days");
//extract((array)$method);
//extract($method, EXTR_PREFIX_ALL,'p');
//extract((array)$post);
//strtotime(($year+ 1). '-1-1');
while ($date < $endDate)
{
//$times = $prayTime->getPrayerTimes($date, $latitude, $longitude, $timeZone);
$day = hdate('M d _D _j _F', $date);
// print $day. "\t". implode("\t", $times). "\n";
$date += 24*60*60; // next day
}*/
?>
<?php
$inputMonth = $_POST['months'];
$year = $_POST['year'];
$sooo = date('m');
$soooo = date('Y');
if ($inputMonth==""){$inputMonth="$sooo";}else{$inputMonth= $_POST['months'];}
if ($year==""){$year="$soooo";}else{$year= $_POST['year'];}
//$months = preg_replace('1','03',$months);
// if (isset($_GET['month'])){
// $inputMonth=$_GET['month'];
$mkt = mktime(0, 0, 0, $inputMonth, 1, $year);
$date2 = date("$year-m-d", $mkt);
$end2 = $year . "-" . $inputMonth . "-" . date('t', strtotime($date2));
$datess = strtotime("'.$inputMonth.' d $year");
?> <style type="text/css">
table {
width: 80%;
border-collapse: collapse;
}
th, td {
border: 1px solid #1565c0;
padding: 3px;
}
th {
background: #f3f3f3;
}
caption {
padding: 7px;
background: #fafafa;
caption-side: top;
}
</style><table>
<tr>
<?php
/*elseif ($days !== hdate('m d _D _j _F', $mkt)); {
$class = "pre";
}*/
//extract(("p")$post);
while (strtotime($date2) <= strtotime($end2)) {
$times = $prayTime->getPrayerTimes($mkt, $latitude, $longitude, $timeZone);
$days=hdate("$inputMonth d _D _j _F _Y", $mkt);
/*$days = hdate(''.$inputMonth.' d _D _j _F', $mkt);*/
//$class = '';
$datees1=date('d m Y');
$datees='<span class="header">'. $datees.'</span>';
$class = '';
if ($datees1 == hdate("d m Y",$mkt)) {
$days='<font color="red">'. $days.'</font>';
// $class = "header";
} elseif ($datees !== hdate("d m")) {
$class = "current";
}
print $days. "\t". implode("\t",$times). "\n";
$mkt += 24*60*60; // next day
$datees += 24*60*60;
$day_num = date('d', strtotime($date2));
$day_name = date('l', strtotime($date2));
$date2 = date("Y-m-d", strtotime("+1 day", strtotime($date2)));
echo "<td>$day_numm <br/> $day_namme</td>";
}// end while
?>
</tr>
</table>
<?php
// } //end if
?>
</body>
</html>
</pre>
<script type="text/javascript">
var method = <?php echo $method ?>;
document.getElementById('method').selectedIndex = Math.min(method, 6);
</script>
</body>
</html>