forked from csc325/GCal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
338 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,136 @@ | ||
<?php | ||
require_once 'global.php'; | ||
require_once 'header.php'; | ||
/* | ||
* categories.php: Original Version of category management feature | ||
* categoryAdmin2.php is current version | ||
* PHP version 5 | ||
* | ||
* LICENSE: This source file is subject to version 3.01 of the PHP license | ||
* that is available through the world-wide-web at the following URI: | ||
* http://www.php.net/license/3_01.txt. If you did not receive a copy of | ||
* the PHP License and are unable to obtain it through the web, please | ||
* send a note to [email protected] so we can mail you a copy immediately. | ||
* | ||
* @category Administrator Functions | ||
* @author CSC-325 Database and Web Application Fall 2010 Class | ||
* @license http://www.php.net/license/3_01.txt PHP License 3.01 | ||
* @version 1.0 | ||
* @deprecated File deprecated since version 3.0 categoryAdmin2.php | ||
*/ | ||
|
||
/*Require html header and global variables*/ | ||
require_once 'global.php'; | ||
require_once 'header.php'; | ||
|
||
echo '<div class="body">'; | ||
echo '<div class="col large">'; | ||
echo '<div class="body">'; | ||
echo '<div class="col large">'; | ||
|
||
if ( $_POST ) | ||
{ | ||
$queryDelete = 'UPDATE categories SET permanent=0 WHERE categoryID = '; | ||
$queryAdd = 'UPDATE categories SET permanent=1 WHERE categoryID = '; | ||
|
||
$addArray = array_keys( $_POST, 'add' ); | ||
$deleteArray = array_keys( $_POST, 'delete' ); | ||
if ($_POST) { | ||
$query_delete = 'UPDATE categories SET permanent=0 WHERE categoryID = '; | ||
$query_add = 'UPDATE categories SET permanent=1 WHERE categoryID = '; | ||
$add_array = array_keys($_POST, 'add'); | ||
$delete_array = array_keys($_POST, 'delete'); | ||
|
||
if ( $addArray ) | ||
{ | ||
$queryAdd .= implode( ' OR categoryID = ', $addArray ); | ||
$resultAdd = mysql_query($queryAdd); | ||
echo mysql_error(); | ||
/* To do: error check */ | ||
} | ||
if ($addArray) { | ||
$query_add .= implode(' OR categoryID = ', $add_array); | ||
$result_add = mysql_query($query_add); | ||
echo mysql_error(); | ||
/* To do: error check */ | ||
} | ||
|
||
if ( $deleteArray ) | ||
{ | ||
$queryDelete .= implode( ' OR categoryID = ', $deleteArray ); | ||
$resultDelete = mysql_query($queryDelete); | ||
echo mysql_error(); | ||
/* To do: error check */ | ||
} | ||
} | ||
if ($delete_array) { | ||
$query_delete .= implode(' OR categoryID = ', $delete_array); | ||
$result_delete = mysql_query($query_delete); | ||
echo mysql_error(); | ||
/* To do: error check */ | ||
} | ||
} | ||
|
||
$queryPerm = "SELECT * FROM categories | ||
$query_perm = "SELECT * FROM categories | ||
WHERE permanent=1 | ||
ORDER BY requestCount DESC, | ||
categoryName ASC"; | ||
|
||
$resultPerm = mysql_query($queryPerm); | ||
$result_perm = mysql_query($query_perm); | ||
|
||
$queryTemp = "SELECT * FROM categories | ||
$query_temp = "SELECT * FROM categories | ||
WHERE permanent=0 | ||
ORDER BY requestCount DESC, | ||
categoryName ASC"; | ||
|
||
$resultTemp = mysql_query($queryTemp); | ||
?> | ||
$result_temp = mysql_query($query_temp); | ||
?> | ||
|
||
<form name="categoryPerm" action="categories.php" method="post"> | ||
<table> | ||
<tr> | ||
<td colspan="3"> | ||
<h1>Permanent Categories</h1> | ||
</td> | ||
</tr> | ||
<form name="categoryPerm" action="categories.php" method="post"> | ||
<table> | ||
<tr> | ||
<td colspan="3"> | ||
<h1>Permanent Categories</h1> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<th>Category</th> | ||
<th>Requests</th> | ||
<th>Delete</th> | ||
</tr> | ||
<tr> | ||
<th>Category</th> | ||
<th>Requests</th> | ||
<th>Delete</th> | ||
</tr> | ||
|
||
<?php while ($row = mysql_fetch_assoc($resultPerm)) : ?> | ||
<?php while ($row = mysql_fetch_assoc($resultPerm)) : ?> | ||
|
||
<tr> | ||
<td><?php echo $row['categoryName']; ?></td> | ||
<td><?php echo $row['requestCount']; ?></td> | ||
<td><input type="checkbox" name="<?php echo $row['categoryID']; ?>" value="delete"></td> | ||
</tr> | ||
<tr> | ||
<td><?php echo $row['categoryName']; ?></td> | ||
<td><?php echo $row['requestCount']; ?></td> | ||
<td><input type="checkbox" name="<?php echo $row['categoryID']; ?>" value="delete"></td> | ||
</tr> | ||
|
||
<?php endwhile; ?> | ||
<?php endwhile; ?> | ||
|
||
<tr> | ||
<td colspan="3"> | ||
<h1>Temporary Categories</h1> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan="3"> | ||
<h1>Temporary Categories</h1> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<th>Category</th> | ||
<th>Requests</th> | ||
<th>Add</th> | ||
</tr> | ||
<tr> | ||
<th>Category</th> | ||
<th>Requests</th> | ||
<th>Add</th> | ||
</tr> | ||
|
||
<?php while ($row = mysql_fetch_assoc($resultTemp)) : ?> | ||
<?php while ($row = mysql_fetch_assoc($resultTemp)) : ?> | ||
|
||
<tr> | ||
<td><?php echo $row['categoryName']; ?></td> | ||
<td><?php echo $row['requestCount']; ?></td> | ||
<td><input type="checkbox" name="<?php echo $row['categoryID']; ?>" value="add"></td> | ||
</tr> | ||
<tr> | ||
<td><?php echo $row['categoryName']; ?></td> | ||
<td><?php echo $row['requestCount']; ?></td> | ||
<td><input type="checkbox" name="<?php echo $row['categoryID']; ?>" value="add"></td> | ||
</tr> | ||
|
||
<?php endwhile; ?> | ||
<?php endwhile; ?> | ||
|
||
</table> | ||
</table> | ||
|
||
<input type="submit" value="update"> | ||
</form> | ||
<input type="submit" value="update"> | ||
</form> | ||
|
||
<style type="text/css"> | ||
table { | ||
margin: 10px 10px 10px 0; | ||
} | ||
<style type="text/css"> | ||
table { | ||
margin: 10px 10px 10px 0; | ||
} | ||
|
||
td, th { | ||
padding: 5px; | ||
border: 1px solid #ccc; | ||
} | ||
td, th { | ||
padding: 5px; | ||
border: 1px solid #ccc; | ||
} | ||
|
||
th { | ||
text-align: left; | ||
font-size: 14px; | ||
color: #555; | ||
} | ||
</style> | ||
th { | ||
text-align: left; | ||
font-size: 14px; | ||
color: #555; | ||
} | ||
</style> | ||
|
||
<?php | ||
echo '</div>'; | ||
require_once 'sidebar.php'; | ||
echo '</div>'; | ||
require_once 'footer.php'; | ||
<?php | ||
echo '</div>'; | ||
require_once 'sidebar.php'; | ||
echo '</div>'; | ||
require_once 'footer.php'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
<?php | ||
require_once 'global.php'; | ||
require_once 'header.php'; | ||
/* | ||
* categoryAdmin2.php: Current version of category management | ||
* PHP version 5 | ||
* | ||
* LICENSE: This source file is subject to version 3.01 of the PHP license | ||
* that is available through the world-wide-web at the following URI: | ||
* http://www.php.net/license/3_01.txt. If you did not receive a copy of | ||
* the PHP License and are unable to obtain it through the web, please | ||
* send a note to [email protected] so we can mail you a copy immediately. | ||
* | ||
* @category Administrator Functions | ||
* @author CSC-325 Database and Web Application Fall 2010 Class | ||
* @license http://www.php.net/license/3_01.txt PHP License 3.01 | ||
* @version 3.0 | ||
*/ | ||
|
||
/*Require html header, global variables and all functions*/ | ||
|
||
require_once 'global.php'; | ||
require_once 'header.php'; | ||
?> | ||
|
||
<!-- Permanent Categories Table --> | ||
|
@@ -91,7 +111,7 @@ | |
<button type='button' id='update'>Update</button> | ||
|
||
<script type="text/javascript"> | ||
<!-- | ||
|
||
//function that adds input field if input for location/category drop down menu is other | ||
$(document).ready(function(){ | ||
$("input[value='rename']").change ( function () { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
session_start(); | ||
require_once 'global.php'; | ||
require_once 'header.php'; | ||
|
||
if(is_admin()) { | ||
//check that user is admin | ||
|
||
echo '<div class = "body">'; | ||
echo '<div class="col large">'; | ||
echo 'Administration page for flagged events<br><br><br>'; | ||
|
||
$flagged_query = "SELECT eventID, eventName, flaggedCount FROM events | ||
WHERE events.flagged=1"; | ||
$flagged_result = mysql_query($flagged_query); | ||
|
||
if (mysql_num_rows($flagged_result) != 0) { | ||
while($row = mysql_fetch_row($flagged_result)) { | ||
echo '<a href="'.ed(false).'detailView.php?eventID='.$row[0].'">'.$row[1].'</a> has been flagged '.$row[2].' times'; | ||
echo '<br>'; | ||
echo '<a href="'.ed(false).'flag_reset.php?eventID='.$row[0].'"> I checked it dude. It is ok now... </a>'; | ||
echo '<br>'; | ||
echo '<br>'; | ||
} | ||
} | ||
|
||
} else { | ||
header('Location: '.ed(false).'index.php'); | ||
exit(); | ||
} | ||
|
||
echo '</div>'; | ||
include 'sidebar.php'; | ||
echo '</div>'; | ||
include 'footer.php'; | ||
?> |
Oops, something went wrong.