ERROR - 2026-07-23 04:54:21 --> You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 20
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(230): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-22')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-22')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 04:54:21 --> CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 20
[Method: GET, Route: classdiaryallreport/report/2026-07-02/2026-07-22]
in SYSTEMPATH\Database\BaseConnection.php on line 863.
 1 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 2 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 3 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 4 APPPATH\Models\ClassDiaryModel.php(230): CodeIgniter\BaseModel->findAll()
 5 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-22')
 6 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-22')
 7 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
 8 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 9 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
10 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
11 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 04:54:21 --> [Caused by] CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 20
in SYSTEMPATH\Database\MySQLi\Connection.php on line 310.
 1 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 2 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 4 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 5 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 6 APPPATH\Models\ClassDiaryModel.php(230): CodeIgniter\BaseModel->findAll()
 7 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-22')
 8 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-22')
 9 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
10 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
11 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
12 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
13 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 04:54:21 --> [Caused by] mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 20
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(230): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-22')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-22')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
ERROR - 2026-07-23 04:57:04 --> You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-22')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-22')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 04:57:04 --> CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
[Method: GET, Route: classdiaryallreport/report/2026-07-02/2026-07-22]
in SYSTEMPATH\Database\BaseConnection.php on line 863.
 1 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 2 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 3 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 4 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 5 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-22')
 6 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-22')
 7 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
 8 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 9 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
10 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
11 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 04:57:04 --> [Caused by] CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 310.
 1 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 2 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 4 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 5 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 6 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 7 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-22')
 8 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-22')
 9 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
10 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
11 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
12 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
13 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 04:57:04 --> [Caused by] mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-22\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-22')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-22')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
ERROR - 2026-07-23 04:58:39 --> You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-04\'
AND `class_diary`.`date` <= \'2026-07-13\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-04\'
AND `class_diary`.`date` <= \'2026-07-13\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-04\'
AND `class_diary`.`date` <= \'2026-07-13\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-04', '2026-07-13')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-04', '2026-07-13')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 04:58:39 --> CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
[Method: GET, Route: classdiaryallreport/report/2026-07-04/2026-07-13]
in SYSTEMPATH\Database\BaseConnection.php on line 863.
 1 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 2 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 3 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 4 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 5 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-04', '2026-07-13')
 6 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-04', '2026-07-13')
 7 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
 8 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 9 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
10 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
11 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 04:58:39 --> [Caused by] CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 310.
 1 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-04\'
AND `class_diary`.`date` <= \'2026-07-13\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 2 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-04\'
AND `class_diary`.`date` <= \'2026-07-13\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 4 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 5 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 6 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 7 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-04', '2026-07-13')
 8 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-04', '2026-07-13')
 9 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
10 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
11 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
12 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
13 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 04:58:39 --> [Caused by] mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-04\'
AND `class_diary`.`date` <= \'2026-07-13\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-04\'
AND `class_diary`.`date` <= \'2026-07-13\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-04\'
AND `class_diary`.`date` <= \'2026-07-13\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-04', '2026-07-13')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-04', '2026-07-13')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
ERROR - 2026-07-23 05:00:16 --> You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-14\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-14\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-14\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-14')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-14')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:00:16 --> CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
[Method: GET, Route: classdiaryallreport/report/2026-07-03/2026-07-14]
in SYSTEMPATH\Database\BaseConnection.php on line 863.
 1 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 2 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 3 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 4 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 5 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-14')
 6 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-14')
 7 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
 8 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 9 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
10 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
11 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:00:16 --> [Caused by] CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 310.
 1 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-14\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 2 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-14\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 4 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 5 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 6 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 7 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-14')
 8 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-14')
 9 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
10 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
11 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
12 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
13 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:00:16 --> [Caused by] mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-14\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-14\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-14\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-14')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-14')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
ERROR - 2026-07-23 05:02:00 --> You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-15')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-15')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:00 --> CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
[Method: GET, Route: classdiaryallreport/report/2026-07-02/2026-07-15]
in SYSTEMPATH\Database\BaseConnection.php on line 863.
 1 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 2 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 3 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 4 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 5 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-15')
 6 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-15')
 7 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
 8 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 9 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
10 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
11 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:00 --> [Caused by] CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 310.
 1 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 2 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 4 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 5 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 6 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 7 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-15')
 8 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-15')
 9 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
10 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
11 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
12 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
13 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:00 --> [Caused by] mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` =
        IF(
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(232): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-15')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-15')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
ERROR - 2026-07-23 05:02:43 --> You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-15')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-15')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:43 --> CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
[Method: GET, Route: classdiaryallreport/report/2026-07-02/2026-07-15]
in SYSTEMPATH\Database\BaseConnection.php on line 863.
 1 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 2 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 3 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 4 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 5 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-15')
 6 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-15')
 7 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
 8 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 9 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
10 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
11 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:43 --> [Caused by] CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 310.
 1 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 2 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 4 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 5 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 6 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 7 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-15')
 8 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-15')
 9 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
10 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
11 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
12 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
13 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:43 --> [Caused by] mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-02\'
AND `class_diary`.`date` <= \'2026-07-15\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-02', '2026-07-15')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-02', '2026-07-15')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
ERROR - 2026-07-23 05:02:49 --> You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-08')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-08')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:49 --> CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
[Method: GET, Route: classdiaryallreport/report/2026-07-03/2026-07-08]
in SYSTEMPATH\Database\BaseConnection.php on line 863.
 1 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 2 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 3 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 4 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 5 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-08')
 6 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-08')
 7 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
 8 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 9 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
10 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
11 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:49 --> [Caused by] CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 310.
 1 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 2 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 4 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 5 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 6 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 7 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-08')
 8 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-08')
 9 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
10 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
11 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
12 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
13 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:49 --> [Caused by] mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 22
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name,
        class_day.start_time AS class_day_start_time,
        class_day.end_time AS class_day_end_time
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class_diary`.`class_id` AND `class_day`.`day_id` = 
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(238): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-08')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-08')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
ERROR - 2026-07-23 05:02:55 --> You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 20
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(230): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-08')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-08')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:55 --> CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 20
[Method: GET, Route: classdiaryallreport/report/2026-07-03/2026-07-08]
in SYSTEMPATH\Database\BaseConnection.php on line 863.
 1 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 2 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 3 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 4 APPPATH\Models\ClassDiaryModel.php(230): CodeIgniter\BaseModel->findAll()
 5 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-08')
 6 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-08')
 7 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
 8 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 9 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
10 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
11 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:55 --> [Caused by] CodeIgniter\Database\Exceptions\DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 20
in SYSTEMPATH\Database\MySQLi\Connection.php on line 310.
 1 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 2 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 4 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 5 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 6 APPPATH\Models\ClassDiaryModel.php(230): CodeIgniter\BaseModel->findAll()
 7 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-08')
 8 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-08')
 9 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
10 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
11 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
12 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
13 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:02:55 --> [Caused by] mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `...' at line 20
in SYSTEMPATH\Database\MySQLi\Connection.php on line 300.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(300): mysqli->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(908): CodeIgniter\Database\MySQLi\Connection->execute('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 3 SYSTEMPATH\Database\BaseConnection.php(825): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = 1
AND `class_diary`.`date` >= \'2026-07-03\'
AND `class_diary`.`date` <= \'2026-07-08\'
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC')
 4 SYSTEMPATH\Database\BaseBuilder.php(1659): CodeIgniter\Database\BaseConnection->query('SELECT class_diary.id,
        class_diary.date,
        class_diary.started_time,
        class_diary.ended_time,
        class_diary.comment AS class_diary_comment,

        class.name AS class_name,
        class.code AS class_code,

        class_status.name AS class_status_name,

        lesson.name AS lesson_name,
        lesson.code AS lesson_code,

        day.name AS class_day_name
FROM `class_diary`
LEFT JOIN `class` ON `class`.`id` = `class_diary`.`class_id`
LEFT JOIN `class_day` ON `class_day`.`class_id` = `class`.`id` AND `class_day`.`day_id` =
        (
LEFT JOIN `day` ON `day`.`id` = `class_day`.`day_id`
LEFT JOIN `class_status` ON `class_status`.`id` = `class_diary`.`class_status_id`
LEFT JOIN `lesson` ON `lesson`.`id` = `class_diary`.`lesson_id`
WHERE `class_diary`.`status` = :class_diary.status:
AND `class_diary`.`date` >= :class_diary.date:
AND `class_diary`.`date` <= :class_diary.date.1:
ORDER BY `class_diary`.`date` DESC, `class_diary`.`started_time` ASC', [...], false)
 5 SYSTEMPATH\Model.php(255): CodeIgniter\Database\BaseBuilder->get()
 6 SYSTEMPATH\BaseModel.php(676): CodeIgniter\Model->doFindAll(0, 0)
 7 APPPATH\Models\ClassDiaryModel.php(230): CodeIgniter\BaseModel->findAll()
 8 APPPATH\Controllers\Report_Class_Diary_All.php(29): App\Models\ClassDiaryModel->getClassDiaryReport('2026-07-03', '2026-07-08')
 9 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary_All->report('2026-07-03', '2026-07-08')
10 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary_All))
11 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
12 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
13 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
14 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:22:22 --> CodeIgniter\Exceptions\BadMethodCallException: Call to undefined method App\Models\ClassDiaryModel::getStudentClassStatusCount
[Method: GET, Route: classdiaryreport/statuscount/7]
in SYSTEMPATH\Model.php on line 758.
 1 APPPATH\Controllers\Report_Class_Diary.php(30): CodeIgniter\Model->__call('getStudentClassStatusCount', [...])
 2 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary->getStudentClassStatusCount('7')
 3 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary))
 4 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 5 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
 6 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
 7 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:22:33 --> CodeIgniter\Exceptions\BadMethodCallException: Call to undefined method App\Models\ClassDiaryModel::getStudentClassStatusCount
[Method: GET, Route: classdiaryreport/statuscount/7]
in SYSTEMPATH\Model.php on line 758.
 1 APPPATH\Controllers\Report_Class_Diary.php(30): CodeIgniter\Model->__call('getStudentClassStatusCount', [...])
 2 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary->getStudentClassStatusCount('7')
 3 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary))
 4 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 5 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
 6 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
 7 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:22:44 --> CodeIgniter\Exceptions\BadMethodCallException: Call to undefined method App\Models\ClassDiaryModel::getStudentClassStatusCount
[Method: GET, Route: classdiaryreport/statuscount/6]
in SYSTEMPATH\Model.php on line 758.
 1 APPPATH\Controllers\Report_Class_Diary.php(30): CodeIgniter\Model->__call('getStudentClassStatusCount', [...])
 2 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary->getStudentClassStatusCount('6')
 3 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary))
 4 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 5 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
 6 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
 7 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
CRITICAL - 2026-07-23 05:22:47 --> CodeIgniter\Exceptions\BadMethodCallException: Call to undefined method App\Models\ClassDiaryModel::getStudentClassStatusCount
[Method: GET, Route: classdiaryreport/statuscount/9]
in SYSTEMPATH\Model.php on line 758.
 1 APPPATH\Controllers\Report_Class_Diary.php(30): CodeIgniter\Model->__call('getStudentClassStatusCount', [...])
 2 SYSTEMPATH\CodeIgniter.php(974): App\Controllers\Report_Class_Diary->getStudentClassStatusCount('9')
 3 SYSTEMPATH\CodeIgniter.php(520): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Report_Class_Diary))
 4 SYSTEMPATH\CodeIgniter.php(363): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 5 SYSTEMPATH\Boot.php(417): CodeIgniter\CodeIgniter->run()
 6 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
 7 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
