/
pen.php
131 lines (117 loc) · 4.25 KB
/
pen.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
<!--
* PROTOTYPE PORK TRACEABILITY SYSTEM
* Copyright © 2014 UPLB.
-->
<!DOCTYPE HTML>
<html lang="en">
<?php
session_start();
require_once "connect.php";
if(!isset($_SESSION['username']) || !isset($_SESSION['password']))
{
header("Location: login.php");
}
include "inc/functions.php";
$db = new phpork_functions ();
?>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pork Traceability System</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/style2.css">
</head>
<body>
<div class="container">
<div class="page-header">
<img class="img-responsive" src="css/images/letterhead.png">
</div>
<form class="form-horizontal" class="logout" method="post" action="logout.php" style="width:30%; margin:0 0 0 70%;">
<div class="form-group" >
<label class="control-label col-xs-4 col-sm-4" >Current User: </label>
<label class="control-label col-xs-2 col-sm-2 label-default" style="text-align: center; background-color: white; border: 2px solid;"><?php echo $_SESSION['username'];?></label>
<div class="col-xs-2 col-sm-2">
<button type="submit" class="btn btn-primary btn-sm">Logout</button>
</div>
</div>
</form>
<div class="row">
<div class="content" >
<ul class="step-indicator">
<li class="each-step active">Select house</li>
<li class="each-step active">Select pen</li>
<li class="each-step">Select pig</li>
</ul>
</div>
<div class="step-content active">
<?php
$h = $_GET['houseno'];
$l = $_GET['location'];
echo "<input type = 'hidden' value= '$h' name = 'house' id = 'houseid'/>";
echo "<input type = 'hidden' value= '$l' name = 'loc' id = 'locid'/>";
?>
<span class="custom-dropdown">
<select id="dropdown">
<?php $db->ddl_pen($_GET['houseno']); ?>
</select>
</span>
<div id="button-holder" class="text-center col-md-10">
<div id="prompt" style="display:none;"></div>
<button class="btn-cust btn-cust-lg btn-cust-img-left previous " id="previous" onmouseover="popup('prev')" onmouseout="hide()">
<span class="stepBtn">Previous</span>
</button>
<button class="btn-cust btn-cust-lg btn-cust-img-right next " id="next" onmouseover="popup('next')" onmouseout="hide()">
<span class="stepBtn">Next</span>
</button>
</div>
</div>
</div>
<div class="page-footer">
Prototype Pork Traceability System <br> Copyright © 2014 - <?php echo date("Y");?> UPLB <br>
funded by PCAARRD
</div>
</div>
<script src="js/jquery-2.1.4.js" type="text/javascript"></script>
<script src="js/jquery-latest.js" type="text/javascript"></script>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery.js"></script>
<script src="js/javascript.js"></script>
<script src="js/jquery.min-1.js"></script>
<script type="text/javascript" src="js/jsapi.js"></script>
<script type="text/javascript">
$(document).ready(function () {
//your code here
$('#next').on("click",function() {
var penno = $("#dropdown").val();
var houseno = $("#houseid").val();
var location =$("#locid").val();
window.location = "pig.php?location="+location+"&houseno="+houseno+"&penno="+penno;
});
$('#previous').on("click",function() {
var location = $("#locid").val();
window.location = "rf11.php?location="+location;
});
});
</script>
<script>
function popup(step){
var div = document.getElementById('prompt');
if(step=="next"){
div.style.display ="block";
div.style.position ="absolute";
div.innerHTML = "Click here to proceed to next step.";
}else if(step=="prev"){
div.style.display ="block";
div.style.position ="absolute";
div.innerHTML = "Click here to go back to previous step.";
}
}
function hide(){
document.getElementById('prompt').style.display = 'none';
}
</script>
</body>
</html>