-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheader.php
199 lines (189 loc) · 7.61 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?php
/* header.php
* this file contains the <head> tag and the main navigation menu.
*
* TODO:
* Change where "class=active_page" is located.
* include js based on page
*
* read post variable
* Set $title_name
* Set $active_page
*/
//change the title and highlighted menu item based on page selection
include 'include/config.php';
$active_config= "style=\"border-bottom:3px solid #fff\"";
$loadscript = "";
$header_scripts ="";
$body_end_scripts = "";
$getPage = filter_input(INPUT_GET,"page") ? filter_input(INPUT_GET,"page",FILTER_SANITIZE_STRING) : "";
$getSub = filter_input(INPUT_GET,"sub") ? filter_input(INPUT_GET,"sub",FILTER_SANITIZE_STRING) : "";
switch ($getPage) {
case "calcs":
$title_name = "Basic_Calculator";
$home_page_active = "";
$basiccalcs_page_active = $active_config;
$shear_page_active = "";
$BOPindex_page_active ="";
$pipe_page_active = "";
$project_page_active = "";
$forms_page_active = "";
switch ($getSub){
case "ssc":
$title_name = "Simple Shear Calculator";
$loadscript .= "load_form_fields();"; //This will preload the BOP selection by default.
//TODO if a save is present then need to run load_save_shear()
if(isset($_GET["save"]) && is_numeric($_GET["save"])){
$loadscript .=" load_saved_shear();";
}
$header_scripts .= "<script src='include/shear.js''></script>";
break;
case "mtsc":
$title_name = "Multi-Tube Shear Calculator";
$loadscript .= "load_form_fields();"; //This will preload the BOP selection by default.
//TODO if a save is present then need to run load_save_shear()
if(isset($_GET["save"]) && is_numeric($_GET["save"])){
$loadscript .=" load_saved_shear();";
}
// DELETE - moved to end of body so globals could be declared - $header_scripts .= "<script src='include/shear2.js''></script>";
$body_end_scripts .= "<script src='include/shear2.js''></script>";
break;
case "atest":
$title_name = "Accumulator Sizing Verification";
$header_scripts .= "<script src='include/accum.js''></script>";
break;
}
break;
case "pipe":
$title_name = "Pipe Index";
$home_page_active = "";
$basiccalcs_page_active = "";
$shear_page_active = "";
$BOPindex_page_active ="";
$pipe_page_active = $active_config;
$project_page_active = "";
$forms_page_active = "";
break;
case "bop":
$title_name = "BOP index";
$home_page_active = "";
$basiccalcs_page_active = "";
$shear_page_active = "";
$BOPindex_page_active = $active_config;
$pipe_page_active = "";
$project_page_active = "";
$forms_page_active = "";
break;
case "project":
$title_name = "Project Builder";
$home_page_active = "";
$basiccalcs_page_active = "";
$shear_page_active = "";
$BOPindex_page_active ="";
$pipe_page_active = "";
$project_page_active = $active_config;
$forms_page_active = "";
break;
case "updates":
$title_name = "Update Log";
$home_page_active = $active_config;
$basiccalcs_page_active = "";
$shear_page_active = "";
$BOPindex_page_active ="";
$pipe_page_active = "";
$project_page_active = "";
$forms_page_active = "";
break;
case "forms":
$title_name = "Form - ";
$home_page_active = "";
$basiccalcs_page_active = "";
$shear_page_active = "";
$BOPindex_page_active ="";
$pipe_page_active = "";
$project_page_active = "";
$forms_page_active = $active_config;
switch ($getSub){
case "cids":
$title_name .= "Client Input Data Sheet";
//$loadscript .= "load_form_fields();";
break;
}
break;
//this will be the homepage case
default:
$title_name = "Home";
$home_page_active = $active_config;
$basiccalcs_page_active = "";
$shear_page_active = "";
$BOPindex_page_active ="";
$pipe_page_active = "";
$project_page_active = "";
$forms_page_active = "";
break;
}
//TODO: MOVE TO jQuery section of jfunctions.js
$onloadscript = "onload=\"".$loadscript."\"";
?>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OTC Solutions tool set - <?php echo $title_name; ?></title>
<meta name="description" content="Tools available for OTCS engineers">
<meta name="author" content="David Hanks">
<!--HEADER SCRIPTS-->
<script src="https://www.gstatic.com/firebasejs/4.13.0/firebase.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="include/jfunctions.js"></script>
<?php echo $header_scripts ?>
<!--END HEADER SCRIPTS-->
<!--STYLE SHEETS-->
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="CSS/style.css">
<!--END STYLE SHEETS -->
<!--Bootstrap 3.3.7-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body <?php echo $onloadscript;?>>
<div class="wrapper">
<!--NAVIGATION BAR-->
<?php
/*
* Navigation bar reference
* https://www.w3schools.com/w3css/w3css_navigation.asp
*
*
*/?>
<div class="w3-bar w3-black">
<a href="./" <?php echo $home_page_active; ?> class="w3-bar-item w3-button w3-mobile"><i class="fa fa-home w3-small"></i></a>
<div class="w3-dropdown-hover">
<a href="?page=calcs" <?php echo $basiccalcs_page_active; ?> class="w3-button">Calculators</a>
<div class="w3-dropdown-content w3-bar-block w3-card-4">
<a href="?page=calcs"<?php echo $basiccalcs_page_active; ?> class="w3-bar-item w3-button">About</a>
<!-- Old <a href="?page=calcs&sub=ssc" class="w3-bar-item w3-button">Shear Calculator</a> -->
<a href="?page=calcs&sub=mtsc" class="w3-bar-item w3-button">Shear Calculator</a>
<a href="?page=calcs&sub=atest" class="w3-bar-item w3-button">Accumulator Test</a>
</div>
</div>
<div class="w3-dropdown-hover">
<a href="?page=bop" <?php echo $BOPindex_page_active; ?> class="w3-button">BOP Index</a>
<div class="w3-dropdown-content w3-bar-block w3-card-4">
<a href="?page=bop&sub=Browse" class="w3-bar-item w3-button">Browse all</a>
<a href="?page=bop&sub=Detail" class="w3-bar-item w3-button">Detailed view</a>
<a href="?page=bop&sub=Add" class="w3-bar-item w3-button">Add new</a>
</div>
</div>
<div class="w3-dropdown-hover">
<a href="?page=forms" <?php echo $forms_page_active; ?> class="w3-button">Forms</a>
<div class="w3-dropdown-content w3-bar-block w3-card-4">
<a href="?page=forms&sub=cids" class="w3-bar-item w3-button">CIDS</a>
</div>
</div>
<a href="#" class="w3-bar-item w3-button w3-mobile w3-right" id="nav_login">Login</a>
<a href="#" class="w3-bar-item w3-button w3-mobile w3-right w3-hide" id="nav_logout">Logout</a>
</div>