Exemplo n.º 1
0
    $scale_information = $fw->getScale($id);
    if (is_array($scale_information)) {
        ?>
	<h2>Scale Information</h2> <?php 
        if ($fw->isAdmin($_SESSION)) {
            if ($ismobi->CheckMobile()) {
                $output = '
		<ul class="inline-list clearfix no-print">';
                /*$output .= '
                		<li>
                			<form action="viewScale.php?id='. $scale_information['scale_id'] .'" method="post">
                				<button type="submit" name="submit" class="ui-btn ui-btn-inline ui-icon-edit ui-btn-icon-left" value="Edit Scale">Edit</button>	
                			</form>
                		</li>
                			';*/
                if ($fw->isSuperAdmin($_SESSION)) {
                    $output .= '
			<li>
				<form action="updateTicket.php?id=' . $scale_information['scale_id'] . '" method="post">	
					<button type="submit" name="submit" class="ui-btn ui-btn-inline ui-icon-delete ui-btn-icon-left" value="Delete Scale" onClick=\'return confirm("Are you sure you want to delete this scale?")\'>Delete</button>
				</form>
			</li>
				';
                }
                $output .= '				
		</ul>';
            } else {
                $output = '
		<ul class="inline-list clearfix no-print">';
                $output .= '
			<li>
Exemplo n.º 2
0
		</script>
		<!--<link rel="stylesheet" type="text/css" href="quantum.css" />-->
		<!--[if lt IE9]>
			<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
		<meta name="viewport" content="width=device-width, initial-scale=0.62">
	</head>
	
	<body>
		<?php 
    include 'header.php';
    ?>
		
		<h2>Registered Users</h2>
		<?php 
    if ($fw->isAdmin($_SESSION) || $fw->isSuperAdmin($_SESSION)) {
        $query = "select * from users";
    } else {
        die;
    }
    $result = $fw->query($query);
    if ($result) {
        $num_results = $result->num_rows;
        echo "<p>Number of matches found: " . $num_results . "</p>";
        if ($num_results > 0) {
            $output = "\n\n\t\t<table class=\"table-striped table-style table-hover search-results\">\n" . "\t\t\t<thead>\n" . "\t\t\t\t<tr>\n" . "\t\t\t\t\t<th>ID</th>\n" . "\t\t\t\t\t<th>Username</th>\n" . "\t\t\t\t\t<th>Full Name</th>\n" . "\t\t\t\t\t<th>Email</th>\n" . "\t\t\t\t\t<th>is_user</th>\n" . "\t\t\t\t\t<th>is_admin</th>\n" . "\t\t\t\t\t<th>is_super</th>\n" . "\t\t\t\t</tr>\n" . "\t\t\t</thead>\n" . "\t\t\t<tbody>\n";
            for ($i = 0; $i < $num_results; $i++) {
                $row = $result->fetch_assoc();
                $output .= "\t\t\t\t<tr>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['id']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['username']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['fullname']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['email']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['is_user']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['is_admin']) . "</td>\n" . "\t\t\t\t\t<td>" . $fw->clean_output($row['is_superadmin']) . "</td>\n" . "\t\t\t\t</tr>\n";
            }
            $output .= "\t\t\t</tbody>\n" . "\t\t</table>\n";
Exemplo n.º 3
0
<?php

session_start();
include 'framework.php';
@($fw = new scaleDB('localhost', 'root', '', 'brechbuhler_test'));
if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION) && $fw->isSuperAdmin($_SESSION)) {
    if (isset($_GET['id'])) {
        $scale_id = $fw->clean_input($_GET['id']);
    } else {
        die("No scale was defined in the delete request.");
    }
    #$fullname = $_SESSION['user_validation']['fullname'];
    #$username = $_SESSION['user_validation']['username'];
    echo $scale_id . "<br />";
    $query_scales = "delete from scales where id = '" . $scale_id . "'";
    echo $query_scales . "<br />";
    $result_scales = $fw->query($query_scales);
    if (!$result_scales) {
        die("Something happened.  The scale could not be removed from the database at this time.  Please try again later.");
    }
    $query_events = "delete from events where scale_id = '" . $scale_id . "'";
    $result_events = $fw->query($query_events);
    if (!$result_events) {
        die("Something happened.  The events could not be removed from the database at this time.  Please notify an admin.");
    }
    header('Location: index.php?result=31');
    die("The scale was successfully removed from the database.");
} else {
    header("Location: login.php");
    die("You must be logged in to view this page.");
}