Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.36 KB | None | 0 0
  1. Create Brand
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <title> Nile</title>
  6. <meta charset="utf-8" />
  7.  
  8.  
  9.  
  10. <link href="external_Style_sheet.css" rel="stylesheet" />
  11. </head>
  12.  
  13.  
  14.  
  15. <body>
  16.  
  17. <nav>
  18. <ul>
  19. <li> <a href="Default.html"> Home</a></li>
  20. <li> <a href="CreateItem.html"> Items</a></li>
  21. <li> <a href="CreateCategory.html"> Categories</a></li>
  22. </ul>
  23. <p></p>
  24. </nav>
  25.  
  26. <header> <font size="10" color="purple" font:bold>Nile</font></header>
  27. <font size="3" color="purple" font:bold> Welcome to the Nile! We are a shopping store online where you can buy everything you could possibly need in one single location. Feel free to browse!</font>
  28. <p><img src="online shop.jpg" alt="" style="width:304px;height:228px;"></p>
  29.  
  30.  
  31. <table>
  32. <tr>
  33. <th><font size="5" color="purple" font:bold>History</th></font>
  34. </tr>
  35.  
  36. <tr>
  37. <td> <font size="3" color="purple" font:bold>Our company started in 1936 in Smithfield, Pennsylvania. We were a family of four that decided we wanted to open up a store to fit the needs of everyone on the web all over the country.</td></font>
  38. </tr>
  39.  
  40.  
  41. </table><br />
  42.  
  43. <table>
  44. <tr>
  45. <th><font size="5" color="purple" font:bold>Owners</th></font>
  46. </tr>
  47.  
  48. <tr>
  49. <td><font size="3" color="purple" font:bold>This company is owned and operated by Brittani Kiger and my family. We are locally owned and operated, as well.</td></font>
  50. </tr>
  51.  
  52.  
  53. </table>
  54. <br />
  55.  
  56. <table>
  57. <tr>
  58. <th><font size="5" color="purple" font:bold>Contact Us</th></font>
  59. </tr>
  60.  
  61. <tr>
  62. <td><font size="3" color="purple" font:bold>If you would like to contact us, we can be reached by email at brittani.kiger@gmail.com</td></font>
  63. </tr>
  64.  
  65. </table>
  66. <br />
  67.  
  68. <table>
  69. <tr>
  70. <th><font size="5" color="purple" font:bold>Items</th></font>
  71. </tr>
  72.  
  73. <tr>
  74. <td><font size="3" color="purple" font:bold>We offer many kinds of items that people would be interested in buying.</td></font>
  75. </tr>
  76.  
  77.  
  78. </table>
  79. <br />
  80.  
  81. Insert Brand Name:
  82. <form id="brand_input">
  83. <input id="input" class= "data" type ="text" required />
  84. <input type="button" onclick="SaveBrand()" value="Save" />
  85. <input type="button" onclick="BrandOutputArray()" value="Output" />
  86. <p id="results"></p>
  87. </form>
  88.  
  89. Insert item's total:
  90. <form id="total_input">
  91. <input id="Number1" class="data" type = "number" required />
  92. <input type ="button" onclick="SaveBrand()" value = "Save" />
  93. <input type ="button" onclick="print_quantity()" value ="Output1" />
  94.  
  95.  
  96. <input type="button" value="Generate Table" onclick="GenerateTable()" />
  97. <hr />
  98. <div id="dvTable">
  99. </div>
  100.  
  101.  
  102.  
  103.  
  104. <h2>Brand Name</h2>
  105. <script>
  106. var brand;
  107. var complete_total=0;
  108. var total_plus_tax = 0;
  109. var brandArray = [];
  110. var totalArray =[];
  111.  
  112. brandArray.push(["input", "data", "text"]);
  113. function storeBrand() {
  114. var brandStuff = document.getElementsByClassName("data");
  115. for (i = 0; i < brandStuff.length; i++) {
  116. brandArray.push([brandStuff[i].value, brandStuff[(i + 1)].value, brandStuff[(i + 2)].value]);
  117. }
  118. document.getElementById("brand_input").reset();
  119. localStorage.setItem("brandArray", brandArray);
  120. }
  121.  
  122. function BrandOutputArray() {
  123. document.getElementByClass("data").innerHTML = localStorage.getItem("brandArray");
  124. prompt("brandArray");
  125.  
  126. }
  127.  
  128. totalArray.push(["Number1", "data", "text"]);
  129. function storeTotal() {
  130. var totalStuff = document.getElementsByClassName("data");
  131. for (i = 0; i < totalStuff.length; i++) {
  132. totalArray.push([totalStuff[i].value, totalStuff[(i + 1)].value, totalStuff[(i + 2)].value]);
  133. }
  134. document.getElementById("total_input").reset();
  135. localStorage.setItem("totalArray", totalArray);
  136. }
  137.  
  138. function BrandOutputArray() {
  139. document.getElementByClass("data").innerHTML = localStorage.getItem("brandArray");
  140. prompt("brandArray");
  141.  
  142. }
  143. function quantity() {
  144. item_price = document.getElementById('Number1').value;
  145. var item_total = Number(item_price);
  146.  
  147. if(item_price >100)
  148. {
  149. shipping = 10;
  150. }
  151. else
  152. {
  153. shipping = 5;
  154. }
  155.  
  156. complete_total = +shipping + +item_total;
  157. var tax = 0.06;
  158. total_tax = (+shipping + +item_total) * tax
  159. total_plus_tax = total_tax + +item_total;
  160. }
  161. function print_quantity() {
  162. quantity();
  163. alert("<p>The shipping is: $" + shipping);
  164. alert("<p>Your total will be: $" + complete_total);
  165. alert("<p>Your total plus tax will be: $" + total_plus_tax);
  166. }
  167. var Array[];
  168.  
  169. /*function StoreBrand() {
  170. quantity();
  171.  
  172. brandArray.push(document.getElementById("input").value);
  173. localStorage.setItem("brandArray", brandArray);
  174. document.getElementById("brand_input").reset();
  175.  
  176. totalArray.push(document.getElementById("Number1").value);
  177. localStorage.setItem("totalArray", totalArray);
  178. document.getElementById("total_input").reset();
  179.  
  180.  
  181.  
  182.  
  183. }
  184. */
  185.  
  186.  
  187.  
  188. function SaveBrand() {
  189. storeBrand();
  190. document.getElementById("SaveBrand").innerHTML = StoreBrand();
  191. }
  192.  
  193. function GenerateTable() {
  194. //Build an array containing Customer records.
  195. var Array = new Array();
  196. Array.push(["brandArray", "totalArray"]);
  197.  
  198.  
  199. //Create a HTML Table element.
  200. var table = document.createElement("TABLE");
  201. table.border = "1";
  202.  
  203. //Get the count of columns.
  204. var columnCount = Array[0].length;
  205.  
  206. //Add the header row.
  207. var row = table.insertRow(-1);
  208. for (var i = 0; i < columnCount; i++) {
  209. var headerCell = document.createElement("TH");
  210. headerCell.innerHTML = Array[0][i];
  211. row.appendChild(headerCell);
  212. }
  213.  
  214. //Add the data rows.
  215. for (var i = 1; i < Array.length; i++) {
  216. row = table.insertRow(-1);
  217. for (var j = 0; j < columnCount; j++) {
  218. var cell = row.insertCell(-1);
  219. cell.innerHTML = Array[i][j];
  220. }
  221. }
  222.  
  223. var dvTable = document.getElementById("dvTable");
  224. dvTable.innerHTML = "";
  225. dvTable.appendChild(table);
  226. }
  227.  
  228.  
  229.  
  230. </script>
  231.  
  232. </form>
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241. <footer>
  242. <p> Created by: Brittani Kiger</p>
  243. <p>Contact us: brittani.kiger@gmail.com</p>
  244.  
  245. </footer>
  246. </body>
  247. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement