-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddproduct.php
More file actions
124 lines (103 loc) · 5.07 KB
/
addproduct.php
File metadata and controls
124 lines (103 loc) · 5.07 KB
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
//if (session_status() !== PHP_SESSION_ACTIVE) {session_start();}
if(session_id() == '' || !isset($_SESSION)){session_start();}
if(!isset($_SESSION["username"])) {
header("location:index.php");
}
if($_SESSION["type"]!="admin") {
header("location:index.php");
}
include 'config.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="Songify the one stop shop for Vinyl CDs and Albums">
<meta name="author" content="Deeptha, Nagabharan, Sudhir">
<link rel="icon" href="./images/favicon.png">
<title>Add Products</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<!-- NAVBAR
================================================== -->
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span>Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="./index.php"><span style="color:#CCFF00">Songify<span></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="./index.php">Home</a></li>
<li><a href="./about.php">About</a></li>
<li><a href="./contact.php">Contact</a></li>
<?php
if(isset($_SESSION['username'])){
echo '<li><a href="./products.php">Products</a></li>';
}
?>
</ul>
<ul class="nav navbar-nav navbar-right">
<?php
if(isset($_SESSION['username'])){
echo '<li><a href="./account.php">My Account</a></li>';
echo '<li><a href="./logout.php">Log Out</a></li>';
}
else{
echo '<li><a href="./signup.php">Log In</a></li>';
echo '<li><a href="./register.php">Register</a></li>';
}
?>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container" style="margin-top:70px;">
<div class="row">
<form class="form-signin" method="POST" action="insertproduct.php">
<h2 class="form-signin-heading" align="center">Create New Product</h2>
<label for="inputAlbumName">Album Name</label>
<input type="text" id="inputAlbumName" name="aname" class="form-control" placeholder="Album Name" required autofocus> <br/>
<label for="inputGenre">Genre</label>
<input type="text" id="inputGenre" name="genre" class="form-control" placeholder="Genre" required> <br/>
<label for="inputArtist">Artist</label>
<input type="text" id="inputArtist" name="artist" class="form-control" placeholder="Artist" required> <br/>
<label for="inputYear">Year</label>
<input type="text" id="inputYear" name="year" class="form-control" placeholder="Year" required> <br/>
<label for="inputQty">Quantity</label>
<input type="text" id="inputQty" name="qty" class="form-control" placeholder="Quantity" required> <br/>
<label for="inputPrice">Price(Per Unit)</label>
<input type="text" id="inputPrice" name="price" class="form-control" placeholder="Price" required> <br/>
<label for="inputImage">Image</label>
<input type="text" id="inputImage" name="image" class="form-control" placeholder="Image" required> <br/>
<div align="center">
<button class="btn btn-lg btn-primary" type="submit">Add</button>
</div>
</form>
<br/>
</div>
</div><!-- /.container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
</body>
</html>