forked from dhruvkayastha/FreshProduce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
farmer.php
62 lines (61 loc) · 1.99 KB
/
farmer.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
<style type="text/css">
.afs{
top:200px;
left: 35%;
/*margin-left:-50px;*/
position: absolute;
}
</style>
<html>
<head>
<meta charset="UTF-8">
<title>Home | FreshProduce</title>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<div class="fb-header">
<div id="img1" class="fb-header"><a href="farmer.php"><img border="0" alt="FreshProduce" src="icon4.jpeg" width="150" height="150"></a></div>
<form name="loginForm" method="post" action="signout.php">
<div id="form1" class="fb-header">
<!-- <input type="text" placeholder="Email" name="email" id="email" pattern = "[A-Za-z0-9_\-]+@[A-Za-z]+\.[A-Za-z]{2,}" required> -->
</div>
<div id="form2" class="fb-header">
<!-- <input type="password" placeholder="Password" name="pass" id="pass" onkeyup="pwChecker()" required> -->
</div>
<input type="submit" class="submit1" value="Sign out" />
</form>
</div>
<div class='afs' align='center'>
<?php
require_once 'dbconnect.php';
$stmt = $con->prepare("SELECT * FROM user WHERE user_id=?");
$stmt->bind_param("i", $_COOKIE["user_id"]);
$rc = $stmt->execute();
$result = $stmt->get_result();
if($result->num_rows != 1)
{
echo "Invalid Stock ID entered";
}
else
{
$row = $result->fetch_assoc();
$username = $row["name"];
echo "<h2>Welcome $username!<h2>";
}
?>
<br>
<a href="farmer_stock.php"><button>Manage Inventory</button></a> <br>
<a href="view_prod_serv.php">
<button>Buy Products & Services</button></a> <br>
<a href="view_requirements.php">
<button>View Market Requirements</button></a> <br>
<h3>View Transactions</h3>
<a href="transactions.php?type=farmer&view=products">
<button>Products Purchased</button></a>
<a href="transactions.php?type=farmer&view=crops">
<button>Crops Sold</button></a>
<a href="transactions.php?type=farmer&view=services">
<button>Services Purchased</button></a>
</div>
</body>
</html>