Initial commit Change-Id: I0000000000000000000000000000000000000000
This commit is contained in:
86
index.php
Executable file
86
index.php
Executable file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once('classes/conf.php');
|
||||
|
||||
include_once('classes/exceptionReports.php');
|
||||
$obj = new exceptionReports();
|
||||
$obj->host = DB_HOST;
|
||||
$obj->username = DB_USER;
|
||||
$obj->password = DB_PASSWORD;
|
||||
$obj->table = DB_DATABASE;
|
||||
$obj->maps = MAP_LOCATION;
|
||||
$obj->email = EMAIL;
|
||||
$obj->reporturl = REPORT_URL;
|
||||
$obj->connect();
|
||||
|
||||
$welcome = <<<WELCOME
|
||||
|
||||
WELCOME;
|
||||
|
||||
//allow allications to get a JSON
|
||||
if ( $_REQUEST['get'] == 1 )
|
||||
echo $obj->get_reports();
|
||||
else
|
||||
//allow applications to post new exceptions
|
||||
if( $_REQUEST['post'] == 1 )
|
||||
echo $obj->file_report($_REQUEST);
|
||||
else
|
||||
if(isset($_POST['report']) && isset($_POST['status']))
|
||||
$obj->set_status($_REQUEST['report'], $_REQUEST['status']);
|
||||
|
||||
/**
|
||||
Everything after this else block will be used for the web GUI
|
||||
*/
|
||||
else {
|
||||
include("classes/auth.php");
|
||||
include("classes/header.php");
|
||||
require_once('classes/content.php');
|
||||
include_once('classes/comments.php');
|
||||
$comments = new comments("report_comments", DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
|
||||
|
||||
$column1 = new content(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE, "column1");
|
||||
$column1 = $column1->get_body();
|
||||
|
||||
if( $_REQUEST['search'] ){
|
||||
$column1 .= $obj->display_report($_REQUEST['search']);
|
||||
} else {
|
||||
|
||||
|
||||
//delete report
|
||||
if($_REQUEST['delete'] > 0)
|
||||
if($obj->delete_report($_REQUEST['delete']))
|
||||
$column1 .= '<strong>Deleted Report</strong>';
|
||||
|
||||
//delete report comment
|
||||
if($_REQUEST['deletepost'] > 0){
|
||||
$comments->delete_comment($_REQUEST['deletepost'], $_REQUEST['thread']);
|
||||
$column1 .= $obj->display_report($_REQUEST['thread']);
|
||||
} else {
|
||||
|
||||
//this is for the comment module
|
||||
if( $_REQUEST['comment'] > 0 ){
|
||||
if($comments->write($_REQUEST['comment'], $_REQUEST['title'], $_REQUEST['bodytext'])){
|
||||
$column1 .= $obj->display_report($_REQUEST['comment']);
|
||||
}else
|
||||
$column1 .= "Error";
|
||||
} else {
|
||||
|
||||
//this is for displaying the web application
|
||||
if ( $_REQUEST['report'] > 0){
|
||||
if(isset($_REQUEST['status']))
|
||||
$obj->set_status($_REQUEST['report'], $_REQUEST['status']);
|
||||
$column1 .= $obj->display_report($_REQUEST['report']);
|
||||
} else {
|
||||
$column1 .= $welcome;
|
||||
$column1 .= $obj->display_report_list();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo $column1;
|
||||
|
||||
include("classes/footer.php");
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user