Skip to content

Commit

Permalink
Minor settings changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Markloev committed Dec 5, 2016
1 parent f064088 commit f05ee0b
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 10 deletions.
6 changes: 5 additions & 1 deletion includes/header.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?php
session_start();
if(session_id() == '') {
session_start();
}
include('common_functions.php');
$mysqli = new mysqli("mysql.cis.ksu.edu", "markloev", "pcEkhG5B5kg8XExJ%RD", "markloev");
$current_page = basename($_SERVER['SCRIPT_FILENAME']);
if(!checkLogin() && ($current_page != "login.php" && $current_page != "logout.php" && $current_page != "signUp.php")) {
header("Location: login.php");
}
?>

<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down Expand Up @@ -58,3 +61,4 @@
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<link rel="stylesheet" href="includes/main.css">
109 changes: 109 additions & 0 deletions includes/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
.navbar-default {
background-color: #981a0d;
border-color: #8b1d12;
}
.navbar-default .navbar-brand {
color: #ecf0f1;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #ffbbbc;
}
.navbar-default .navbar-text {
color: #ecf0f1;
}
.navbar-default .navbar-nav > li > a {
color: #ecf0f1;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #ffbbbc;
}
.navbar-default .navbar-nav > li > .dropdown-menu {
background-color: #981a0d;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a {
color: #ecf0f1;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:focus {
color: #ffbbbc;
background-color: #8b1d12;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > .divider {
background-color: #8b1d12;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffbbbc;
background-color: #8b1d12;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #ffbbbc;
background-color: #8b1d12;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
color: #ffbbbc;
background-color: #8b1d12;
}
.navbar-default .navbar-toggle {
border-color: #8b1d12;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #8b1d12;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #ecf0f1;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #ecf0f1;
}
.navbar-default .navbar-link {
color: #ecf0f1;
}
.navbar-default .navbar-link:hover {
color: #ffbbbc;
}

@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #ecf0f1;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffbbbc;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffbbbc;
background-color: #8b1d12;
}
}

.btn-primary {
background: #981a0d;
color: #ffffff;
border-color: #981a0d;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .open > .dropdown-toggle.btn-primary, .btn-primary.active {
background: #8b1d12 !important;
border-color: #981a0d !important;
}

:disabled {
background: #8b1d12 !important;
border-color: #981a0d !important;
}

h1{
font-weight: bold;
}
12 changes: 9 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
}
include('includes/header.php');

$totalPoints = 0;
$season = "";
$week = "";
if(isset($_GET['season'])) {
Expand Down Expand Up @@ -79,8 +80,8 @@
No team this week.
</div>
<?php } else { //pprint($team) ?>
<input type='submit' style="width: 10%; float: right;" class='btn btn-primary form-control' id='delete' name='delete' value='Delete Team'>
<table class='table table-striped'>
<input type='submit' style="width: 10%; float: right;" class='btn btn-primary form-control' id='delete' name='delete' value='Delete Team'><br><br><br>
<table class='table table-striped table-bordered table-hover'>
<thead>
<th>Position</th>
<th>Player</th>
Expand All @@ -90,7 +91,10 @@
<?php $pos = array("QB","RB1","RB2","WR1","WR2","TE","FLEX","DF","PK");
foreach($pos as $p) {
printPlayer($p, $team[$p]);
} ?>
}
global $totalPoints;
?>
<tr><td colspan=3 class="pos" align="center">Total Points: <?= " ".$totalPoints ?></td></tr>
</tbody>
</table>
<?php } ?>
Expand Down Expand Up @@ -157,6 +161,8 @@ function calculatePoints($pos, $player) {
$points += (0.04*$passYds) + (0.1*($recYds + $rushYds));
$points -= (2*($int + $fumbles));
}
global $totalPoints;
$totalPoints += $points;
echo $points;
}
?>
Expand Down
27 changes: 21 additions & 6 deletions settings.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<?php
include('includes/header.php');
session_start();
$mysqli = new mysqli("mysql.cis.ksu.edu", "markloev", "pcEkhG5B5kg8XExJ%RD", "markloev");

if(isset($_GET['username'])){
echo "<div class='alert alert-success'>
<strong>Success! </strong>You have successfully updated your username.
</div>";
}

if(isset($_POST['confirmNewUsername'])){
$username = $_POST['newUsername'];
$query = "SELECT username FROM Users";
$result = $mysqli->query($query);
$array = r2a($result);
$array = r2aSettings($result);
$taken = false;
foreach($array as $a){
if($username == $a['username']){
Expand All @@ -16,9 +23,7 @@
$query = "UPDATE Users SET username='".$username."' WHERE username='".$_SESSION['user']['username']."'";
$mysqli->query($query);
$_SESSION['user']['username'] = $username;
echo "<div class='alert alert-success'>
<strong>Success!</strong>You have successfully updated your username.
</div>";
header("settings.php?username=true");
}
}

Expand All @@ -27,10 +32,12 @@
$query = "UPDATE Users SET password='".$password."' WHERE username='".$_SESSION['user']['username']."'";
$mysqli->query($query);
echo "<div class='alert alert-success'>
<strong>Success!</strong>You have successfully updated your password.
<strong>Success! </strong>You have successfully updated your password.
</div>";
}

include('includes/header.php');

?>

<style>
Expand Down Expand Up @@ -68,6 +75,14 @@

<?php
include('includes/footer.php');

function r2aSettings($r) {
$a = array();
while($row = mysqli_fetch_assoc($r)) {
$a[] = $row;
}
return $a;
}
?>

<script>
Expand Down

0 comments on commit f05ee0b

Please sign in to comment.