forked from QuentinCG/OVH-Email-Manager-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
124 lines (113 loc) · 3.68 KB
/
header.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
/*
* \brief header page integrated in all pages
*
* \author Quentin Comte-Gaz <[email protected]>
* \date 18 July 2016
* \license MIT License (contact me if too restrictive)
* \copyright Copyright (c) 2016 Quentin Comte-Gaz
* \version 1.0
*/
?>
<!----------------------BEGIN HEADER------------------->
<?php
require_once(dirname(__FILE__).'/config.php');
require_once(dirname(__FILE__).'/ovh_utility.php');
$is_api_valid = true;
try {
$domain_info = getEmailDomainInfo($api, $domain);
} catch (Exception $e) {
$is_api_valid = false;
//echo "Impossible to get the email server info: ".$e->getMessage();
}
$title = "Email management system for ".$domain." domain";
$slogan = "Manage your <span class='highlight'>".$domain."</span> email account";
switch ($page_name) {
case "index.php":
break;
case "informations.php":
$title = "How to use your email account";
break;
case "contact.php":
$title = "Contact";
break;
default:
break;
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $title; ?></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow">
<link rel="icon" type="image/png" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/buttons.css" />
<link rel="stylesheet" type="text/css" href="css/progress_bar.css" />
<script type="text/javascript" src="js/progress_bar.js"></script>
<script type="text/javascript" src="js/modernizr-1.5.min.js"></script>
</head>
<body>
<div id="main">
<header>
<div id="strapline">
<div id="welcome_slogan">
<h3><?php echo $slogan; ?></h3>
</div>
</div>
<nav>
<div id="menubar">
<ul id="nav">
<li <?php if($page_name == "index.php") { echo "class=\"current\""; } ?>><a href="index.php">Home</a></li>
<li <?php if($page_name == "informations.php") { echo "class=\"current\""; } ?>><a href="informations.php">Information</a></li>
<li <?php if($page_name == "contact.php") { echo "class=\"current\""; } ?>><a href="contact.php">Contact</a></li>
</ul>
</div>
</nav>
</header>
<div id="site_content">
<div class="sidebar_container">
<div class="sidebar">
<div class="sidebar_item">
<h2>Email server status</h2>
<p>
<?php
if($domain_info['status'] == "ok") {
echo '<a class="medium green button" target="_blank" href="'.$email_server.'">Active email server</a>';
} elseif ($is_api_valid == true) {
echo '<a class="medium orange button" href="contact.php">Email server is down</a>';
} else {
echo '<a class="medium orange button" href="contact.php">Impossible to check server status</a>';
}
?>
<br/>
Creation date:
<?php
if (!$is_api_valid) {
echo "Impossible to get information";
} else {
$date = new DateTime($domain_info['creationDate']);
echo $date->format('j-M-Y');
}
?>
<br/>
</p>
</div>
</div>
<!-- You may add additional side bars here: -->
<!--
<div class="sidebar">
<div class="sidebar_item">
<h2>Latest update</h2>
<h3></h3>
<p></p>
</div>
</div>
-->
</div>
<!--site_content not closed-->
<!--div id="main" not closed-->
<!--body not closed-->
<!--html not closed-->
<!----------------------END HEADER--------------------->