Permalink
Browse files

Added graphics, css, set up the database and made the web-app semi fu…

…nctional.
  • Loading branch information...
1 parent 480a563 commit 23e8b20fd4967949c42a8a2fbaae70a7d92c0e50 @santhoshchris committed Jul 16, 2012
View
Binary file not shown.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,129 @@
+html {
+ margin: 0;
+ padding: 0;
+ background-color:#000;
+ color: #e2e2e2;
+ font: normal 100%/1.5 sans-serif;
+}
+
+
+col-items{
+
+ width: 12.65%;
+ padding: 1%;
+ margin:1%;
+
+}
+
+
+body {
+ margin: 0;
+ padding: 0;
+}
+h1 {
+ text-align:center;
+
+}
+
+.bio{
+ margin-left: 27px;
+}
+
+
+
+nav {
+
+ font-size: 1.4em;
+ text-align: center;
+ padding-top: 5px;
+ margin-top: -40px;
+}
+
+nav ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 25px 0 0 0;
+ border-top: 2px solid #666;
+ border-bottom: 2px solid #666;
+}
+
+
+nav li {
+ display: inline;
+}
+
+nav a,
+nav a:link,
+nav a:visited {
+ display: inline-block;
+ padding: 0.
+ color: #F00;
+}
+
+nav a:hover,
+nav a:focus,
+nav a:active,
+nav .current a,
+nav .current a:link,
+nav .current a:visited {
+ background-color: rgba(50,50,50,0.5);
+ color: #fff;
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ -webkit-border-radius: 4px 4px 0px 0px;
+ border-radius: 4px 4px 0px 0px;
+}
+
+
+.col-left {
+ text-align:center;
+ margin:1%;
+ background-color:#333;
+ float: left;
+ width: 11%;
+ height: 700px;
+}
+
+.col-left img{
+
+ text-align: center;
+}
+
+.col-right {
+ margin:1%;
+ background-color: #666;
+ float: left;
+ width: 20%;
+ height: 700px;
+
+}
+
+.col{
+ text-align:center;
+ background-color: #333;
+ float: left;
+ width: 12.65%;
+ padding: 1%;
+ margin:1%;
+
+}
+
+.triple{
+ background-color: #666;
+ float: left;
+ width: 30%;
+ padding: 1%;
+ margin:1%;
+
+}
+
+.col:nth-child(even) {
+ background-color: #666;
+}
+
+
+nav .current a,
+nav .current a:link,
+nav .current a:visited {
+ background-color: #323232;
+}
View
@@ -0,0 +1,50 @@
+
+<?php
+
+/*
+$apples = filter_input(INPUT_POST, 'apples', FILTER_SANITIZE_NUMBER_INT);
+$bananas = filter_input(INPUT_POST, 'bananas', FILTER_SANITIZE_NUMBER_INT);
+$grapes = filter_input(INPUT_POST, 'grapes', FILTER_SANITIZE_NUMBER_INT);
+$oranges = filter_input(INPUT_POST, 'oranges', FILTER_SANITIZE_NUMBER_INT);
+$pineapple = filter_input(INPUT_POST, 'pineapple', FILTER_SANITIZE_NUMBER_INT);
+$beans = filter_input(INPUT_POST, 'beans', FILTER_SANITIZE_NUMBER_INT);
+$carrots = filter_input(INPUT_POST, 'carrots', FILTER_SANITIZE_NUMBER_INT);
+$potatoes = filter_input(INPUT_POST, 'potatoes', FILTER_SANITIZE_NUMBER_INT);
+$tomatoes = filter_input(INPUT_POST, 'tomatoes', FILTER_SANITIZE_NUMBER_INT);
+
+
+*/
+
+include 'includes/db.php';
+
+ $sql = $db->prepare('
+ UPDATE groceries
+ SET checked = 0
+ ');
+
+ $sql->execute();
+
+
+if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+
+ $sql = $db->prepare('
+ UPDATE groceries
+ SET checked = 1
+ WHERE items = :item
+
+ ');
+
+ foreach($_POST as $key=>$value) {
+
+ $sql->bindValue(':item', $key, PDO::PARAM_STR);
+ $sql->execute();
+
+ }
+
+ header('Location: index.php');
+ exit;
+
+}
+
+
+?>
View
@@ -0,0 +1,18 @@
+<?php
+
+// Opens a connection to the MySQL database
+// Shared between all the PHP files in our application
+
+// Our username and password are kept in Environment Varialbes, in .htaccess
+// This is for security, so they are never publicly visible on GitHub
+$user = getenv('DB_USER'); // The MySQL username
+$pass = getenv('DB_PASS'); // The MySQL password
+$data_source = getenv('DATA_SOURCE');
+
+// PDO: PHP Data Objects
+// Allows us to connect to many different kinds of databases
+$db = new PDO($data_source, $user, $pass);
+
+// Force the connection to communicate in UTF-8
+// and support many human languages
+$db->exec('SET NAMES utf8');
View
@@ -0,0 +1,109 @@
+<?php
+
+/*
+$apples = filter_input(INPUT_POST, 'apples', FILTER_SANITIZE_NUMBER_INT);
+$bananas = filter_input(INPUT_POST, 'bananas', FILTER_SANITIZE_NUMBER_INT);
+$grapes = filter_input(INPUT_POST, 'grapes', FILTER_SANITIZE_NUMBER_INT);
+$oranges = filter_input(INPUT_POST, 'oranges', FILTER_SANITIZE_NUMBER_INT);
+$pineapple = filter_input(INPUT_POST, 'pineapple', FILTER_SANITIZE_NUMBER_INT);
+$beans = filter_input(INPUT_POST, 'beans', FILTER_SANITIZE_NUMBER_INT);
+$carrots = filter_input(INPUT_POST, 'carrots', FILTER_SANITIZE_NUMBER_INT);
+$potatoes = filter_input(INPUT_POST, 'potatoes', FILTER_SANITIZE_NUMBER_INT);
+$tomatoes = filter_input(INPUT_POST, 'tomatoes', FILTER_SANITIZE_NUMBER_INT);
+
+
+*/
+
+include 'includes/db.php';
+
+
+ $sql = $db->query('
+ SELECT items
+ FROM groceries
+ WHERE checked = 1
+
+ ');
+
+ $results = $sql->fetchAll();
+
+
+
+
+
+?>
+
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Flexible Layouts</title>
+ <link href="css/general.css" rel="stylesheet">
+
+ <script src="js/list-java.js"></script>
+ </head>
+ <body>
+
+ <div class="col-group clearfix">
+
+ <div class="col-left">
+
+ <img src="buttons/dairy.png" width="139" height="139" alt="dairy">
+ <img src="buttons/fish.png" width="138" height="138" alt="fish">
+ <img src="buttons/fruitsveggies.png" width="138" height="138" alt="veggiesfruits">
+ <img src="buttons/other.png" width="136" height="136" alt="other">
+ <img src="buttons/edit.png" width="105" height="68" alt="edit"> <p>
+ <img src="buttons/undo.png" width="63" height="78" alt="undo">
+ <img src="buttons/save.png" width="56" height="76" alt="save">
+ </div>
+<div class="col-right">
+
+ <h1>Fruits</h1>
+
+ <p>
+
+<form method="post" action="displaylist.php">
+ <input id="item" autofocus>
+
+
+
+ <input type="checkbox" name="apples" value="1" />Apples <br/>
+ <input type="checkbox" name="bananas" value="1" />Bananas <br>
+ <input type="checkbox" name="grapes" value="1" />Grapes <br>
+ <input type="checkbox" name="oranges" value="1" />Oranges <br>
+ <input type="checkbox" name="pineapple" value="1" />Pineapple <br>
+
+ <h1>Vegetables</h1>
+
+ <input type="checkbox" name="beans" value="1" />Beans <br>
+ <input type="checkbox" name="carrots" value="1" />Carrots <br>
+ <input type="checkbox" name="celery" value="1" />Celery <br>
+ <input type="checkbox" name="potatoes" value="1" />Potatoes <br>
+ <input type="checkbox" name="tomatoes" value="1" />Tomatoes <br>
+
+ <button type="submit" id="additem">Add items</button>
+
+
+</form>
+
+
+
+ </div>
+
+ <div class="col triple">
+
+ <h1>FINAL LIST </h1>
+
+
+ <ul>
+ <?php
+ foreach($results as $item){
+
+ echo('<li>'.$item[0].'</li>') ;
+ }
+ ?>
+ </ul>
+ </div>
+ </div>
+ </body>
+
+</html>
View
Binary file not shown.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Binary file not shown.
View
Binary file not shown.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 23e8b20

Please sign in to comment.