天天看點

php學生資訊管理系統(源碼)

項目名稱:基于PHP+MySQL的學生資訊管理系統 

本系統是一個用于管理學生資訊的管理系統,包括基本的增删改查,系統使用PHP語言開發,使用MySQL資料庫,可以供初學者參考使用。

系統環境

MySQL5.1.51-community

PHP7.3.29

1、登陸頁面

php學生資訊管理系統(源碼)

 2、首頁

php學生資訊管理系統(源碼)

 3、添加學生

php學生資訊管理系統(源碼)

4、修改學生

php學生資訊管理系統(源碼)

5、項目結構

php學生資訊管理系統(源碼)

關注微信公衆号:小諸葛的部落格,回複105免費擷取項目源代碼.

部分核心代碼

<?php
include '../dao/LoginDao.php';
include '../bean/Res.php';

header("Content-Type: application/json;charset=UTF-8");

// 從請求中擷取原始資料
$json = file_get_contents('php://input');

// 将其轉換為 PHP 對象
$data = json_decode($json);
//$param = json_encode($data);

$loginDao = new LoginDao();
$res = $loginDao->login($data->uname, $data->upass);

$result = new Res();
if($res){
    $result->setSuccess(true);
    $result->setData("登入成功");
}else{
    $result->setSuccess(false);
    $result->setData("登入失敗");
}
echo json_encode($result);
?>      
<?php
include '../bean/User.php';
include '../dao/StudentDao.php';

header("Content-Type: application/json;charset=UTF-8");

// 從請求中擷取原始資料
$json = file_get_contents('php://input');

// 将其轉換為 PHP 對象
$param = json_decode($json);

$method = $param->method;

$studentDao = new StudentDao();
$res = new Res();

switch ($method){
    case 'queryAll':
        //查詢全部
        $res->setData($studentDao->queryAll());
        $res->setSuccess(true);
        break;
    case 'save':
        //儲存
        $res->setData($studentDao->save($param));
        $res->setSuccess(true);
        break;
    case 'update':
        //更新
        $res->setData($studentDao->update($param));
        $res->setSuccess(true);
        break;
    case 'delete':
        //删除
        $res->setData($studentDao->delete($param));
        $res->setSuccess(true);
        break;
}

echo json_encode($res);

?>