Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions http/admin/index.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//记录ip
require_once "../php/get_ip.php";
//日志
clientlog();
// clientlog();
?>

<!DOCTYPE html>
Expand Down Expand Up @@ -49,7 +49,7 @@
</div>
<div class="form-group"> </div>
<div class="form-group">
<p>没有注册? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="../signup.html"> 去注册!</a></p>
<p>没有管理员账号? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=""> 请联系超级管理员</a></p>
</div>
<div class="form-group">
<input type="submit" onclick="return signin()" value="登录" class="btn btn-primary">
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion http/index.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//记录ip
require_once "php/get_ip.php";
//日志
clientlog();
// clientlog();
?>

<!DOCTYPE html>
Expand Down
5 changes: 5 additions & 0 deletions http/php/admin_signin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 管理员登录
* 与数据库中的管理员表进行对比
*/

//登录各种检测
$username = $_POST['username']; //trim可以去头尾空格
$password = $_POST['password'];
Expand Down
16 changes: 10 additions & 6 deletions http/php/admin_signout.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<?php
//销毁session
session_start();
session_unset();
session_destroy();
/*
* 管理员登出
* 销毁session变量
*/
//销毁session
session_start();
session_unset();
session_destroy();

echo '<h2>退出成功!</h2>';
echo '<meta http-equiv="refresh" content="0.5;url=../admin/index.php">';
echo '<h2>退出成功!</h2>';
echo '<meta http-equiv="refresh" content="0.5;url=../admin/index.php">';
?>
5 changes: 5 additions & 0 deletions http/php/admin_signup.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 管理员注册
* 新增管理员用户
*/

//注册操作
$username = $_POST['username'];
$password = $_POST['password'];
Expand Down
6 changes: 5 additions & 1 deletion http/php/back_rental.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
//还车
/*
* 还车实现
* 将还车的数据加入到数据库中
*/


//计算两日期相差函数
function diffBetweenTwoDays ($day1, $day2)
Expand Down
20 changes: 11 additions & 9 deletions http/php/conn_db.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<?php

header("content-type:text/html;charset=utf-8");
/*
* 链接数据库
*/
header("content-type:text/html;charset=utf-8");

//链接数据库
$conn = mysqli_connect(localhost , 'rental' , '66778899');
if(! $conn )
{
die('连接失败: ' . mysqli_error($conn));
exit;
}
$conn = mysqli_connect(localhost, 'rental', '66778899');
if (!$conn) {
die('连接失败: ' . mysqli_error($conn));
exit;
}
// 设置编码,防止中文乱码
mysqli_query($conn , "set names utf8");
mysqli_query($conn, "set names utf8");

//选择数据库
mysqli_select_db( $conn, 'car_rental');
mysqli_select_db($conn, 'car_rental');

// echo '链接成功!';

Expand Down
53 changes: 27 additions & 26 deletions http/php/delete_car.php
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
<?php
//删除车辆
/*
* 在车辆管理中删除车辆
* 从数据库中删除该车辆
*/

$cid = $_POST['cid'];
$cid = $_POST['cid'];

//服务器端判断完整性
if (empty($cid))
{
if (empty($cid)) {
echo "<script>alert('数据输入不完整!');history.go(-1);</script>";
exit;
}
}

//连接数据库
include "conn_db.php";
include "conn_db.php";

//先检查该数据是否存在
$sql = "select * from car where cid = '$cid'";
$sql = "select * from car where cid = '$cid'";
//查询数据库
$retval = mysqli_query( $conn, $sql );
if(! $retval )
{
die('1无法读取数据: ' . mysqli_error($conn));
}
$num = mysqli_num_rows( $retval);
if(!$num) //没找到的的话
{
echo "<script>alert('没有找到该车辆!');history.go(-1);</script>";
exit;
}
$retval = mysqli_query($conn, $sql);
if (!$retval) {
die('1无法读取数据: ' . mysqli_error($conn));
}
$num = mysqli_num_rows($retval);
if (!$num) //没找到的的话
{
echo "<script>alert('没有找到该车辆!');history.go(-1);</script>";
exit;
}

//删除
$sql_delete = "DELETE FROM `car_rental`.`car` WHERE `cid`='$cid'";
$retval = mysqli_query($conn, $sql_delete);
if (!$retval) {
die('2无法读取数据: ' . mysqli_error($conn));
echo "<script>alert('错误!');history.go(-1);</script>";
exit;
}
$sql_delete = "DELETE FROM `car_rental`.`car` WHERE `cid`='$cid'";
$retval = mysqli_query($conn, $sql_delete);
if (!$retval) {
die('2无法读取数据: ' . mysqli_error($conn));
echo "<script>alert('错误!');history.go(-1);</script>";
exit;
}

echo "<script>alert('删除成功!');history.go(-1);</script>";
echo "<script>alert('删除成功!');history.go(-1);</script>";

?>
5 changes: 5 additions & 0 deletions http/php/delete_rental.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 在订单管理中删除订单
* 在数据库中删除该订单
*/

//删除订单
$contractid = $_POST['contractid'];

Expand Down
5 changes: 5 additions & 0 deletions http/php/edit_car.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 编辑车辆信息
* 将编辑后的车辆信息写入数据库中
*/

//编辑车辆
$cid = $_POST['cid'];
$cplant = $_POST['cplant'];
Expand Down
5 changes: 5 additions & 0 deletions http/php/edit_rental.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 订单管理中编辑订单信息
* 更新到数据库
*/

//修改

//计算
Expand Down
5 changes: 5 additions & 0 deletions http/php/edit_user.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 用户管理中编辑用户信息
* 更改用户的会员体系
*/

//编辑用户
$uid = $_POST['uid'];
$isvip = $_POST['isvip'];
Expand Down
5 changes: 5 additions & 0 deletions http/php/fixed.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 车辆维修
* 生成支出价格
*/

//维修车辆

$cid = $_POST['cid'];
Expand Down
Empty file modified http/php/get_ip.php
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions http/php/go_rental.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 确认租车订单
* 确认信息加入到数据表中
*/

//确认订单

$contractid = $_POST['contractid'];
Expand Down
5 changes: 5 additions & 0 deletions http/php/new_car.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 新增车辆
* 新增车辆信息到数据表中
*/

//取得数据
$cplant = $_POST['cplant'];
$cbrand = $_POST['cbrand'];
Expand Down
5 changes: 5 additions & 0 deletions http/php/new_rental.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 管理员新增租车订单
* 由管理员填写租车订单
*/

//新订单

$cid = $_POST['cid'];
Expand Down
5 changes: 5 additions & 0 deletions http/php/users_signin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 用户登录
* 与数据库中的用户表比对并设置SESSION变量
*/

//登录各种检测
$username = $_POST['username']; //trim可以去头尾空格
$password = $_POST['password'];
Expand Down
5 changes: 5 additions & 0 deletions http/php/users_signout.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 用户登出
* 并销毁session
*/

//销毁session
session_start();
session_unset();
Expand Down
5 changes: 5 additions & 0 deletions http/php/users_signup.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*
* 用户注册
*
*/

//注册操作
$username = $_POST['username'];
$password = $_POST['password'];
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion http/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
//记录ip
require_once "php/get_ip.php";
//日志
clientlog();
// clientlog();

?>

Expand Down