コード例 #1
0
ファイル: manuser.php プロジェクト: nickpelone/unca-chairs
<?php

session_start();
include "functions.php";
$conn = c2db("test", "test");
$result = $conn->query("select count(*) as count from users where status='active'");
$row = $result->fetch_assoc();
if (isset($_REQUEST['bottom'])) {
    $bottom = $_REQUEST['bottom'];
    if ($bottom < 0) {
        $bottom = 0;
    }
    if ($bottom > $row['count'] - 1) {
        $bottom = $row['count'] - 1;
    }
} else {
    $bottom = 0;
}
echo $bottom . '\\n';
?>
<html>

<head>
<link rel="stylesheet" type="text/css" href="style.css"/>
<title>Chairs of Fury</title>
<script language="JavaScript">
function moduser(user) {
	window.open("handler.php?choice=modifyuser&theusr="******"moduser","height=350,width=500");
}
</script>
</head>
コード例 #2
0
ファイル: handler.php プロジェクト: nickpelone/unca-chairs
<?php

session_start();
include "functions.php";
$conn = c2db("npelone", "npel9717");
$choice = $_REQUEST['choice'];
switch ($choice) {
    case 'login':
        //Handles login process
        //Checklist of stuff to do:
        //1) Calculate daily payout from payscale
        //2) Figure out if past due on payments to chairs
        //3) Process payments to bank/other student renting them the chair if they don't own it
        $username = $_REQUEST['username'];
        $password = $_REQUEST['password'];
        $result = $conn->query("select * from users where userID='{$username}';");
        $row = $result->fetch_row();
        if ($row[1] == $password) {
            $_SESSION['loggedin'] = 'true';
            $_SESSION['user'] = $row[0];
            $_SESSION['status'] = $row[10];
        } else {
            session_destroy();
        }
        header("Location: profile.php");
        break;
    case 'profile':
        //Shows profile interface for the users
        header("Location: profile.php");
        break;
    case 'manageusers':