-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmstools
More file actions
184 lines (169 loc) · 5.94 KB
/
Copy pathcmstools
File metadata and controls
184 lines (169 loc) · 5.94 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
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
<!DOCTYPE html>
<!--This is the where you declare what type of html you are using for
the text document the current one is html 5-->
<html>
<head>
<meta name="description" content="eccomerce"/>
<meta name="keywords" content="Buy, shop, HTML5"/>
<script>
var b = document.getElementById('stock').value;
function myEventHandler(e) {
alert("You have added" + name + "at the stock value of" + stock);
}
function del(){
if(confirm('Do you really want to delete this item')){
document.form1.submit();
}
}
function update(){
if(confirm('Do you really want to update this item')){
document.form1.submit();
}
}
function validateStock(){
if (b > 1){
alert("You have inputted an invalid stock");
}
else{
form.submit()
}
}
</script>
<script>
function showCustomer(str)
{
var xmlhttp;
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getcustomer.php?q="+str,true);
//spinner;
xmlhttp.send();
}
</script>
<script src="script.js"></script>
<title>Add Product</title>
<link rel="stylesheet" type="text/css" href="10.css" />
<!--This is the link between the css page and the html page it corrisponds to. all of it has been checked and validated on w3c validator but can't have a
refer link because it will read the html page not the external styles sheet.-->
</head>
<body>
<nav class = "navigation">
<p><a class="nav" onclick="window.location='index.html'">Homepage</a></p>
<p><a class="nav" onclick="window.location='products.php'">Products</a></p>
<p><a class="nav" onclick="window.location='shoppingcart.php'">Basket</a></p>
<p><a class="nav" onclick="window.location='cmsTools.php'">CMS tools</a></p>
</nav>
<!-- this tag has it's position fixed at all times so the user always has a navigation to other pages present.
i was interially intending on using javascript but that invalidated my page.-->
<footer class ="footer">
<h1>Q-Bay</h1>
</footer>
<!--the content, navigation and footer class elements should only be used once else they will overlap the existing content
due to the styling that is used. While this means i can't use these specifc tags more than once i can still add other css tags
within these sections that can altering the body to give of a background or using a class tags to change specific tables or fonts.-->
<article class = "content">
<h3>Add A Product</h3>
<form id="form" form action="addproduct.php" method="POST" enctype="multipart/form-data">
<fieldset>
<p>name: <input type="text" name="name"/></p>
<p>discription: <input type="text" name="discp" size="50" rows="50"/></p>
<p>price: <input type="text" name="price"/></p>
<p>stock: <input type="text" name="stock"/></p>
<p>
Catagory: <select name="catagory">
<option value="">Select a catagory:</option>
<option value="Computing">Computing</option>
<option value="Books">Books</option>
<option value="CD/DVD">CD/DVD's</option>
<option value="Gaming">Gaming</option>
</select>
</p>
<p>Filename: <input type="file" name="file" id="file" size="40" /></p>
<input type="button" value="create record" onclick="validateStock()"/>
<input type="reset" value="Clear and Restart"/></P>
</fieldset>
</form>
<h3>delete a Product</h3>
<form action="">
<fieldset>
<p>serial code: <input id ="dele" type="text" name="code"/></p>
<input type="button" value="Delete" onclick="deleteProduct(dele.value)"/>
<input type="reset" value="Clear and Restart"/></P>
</fieldset>
</form>
<p>
<div id = "deleteMes">
</div>
</p>
<h3>Update A Product</h3>
<form action="">
<fieldset>
<p>Serial id:<input type="text" name="serial" id="serial"/></p>
<form>
<p><input type="button" value="Get Product" onclick="findProductupdate(serial.value)"/></p>
<div id = "changers">
</div>
</form>
<p>Changed fields</p>
<p>Name: <input type="text" name="name" id="name"/></p>
<p>Discription: <input type="text" name="discp" id="discp"/></p>
<p>Price: <input type="text" name="price" id="price"/></p>
<p>Catagory: <select name="catagory">
<option value="">Select a catagory:</option>
<option value="Computing">Computing</option>
<option value="Books">Books</option>
<option value="CD/DVD">CD/DVD's</option>
<option value="Gaming">Gaming</option>
</select></p>
<input type="button" value="change" onclick="updateProduct(serial.value,name.value,descp.value,price.value,catagory.value)"/>
<input type="reset" value="Clear and Restart"/></P>
</fieldset>
</form>
<div id = "updates">
</div>
<h3>Customer information</h3>
<form action="">
<select name="customers" onchange="showCustomer(this.value)">
<option value="">Select a customer:</option>
<option value="1">serial 1</option>
<option value="2">serial 2</option>
<option value="3">serial 3</option>
</select>
</form>
<p>
<div id="txtHint">
</div>
</p>
<h3>Order details</h3>
<form action "">
Date<input type = "date" id = "dateOrder">
<input value ="submit" type= "button" onclick="findOrder(dateOrder.value)">
</form>
<div id = "order">
</div>
<!--This image is being positioned by linking it by a section id to my css code-->
<p>
<a class="nav" href="javascript:scroll(0,0)">Top of page</a>
</p>
<!--This is a link is javascript changing the scroll position to the top of the page.-->
</article>
</body>
</html>