Explorar el Código

Upload files to 'public_html'

david.ortiz11 hace 5 años
padre
commit
af67223708
Se han modificado 3 ficheros con 158 adiciones y 0 borrados
  1. 5
    0
      public_html/footer.php
  2. 119
    0
      public_html/hazards.php
  3. 34
    0
      public_html/header.php

+ 5
- 0
public_html/footer.php Ver fichero

@@ -0,0 +1,5 @@
1
+<footer class="footer">
2
+	<div class="copyright-wrapper">
3
+		<small class="copyright header">OPASO 2020 <i class="copyright-icon">&#169</i></small>
4
+	</div>
5
+</footer>

+ 119
- 0
public_html/hazards.php Ver fichero

@@ -0,0 +1,119 @@
1
+<!--    Authors         :   Carlos C. Corrada-Bravo
2
+                            David J. Ortiz-Rivera
3
+
4
+        Organization    :   Centro de Desarrollo y Consultoria Computacional
5
+        Project         :   OPASO Material Registry  
6
+        File            :   hazards
7
+        Description     :   Display materials by hazards -->
8
+
9
+<!-- verify session -->
10
+<?php require_once("header.php");?>
11
+
12
+<!doctype html>
13
+<html lang="en">
14
+    <!-- encoding/imports/styling -->
15
+    <head>
16
+        <meta charset="utf-8">
17
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
+        <title class="title">Hazards</title>
19
+        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
20
+        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
21
+        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
22
+        <link rel="stylesheet" href="/style/main.css">
23
+        <link rel="stylesheet" href="/style/hazards.css">
24
+    </head>
25
+
26
+    <!-- content -->
27
+    <body>
28
+        <!-- alerts -->
29
+        <div class="alerts">
30
+            <div class="alert">
31
+                <div class="message-icon-wrapper">
32
+                    <i class="message-icon success-icon material-icons">done</i>
33
+                    <i class="message-icon error-icon failed-icon warning-icon material-icons">close</i>
34
+                </div>
35
+                <p class="alert-status"></p>
36
+                <p class="alert-message"></p>
37
+            </div>
38
+        </div>
39
+
40
+        <div class="content">
41
+            <!-- navbar -->
42
+            <?php require_once("navbar.php")?>
43
+            <div class="main">
44
+                <div class="header-wrapper">
45
+                    <h5 class="header"><?php if(isset($_GET["ghs"])){echo $_GET["ghs"];} else{echo "GHS Codes";}?></h5>
46
+                    
47
+                    <!-- processing -->
48
+                    <div class="processing">
49
+                        <p class="processing-text">Fetching material data...</p>
50
+                        <div class="loader"></div>
51
+                    </div>
52
+                    <span class="description"></span>
53
+                </div>
54
+                
55
+
56
+                <div class="main-wrapper">
57
+                    <div class="ghs-codes"></div>
58
+                    <div class="hazard">
59
+                        <div class="float-right">
60
+                            <div class="dropdown download">
61
+                                <button class="btn btn-outline-success download-btn" type="button" title="Download" id="dropdown-menu-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="material-icons download-icon">archived</i></button>
62
+                                <div class="dropdown-menu" aria-labelledby="dropdown-menu-button">
63
+                                    <span class="download-option" value="ghs_report">GHS Report</span>
64
+                                </div>
65
+                            </div>
66
+
67
+                            <!-- search form -->
68
+                            <div class="search-form-wrapper">
69
+                                <input class="search-form" type="text" placeholder="Search for materials" name="search-form">
70
+                                <button class="clear-btn search-form-submit">
71
+                                    <i class="material-icons clear-icon">close</i>
72
+                                </button>
73
+                            </div>
74
+                        </div>
75
+
76
+                        <!-- materials -->
77
+                        <h6 class="header sub-header">Materials</h6>
78
+                        <div class="table-wrapper content-wrapper">
79
+                            <table class="table">
80
+                                <thead class="table-header">
81
+                                    <tr>
82
+                                        <th class="sort" value="mat_name" >Material
83
+                                            <i class="sort-icon sort-material fas fa-caret-down"></i>
84
+                                        </th>
85
+                                        <th  class="sort" value="man_name">Manufacturer
86
+                                            <i class="sort-alt man_name fas fa-caret-down"></i>
87
+                                        </th>
88
+                                        <th value="sds">SDS</th>
89
+                                        <th value="cas">CAS Num.</th>
90
+                                        <th value="capacity">Capacity</th>
91
+                                        <th value="quantity">Quantity</th>
92
+                                        <th value="total" >Total
93
+                                        </th>
94
+                                        <th >Location</th>
95
+                                        <th  class="sort" value="lab_room">Laboratory
96
+                                            <i class="sort-alt lab_room fas fa-caret-down"></i>
97
+                                        </th>
98
+                                    </tr>
99
+                                </thead>
100
+                                <tbody></tbody>
101
+                            </table>
102
+                        </div>
103
+                    <h6 class="header table-total"></h6>
104
+                    </div>
105
+                </div>
106
+            </div>
107
+
108
+            <!-- footer -->
109
+            <?php require_once("footer.php")?>
110
+        </div>  
111
+
112
+        <!-- scripts -->
113
+        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
114
+        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
115
+        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
116
+        <script type="text/javascript" src="/scripts/main.js"></script>
117
+        <script type="text/javascript" src="/scripts/hazards.js"></script>
118
+    </body>
119
+</html>

+ 34
- 0
public_html/header.php Ver fichero

@@ -0,0 +1,34 @@
1
+<?php
2
+/*  Authors         :   Carlos C. Corrada-Bravo
3
+                        David J. Ortiz-Rivera
4
+
5
+    Organization    :   Centro de Desarrollo y Consultoria Computacional
6
+    Project         :   OPASO Material Registry   
7
+    File            :   header
8
+    Description     :   Handle session expiry for OPASO */
9
+
10
+	/* start user session */
11
+	if(!isset($_SESSION)){
12
+		session_start();
13
+	}
14
+
15
+	/* check for expired session */
16
+	if(!isset($_SESSION["last_activity"]) or (time() - $_SESSION["last_activity"]) > 1800){
17
+		session_unset();
18
+		session_destroy();
19
+		$_SESSION = array();
20
+		header("Location: /?error=session_expired");
21
+		die();
22
+	}
23
+
24
+	/* update last activity */
25
+	else{
26
+		$_SESSION["last_activity"] = time();
27
+	}
28
+
29
+	/* update session id, after 30 mins */
30
+	if((time() - $_SESSION["created"]) > 1800){
31
+	    session_regenerate_id(true);
32
+	    $_SESSION["created"] = time();
33
+	}
34
+?>