-
Notifications
You must be signed in to change notification settings - Fork 1
/
head.php
63 lines (61 loc) · 2.67 KB
/
head.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
// name of the current script from uri
$current_script = $_SERVER['SCRIPT_NAME'];
// array containing list of main pages
$pages = array(
'/index.php' => array('Home', '🏠'),
'/details.php' => array('Details', '📈'),
'/trader/index.php' => array('Trader', '💵'),
'/news.php' => array('News', '📰'),
'/about.php' => array('About', '🔬')
);
// name and emoji that should be associated with current script file
$page_title = $pages[$current_script][0];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Campaign Treasurer Companion | <?php echo $page_title; ?></title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/base.css" type="text/css" />
<meta name="theme-color" content="#326e82">
<meta name="author" content="SwG Ghosh">
<meta name="description" content="The Campaign Treasurer Companion Web App for Prayas fest.">
</head>
<body>
<div class="bars">
<div class="topbar">
<h1>
Campaign Treasurer Companion
</h1>
<small class="time">
<?php
// time zone is set to Indian Standard Time
date_default_timezone_set('Asia/Kolkata');
// date stamp to be echoed
echo date('Y-m-d H:i:s')."\n";
?>
</small>
</div>
<div class="bottombar">
<ul class="tabs">
<?php
// iterate across each item in pages list to make anchor links for use in menu
foreach($pages as $script_name => $page) {
$title = $page[0];
$emoji = $page[1];
// in case of iterated page is same as current page use id selected
if(strcmp($script_name, $current_script) === 0) {
$str = '<a href="'.$script_name.'" class="tabitem"><li id="selected"><span class="emoji">'.$emoji.'</span><br>'.$title.'</li></a>';
}
// else do not use id selected
else {
$str = '<a href="'.$script_name.'" class="tabitem"><li><span class="emoji">'.$emoji.'</span><br>'.$title.'</li></a>';
}
echo $str."\n";
}
?>
</ul>
</div>
</div>