Beispiel #1
0
    $info = $db->from("User")->where("`id`='" . $_SESSION['id'] . "'")->select()->fetch_one();
    if ($info['pass'] != $_POST['old_pass']) {
        redirect("error.php");
    }
    $para = array('nick' => $_POST['nick'], 'school' => $_POST['school']);
    if ($info['power'] == 2) {
        $para['use'] = 'no';
    }
    $hook = false;
    if (isset($_POST['new_pass'])) {
        if ($_POST['new_pass'] != "") {
            $para['pass'] = $_POST['new_pass'];
            $hook = true;
        }
    }
    $db->set($para)->where("`id`='" . $_SESSION['id'] . "'")->update("User");
    if ($hook) {
        $qu = $db->from("User")->where("`id`='" . $_SESSION['id'] . "'")->select()->fetch_one();
        $_SESSION['uu'] = $qu['user'];
        $_SESSION['pp'] = $qu['pass'];
        $_SESSION['new_pass'] = $_POST['new_pass'];
        redirect('hook.php?action=modifyUser');
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Index</title>
		<script>
Beispiel #2
0
        Filename: modify.php
        Description: Created by SpringHack using vim automatically.
**/
require_once "user.common.php";
require_once "tech.common.php";
if (!isset($_SESSION['id'])) {
    redirect("login.php");
}
if ($db->from("User")->where("`id`='" . $_SESSION['id'] . "'")->select()->fetch_one()['use'] != 'yes') {
    redirect("none.php");
}
$db = new MySQL();
switch ($_GET['action']) {
    case 'check':
        if ($db->from("Tech")->where("`user`='" . $_SESSION['id'] . "' AND `id`='" . $_GET['id'] . "'")->select()->num_rows() == 1) {
            $db->set(array('hack' => 'check', 'reason' => ''))->where("`id`='" . $_GET['id'] . "'")->update("Tech");
        }
        break;
    case 'remod':
        $db->set(array('hack' => 'remod', 'reason' => $_GET['str']))->where("`id`='" . $_GET['id'] . "'")->update("Tech");
        break;
    case 'post':
        $db->set(array('hack' => 'post', 'reason' => ''))->where("`id`='" . $_GET['id'] . "'")->update("Tech");
        break;
    case 'recheck':
        $db->set(array('hack' => 'recheck', 'reason' => $_GET['str']))->where("`id`='" . $_GET['id'] . "'")->update("Tech");
        break;
    case 'ok':
        $db->set(array('hack' => 'ok', 'reason' => ''))->where("`id`='" . $_GET['id'] . "'")->update("Tech");
    default:
        break;
Beispiel #3
0
            redirect('error.php');
        } else {
            $id = 'old';
        }
    } else {
        $id = 'new';
    }
    $_POST['time'] = time();
    $_POST['work'] = serialize($_POST['work']);
    if ($id == 'new') {
        unset($_POST['submit']);
        $db->value($_POST)->insert('Expert');
        echo $db->error();
    } else {
        unset($_POST['submit']);
        $db->set($_POST)->where("`user_id`='" . $_POST['user_id'] . "' AND `user_pw`='" . $_POST['user_pw'] . "'")->update('Expert');
    }
    redirect('expert.php?user_id=' . $_POST['user_id']);
}
$addition = '';
if (isset($_GET['user_id'])) {
    $addition = '
		<script>
				$(function () {
						$.get("json.php?time=" + (new Date()).getTime() + "&action=getExpert&user_id=' . $_GET['user_id'] . '", function (data) {
								data = JSON.parse(data);
								for (var i in data)
								{
									switch (i)
									{
										case "work":
Beispiel #4
0
<?php

/**
        Author: SpringHack - springhack@live.cn
        Last modified: 2015-11-03 17:52:54
        Filename: uuu.php
        Description: Created by SpringHack using vim automatically.
**/
?>

<?php 
require_once "user.common.php";
require_once "tech.common.php";
if (!isset($_SESSION['id'])) {
    redirect("login.php");
}
if ($db->from("User")->where("`id`='" . $_SESSION['id'] . "'")->select()->fetch_one()['use'] != 'yes') {
    redirect("error.php");
}
$db = new MySQL();
if ($_GET['action'] == 'yes') {
    $db->set(array('use' => 'yes'))->where("`id`='" . $_GET['id'] . "'")->update("User");
} else {
    $db->from("User")->where("`id`='" . $_GET['id'] . "'")->delete();
}
?>
<script>
	alert("操作成功完成!");
	history.back(-1);
</script>
Beispiel #5
0
        $id = uniqid();
        $_POST['user'] = $_SESSION['id'];
        $_POST['owner'] = $db->from("User")->where("`id`='" . $_SESSION['id'] . "'")->select()->fetch_one()['nick'];
        $_POST['number'] = $id;
        $_POST['id'] = $id;
        $_POST['keyword'] = serialize($_POST['keyword']);
        unset($_POST['submit']);
        $db->value($_POST)->insert('Tech');
    } else {
        $_POST['user'] = $_SESSION['id'];
        $_POST['owner'] = $db->from("User")->where("`id`='" . $_SESSION['id'] . "'")->select()->fetch_one()['nick'];
        $_POST['number'] = $id;
        $_POST['id'] = $id;
        $_POST['keyword'] = serialize($_POST['keyword']);
        unset($_POST['submit']);
        $db->set($_POST)->where("`id`='" . $id . "'")->update('Tech');
    }
    header('Location: insert.php?id=' . $id);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>新建成果</title>
    </head>
    <body>
    	<center>
			<?php 
require_once "frame.php";
?>