-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Thay đổi lại cách thức thực hiện truy vấn SQL -> hạn chế lỗi SQL Injection ✓ - Fix lỗi bị lag khi thực hiện thêm, sửa, xóa với các mục có nhiều dữ liệu ✓ - Fix lỗi không cài đặt được ở 1 số máy ✓ - Fix lỗi không hiện công thức toán khi làm bài ✓ - Rewrite URL ✓ - Thêm upload ảnh cho nội dung câu hỏi ✓ - Tối ưu lại một số code ✓
- Loading branch information
Showing
98 changed files
with
3,419 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
Nếu đã kiểm tra lại và vẫn lỗi, bạn có thể mở file config/connect.php sửa trực tiếp kết nối trong đó, | ||
hoặc liên hệ báo lỗi tới email: [email protected] | ||
|
||
- Sửa URL trang web trong config/config.php | ||
- Sửa tài khoản gửi email quên mật khẩu tại /controllers/controller_login.php dòng 127, 128 | ||
|
||
- Tài khoản mặc định: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ class Config | |
const EMAIL = "[email protected]"; | ||
const RELEASE = "27/03/2019"; | ||
const TIMEZONE = "Asia/Bangkok"; | ||
const APP_URL = "http://localhost/"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
* Mail: [email protected] | ||
**/ | ||
|
||
require_once('core/Base.php'); | ||
require_once('config/config.php'); | ||
require_once('models/model_admin.php'); | ||
require_once('views/view_admin.php'); | ||
//load thư viện PhpSpreadSheet | ||
|
@@ -1001,13 +1003,29 @@ public function submit_update_avatar() | |
$duoi = explode('.', $_FILES['file']['name']); | ||
$duoi = $duoi[(count($duoi)-1)]; | ||
if ($duoi === 'jpg' || $duoi === 'png') { | ||
if (move_uploaded_file($_FILES['file']['tmp_name'], 'res/img/avatar/'.$this->info['username'].'_' . $_FILES['file']['name'])) { | ||
if (move_uploaded_file($_FILES['file']['tmp_name'], 'upload/avatar/'.$this->info['username'].'_' . $_FILES['file']['name'])) { | ||
$avatar = $this->info['username'] .'_' . $_FILES['file']['name']; | ||
$update = $this->update_avatar($avatar, $this->info['username']); | ||
} | ||
} | ||
} | ||
} | ||
public function uploadImage() | ||
{ | ||
if (isset($_FILES['file'])) { | ||
$base = new Base(); | ||
$res = array(); | ||
$path = 'upload/question_images/'; | ||
$upload = $base->uploadImage($_FILES['file'],$path); | ||
if($upload != false) { | ||
$res['url'] = Config::APP_URL . $path . $upload; | ||
$res['stt'] = true; | ||
} | ||
else | ||
$res['stt'] = false; | ||
echo json_encode($res); | ||
} | ||
} | ||
public function delete_check_students() | ||
{ | ||
$result = array(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* Base Function | ||
* @author: Nong Van Du (Dzu) | ||
* Mail: [email protected] | ||
**/ | ||
|
||
class Base | ||
{ | ||
public function __construct() | ||
{ | ||
|
||
} | ||
public function uploadImage($file, $path) | ||
{ | ||
$expl = explode('.', $file['name']); | ||
$ext = $expl[(count($expl)-1)]; | ||
$name = $this->convertString($expl[0]); | ||
$hash = md5(time()); | ||
if ($ext === 'jpg' || $ext === 'png' || $ext === 'jpeg') { | ||
$new_name = $hash .'_' . $name . '.' . $ext; | ||
if (move_uploaded_file($file['tmp_name'], $path . $new_name)) { | ||
return $new_name; | ||
} else { | ||
return false; | ||
} | ||
} | ||
|
||
} | ||
public function convertString($str) { | ||
$str = trim(mb_strtolower($str)); | ||
$str = preg_replace('/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/', 'a', $str); | ||
$str = preg_replace('/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/', 'e', $str); | ||
$str = preg_replace('/(ì|í|ị|ỉ|ĩ)/', 'i', $str); | ||
$str = preg_replace('/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/', 'o', $str); | ||
$str = preg_replace('/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/', 'u', $str); | ||
$str = preg_replace('/(ỳ|ý|ỵ|ỷ|ỹ)/', 'y', $str); | ||
$str = preg_replace('/(đ)/', 'd', $str); | ||
$str = preg_replace('/[^a-z0-9-\s]/', '', $str); | ||
$str = preg_replace('/([\s]+)/', '-', $str); | ||
return $str; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,6 +161,7 @@ function step_error() | |
echo "Tài khoản mặc định: <b>admin</b><br />"; | ||
echo "Mật khẩu: <b>123456</b> <br />"; | ||
echo "Vui lòng đăng nhập và đổi mật khẩu ngay sau khi đăng nhập. <br />"; | ||
echo "Sửa URL trang web trong config/config.php <br />"; | ||
echo 'Mọi thông tin chi tiết, hỗ trợ, góp ý, báo lỗi,<br />'; | ||
echo"vui lòng liên hệ <span class='pass'>[email protected]</span> hoặc trực tiếp trang chính thức sản phẩm <a href='https://github.com/meesudzu/trac-nghiem-online'>TẠI ĐÂY</a> | ||
<br /><br />"; | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.