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
1 parent
bd4a004
commit 116de88
Showing
3 changed files
with
105 additions
and
57 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,36 +1,54 @@ | ||
<?php | ||
session_start(); | ||
/* | ||
* flag_admin.php | ||
* 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 admin feature | ||
* @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 | ||
*/ | ||
session_start(); | ||
require_once 'global.php'; | ||
require_once 'header.php'; | ||
|
||
if(is_admin()) { | ||
//check that user is admin | ||
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>'; | ||
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); | ||
$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(); | ||
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'; | ||
echo '</div>'; | ||
include 'sidebar.php'; | ||
echo '</div>'; | ||
include '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,26 +1,41 @@ | ||
<?php | ||
session_start(); | ||
require_once 'global.php'; | ||
/* | ||
* flag_event | ||
* 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 event feature | ||
* @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 | ||
*/ | ||
session_start(); | ||
require_once 'global.php'; | ||
|
||
// set table name | ||
$eventID = addslashes($_GET["eventID"]); | ||
// set table name | ||
$eventID = addslashes($_GET["eventID"]); | ||
|
||
//check that user is logged in and is either an admin or created the event | ||
if(is_logged_in()) { | ||
$userID = $_SESSION['userID']; | ||
//check that user is logged in and is either an admin or created the event | ||
if(is_logged_in()) { | ||
$userID = $_SESSION['userID']; | ||
|
||
//add flag | ||
$flag_query = "UPDATE events | ||
//add flag | ||
$flag_query = "UPDATE events | ||
SET | ||
flagged=1, | ||
flaggedCount = flaggedCount + 1 | ||
WHERE eventID='$eventID'"; | ||
$flag_result = mysql_query($flag_query); | ||
$flag_result = mysql_query($flag_query); | ||
|
||
header('Location: '.ed(false).'detailView.php?flag=true&eventID='.$eventID); | ||
exit(); | ||
} else { | ||
header('Location: '.ed(false).'detailView.php?eventID='.$eventID); | ||
exit(); | ||
} | ||
header('Location: '.ed(false).'detailView.php?flag=true&eventID='.$eventID); | ||
exit(); | ||
} else { | ||
header('Location: '.ed(false).'detailView.php?eventID='.$eventID); | ||
exit(); | ||
} | ||
?> |
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,24 +1,39 @@ | ||
<?php | ||
session_start(); | ||
require_once 'global.php'; | ||
/* | ||
* flag_reset : resets flag for an event to 0 in database | ||
* 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 user 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 | ||
*/ | ||
session_start(); | ||
require_once 'global.php'; | ||
|
||
// set table name | ||
$eventID = addslashes($_GET["eventID"]); | ||
// set table name | ||
$eventID = addslashes($_GET["eventID"]); | ||
|
||
//check that user is logged in and is either an admin or created the event | ||
if(is_admin()) { | ||
//check that user is logged in and is either an admin or created the event | ||
if(is_admin()) { | ||
|
||
//reset flag | ||
$flag_query = "UPDATE events | ||
//reset flag | ||
$flag_query = "UPDATE events | ||
SET | ||
flagged=0 | ||
WHERE eventID='$eventID'"; | ||
$flag_result = mysql_query($flag_query); | ||
$flag_result = mysql_query($flag_query); | ||
|
||
header('Location: '.ed(false).'flag_admin.php'); | ||
exit(); | ||
} else { | ||
header('Location: '.ed(false).'index.php'); | ||
exit(); | ||
} | ||
header('Location: '.ed(false).'flag_admin.php'); | ||
exit(); | ||
} else { | ||
header('Location: '.ed(false).'index.php'); | ||
exit(); | ||
} | ||
?> |