Browse Source

Add files via upload

Initial upload to master branch.
master
Jeffery R 8 years ago
committed by GitHub
parent
commit
2416a7713e
27 changed files with 5299 additions and 0 deletions
  1. +37
    -0
      RepoJS/README.md
  2. +5
    -0
      RepoJS/bower.json
  3. BIN
      RepoJS/fonts/repo.eot
  4. +18
    -0
      RepoJS/fonts/repo.svg
  5. BIN
      RepoJS/fonts/repo.ttf
  6. BIN
      RepoJS/fonts/repo.woff
  7. +296
    -0
      RepoJS/repo.js
  8. +29
    -0
      RepoJS/repo.min.js
  9. +39
    -0
      admin.php
  10. +3165
    -0
      includes/carbon.php
  11. +27
    -0
      includes/footer.php
  12. +114
    -0
      includes/header.php
  13. +346
    -0
      includes/w3.css
  14. +40
    -0
      index.php
  15. +50
    -0
      quotes.php
  16. +87
    -0
      quotes/allQuotes.php
  17. +44
    -0
      quotes/newPerson.php
  18. +80
    -0
      quotes/newQuote.php
  19. +198
    -0
      quotes/panda.php
  20. +60
    -0
      quotes/people.php
  21. +124
    -0
      quotes/private.php
  22. +120
    -0
      quotes/public.php
  23. +9
    -0
      quotes_connect.php
  24. +102
    -0
      user/editUser.php
  25. +93
    -0
      user/newUser.php
  26. +145
    -0
      user/profile.php
  27. +71
    -0
      user/users.php

+ 37
- 0
RepoJS/README.md View File

@ -0,0 +1,37 @@
Repo.js
=======
[![Build Status](http://img.shields.io/travis/darcyclarke/Repo.js.svg?style=flat-square)](https://travis-ci.org/darcyclarke/Repo.js)
[![Dependency Status](https://david-dm.org/darcyclarke/repo.js/badges.svg?style=flat-square)](https://david-dm.org/darcyclarke/repo.js/badges)
[![devDependency Status](https://david-dm.org/darcyclarke/repo.js/badges/dev-status.svg?style=flat-square)](https://david-dm.org/darcyclarke/repo.js/badges#info=devDependencies)
[![Code Climate](http://img.shields.io/codeclimate/github/darcyclarke/Repo.js.svg?style=flat-square)](https://codeclimate.com/github/darcyclarke/Repo.js)
[![npm](https://img.shields.io/npm/v/repo.js.svg?maxAge=2592000&style=flat-square)](https://www.npmjs.com/package/repo.js)
[![npm](https://img.shields.io/npm/dt/repo.js.svg?maxAge=2592000&style=flat-square)](https://www.npmjs.com/package/repo.js)
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://darcyclarke.mit-license.org)
[![Join the chat at https://gitter.im/darcyclarke/Repo.js](http://img.shields.io/:Gitter-Join Chat-orange.svg?style=flat-square)](https://gitter.im/darcyclarke/Repo.js)
Repo.js is a jQuery plugin that lets you easily embed a Github repo onto your site. This is great for other plugin or library authors that want to showcase the contents of a repo on their project pages.
Repo.js uses [Markus Ekwall](https://twitter.com/#!/mekwall)'s [jQuery Vangogh](https://github.com/mekwall/jquery-vangogh) plugin for styling of file contents. Vangogh, subsequently, utilizes [highlight.js](https://github.com/isagalaev/highlight.js), written by [Ivan Sagalaev](https://github.com/isagalaev) for syntax highlighting.
##Example Usage
```javascript
$('body').repo({ user: 'darcyclarke', name: 'Repo.js' });
````
You can also reference a specific branch if you want:
```javascript
$('body').repo({ user: 'jquery', name: 'jquery', branch: 'strip_iife' });
````
##License
Copyright (c) 2016 Darcy Clarke <darcy@darcyclarke.me>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 5
- 0
RepoJS/bower.json View File

@ -0,0 +1,5 @@
{
"name": "Repo.js",
"version": "1.0",
"main": "repo.js"
}

BIN
RepoJS/fonts/repo.eot View File


+ 18
- 0
RepoJS/fonts/repo.svg View File

@ -0,0 +1,18 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
This is a custom SVG font generated by IcoMoon.
<iconset grid="16"></iconset>
</metadata>
<defs>
<font id="icomoon" horiz-adv-x="512" >
<font-face units-per-em="512" ascent="480" descent="-32" />
<missing-glyph horiz-adv-x="512" />
<glyph unicode="&#x66;" d="M 416.00,0.00L 512.00,256.00L 96.00,256.00L0.00,0.00 zM 64.00,288.00 L 0.00,0.00 L 0.00,416.00 L 144.00,416.00 L 208.00,352.00 L 416.00,352.00 L 416.00,288.00 Z" />
<glyph unicode="&#x74;" d="M 451.716,380.285l-71.432,71.431C 364.728,467.272, 334.00,480.00, 312.00,480.00L 72.00,480.00 C 50.00,480.00, 32.00,462.00, 32.00,440.00l0.00-432.00 c0.00-22.00, 18.00-40.00, 40.00-40.00l 368.00,0.00 c 22.00,0.00, 40.00,18.00, 40.00,40.00
L 480.00,312.00 C 480.00,334.00, 467.272,364.729, 451.716,380.285z M 429.089,357.657c 1.565-1.565, 3.125-3.487, 4.64-5.657L 352.00,352.00 L 352.00,433.728
c 2.17-1.515, 4.092-3.075, 5.657-4.64L 429.089,357.657z M 448.00,8.00c0.00-4.336-3.664-8.00-8.00-8.00L 72.00,0.00 c-4.336,0.00-8.00,3.664-8.00,8.00L 64.00,440.00 c0.00,4.336, 3.664,8.00, 8.00,8.00
l 240.00,0.00 c 2.416,0.00, 5.127-0.305, 8.00-0.852L 320.00,320.00 l 127.148,0.00 c 0.547-2.873, 0.852-5.583, 0.852-8.00L 448.00,8.00 z" />
<glyph class="hidden" unicode="&#xf000;" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
</font></defs></svg>

BIN
RepoJS/fonts/repo.ttf View File


BIN
RepoJS/fonts/repo.woff View File


+ 296
- 0
RepoJS/repo.js
File diff suppressed because it is too large
View File


+ 29
- 0
RepoJS/repo.min.js
File diff suppressed because it is too large
View File


+ 39
- 0
admin.php View File

@ -0,0 +1,39 @@
<?php
//11-24-16
require('includes/header.php');
if($admin)
{
echo '<div class="w3-row w3-padding-32">';
echo '<div class="w3-twothird w3-container">';
//users
include('user/users.php');
echo '</div><div class="w3-third w3-container">';
//profile
include('user/profile.php');
echo '</div></div>';
echo '<div class="w3-row w3-padding-32">';
echo '<div class="w3-twothird w3-container">';
//edit user
include('user/editUser.php');
echo '</div><div class="w3-third w3-container">';
//new user
include('user/newUser.php');
echo '</div></div>';
}
else
{
include('includes/profile.php');
}
require('includes/footer.php');
?>

+ 3165
- 0
includes/carbon.php
File diff suppressed because it is too large
View File


+ 27
- 0
includes/footer.php View File

@ -0,0 +1,27 @@
<?php
//11-24-16
echo '<!-- Footer -->
<footer class="w3-container w3-theme-dark w3-padding-16 w3-center">
<div style="position:relative;bottom:55px;" class="w3-tooltip w3-right">
<span class="w3-text w3-theme-light w3-padding">Go To Top</span>&nbsp;
<a class="w3-text-white" href="#myHeader"><span class="w3-xlarge">
<i class="fa fa-chevron-circle-up"></i></span></a>
</div>
<p>Panda Quotes</p>
</footer>';
echo '</body></html>';
try
{
mysqli_close($dbc);
}
catch (Exception $ex)
{
}
?>

+ 114
- 0
includes/header.php View File

@ -0,0 +1,114 @@
<?php
//11-24-16
$loggedIn = false;
$admin = false;
session_start();
ob_start();
require_once("../quotes_connect.php");
if((md5($_SERVER['HTTP_USERAGENT'] . 'salt')) == ($_SESSION['agent']) && $_SESSION['use'] == true)
{
$loggedIn = true;
//checks to see if user is an admin
$q = "select admin from users where user_name='" . $_SESSION['username'] . "'";
$r = mysqli_query($dbc, $q);
if(@mysqli_num_rows($r) == 1)
{
while($row = mysqli_fetch_array($r))
{
$checka = $row['admin'];
}
if($checka)
{
$admin = true;
}
}
}
if($admin)
{
echo '<!DOCTYPE html>
<html>
<title>Panda Quotes</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" > </script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="includes/w3.css">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3-theme-black.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css">
<body>
<!-- Header -->
<header class="w3-container w3-theme w3-padding" id="myHeader">
<div class="w3-center">
<h1 class="w3-xxxlarge w3-animate-bottom">Panda Quotes</h1>
<ul class="w3-navbar w3-theme">
<li><a class="w3-dark-grey w3-padding-16" href="index.php">Home</a></li>
<li><a class="w3-padding-16" href="quotes.php">Add Quote</a></li>
<li><a class="w3-padding-16" href="admin.php">Admin</a></li>
</ul>
</div>
</header>';
}
elseif($loggedIn)
{
echo '<!DOCTYPE html>
<html>
<title>Panda Quotes</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" > </script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="includes/w3.css">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3-theme-black.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css">
<body>
<!-- Header -->
<header class="w3-container w3-theme w3-padding" id="myHeader">
<div class="w3-center">
<h1 class="w3-xxxlarge w3-animate-bottom">Panda Quotes</h1>
<ul class="w3-navbar w3-theme">
<li><a class="w3-dark-grey w3-padding-16" href="index.php">Home</a></li>
<li><a class="w3-padding-16" href="quotes.php">Add Quote</a></li>
</ul>
</div>
</header>';
}
else
{
echo '<!DOCTYPE html>
<html>
<title>Panda Quotes</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" > </script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="includes/w3.css">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3-theme-black.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css">
<body>
<!-- Header -->
<header class="w3-container w3-theme w3-padding" id="myHeader">
<div class="w3-center">
<h1 class="w3-xxxlarge w3-animate-bottom">Panda Quotes</h1>
<ul class="w3-navbar w3-theme">
<li><a class="w3-dark-grey w3-padding-16" href="index.php">Home</a></li>
</ul>
</div>
</header>';
}
?>

+ 346
- 0
includes/w3.css View File

@ -0,0 +1,346 @@
/* W3.CSS 2.74 by Jan Egil and Borge Refsnes */
*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
/* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */
html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}
article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}
audio,canvas,video{display:inline-block;vertical-align:baseline}
audio:not([controls]){display:none;height:0}[hidden],template{display:none}
a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}
dfn{font-style:italic}mark{background:#ff0;color:#000}
small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup{top:-0.5em}sub{bottom:-0.25em}
img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}
hr{-moz-box-sizing:content-box;box-sizing:content-box}
code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}
button,input,select,textarea{font:inherit;margin:0}
button{overflow:visible}button,select{text-transform:none}
button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}
button[disabled],html input[disabled]{cursor:default}
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
input[type=checkbox],input[type=radio]{padding:0}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}
input[type=search]{box-sizing:content-box;-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}
input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}
fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em}
legend{border:0;padding:0}pre,textarea{overflow:auto}
/* End extract from normalize.css */
html,body{font-family:Verdana,sans-serif;font-size:15px;line-height:1.5}html{overflow-x:hidden}
h1,h2,h3,h4,h5,h6,.w3-slim,.w3-wide{font-family:"Segoe UI",Arial,sans-serif}
h1{font-size:36px}h2{font-size:30px}h3{font-size:24px}h4{font-size:20px}h5{font-size:18px}h6{font-size:16px}
.w3-serif{font-family:"Times New Roman",Times,serif}
h1,h2,h3,h4,h5,h6{font-weight:400;margin:10px 0}.w3-wide{letter-spacing:4px}
h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{font-weight:inherit}
hr{height:0;border:0;border-top:1px solid #eee;margin:20px 0}
img{margin-bottom:-5px}a{color:inherit}
table{border-collapse:collapse;border-spacing:0;width:100%;display:table}
table,th,td{border:none}.w3-table-all{border:1px solid #ccc}
.w3-bordered tr,.w3-table-all tr{border-bottom:1px solid #ddd}
.w3-striped tbody tr:nth-child(even){background-color:#f1f1f1}
.w3-table-all tr:nth-child(odd){background-color:#fff}
.w3-table-all tr:nth-child(even){background-color:#f1f1f1}
.w3-hoverable tbody tr:hover,.w3-ul.w3-hoverable li:hover{background-color:#ccc}
.w3-centered tr th,.w3-centered tr td{text-align:center}
.w3-table td,.w3-table th,.w3-table-all td,.w3-table-all th{padding:6px 8px;display:table-cell;text-align:left;vertical-align:top}
.w3-table th:first-child,.w3-table td:first-child,.w3-table-all th:first-child,.w3-table-all td:first-child{padding-left:16px}
.w3-btn,.w3-btn-block{border:none;display:inline-block;outline:0;padding:6px 16px;vertical-align:middle;overflow:hidden;text-decoration:none!important;color:#fff;background-color:#000;text-align:center;cursor:pointer;white-space:nowrap}
.w3-disabled,.w3-btn:disabled,.w3-btn-floating:disabled,.w3-btn-floating-large:disabled{cursor:not-allowed;opacity:0.3}
.w3-btn.w3-disabled *,.w3-btn-block.w3-disabled,.w3-btn-floating.w3-disabled *,.w3-btn:disabled *,.w3-btn-floating:disabled *{pointer-events:none}
.w3-btn.w3-disabled:hover,.w3-btn-block.w3-disabled:hover,.w3-btn:disabled:hover,.w3-btn-floating.w3-disabled:hover,.w3-btn-floating:disabled:hover,
.w3-btn-floating-large.w3-disabled:hover,.w3-btn-floating-large:disabled:hover{box-shadow:none}
.w3-btn:hover,.w3-btn-block:hover,.w3-btn-floating:hover,.w3-btn-floating-large:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)}
.w3-btn-block{width:100%}
.w3-btn,.w3-btn-floating,.w3-btn-floating-large,.w3-closenav,.w3-opennav{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
.w3-btn-floating,.w3-btn-floating-large{display:inline-block;text-align:center;color:#fff;background-color:#000;position:relative;overflow:hidden;z-index:1;padding:0;border-radius:50%;cursor:pointer;font-size:24px}
.w3-btn-floating{width:40px;height:40px;line-height:40px}
.w3-btn-floating-large{width:56px;height:56px;line-height:56px}
.w3-btn-group .w3-btn{float:left}
.w3-btn-bar .w3-btn{box-shadow:none;background-color:inherit;color:inherit;float:left}
.w3-btn-bar .w3-btn:hover{background-color:#ccc}
.w3-ripple{position:relative;overflow:hidden}
.w3-ripple:after{content:"";background:#ccc;position:absolute;padding:300%;bottom:0;left:0;opacity:0;transition:0.8s}
.w3-ripple:active:after{padding:0;opacity:1;transition:0s}
.w3-badge,.w3-tag,.w3-sign{background-color:#000;color:#fff;display:inline-block;padding-left:8px;padding-right:8px;text-align:center}
.w3-badge{border-radius:50%}
ul.w3-ul{list-style-type:none;padding:0;margin:0}
ul.w3-ul li{padding:6px 2px 6px 16px;border-bottom:1px solid #ddd}
ul.w3-ul li:last-child{border-bottom:none}
.w3-tooltip,.w3-display-container{position:relative}
.w3-fluid{max-width:100%;height:auto}
.w3-tooltip .w3-text{display:none}
.w3-tooltip:hover .w3-text{display:inline-block}
.w3-navbar{list-style-type:none;margin:0;padding:0;overflow:hidden}
.w3-navbar li{float:left}.w3-navbar li a,.w3-navitem{display:block;padding:8px 16px}.w3-navbar li a:hover{color:#000;background-color:#ccc}
.w3-navbar .w3-dropdown-hover,.w3-navbar .w3-dropdown-click{position:static}
.w3-navbar .w3-dropdown-hover:hover,.w3-navbar .w3-dropdown-hover:first-child,.w3-navbar .w3-dropdown-click:hover{background-color:#ccc;color:#000}
.w3-navbar a,.w3-topnav a,.w3-sidenav a,.w3-dropdown-content a,.w3-accordion-content a,.w3-dropnav a{text-decoration:none!important}
.w3-navbar .w3-opennav.w3-right{float:right!important}.w3-topnav{padding:8px 8px}
.w3-topnav a{padding:0 8px;border-bottom:3px solid transparent;-webkit-transition:border-bottom .3s;transition:border-bottom .3s}
.w3-topnav a:hover{border-bottom:3px solid #fff}.w3-topnav .w3-dropdown-hover a{border-bottom:0}
.w3-opennav,.w3-closenav{color:inherit}.w3-opennav:hover,.w3-closenav:hover{cursor:pointer;opacity:0.8}
.w3-btn,.w3-btn-floating,.w3-dropnav a,.w3-btn-floating-large,.w3-btn-block,.w3-hover-shadow,.w3-hover-opacity,
.w3-navbar a,.w3-sidenav a,.w3-pagination li a,.w3-hoverable tbody tr,.w3-hoverable li,.w3-accordion-content a,.w3-dropdown-content a,.w3-dropdown-click:hover,.w3-dropdown-hover:hover,.w3-opennav,.w3-closenav,.w3-closebtn,
.w3-hover-amber,.w3-hover-aqua,.w3-hover-blue,.w3-hover-light-blue,.w3-hover-brown,.w3-hover-cyan,.w3-hover-blue-grey,.w3-hover-green,.w3-hover-light-green,.w3-hover-indigo,.w3-hover-khaki,.w3-hover-lime,.w3-hover-orange,.w3-hover-deep-orange,.w3-hover-pink,
.w3-hover-purple,.w3-hover-deep-purple,.w3-hover-red,.w3-hover-sand,.w3-hover-teal,.w3-hover-yellow,.w3-hover-white,.w3-hover-black,.w3-hover-grey,.w3-hover-light-grey,.w3-hover-dark-grey,.w3-hover-text-amber,.w3-hover-text-aqua,.w3-hover-text-blue,.w3-hover-text-light-blue,
.w3-hover-text-brown,.w3-hover-text-cyan,.w3-hover-text-blue-grey,.w3-hover-text-green,.w3-hover-text-light-green,.w3-hover-text-indigo,.w3-hover-text-khaki,.w3-hover-text-lime,.w3-hover-text-orange,.w3-hover-text-deep-orange,.w3-hover-text-pink,.w3-hover-text-purple,
.w3-hover-text-deep-purple,.w3-hover-text-red,.w3-hover-text-sand,.w3-hover-text-teal,.w3-hover-text-yellow,.w3-hover-text-white,.w3-hover-text-black,.w3-hover-text-grey,.w3-hover-text-light-grey,.w3-hover-text-dark-grey
{-webkit-transition:background-color .3s,color .15s,box-shadow .3s,opacity 0.3s;transition:background-color .3s,color .15s,box-shadow .3s,opacity 0.3s}
.w3-sidenav{height:100%;width:200px;background-color:#fff;position:fixed!important;z-index:1;overflow:auto}
.w3-sidenav a{padding:4px 2px 4px 16px}.w3-sidenav a:hover{background-color:#ccc}.w3-sidenav a,.w3-dropnav a{display:block}
.w3-sidenav .w3-dropdown-hover:hover,.w3-sidenav .w3-dropdown-hover:first-child,.w3-sidenav .w3-dropdown-click:hover,.w3-dropnav a:hover{background-color:#ccc;color:#000}
.w3-sidenav .w3-dropdown-hover,.w3-sidenav .w3-dropdown-click {width:100%}.w3-sidenav .w3-dropdown-hover .w3-dropdown-content,.w3-sidenav .w3-dropdown-click .w3-dropdown-content{min-width:100%}
.w3-main,#main{transition:margin-left .4s}
.w3-modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4)}
.w3-modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px}.w3-closebtn{text-decoration:none;float:right;font-size:24px;font-weight:bold;color:inherit}
.w3-closebtn:hover,.w3-closebtn:focus{color:#000;text-decoration:none;cursor:pointer}
.w3-pagination{display:inline-block;padding:0;margin:0}.w3-pagination li{display:inline}
.w3-pagination li a{text-decoration:none;color:#000;float:left;padding:8px 16px}
.w3-pagination li a:hover{background-color:#ccc}
.w3-input-group,.w3-group{margin-top:24px;margin-bottom:24px}
.w3-input{padding:8px;display:block;border:none;border-bottom:1px solid #808080;width:100%}
.w3-label{color:#009688}.w3-input:not(:valid)~.w3-validate{color:#f44336}
.w3-select{padding:9px 0;width:100%;color:#000;border:1px solid transparent;border-bottom:1px solid #009688}
.w3-select select:focus{color:#000;border:1px solid #009688}.w3-select option[disabled]{color:#009688}
.w3-dropdown-click,.w3-dropdown-hover{position:relative;display:inline-block;cursor:pointer}
.w3-dropdown-hover:hover .w3-dropdown-content{display:block;z-index:1}
.w3-dropdown-content{cursor:auto;color:#000;background-color:#fff;display:none;position:absolute;min-width:160px;margin:0;padding:0}
.w3-dropdown-content a{padding:6px 16px;display:block}
.w3-dropdown-content a:hover{background-color:#ccc}
.w3-accordion {width:100%;cursor:pointer}
.w3-accordion-content{cursor:auto;display:none;position:relative;width:100%;margin:0;padding:0}
.w3-accordion-content a{padding:6px 16px;display:block}.w3-accordion-content a:hover{background-color:#ccc}
.w3-progress-container{width:100%;height:1.5em;position:relative;background-color:#f1f1f1}
.w3-progressbar{background-color:#757575;height:100%;position:absolute;line-height:inherit}
input[type=checkbox].w3-check,input[type=radio].w3-radio{width:24px;height:24px;position:relative;top:6px}
input[type=checkbox].w3-check:checked+.w3-validate,input[type=radio].w3-radio:checked+.w3-validate{color:#009688}
input[type=checkbox].w3-check:disabled+.w3-validate,input[type=radio].w3-radio:disabled+.w3-validate{color:#aaa}
.w3-responsive{overflow-x:auto}
.w3-container:after,.w3-panel:after,.w3-row:after,.w3-row-padding:after,.w3-topnav:after,.w3-clear:after,.w3-btn-group:before,.w3-btn-group:after,.w3-btn-bar:before,.w3-btn-bar:after
{content:"";display:table;clear:both}
.w3-col,.w3-half,.w3-third,.w3-twothird,.w3-threequarter,.w3-quarter{float:left;width:100%}
.w3-col.s1{width:8.33333%}
.w3-col.s2{width:16.66666%}
.w3-col.s3{width:24.99999%}
.w3-col.s4{width:33.33333%}
.w3-col.s5{width:41.66666%}
.w3-col.s6{width:49.99999%}
.w3-col.s7{width:58.33333%}
.w3-col.s8{width:66.66666%}
.w3-col.s9{width:74.99999%}
.w3-col.s10{width:83.33333%}
.w3-col.s11{width:91.66666%}
.w3-col.s12,.w3-half,.w3-third,.w3-twothird,.w3-threequarter,.w3-quarter{width:99.99999%}
@media only screen and (min-width:601px){
.w3-col.m1{width:8.33333%}
.w3-col.m2{width:16.66666%}
.w3-col.m3,.w3-quarter{width:24.99999%}
.w3-col.m4,.w3-third{width:33.33333%}
.w3-col.m5{width:41.66666%}
.w3-col.m6,.w3-half{width:49.99999%}
.w3-col.m7{width:58.33333%}
.w3-col.m8,.w3-twothird{width:66.66666%}
.w3-col.m9,.w3-threequarter{width:74.99999%}
.w3-col.m10{width:83.33333%}
.w3-col.m11{width:91.66666%}
.w3-col.m12{width:99.99999%}}
@media only screen and (min-width:993px){
.w3-col.l1{width:8.33333%}
.w3-col.l2{width:16.66666%}
.w3-col.l3,.w3-quarter{width:24.99999%}
.w3-col.l4,.w3-third{width:33.33333%}
.w3-col.l5{width:41.66666%}
.w3-col.l6,.w3-half{width:49.99999%}
.w3-col.l7{width:58.33333%}
.w3-col.l8,.w3-twothird{width:66.66666%}
.w3-col.l9,.w3-threequarter{width:74.99999%}
.w3-col.l10{width:83.33333%}
.w3-col.l11{width:91.66666%}
.w3-col.l12{width:99.99999%}}
.w3-content{max-width:980px;margin:auto}
.w3-rest{overflow:hidden}
.w3-hide{display:none!important}.w3-show-block,.w3-show{display:block!important}.w3-show-inline-block{display:inline-block!important}
@media (max-width:600px){.w3-modal-content{margin:0 10px;width:auto!important}.w3-modal{padding-top:30px}}
@media (max-width:768px){.w3-modal-content{width:500px}.w3-modal{padding-top:50px}}
@media (min-width:993px){.w3-modal-content{width:900px}}
@media screen and (max-width:600px){.w3-topnav a{display:block}.w3-navbar li:not(.w3-opennav){float:none;width:100%!important}.w3-navbar li.w3-right{float:none!important}}
@media screen and (max-width:600px){.w3-topnav .w3-dropdown-hover .w3-dropdown-content,.w3-navbar .w3-dropdown-click .w3-dropdown-content,.w3-navbar .w3-dropdown-hover .w3-dropdown-content{position:relative}}
@media screen and (max-width:600px){.w3-topnav,.w3-navbar{text-align:center}}
@media (max-width:600px){.w3-hide-small{display:none!important}}
@media (max-width:992px) and (min-width:601px){.w3-hide-medium{display:none!important}}
@media (min-width:993px){.w3-hide-large{display:none!important}}
@media screen and (max-width:992px){.w3-sidenav.w3-collapse{display:none}.w3-main{margin-left:0!important;margin-right:0!important}}
@media screen and (min-width:993px){.w3-sidenav.w3-collapse{display:block!important}}
.w3-top,.w3-bottom{position:fixed;width:100%;z-index:1}.w3-top{top:0}.w3-bottom{bottom:0}
.w3-overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);z-index:2}
.w3-left{float:left!important}.w3-right{float:right!important}
.w3-tiny{font-size:10px!important}.w3-small{font-size:12px!important}
.w3-medium{font-size:15px!important}.w3-large{font-size:18px!important}
.w3-xlarge{font-size:24px!important}.w3-xxlarge{font-size:36px!important}
.w3-xxxlarge{font-size:48px!important}.w3-jumbo{font-size:64px!important}
.w3-vertical{word-break:break-all;line-height:1;text-align:center;width:0.6em}
.w3-left-align{text-align:left!important}.w3-right-align{text-align:right!important}
.w3-justify{text-align:justify!important}.w3-center{text-align:center!important}
.w3-display-topleft{position:absolute;left:0;top:0}.w3-display-topright{position:absolute;right:0;top:0}
.w3-display-bottomleft{position:absolute;left:0;bottom:0}.w3-display-bottomright{position:absolute;right:0;bottom:0}
.w3-display-middle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%)}
.w3-display-topmiddle{position:absolute;left:0;top:0;width:100%;text-align:center}.w3-display-bottommiddle{position:absolute;left:0;bottom:0;width:100%;text-align:center}
.w3-circle{border-radius:50%!important}
.w3-round-small{border-radius:2px!important}.w3-round,.w3-round-medium{border-radius:4px!important}
.w3-round-large{border-radius:8px!important}.w3-round-xlarge{border-radius:16px!important}
.w3-round-xxlarge{border-radius:32px!important}.w3-round-jumbo{border-radius:64px!important}
.w3-border-0{border:0!important}
.w3-border{border:1px solid #ccc!important}
.w3-border-top{border-top:1px solid #ccc!important}.w3-border-bottom{border-bottom:1px solid #ccc!important}
.w3-border-left{border-left:1px solid #ccc!important}.w3-border-right{border-right:1px solid #ccc!important}
.w3-margin{margin:16px!important}.w3-margin-0{margin:0!important}
.w3-margin-top{margin-top:16px!important}.w3-margin-bottom{margin-bottom:16px!important}
.w3-margin-left{margin-left:16px!important}.w3-margin-right{margin-right:16px!important}
.w3-section{margin-top:16px!important;margin-bottom:16px!important}
.w3-padding-tiny{padding:2px 4px!important}.w3-padding-small{padding:4px 8px!important}
.w3-padding-medium,.w3-padding,.w3-form{padding:8px 16px!important}
.w3-padding-large{padding:12px 24px!important}.w3-padding-xlarge{padding:16px 32px!important}
.w3-padding-xxlarge{padding:24px 48px!important}.w3-padding-jumbo{padding:32px 64px!important}
.w3-padding-4{padding-top:4px!important;padding-bottom:4px!important}
.w3-padding-8{padding-top:8px!important;padding-bottom:8px!important}
.w3-padding-12{padding-top:12px!important;padding-bottom:12px!important}
.w3-padding-16{padding-top:16px!important;padding-bottom:16px!important}
.w3-padding-24{padding-top:24px!important;padding-bottom:24px!important}
.w3-padding-32{padding-bottom:32px!important}
.w3-padding-48{padding-top:48px!important;}
.w3-padding-64{padding-top:64px!important;padding-bottom:64px!important}
.w3-padding-128{padding-top:128px!important;padding-bottom:128px!important}
.w3-padding-0{padding:0!important}
.w3-padding-top{padding-top:8px!important}.w3-padding-bottom{padding-bottom:8px!important}
.w3-padding-left{padding-left:16px!important}.w3-padding-right{padding-right:16px!important}
.w3-topbar{border-top:6px solid #ccc!important}.w3-bottombar{border-bottom:6px solid #ccc!important}
.w3-leftbar{border-left:6px solid #ccc!important}.w3-rightbar{border-right:6px solid #ccc!important}
.w3-row-padding,.w3-row-padding>.w3-half,.w3-row-padding>.w3-third,.w3-row-padding>.w3-twothird,.w3-row-padding>.w3-threequarter,.w3-row-padding>.w3-quarter,.w3-row-padding>.w3-col{padding:0 8px}
.w3-spin{animation:w3-spin 2s infinite linear;-webkit-animation:w3-spin 2s infinite linear}
@-webkit-keyframes w3-spin{
0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}
@keyframes w3-spin{
0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}
.w3-container{padding:0.01em 16px}
.w3-panel{padding:0.01em 16px;margin-top:16px!important;margin-bottom:16px!important}
.w3-example{background-color:#f1f1f1;padding:0.01em 16px}
.w3-code,.w3-codespan{font-family:Consolas,"courier new";font-size:16px}
.w3-code{line-height:1.4;width:auto;background-color:#fff;padding:8px 12px;border-left:4px solid #009688;word-wrap:break-word}
.w3-codespan{color:crimson;background-color:#f1f1f1;padding-left:4px;padding-right:4px;font-size:110%}
.w3-example,.w3-code,.w3-reference{margin:20px 0}
.w3-card{border:1px solid #ccc}
.w3-card-2,.w3-example{box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)!important}
.w3-card-4,.w3-hover-shadow:hover{box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)!important}
.w3-card-8{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)!important}
.w3-card-12{box-shadow:0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19)!important}
.w3-card-16{box-shadow:0 16px 24px 0 rgba(0,0,0,0.22),0 25px 55px 0 rgba(0,0,0,0.21)!important}
.w3-card-24{box-shadow:0 24px 24px 0 rgba(0,0,0,0.2),0 40px 77px 0 rgba(0,0,0,0.22)!important}
.w3-animate-fading{-webkit-animation:fading 10s infinite;animation:fading 10s infinite}
@-webkit-keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}}
@keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}}
.w3-animate-opacity{-webkit-animation:opac 1.5s;animation:opac 1.5s}
@-webkit-keyframes opac{from{opacity:0} to{opacity:1}}
@keyframes opac{from{opacity:0} to{opacity:1}}
.w3-animate-top{position:relative;-webkit-animation:animatetop 0.4s;animation:animatetop 0.4s}
@-webkit-keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}}
@keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}}
.w3-animate-left{position:relative;-webkit-animation:animateleft 0.4s;animation:animateleft 0.4s}
@-webkit-keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}}
@keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}}
.w3-animate-right{position:relative;-webkit-animation:animateright 0.4s;animation:animateright 0.4s}
@-webkit-keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}}
@keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}}
.w3-animate-bottom{position:relative;-webkit-animation:animatebottom 0.4s;animation:animatebottom 0.4s}
@-webkit-keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0px;opacity:1}}
@keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}}
.w3-animate-zoom {-webkit-animation:animatezoom 0.6s;animation:animatezoom 0.6s}
@-webkit-keyframes animatezoom{from{-webkit-transform:scale(0)} to{-webkit-transform:scale(1)}}
@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}}
.w3-animate-input{-webkit-transition:width 0.4s ease-in-out;transition:width 0.4s ease-in-out}.w3-animate-input:focus{width:100%!important}
.w3-opacity,.w3-hover-opacity:hover{opacity:0.60;filter:alpha(opacity=60)}
.w3-text-shadow{text-shadow:1px 1px 0 #444}.w3-text-shadow-white{text-shadow:1px 1px 0 #ddd}
.w3-transparent{background-color:transparent!important}
.w3-hover-none:hover{box-shadow:none!important;background-color:transparent!important}
/* Start of colors */
.w3-amber,.w3-hover-amber:hover{color:#000!important;background-color:#ffc107!important}
.w3-aqua,.w3-hover-aqua:hover{color:#000!important;background-color:#00ffff!important}
.w3-blue,.w3-hover-blue:hover{color:#fff!important;background-color:#2196F3!important}
.w3-light-blue,.w3-hover-light-blue:hover{color:#000!important;background-color:#87CEEB!important}
.w3-brown,.w3-hover-brown:hover{color:#fff!important;background-color:#795548!important}
.w3-cyan,.w3-hover-cyan:hover{color:#000!important;background-color:#00bcd4!important}
.w3-blue-grey,.w3-hover-blue-grey:hover{color:#fff!important;background-color:#607d8b!important}
.w3-green,.w3-hover-green:hover{color:#fff!important;background-color:#4CAF50!important}
.w3-light-green,.w3-hover-light-green:hover{color:#000!important;background-color:#8bc34a!important}
.w3-indigo,.w3-hover-indigo:hover{color:#fff!important;background-color:#3f51b5!important}
.w3-khaki,.w3-hover-khaki:hover{color:#000!important;background-color:#f0e68c!important}
.w3-lime,.w3-hover-lime:hover{color:#000!important;background-color:#cddc39!important}
.w3-orange,.w3-hover-orange:hover{color:#000!important;background-color:#ff9800!important}
.w3-deep-orange,.w3-hover-deep-orange:hover{color:#fff!important;background-color:#ff5722!important}
.w3-pink,.w3-hover-pink:hover{color:#fff!important;background-color:#e91e63!important}
.w3-purple,.w3-hover-purple:hover{color:#fff!important;background-color:#9c27b0!important}
.w3-deep-purple,.w3-hover-deep-purple:hover{color:#fff!important;background-color:#673ab7!important}
.w3-red,.w3-hover-red:hover{color:#fff!important;background-color:#f44336!important}
.w3-sand,.w3-hover-sand:hover{color:#000!important;background-color:#fdf5e6!important}
.w3-teal,.w3-hover-teal:hover{color:#fff!important;background-color:#009688!important}
.w3-yellow,.w3-hover-yellow:hover{color:#000!important;background-color:#ffeb3b!important}
.w3-white,.w3-hover-white:hover{color:#000!important;background-color:#fff!important}
.w3-black,.w3-hover-black:hover{color:#fff!important;background-color:#000!important}
.w3-grey,.w3-hover-grey:hover{color:#000!important;background-color:#9e9e9e!important}
.w3-light-grey,.w3-hover-light-grey:hover{color:#000!important;background-color:#f1f1f1!important}
.w3-dark-grey,.w3-hover-dark-grey:hover{color:#fff!important;background-color:#616161!important}
.w3-pale-red,.w3-hover-pale-red:hover{color:#000!important;background-color:#ffdddd!important}
.w3-pale-green,.w3-hover-pale-green:hover{color:#000!important;background-color:#ddffdd!important}
.w3-pale-yellow,.w3-hover-pale-yellow:hover{color:#000!important;background-color:#ffffcc!important}
.w3-pale-blue,.w3-hover-pale-blue:hover{color:#000!important;background-color:#ddffff!important}
.w3-text-amber,.w3-hover-text-amber:hover{color:#ffc107!important}
.w3-text-aqua,.w3-hover-text-aqua:hover{color:#00ffff!important}
.w3-text-blue,.w3-hover-text-blue:hover{color:#2196F3!important}
.w3-text-light-blue,.w3-hover-text-light-blue:hover{color:#87CEEB!important}
.w3-text-brown,.w3-hover-text-brown:hover{color:#795548!important}
.w3-text-cyan,.w3-hover-text-cyan:hover{color:#00bcd4!important}
.w3-text-blue-grey,.w3-hover-text-blue-grey:hover{color:#607d8b!important}
.w3-text-green,.w3-hover-text-green:hover{color:#4CAF50!important}
.w3-text-light-green,.w3-hover-text-light-green:hover{color:#8bc34a!important}
.w3-text-indigo,.w3-hover-text-indigo:hover{color:#3f51b5!important}
.w3-text-khaki,.w3-hover-text-khaki:hover{color:#b4aa50!important}
.w3-text-lime,.w3-hover-text-lime:hover{color:#cddc39!important}
.w3-text-orange,.w3-hover-text-orange:hover{color:#ff9800!important}
.w3-text-deep-orange,.w3-hover-text-deep-orange:hover{color:#ff5722!important}
.w3-text-pink,.w3-hover-text-pink:hover{color:#e91e63!important}
.w3-text-purple,.w3-hover-text-purple:hover{color:#9c27b0!important}
.w3-text-deep-purple,.w3-hover-text-deep-purple:hover{color:#673ab7!important}
.w3-text-red,.w3-hover-text-red:hover{color:#f44336!important}
.w3-text-sand,.w3-hover-text-sand:hover{color:#fdf5e6!important}
.w3-text-teal,.w3-hover-text-teal:hover{color:#009688!important}
.w3-text-yellow,.w3-hover-text-yellow:hover{color:#d2be0e!important}
.w3-text-white,.w3-hover-text-white:hover{color:#fff!important}
.w3-text-black,.w3-hover-text-black:hover{color:#000!important}
.w3-text-grey,.w3-hover-text-grey:hover{color:#757575!important}
.w3-text-light-grey,.w3-hover-text-light-grey:hover{color:#f1f1f1!important}
.w3-text-dark-grey,.w3-hover-text-dark-grey:hover{color:#3a3a3a!important}
.w3-border-amber,.w3-hover-border-amber:hover{border-color:#ffc107!important}
.w3-border-aqua,.w3-hover-border-aqua:hover{border-color:#00ffff!important}
.w3-border-blue,.w3-hover-border-blue:hover{border-color:#2196F3!important}
.w3-border-light-blue,.w3-hover-border-light-blue:hover{border-color:#87CEEB!important}
.w3-border-brown,.w3-hover-border-brown:hover{border-color:#795548!important}
.w3-border-cyan,.w3-hover-border-cyan:hover{border-color:#00bcd4!important}
.w3-border-blue-grey,.w3-hover-blue-grey:hover{border-color:#607d8b!important}
.w3-border-green,.w3-hover-border-green:hover{border-color:#4CAF50!important}
.w3-border-light-green,.w3-hover-border-light-green:hover{border-color:#8bc34a!important}
.w3-border-indigo,.w3-hover-border-indigo:hover{border-color:#3f51b5!important}
.w3-border-khaki,.w3-hover-border-khaki:hover{border-color:#f0e68c!important}
.w3-border-lime,.w3-hover-border-lime:hover{border-color:#cddc39!important}
.w3-border-orange,.w3-hover-border-orange:hover{border-color:#ff9800!important}
.w3-border-deep-orange,.w3-hover-border-deep-orange:hover{border-color:#ff5722!important}
.w3-border-pink,.w3-hover-border-pink:hover{border-color:#e91e63!important}
.w3-border-purple,.w3-hover-border-purple:hover{border-color:#9c27b0!important}
.w3-border-deep-purple,.w3-hover-border-deep-purple:hover{border-color:#673ab7!important}
.w3-border-red,.w3-hover-border-red:hover{border-color:#f44336!important}
.w3-border-sand,.w3-hover-border-sand:hover{border-color:#fdf5e6!important}
.w3-border-teal,.w3-hover-border-teal:hover{border-color:#009688!important}
.w3-border-yellow,.w3-hover-border-yellow:hover{border-color:#ffeb3b!important}
.w3-border-white,.w3-hover-border-white:hover{border-color:#fff!important}
.w3-border-black,.w3-hover-border-black:hover{border-color:#000!important}
.w3-border-grey,.w3-hover-border-grey:hover{border-color:#9e9e9e!important}
.w3-border-light-grey,.w3-hover-border-light-grey:hover{border-color:#f1f1f1!important}
.w3-border-dark-grey,.w3-hover-border-dark-grey:hover{border-color:#616161!important}
.w3-border-pale-red,.w3-hover-border-pale-red:hover{border-color:#ffe7e7!important}.w3-border-pale-green,.w3-hover-border-pale-green:hover{border-color:#e7ffe7!important}
.w3-border-pale-yellow,.w3-hover-border-pale-yellow:hover{border-color:#ffffcc!important}.w3-border-pale-blue,.w3-hover-border-pale-blue:hover{border-color:#e7ffff!important}

+ 40
- 0
index.php View File

@ -0,0 +1,40 @@
<?php
//11-24-16
include('includes/header.php');
//first row
include 'quotes/panda.php';
include('quotes/public.php');
include('quotes/private.php');
//4-row
echo '<div class="w3-row w3-padding-32">';
echo '<div class="w3-half w3-container"><div style=\'position: relative; width: 100%; height: 0px; padding-bottom: 60%;\'">';
echo '<iframe src="https://www.youtube.com/embed/bxydoU2R7F4" frameborder="0" allowfullscreen style=\'position: absolute; left: 0px; top: 0px; width: 100%; height: 100%\'"></iframe>';
echo '</div></div>';
echo '<div class="w3-half w3-container"><div id="repo1">';
echo '<script src="RepoJS/repo.js"></script>
<script>
$(\'#repo1\').repo({ user: \'jrtechs\', name: \'Panda-Quotes\' });
</script>';
echo '</div></div>';
echo '</div>';
include('includes/footer.php');
?>

+ 50
- 0
quotes.php View File

@ -0,0 +1,50 @@
<?php
include('includes/header.php');
if($loggedIn)
{
echo '<div class="w3-row w3-padding-32">';
echo '<div class="w3-twothird w3-container">';
//add quote
include('quotes/newQuote.php');
echo '</div><div class="w3-third w3-container">';
//profile
include('user/profile.php');
echo '</div></div>';
echo '<div class="w3-row w3-padding-32">';
echo '<div class="w3-twothird w3-container">';
//people
include('quotes/people.php');
echo '</div><div class="w3-third w3-container">';
//add person
include('quotes/newPerson.php');
echo '</div></div>';
echo '<div class="w3-row w3-padding-32">';
echo '<div class="w3-twothird w3-container">';
//people
include('quotes/allQuotes.php');
echo '</div><div class="w3-third w3-container">';
echo '</div></div>';
}
else
{
include('includes/profile.php');
}
include('includes/footer.php');
?>

+ 87
- 0
quotes/allQuotes.php View File

@ -0,0 +1,87 @@
<?php
require_once 'includes/carbon.php';
use Carbon\Carbon;
if($loggedIn)
{
if(isset($_POST['del_quote_id']))
{
$del_id = mysqli_real_escape_string($dbc, trim($_POST['del_quote_id']));
$q = "delete from quote where quote_id='$del_id' limit 1";
$r = mysqli_query($dbc, $q);
header("Location: quotes.php");
}
echo '<h1 class="w3-text-teal w3-center">Quotes</h1>';
$q = "select * from quote";
$r = mysqli_query($dbc, $q);
echo '<div class="w3-responsive w3-card-4">
<table class="w3-table w3-striped w3-bordered">
<thead>
<tr class="w3-theme w3-center">
<td>Quote</td>
<td>Person</td>
<td>Created By</td>
<td>Date</td>
<td>Delete</td>
</tr>
</thead>
<tbody>
';
while($row = mysqli_fetch_array($r))
{
echo '<tr>';
//quote
echo "<td>" . $row['quote'] . "</td>";
//person
$q2 = "select name from people where person_id='" . $row['person_id'] . "'";
$r2 = mysqli_query($dbc, $q2);
while($row2 = mysqli_fetch_array($r2))
{
echo "<td>" . $row2['name'] . "</td>";
}
//created by
$q2 = "select user_name from users where user_id='" . $row['user_id'] . "'";
$r2 = mysqli_query($dbc, $q2);
while($row2 = mysqli_fetch_array($r2))
{
echo "<td>" . $row2['user_name'] . "</td>";
}
//date
$c = Carbon::createFromTimestampUTC(strtotime($row['creation_date'] . ' UTC'));
echo '<td>' . $c->format('l jS \of F Y') . '</td>';
//del
echo '<td>';
echo '<form action = "quotes.php" method = "post">
<input type = "submit" name="Delete" value="Delete" class="w3-padding-16 w3-hover-dark-grey w3-btn-block w3-center-align"/>
<input type="hidden" name="delPerson" value="TRUE">
<input type="hidden" name="del_quote_id" value=' . $row['quote_id'] . '>
</form>';
echo '</td>';
echo '</tr>';
}
echo '</tbody>
</table>
</div>';
}
?>

+ 44
- 0
quotes/newPerson.php View File

@ -0,0 +1,44 @@
<?php
if($loggedIn)
{
$errors = array();
if(isset($_POST['newPerson']))
{
$i_first = mysqli_real_escape_string($dbc, trim($_POST['person_first']));
$i_last = mysqli_real_escape_string($dbc, trim($_POST['person_last']));
$q = "insert into people (name, creation_date) values ('" . $i_first . " " . $i_last . "' , now())";
$r = mysqli_query($dbc, $q);
header("Location: quotes.php");
}
echo '<h1 class="w3-text-teal"><center>New Person</center></h1>';
echo '<form action="quotes.php" method ="post" class="w3-container w3-card-4">
<div class="w3-group">
<input class="w3-input" type="text" name="person_first" required>
<label class="w3-label w3-validate">First Name</label>
</div>
<div class="w3-group">
<input class="w3-input" type="text" name="person_last" required>
<label class="w3-label w3-validate">Last Name</label>
</div>
<p><input type="submit" name="Submit" value="Add Person" class="w3-padding-16 w3-hover-dark-grey w3-btn-block w3-center-align" /></p>
<input type="hidden" name="newPerson" value="TRUE" />
</form>';
foreach($errors as $msg)
{
echo " - $msg<br />";
}
}
?>

+ 80
- 0
quotes/newQuote.php View File

@ -0,0 +1,80 @@
<?php
if($loggedIn)
{
$errors = array();
if(isset($_POST['new_quote']))
{
$i_name = mysqli_real_escape_string($dbc, trim($_POST['add_quote_name']));
$i_quote = mysqli_real_escape_string($dbc, trim($_POST['add_quote_quote']));
$q = "select * from people where name ='$i_name'";
$r = mysqli_query($dbc, $q);
if(@mysqli_num_rows($r) == 1)
{
while($row = mysqli_fetch_array($r))
{
$person_id = $row['person_id'];
}
if($_POST['add_quote_visibility'])
{
$q_create = "insert into quote (user_id, creation_date, person_id, quote, visibility) values ('" . $_SESSION['user_id'] . "', now(), '$person_id', '$i_quote', true)";
}
else
{
$q_create = "insert into quote (user_id, creation_date, person_id, quote, visibility) values ('" . $_SESSION['user_id'] . "', now(), '$person_id', '$i_quote', false)";
}
//echo $q_create;
mysqli_query($dbc, $q_create);
header("Location: quotes.php");
}
}
echo '<h1 class="w3-text-teal"><center>New Quote</center></h1>';
echo '<form action="quotes.php" method ="post" class="w3-container w3-card-4">';
$q = "select name from people order by name asc";
$r = mysqli_query($dbc, $q);
echo '<select class="w3-select" name ="add_quote_name">';
while($row = mysqli_fetch_array($r))
{
echo '<option value="' . $row['name'] . '">';
echo $row['name'] . '</option>';
}
echo '</select>';
echo '<div class="w3-group">
<input class="w3-input" type="text" name="add_quote_quote" required>
<label class="w3-label w3-validate">Quote</label>
</div>
<input class="w3-check" type="checkbox" name="add_quote_visibility" checked>
<label class="w3-validate">Public<label>
<p><input type="submit" name="Submit" value="Create Quote" class="w3-padding-16 w3-hover-dark-grey w3-btn-block w3-center-align" /></p>
<input type="hidden" name="new_quote" value="TRUE" />
</form>';
foreach($errors as $msg)
{
echo " - $msg<br />";
}
}
?>

+ 198
- 0
quotes/panda.php View File

@ -0,0 +1,198 @@
<?php
function wordWrapAnnotation(&$image, &$draw, $text, $maxWidth)
{
$words = explode(" ", $text);
$lines = array();
$i = 0;
$lineHeight = 0;
while($i < count($words) )
{
$currentLine = $words[$i];
if($i+1 >= count($words))
{
$lines[] = $currentLine;
break;
}
//Check to see if we can add another word to this line
$metrics = $image->queryFontMetrics($draw, $currentLine . ' ' . $words[$i+1]);
while($metrics['textWidth'] <= $maxWidth)
{
//If so, do it and keep doing it!
$currentLine .= ' ' . $words[++$i];
if($i+1 >= count($words))
break;
$metrics = $image->queryFontMetrics($draw, $currentLine . ' ' . $words[$i+1]);
}
//We can't add the next word to this line, so loop to the next line
$lines[] = $currentLine;
$i++;
//Finally, update line height
if($metrics['textHeight'] > $lineHeight)
$lineHeight = $metrics['textHeight'];
}
return array($lines, $lineHeight);
}
function displayImage($quote, $person, $imageLoc)
{
$draw = new ImagickDraw();
$image = new Imagick();
$image->readImage($imageLoc);
//grayscale
//$image->modulateImage(100, 0, 100);
/* Green text */
$draw->setFillColor("rgb(0,255,0)");
/* Font properties */
$draw->setFont('Bookman-DemiItalic');
$fontsize = 0.05 * $image->getimagewidth();
$draw->setFontSize( "$fontsize" );
//width = 1180 font is 50
//width = 300 font is 15
//font = slope of diff(width) + x intercept
$xpos = $image->getimagewidth()/4;
$ypos = $image->getimageheight()/4;
$msg = '"' . $quote . '"' . " - $person";
list($lines, $lineHeight) = wordWrapAnnotation($image, $draw, $msg, $image->getimagewidth() /2);
for($i = 0; $i < count($lines); $i++)
{
$image->annotateImage($draw, $xpos, $ypos + $i*$lineHeight, 0, $lines[$i]);
}
/* Give image a format */
$image->setImageFormat('png');
echo '<img src="data:image/jpg;base64,'.base64_encode($image->getImageBlob()).'" alt="" width="100%"/>';
}
function printHalf($query)
{
//random
$r = mysqli_query ($dbc, $query);
while($row = mysqli_fetch_array($r))
{
$q2 = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
$r2 = mysqli_query($dbc, $q2);
while($row2 = mysqli_fetch_array($r2))
{
$images = glob('../img/*');
displayImage($row['quote'], $row2['name'], $images[rand(0, count($images) - 1)]);
}
}
echo '</div>';
}
echo '<div class="w3-row-padding w3-center w3-margin-top">';
echo '<div class="w3-half">';
echo '<h1 class="w3-text-teal w3-center">Random Quote</h1>';
$q ="select * from quote where visibility=true order by rand() limit 1";
$r = mysqli_query ($dbc, $q);
while($row = mysqli_fetch_array($r))
{
$q2 = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
$r2 = mysqli_query($dbc, $q2);
while($row2 = mysqli_fetch_array($r2))
{
$images = glob('../img/*');
displayImage($row['quote'], $row2['name'], $images[rand(0, count($images) - 1)]);
}
}
echo '</div>';
echo '<div class="w3-half">';
echo '<h1 class="w3-text-teal w3-center">Most Recent</h1>';
$q ="select * from quote where visibility=true order by creation_date desc limit 1";
$r = mysqli_query ($dbc, $q);
while($row = mysqli_fetch_array($r))
{
$q2 = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
$r2 = mysqli_query($dbc, $q2);
while($row2 = mysqli_fetch_array($r2))
{
$images = glob('../img/*');
displayImage($row['quote'], $row2['name'], $images[rand(0, count($images) - 1)]);
}
}
echo '</div>';
echo '</div>';
echo '<div class="w3-row-padding w3-center w3-margin-top">';
echo '<div class="w3-half row-center">';
if(isset($_POST['panda']))
{
displayImage($_POST['panda_quote'], $_POST['panda_name'], $images[rand(0, count($images) - 1)]);
}
echo '<h1 class="w3-text-teal w3-center">Create a panda quote!</h1>';
echo '<form action="index.php" method ="post" class="w3-container w3-card-4">
<div class="w3-group">
<input class="w3-input" type="text" name="panda_quote" required>
<label class="w3-label w3-validate">Quote</label>
</div>
<div class="w3-group">
<input class="w3-input" type="text" name="panda_name" required>
<label class="w3-label w3-validate">Person\'s Name</label>
</div>
<p><input type="submit" name="Submit" value="Create Panda Quote" class="w3-padding-16 w3-hover-dark-grey w3-btn-block w3-center-align" /></p>
<input type="hidden" name="panda" value="TRUE" />
</form>';
echo '</div>';
echo '<div class="w3-half w3-container">';
//profile
include('user/profile.php');
echo '</div>';
echo '</div>';
?>

+ 60
- 0
quotes/people.php View File

@ -0,0 +1,60 @@
<?php
if($loggedIn)
{
if(isset($_POST['delPerson']))
{
$delete_id = mysqli_real_escape_string($dbc, trim($_POST['del_person_id']));
$q = "delete from people where person_id='$delete_id' limit 1";
mysqli_query($dbc, $q);
$q = "delete from quote where person_id='$delete_id'";
mysqli_query($dbc, $q);
}
echo '<h1 class="w3-text-teal w3-center">People</h1>';
$q = "select * from people";
$r = mysqli_query($dbc, $q);
echo '<div class="w3-responsive w3-card-4">
<table class="w3-table w3-striped w3-bordered">
<thead>
<tr class="w3-theme w3-center">
<td>Name</td>
<td>Delete</td>
</tr>
</thead>
<tbody>
';
while($row = mysqli_fetch_array($r))
{
echo '<tr>';
//display name
echo "<td>" . $row['name'] . "</td>";
//del
echo '<td>';
echo '<form action = "quotes.php" method = "post">
<input type = "submit" name="Delete" value="Delete" class="w3-padding-16 w3-hover-dark-grey w3-btn-block w3-center-align"/>
<input type="hidden" name="delPerson" value="TRUE">
<input type="hidden" name="del_person_id" value=' . $row['person_id'] . '>
</form>';
echo '</td>';
echo '</tr>';
}
echo '</tbody>
</table>
</div>';
}
?>

+ 124
- 0
quotes/private.php View File

@ -0,0 +1,124 @@
<?php
if($loggedIn)
{
echo '<div class="w3-row w3-padding-32">';
echo '<h1 class="w3-text-teal w3-center">Private Quotes</h1>';
$q_people = "select * from people order by name asc";
$r_people = mysqli_query($dbc, $q_people);
$i = 1;
$row_count = $r_people->num_rows;
//echo $row_count;
//$people_array = mysqli_fetch_array($r_people);
echo '<div class="w3-half w3-container">';
while($row = mysqli_fetch_array($r_people))
{
if($i <= $row_count/2)
{
//printPerson($row['person_id']);
//echo $row['name'];
$q_quotes = "select * from quote where person_id='" . $row['person_id'] . "' and visibility=false";
//echo $q_quotes;
$r = mysqli_query($dbc, $q_quotes);
if($r->num_rows == 0)
{
//echo 'nada';
}
else
{
echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
echo '<p class="w3-xlarge w3-serif">';
while($row_quote = mysqli_fetch_array($r))
{
echo '<i>"' . $row_quote['quote'] . '"</i><br>';
}
echo '</p>';
$q_name = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
//echo $q_name;
$r_name = mysqli_query($dbc, $q_name);
while($row_name = mysqli_fetch_array($r_name))
{
echo '<p>' . $row_name['name'] . '</p>';
}
echo '</div>';
}
}
$i++;
}
echo '</div>';
echo '<div class="w3-half w3-container">';
$i = 1;
$r_people = mysqli_query($dbc, $q_people);
while($row = mysqli_fetch_array($r_people))
{
if($i <= $row_count && $i > $row_count/2)
{
//printPerson($row['person_id']);
//echo $row['name'];
$q_quotes = "select * from quote where person_id='" . $row['person_id'] . "' and visibility=false";
//echo $q_quotes;
$r = mysqli_query($dbc, $q_quotes);
if($r->num_rows == 0)
{
//echo 'nada';
}
else
{
echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
echo '<p class="w3-xlarge w3-serif">';
while($row_quote = mysqli_fetch_array($r))
{
echo '<i>"' . $row_quote['quote'] . '"</i><br>';
}
echo '</p>';
$q_name = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
//echo $q_name;
$r_name = mysqli_query($dbc, $q_name);
while($row_name = mysqli_fetch_array($r_name))
{
echo '<p>' . $row_name['name'] . '</p>';
}
echo '</div>';
}
}
$i ++;
}
echo '</div>';
echo '</div>';
}
?>

+ 120
- 0
quotes/public.php View File

@ -0,0 +1,120 @@
<?php
echo '<div class="w3-row w3-padding-32">';
echo '<h1 class="w3-text-teal w3-center">Quotes</h1>';
$q_people = "select * from people order by name asc";
$r_people = mysqli_query($dbc, $q_people);
$i = 1;
$row_count = $r_people->num_rows;
//echo $row_count;
//$people_array = mysqli_fetch_array($r_people);
echo '<div class="w3-half w3-container">';
while($row = mysqli_fetch_array($r_people))
{
if($i <= $row_count/2)
{
//printPerson($row['person_id']);
//echo $row['name'];
$q_quotes = "select * from quote where person_id='" . $row['person_id'] . "' and visibility=true";
//echo $q_quotes;
$r = mysqli_query($dbc, $q_quotes);
if($r->num_rows == 0)
{
//echo 'nada';
}
else
{
echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
echo '<p class="w3-xlarge w3-serif">';
while($row_quote = mysqli_fetch_array($r))
{
echo '<i>"' . $row_quote['quote'] . '"</i><br>';
}
echo '</p>';
$q_name = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
//echo $q_name;
$r_name = mysqli_query($dbc, $q_name);
while($row_name = mysqli_fetch_array($r_name))
{
echo '<p>' . $row_name['name'] . '</p>';
}
echo '</div>';
}
}
$i++;
}
echo '</div>';
echo '<div class="w3-half w3-container">';
$i = 1;
$r_people = mysqli_query($dbc, $q_people);
while($row = mysqli_fetch_array($r_people))
{
if($i <= $row_count && $i > $row_count/2)
{
//printPerson($row['person_id']);
//echo $row['name'];
$q_quotes = "select * from quote where person_id='" . $row['person_id'] . "' and visibility=true";
//echo $q_quotes;
$r = mysqli_query($dbc, $q_quotes);
if($r->num_rows == 0)
{
//echo 'nada';
}
else
{
echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
echo '<p class="w3-xlarge w3-serif">';
while($row_quote = mysqli_fetch_array($r))
{
echo '<i>"' . $row_quote['quote'] . '"</i><br>';
}
echo '</p>';
$q_name = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
//echo $q_name;
$r_name = mysqli_query($dbc, $q_name);
while($row_name = mysqli_fetch_array($r_name))
{
echo '<p>' . $row_name['name'] . '</p>';
}
echo '</div>';
}
}
$i ++;
}
echo '</div>';
echo '</div>';
?>

+ 9
- 0
quotes_connect.php View File

@ -0,0 +1,9 @@
<?php
try
{
$dbc = mysqli_connect("127.0.0.1", "quote_user", 'supersecretpassword', "quotes");
} catch (Exception $ex) {
echo 'Bad things just happened';
}
?>

+ 102
- 0
user/editUser.php View File

@ -0,0 +1,102 @@
<?php
if($admin)
{
$errors = array();
if(isset($_POST['edit_user']))
{
$i_username = mysqli_real_escape_string($dbc, trim($_POST['edit_user_username']));
$i_first = mysqli_real_escape_string($dbc, trim($_POST['edit_user_first']));
$i_last = mysqli_real_escape_string($dbc, trim($_POST['edit_user_last']));
$i_password = mysqli_real_escape_string($dbc, trim($_POST['edit_user_pass']));
$i_admin = mysqli_real_escape_string($dbc, trim($_POST['edit_user_admin']));
$passcom = $i_password . $i_first;
$passcom = SHA1($passcom);
if($i_admin)
{
$admin_temp = "true";
}
else
{
$admin_temp = "false";
}
$q = "select user_id from users where user_name ='$i_username'";
$r = mysqli_query($dbc, $q);
while($row = mysqli_fetch_array($r))
{
$q = "update users set first_name ='$i_first' where user_id='" . $row['user_id'] . "'";
$r2 = mysqli_query($dbc, $q);
$q = "update users set last_name ='$i_last' where user_id='" . $row['user_id'] . "'";
$r2 = mysqli_query($dbc, $q);
$q = "update users set pass ='$passcom' where user_id='" . $row['user_id'] . "'";
$r2 = mysqli_query($dbc, $q);
//echo $q;
$q = "update users set admin =$admin_temp where user_id='" . $row['user_id'] . "'";
$r2 = mysqli_query($dbc, $q);
//echo $q;
}
header("Location: admin.php");
}
echo '<h1 class="w3-text-teal"><center>Edit User</center></h1>';
echo '<form action="admin.php" method ="post" class="w3-container w3-card-4">';
$q = "select user_name from users";
$r = mysqli_query($dbc, $q);
echo '<select class="w3-select" name ="edit_user_username">';
while($row = mysqli_fetch_array($r))
{
echo '<option value="' . $row['user_name'] . '">';
echo $row['user_name'] . '</option>';
}
echo '</select>';
echo '<div class="w3-group">
<input class="w3-input" type="text" name="edit_user_first" required>
<label class="w3-label w3-validate">First Name</label>
</div>
<div class="w3-group">
<input class="w3-input" type="text" name="edit_user_last" required>
<label class="w3-label w3-validate">Last Name</label>
</div>
<div class="w3-group">
<input class="w3-input" type="password" name="edit_user_pass" maxlength="20" required>
<label class="w3-label w3-validate">Password</label>
</div>
<input class="w3-check" type="checkbox" name="edit_user_admin">
<label class="w3-validate">Admin<label>
<p><input type="submit" name="Submit" value="Edit User" class="w3-padding-16 w3-hover-dark-grey w3-btn-block w3-center-align" /></p>
<input type="hidden" name="edit_user" value="TRUE" />
</form>';
foreach($errors as $msg)
{
echo " - $msg<br />";
}
}
?>

+ 93
- 0
user/newUser.php View File

@ -0,0 +1,93 @@
<?php
if($admin)
{
$errors = array();
if(isset($_POST['newUser']))
{
// echo '**********';
$i_first = mysqli_real_escape_string($dbc, trim($_POST['first']));
$i_last = mysqli_real_escape_string($dbc, trim($_POST['last']));
$i_pass = mysqli_real_escape_string($dbc, trim($_POST['pass']));
$i_user = mysqli_real_escape_string($dbc, trim($_POST['user_name']));
if($i_first && $i_last && $i_pass && $i_user)
{
$q = "select user_id from users where user_name='$i_user'";
$r = mysqli_query($dbc, $q);
if(@mysqli_num_rows($r) == 1)
{
$errors['name'] = "That user name is already in use.";
}
}
else
{
$errors['input'] = "Please fill in all fields!";
}
if(empty($errors))
{
$passcom = $i_pass . $i_first;
$passcom = SHA1($passcom);
if(isset($_POST['admin']))
{
$adminn = "true";
}
else
{
$adminn = "false";
}
$q = "insert into users(first_name, last_name, user_name, pass, registration_date, admin) values ('$i_first', '$i_last' , '$i_user', '$passcom', now(), $adminn)";
//echo $q;
$r = mysqli_query($dbc, $q);
header("Location: admin.php");
}
}
echo '<h1 class="w3-text-teal"><center>Add User</center></h1>';
echo '<form action="admin.php" method ="post" class="w3-container w3-card-4">
<div class="w3-group">
<input class="w3-input" type="text" name="user_name" required>
<label class="w3-label w3-validate">User Name</label>
</div>
<div class="w3-group">
<input class="w3-input" type="text" name="first" required>
<label class="w3-label w3-validate">First Name</label>
</div>
<div class="w3-group">
<input class="w3-input" type="text" name="last" required>
<label class="w3-label w3-validate">Last Name</label>
</div>
<div class="w3-group">
<input class="w3-input" type="password" name="pass" maxlength="20" required>
<label class="w3-label w3-validate">Password</label>
</div>
<input class="w3-check" type="checkbox" name="admin">
<label class="w3-validate">Admin<label>
<p><input type="submit" name="Submit" value="Add User" class="w3-padding-16 w3-hover-dark-grey w3-btn-block w3-center-align" /></p>
<input type="hidden" name="newUser" value="TRUE" />
</form>';
foreach($errors as $msg)
{
echo " - $msg<br />";
}
}
?>

+ 145
- 0
user/profile.php View File

@ -0,0 +1,145 @@
<?php
//ini_set('display_errors', 1);
$errors = array();
if(isset($_POST['logout']))
{
$_SESSION = array();
echo '<h3>You are now logged out</h3>';
echo("<meta http-equiv='refresh' content='1'>");
}
if(isset($_POST['log_in']))
{
//echo 'Login procces';
if(isset($_POST['user_name']))
{
$i_username = @mysqli_real_escape_string($dbc, trim($_POST['user_name']));
}
else
{
$errors['User Name'] = 'You need to enter a user name!';
}
if(isset($_POST['password']))
{
$i_password = @mysqli_real_escape_string($dbc, trim($_POST['password']));
}
else
{
$errors['password'] = "You need to enter a password!";
}
if($i_password && $i_username)
{
//valid username
$q3 = "select * from users where user_name='$i_username'";
//echo $q3;
$r3 = mysqli_query($dbc, $q3);
if(@mysqli_num_rows($r3) == 1)
{
//echo 'das good';
$firstName = "";
while($row = mysqli_fetch_array($r3))
{
$firstName = $row['first_name'];
}
$q2 = "select * from users where user_name = '$i_username' and pass ='" . SHA1($i_password . $firstName) . "'";
//echo $q2;
$r2 = mysqli_query($dbc, $q2);
//30 minutes of error seaching to realize if frogot the s in mysqli
if(@mysqli_num_rows($r2) == 1)
{
while($row = mysqli_fetch_array($r2))
{
$_SESSION['use'] = true;
$_SESSION['fname'] = $firstName;
$_SESSION['user_id'] = $row['user_id'];
$_SESSION['username'] = $row['user_name'];
$_SESSION['agent'] = md5($_SERVER['HTTP_USERAGENT'] . 'salt');
header("Location: index.php");
}
}
else
{
$errors['password'] = "You entered an invalid password";
}
}
else
{
$errors['user'] = "You entered an invalid user name!";
}
}
}
echo '<h1 class="w3-text-teal">';
echo '<center>';
if($loggedIn)
{
echo 'Profile';
}
else
{
echo 'Log In';
}
echo '</center></h1>';
echo '<div class ="w3-card-4 w3-container w3-padding-16">';
if($loggedIn)
{
echo '<h3 class="w3-center">Welcome ' . $_SESSION['fname'] . '</h3>';
echo '<form action="index.php" method ="post">
<input class="w3-padding-16 w3-hover-dark-grey w3-btn-block w3-center-align" type="submit" name ="logout" value="logout" />
<input type="hidden" name="logout" value="TRUE" />
</form>';
}
else
{
//prints login form
echo '<form action ="index.php" method ="post">
<div class="w3-group">
<input class="w3-input" type="text" value="" name="user_name" class="w3-container w3-card-4" required/>
<label class="w3-label w3-validate">User Name</label>
</div>
<div class="w3-group">
<input class="w3-input" type="password" value="" name="password" class="w3-container w3-card-4" required/>
<label class="w3-label w3-validate">Password</label>
</div>
<input type="submit" name="login" value="login" class="w3-padding-16 w3-hover-dark-grey w3-btn-block w3-center-align"/>
<input type="hidden" name="log_in" value="TRUE"/>
</form>';
}
foreach($errors as $msg)
{
echo " - $msg<br />";
}
echo '</div>';
?>

+ 71
- 0
user/users.php View File

@ -0,0 +1,71 @@
<?php
//11-24-16
if($admin)
{
if(isset($_POST['delUser']))
{
$i_id = mysqli_real_escape_string($dbc, trim($_POST['del_user_id']));
$q = "delete from users where user_id='$i_id'";
$r = mysqli_query($dbc, $q);
header("Location: admin.php");
}
echo '<h1 class="w3-text-teal"><center>Users</center></h1>';
$q = "select * from users order by first_name asc";
$r = mysqli_query($dbc, $q);
echo '<div class="w3-responsive w3-card-4"><table class="w3-table w3-striped w3-bordered"><thead>';
echo '<tr class="w3-theme">
<td>First Name</td>
<td>Last Name</td>
<td>User Name</td>
<td>Admin</td>
<td><center>Delete User<center></td>
</tr></thead><tbody>';
while($row = mysqli_fetch_array($r))
{
echo '<tr>';
//first name
echo '<td>' . $row['first_name'] . '</td>';
//last name
echo '<td>' . $row['last_name'] . '</td>';
//username
echo '<td>' . $row['user_name'] . '</td>';
//admin
if($row['admin'])
{
echo '<td>True</td>';
}
else
{
echo '<td>False</td>';
}
//del
echo '<td>';
echo '<form action = "admin.php" method = "post">
<input type = "submit" name="Delete" value="Delete" class="w3-padding-16 w3-hover-dark-grey w3-btn-block w3-center-align"/>
<input type="hidden" name="delUser" value="TRUE">
<input type="hidden" name="del_user_id" value=' . $row['user_id'] . '>
</form>';
echo '</td>';
echo '</tr>';
}
echo '</tbody></table></div>';
}
?>

Loading…
Cancel
Save