Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

new ui thanks to @somaiagabr. expose method in ui.

  • Loading branch information...
commit a17ae0d1683bc3b9c52cfbe9d5974a0778fa2f03 1 parent a44a80c
@ahmedre ahmedre authored
View
5 index.php
@@ -36,13 +36,14 @@
if ($ajax) include 'views/locsearch.inc';
else include 'views/main.inc';
}
- else showSalatTimes($data['location'], $data['data'], $format, $ajax);
+ else showSalatTimes($data['location'], $data['data'],
+ $format, $method, $ajax);
return;
}
else if ($ajax) return;
else include 'views/main.inc';
-function showSalatTimes($location, $pt, $format, $ajax = true){
+function showSalatTimes($location, $pt, $format, $method, $ajax = true){
global $q; // don't like this, but...
$data = array();
View
52 style.css
@@ -4,8 +4,8 @@ body {
height: 100%;
}
-a { color: #369; outline: none; }
-a:hover { color: #09F; }
+a { color: #000000; outline: none; }
+a:hover { color: #1a6abb; }
a img { border: 0; }
#main { width: 550px; margin: 0 auto; padding-top: 20px; text-align: center;}
@@ -16,26 +16,33 @@ a img { border: 0; }
#calculating { position: absolute; width: 220px; left: 50%; margin: 15px 0 0 -110px; }
#prayertimes { padding-top: 15px;}
+.changelink { font-size:12px;
+ font-family:Lucida Sans Unicode,Lucida Grande,Arial,sans-serif;
+ color:#4682B4; text-decoration:underline; cursor:pointer }
+#methodbox { display: none; }
+
dl { width: 200px; margin: 0 auto; padding-top: 10px; }
dt { width: 90px; margin: 0 10px 0 0; float: left; text-align: right; font-weight: bold; color: #4682B4; }
dd { width: 90px; margin: 0 10px 0 0; float: left; text-align: left; }
.toplinks { text-align: right; }
.searchdesc { font-size: 80%; color: #565656; font-family: verdana;
- margin-top: 5px; margin-bottom: 10px; }
+ margin-top: 15px; margin-bottom: 10px; }
-#footer { margin-top: 40px; color: #999; }
-#footer a { color: #666; text-decoration: none; margin: 0 5px;}
-#footer a:hover { color: #333; text-decoration: underline; }
+#footer { margin-top: 15px; color: #de6e0b; text-align:right; padding-right:25px }
+#footer a { color: #de6e0b; text-decoration: none; margin: 0 5px;}
+#footer a:hover { color:#4682B4; text-decoration: none; }
+#footer span { color: #4682B4; text-decoration: none; }
#toolbar {
- height: 18px;
+ height: 12px;
font-size: 12px;
font-family: Arial;
- padding-top: 2px;
+ padding: 12px 0;
width: 100%;
line-height: normal;
- border-bottom: 1px #c9d7f1 solid;
+ color:#000000;
+ background-color:#f9d9a4;
}
#toolbarLeft {
@@ -43,7 +50,7 @@ dd { width: 90px; margin: 0 10px 0 0; float: left; text-align: left; }
padding-left: 8px;
}
#toolbarRight {
- color: #999;
+ color: #000000;
float: right;
padding-right: 8px;
}
@@ -51,16 +58,33 @@ dd { width: 90px; margin: 0 10px 0 0; float: left; text-align: left; }
#toolbarRight a {
text-decoration: none;
padding:0 3px;
- color: #369;
+ color: #000000;
}
#toolbarRight a:hover {
- text-decoration: underline;
- color: #09f;
+ text-decoration: none;
+ color: #1a6abb;
}
#toolbarRight span {
- color: #000;
+ color: #1a6abb;
font-weight: bold;
padding: 0 3px;
}
+
+/*-- for redesign--*/
+.zipcode{
+ border:1px solid #e57818;
+ padding:3.5px}
+
+.search{
+ padding:3px 20px;
+ background-color:#f9d9a4;
+ border:1px solid #e57818;
+ cursor:pointer}
+
+.search:hover {
+ padding:3px 20px;
+ background-color:#f09a11;
+ border:1px solid #e57818;
+ cursor:pointer}
View
6 views/about.inc
@@ -1,7 +1,5 @@
-<?php include 'views/header.inc'; ?>
+<?php $isAbout = true; include 'views/header.inc'; ?>
based on the <a href="http://www.arabeyes.org" target="_blank">arabeyes</a> <a href="http://www.arabeyes.org/project.php?proj=ITL" target="_blank">itl library</a>.
the prayer times are calculated using the <a href="http://svn.arabeyes.org/viewvc/projects/itl/ports/php/" target="_blank">itl php extension</a>.
-<br>
-logo made using the <a href="http://creatr.cc/creatr">web2.0 logo creatr</a>.
-<?php include 'views/footer.inc'; ?>
+<?php include 'views/footer.inc'; ?>
View
7 views/footer.inc
@@ -1,11 +1,6 @@
-<div id="footer">
- <a href="/">home</a> |
- <a href="/about">about</a> |
- <a href="http://github.com/islam-dev/waqt.org" target="_blank">github</a> |
- <a href='ma&#105;l&#116;o&#58;mus%6C&#105;&#109;&#97;d&#109;i%6E&#64;gmail&#46;&#99;om'>contact</a>
</div>
+<div style="padding:40px;"></div>
-</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
View
6 views/header.inc
@@ -12,5 +12,9 @@
</head>
<body>
+<?php // $toolbar_make_conn = true; include "toolbar.inc"; ?>
+<div style="height:3px">&nbsp;</div>
+<div style="height:1px; background-color:#ef9a10">&nbsp;</div>
+<?php include 'views/nav.inc'; ?>
<div id="main">
-<a id="logo" href="/"><img src="imgs/waqt.png" border="0"></a>
+<div style="padding-top:10px;padding-bottom:40px"><a id="logo" href="/"><img src="imgs/waqt.jpg" border="0" ></a></div>
View
141 views/main.inc
@@ -1,62 +1,79 @@
-<?php include 'views/header.inc'; ?>
-<script type="text/javascript" src="prototype.lite.js"></script>
-<script type="text/javascript" src="moo.ajax.js"></script>
-<form name="ptform" action="javascript:void(0);" onsubmit="javascript:handleSubmit();">
- <input type="text" id="location" value="<?php echo $q; ?>">
- <input type="submit" value="Search">
- <div class="searchdesc">to get prayertimes, type in a zipcode, postal code, city, city and state, country, or address.</div>
-</form>
-<div id="calculating"></div>
-<div id="prayertimes">
-<?php
-if ((isset($search_results)) && (!is_null($search_results)))
- include 'views/locsearch.inc';
- else if (!is_null($data)) include 'views/salatimes.inc';
-?>
-</div>
-
-<script type="text/javascript">
-<!--
- function init(){
- $('location').focus();
- var input = document.ptform.location.value;
- if (input.length==0){
- if (navigator.geolocation){
- navigator.geolocation.getCurrentPosition(function(position) {
- document.ptform.location.value =
- "loc:" + position.coords.latitude + "," +
- position.coords.longitude;
- handleSubmit();
- });
- }
- }
- }
-
- function clearCalculating(){
- $('calculating').innerHTML = '';
- }
-
- function handleSubmit(){
- $('calculating').innerHTML = '<img src="/imgs/loading.gif">';
- $('prayertimes').innerHTML = '';
- var input = document.ptform.location.value;
- if (input.length==0){
- $('calculating').innerHTML = '';
- return false;
- }
-
- new ajax('calculate.php?ajax=1&q=' + input,
- { update: $('prayertimes'),
- method: 'get',
- onComplete: clearCalculating });
- }
-
- function manualLocation(loc){
- document.ptform.location.value = loc;
- handleSubmit();
- }
-
- init();
--->
-</script>
-<?php include 'views/footer.inc'; ?>
+<?php include 'views/header.inc'; ?>
+<script type="text/javascript" src="prototype.lite.js"></script>
+<script type="text/javascript" src="moo.ajax.js"></script>
+
+<form name="ptform" action="javascript:void(0);" onsubmit="javascript:handleSubmit();">
+ <input class="zipcode" type="text" size="35" id="location" value="<?php echo $q; ?>">
+ <input class="method" type="hidden" id="method">
+ <input class="search" type="submit" value="Search">
+</form>
+<div class="searchdesc">to get prayertimes, type in a zipcode, postal code, city, city and state, country, or address.</div>
+<div id="calculating"></div>
+<div id="prayertimes">
+<?php
+if ((isset($search_results)) && (!is_null($search_results)))
+ include 'views/locsearch.inc';
+ else if (!is_null($data)) include 'views/salatimes.inc';
+?>
+</div>
+
+<script type="text/javascript">
+<!--
+ function init(){
+ $('location').focus();
+ var input = document.ptform.location.value;
+ if (input.length==0){
+ if (navigator.geolocation){
+ navigator.geolocation.getCurrentPosition(function(position) {
+ document.ptform.location.value =
+ "loc:" + position.coords.latitude + "," +
+ position.coords.longitude;
+ handleSubmit();
+ });
+ }
+ }
+ }
+
+ function clearCalculating(){
+ $('calculating').innerHTML = '';
+ }
+
+ function handleSubmit(){
+ $('calculating').innerHTML = '<img src="/imgs/loading.gif">';
+ $('prayertimes').innerHTML = '';
+ var input = document.ptform.location.value;
+ if (input.length==0){
+ $('calculating').innerHTML = '';
+ return false;
+ }
+
+ methodParam = '';
+ var method = document.ptform.method.value;
+ if (input.length > 0)
+ methodParam = '&method=' + method;
+
+ new ajax('calculate.php?ajax=1' + methodParam + '&q=' + input,
+ { update: $('prayertimes'),
+ method: 'get',
+ onComplete: clearCalculating });
+ }
+
+ function manualLocation(loc){
+ document.ptform.location.value = loc;
+ handleSubmit();
+ }
+
+ function toggleMethodBox(){
+ $('methodbox').style.display = 'block';
+ }
+
+ function changeMethod(selector){
+ method = selector.options[selector.options.selectedIndex];
+ document.ptform.method.value = method.value;
+ handleSubmit();
+ }
+
+ init();
+-->
+</script>
+<?php include 'views/footer.inc'; ?>
View
64 views/salatimes.inc
@@ -1,16 +1,48 @@
-<?php
- $param = "q=$location";
-
- print <<<SALATHTML_HEADER
- <div class="times-header">Prayer times for: $location
- <a href="/rss?$param"><img src="imgs/feedicon.png"></a>
- </div>
- <dl>
-SALATHTML_HEADER;
-
- foreach ($data as $val => $time){
- print "<dt>$val: </dt> " .
- "<dd>$time</dd>\n";
- }
-
- print '<div class="clear"></div></dl>';
+<?php
+ $param = "q=$location&method=$method";
+
+ print <<<SALATHTML_HEADER
+ <div class="times-header">Prayer times for: $location
+ <a href="/rss?$param"><img src="imgs/feedicon.png"></a>
+ </div>
+ <dl>
+SALATHTML_HEADER;
+
+ foreach ($data as $val => $time){
+ print "<dt>$val: </dt> " .
+ "<dd>$time</dd>\n";
+ }
+
+ /* methods
+ || 1 || Egyptian General Authority of Survey ||
+ || 2 || University of Islamic Sciences, Karachi (Shaf'i) ||
+ || 3 || University of Islamic Sciences, Karachi (Hanafi) ||
+ || 4 || Islamic Society of North America ||
+ || 5 || Muslim World League (MWL) ||
+ || 6 || Umm Al-Qurra (Saudi Arabia ||
+ || 7 || Fixed Isha Interval (always 90) ||
+ */
+
+ $methods = array(1 => 'Egyptian General Authority of Survey',
+ 2 => 'University of Islamic Sciences, Karachi (Shaf\'i)',
+ 3 => 'University of Islamic Sciences, Karachi (Hanafi)',
+ 4 => 'Islamic Society of North America',
+ 5 => 'Muslim World League (MWL)',
+ 6 => 'Umm Al-Qurra (Saudi Arabia)',
+ 7 => 'Fixed Isha Interval (always 90)');
+
+ $methname = $methods[$method];
+ print '<div class="clear"></div></dl>';
+ print "<div class=\"searchdesc\"> <b>Calculation Method:</b> $methname (<a class=\"changelink\" href=\"javascript:toggleMethodBox();\">change</a>)</div>";
+?>
+
+<div id="methodbox">
+<select onchange="return changeMethod(this)">
+<?php
+ foreach ($methods as $id => $name){
+ $sel = ($id == $method)? "selected" : "";
+ print "<option $sel value=\"$id\">$name</option>";
+ }
+?>
+</select>
+</div>
Please sign in to comment.
Something went wrong with that request. Please try again.