/** * Created by PhpStorm. * User: Wu * Date: 12/22/15 * Time: 1:09 PM */ function getOrgData($keyword) { require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); $stmt = $db->selectDataByOrg($keyword); $arr = array(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $date = $row['date']; $money = $row['money']; array_push($arr, array("year" => $date, "money" => $money)); } echo json_encode(array_values($arr)); }
<?php /** * Created by PhpStorm. * User: Wu * Date: 12/21/15 * Time: 1:20 AM */ require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); $userName = $_POST["userName"]; $password = $_POST["password"]; $vPassword = $_POST["verifyPassword"]; if ($db->selectUser($userName)->rowCount()) { echo "用户名已存在"; } else { if ($password == $vPassword) { $db->addUser($userName, $password); echo "注册成功,正在返回主页"; } else { echo "两次输入的密码不一致,请重新输入"; } } ?> <html> <head> <meta http-equiv="refresh" content="1.5;url=http://115.159.31.63/SEProjectWeb/"> </head> </html>
* Created by PhpStorm. * User: Wu * Date: 12/22/15 * Time: 1:45 PM */ require_once "Security_admin.php"; function fix_keys($array) { foreach ($array as $k => $val) { if (is_array($val)) { $array[$k] = fix_keys($val); } //recurse } return array_values($array); } require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); $stmt = $db->selectStatus1(); $data2 = array(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $crawler_id = $row['crawler_id']; $current_page = $row['current_page']; $current_url = $row['current_url']; $current_title = $row['current_title']; $name = $row['name']; $isrunning = $row['isrunning']; array_push($data2, array($crawler_id, $name, $current_page, $current_title)); } $data3["data"] = fix_keys($data2); echo json_encode($data3);
<?php /** * Created by PhpStorm. * User: Wu * Date: 12/22/15 * Time: 1:09 PM */ require_once "Security.php"; require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); $stmt = $db->selectContentById($_GET['id']); $row = $stmt->fetch(PDO::FETCH_ASSOC); echo $row['content'];
<?php require_once 'Security.php'; /** * Created by PhpStorm. * User: Wu * Date: 12/6/15 * Time: 10:05 PM */ //error_reporting(E_ALL); //ini_set('display_errors', '1'); require_once 'BaseViewOutput.php'; $view = new BaseViewOutput(); require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); require_once "getOrgData.php"; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>企业数据统计</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="./css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="./css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="./js/jquery-2.1.4.min.js"></script> <script src="./js/bootstrap.min.js"></script>
/** * Created by PhpStorm. * User: Wu * Date: 12/22/15 * Time: 1:45 PM */ require_once "Security.php"; $startdate = $_GET["startdate"]; $enddate = $_GET["enddate"]; function fix_keys($array) { foreach ($array as $k => $val) { if (is_array($val)) { $array[$k] = fix_keys($val); } //recurse } return array_values($array); } require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); $stmt = $db->selectSumData($startdate, $enddate); $data2 = array(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $org = $row['org']; $money = $row['summoney']; array_push($data2, array($org, $money)); } $data3["data"] = fix_keys($data2); echo json_encode($data3);
<?php /** * Created by PhpStorm. * User: Wu * Date: 12/24/15 * Time: 11:02 AM */ require_once "Security_admin.php"; require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); $username = $_GET["username"]; $usertype = $_GET["usertype"]; $id = $_GET["id"]; $stmt = $db->modifyUser($id, $username, $usertype); if ($stmt->rowCount() == 0) { echo "请修改后提交"; } else { echo "修改成功"; }
<?php require_once 'Security.php'; require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); /** * Created by PhpStorm. * User: Wu * Date: 12/22/15 * Time: 4:02 PM */ //print_r($_GET); $password = $_GET['password']; $verifyPassword = $_GET["verifyPassword"]; $id = $_SESSION["id"]; if ($password == $verifyPassword) { $db->modifyUserInfoById($id, $password); echo "修改成功"; } else { echo "两次输入的密码不一致,请重新输入"; }
<?php session_start(); /** * Created by PhpStorm. * User: Wu * Date: 12/21/15 * Time: 1:20 AM */ require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); $userName = $_POST["userName"]; $password = $_POST["password"]; $row = $db->selectUser($userName)->fetch(PDO::FETCH_ASSOC); if ($row["password"] == $password) { echo "登陆成功"; $_SESSION["id"] = $row["id"]; $_SESSION["userName"] = $row["username"]; $_SESSION["type"] = $row["type"]; // print_r($_SESSION); } else { echo "密码错误"; } ?> <html> <head> <meta http-equiv="refresh" content="1.5;url=http://115.159.31.63/SEProjectWeb/"> <title>登录</title> </head> </html>
<?php require_once 'Security.php'; /** * Created by PhpStorm. * User: Wu * Date: 12/6/15 * Time: 10:05 PM */ //error_reporting(E_ALL); //ini_set('display_errors', '1'); require_once 'BaseViewOutput.php'; $view = new BaseViewOutput(); require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); ?> <!DOCTYPE html> <html lang="en"> <head> <title>数据查询</title> <?php $view->printHead(); ?> <link rel="stylesheet" href="./css/bootstrap-datetimepicker.min.css"> <link rel="stylesheet" href="./css/bootstrap-select.min.css"> </head> <body> <div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="detailModal"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header">
<?php /** * Created by PhpStorm. * User: Wu * Date: 12/13/15 * Time: 12:28 AM */ //error_reporting(E_ALL); //ini_set('display_errors', '1'); require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); if (isset($_POST['type'])) { $type = $_POST['type']; if ($type == "modify") { $id = $_POST['id']; $name = $_POST['name']; $startURL = $_POST['startURL']; $alloweddomain = $_POST['alloweddomain']; $link = $_POST['link']; $next = $_POST['next']; $title = $_POST['title']; $content = $_POST['content']; $isEnable = isset($_POST['isEnable']) ? 1 : 0; $db->modifyCrawlSettings($id, $name, $startURL, $alloweddomain, $link, $next, $title, $content, $isEnable); // echo "1"; } } else { echo "0"; }
<?php /** * Created by PhpStorm. * User: Wu * Date: 11/29/15 * Time: 2:36 PM */ include_once "DataBaseEngine.php"; $dbEngine = new DataBaseEngine(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>数据查询</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="./css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="./css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="./js/jquery-2.1.4.min.js"></script> <script src="./js/bootstrap.min.js"></script> </head> <body> <div class="container-fluid"> <div class="row"> <div class="col-md-12">
<?php require_once 'Security_admin.php'; /** * Created by PhpStorm. * User: Wu * Date: 12/6/15 * Time: 10:05 PM */ //error_reporting(E_ALL); //ini_set('display_errors', '1'); require_once 'BaseViewOutput.php'; $view = new BaseViewOutput(); require_once "DataBaseEngine.php"; $db = new DataBaseEngine(); if (isset($_POST['type'])) { $type = $_POST['type']; if ($type == "modify") { $id = $_POST['id']; $name = $_POST['name']; $startURL = $_POST['startURL']; $alloweddomain = $_POST['alloweddomain']; $link = $_POST['link']; $next = $_POST['next']; $title = $_POST['title']; $content = $_POST['content']; $isEnable = isset($_POST['isEnable']) ? 1 : 0; $db->modifyCrawlSettings($id, $name, $startURL, $alloweddomain, $link, $next, $title, $content, $isEnable); // echo "1"; } else { if ($type == "add") {