Commit b480de0b by Trần Văn Minh

tổ chức lại thư mục

parent bbd8acad
......@@ -31,7 +31,7 @@ class Admin extends CI_Controller
if ($this->session->userdata('admin_login') != true) {
redirect(site_url('login'), 'refresh');
}
$page_data['page_name'] = 'dashboard';
$page_data['page_name'] = 'dashboard/dashboard';
$page_data['page_title'] = get_phrase('dashboard');
$this->load->view('backend/index.php', $page_data);
}
......@@ -134,7 +134,7 @@ class Admin extends CI_Controller
redirect(site_url('admin/users'), 'refresh');
}
$page_data['page_name'] = 'users';
$page_data['page_name'] = 'user/users';
$page_data['page_title'] = get_phrase('user');
$page_data['users'] = $this->user_model->get_user($param2);
$this->load->view('backend/index', $page_data);
......@@ -147,11 +147,11 @@ class Admin extends CI_Controller
}
if ($param1 == 'add_user_form') {
$page_data['page_name'] = 'user_add';
$page_data['page_name'] = 'user/user_add';
$page_data['page_title'] = get_phrase('student_add');
$this->load->view('backend/index', $page_data);
} elseif ($param1 == 'edit_user_form') {
$page_data['page_name'] = 'user_edit';
$page_data['page_name'] = 'user/user_edit';
$page_data['user_id'] = $param2;
$page_data['page_title'] = get_phrase('student_edit');
$this->load->view('backend/index', $page_data);
......@@ -173,7 +173,7 @@ class Admin extends CI_Controller
$page_data['timestamp_start'] = strtotime('-29 days', time());
$page_data['timestamp_end'] = strtotime(date("m/d/Y"));
}
$page_data['page_name'] = 'enrol_history';
$page_data['page_name'] = 'enrol/enrol_history';
$page_data['enrol_history'] = $this->crud_model->enrol_history_by_date_range($page_data['timestamp_start'], $page_data['timestamp_end']);
$page_data['page_title'] = get_phrase('enrol_history');
$this->load->view('backend/index', $page_data);
......@@ -188,7 +188,7 @@ class Admin extends CI_Controller
$this->crud_model->enrol_a_student_manually();
redirect(site_url('admin/enrol_history'), 'refresh');
}
$page_data['page_name'] = 'enrol_student';
$page_data['page_name'] = 'enrol/enrol_student';
$page_data['page_title'] = get_phrase('enrol_a_student');
$this->load->view('backend/index', $page_data);
}
......@@ -209,7 +209,7 @@ class Admin extends CI_Controller
$page_data['timestamp_end'] = strtotime(date("m/d/Y"));
}
$page_data['page_name'] = 'admin_revenue';
$page_data['page_name'] = 'report/admin_revenue';
$page_data['payment_history'] = $this->crud_model->get_revenue_by_user_type($page_data['timestamp_start'], $page_data['timestamp_end'], 'admin_revenue');
$page_data['page_title'] = get_phrase('admin_revenue');
$this->load->view('backend/index', $page_data);
......@@ -221,7 +221,7 @@ class Admin extends CI_Controller
redirect(site_url('login'), 'refresh');
}
$page_data['page_name'] = 'instructor_revenue';
$page_data['page_name'] = 'report/instructor_revenue';
$page_data['payment_history'] = $this->crud_model->get_revenue_by_user_type("", "", 'instructor_revenue');
$page_data['page_title'] = get_phrase('instructor_revenue');
$this->load->view('backend/index', $page_data);
......@@ -232,7 +232,7 @@ class Admin extends CI_Controller
if ($this->session->userdata('admin_login') != true) {
redirect(site_url('login'), 'refresh');
}
$page_data['page_name'] = 'invoice';
$page_data['page_name'] = 'report/invoice';
$page_data['payment_details'] = $this->crud_model->get_payment_details_by_id($payment_id);
$page_data['page_title'] = get_phrase('invoice');
$this->load->view('backend/index', $page_data);
......@@ -294,7 +294,7 @@ class Admin extends CI_Controller
}
$page_data['languages'] = $this->crud_model->get_all_languages();
$page_data['page_name'] = 'system_settings';
$page_data['page_name'] = 'setting/system_settings';
$page_data['page_title'] = get_phrase('system_settings');
$this->load->view('backend/index', $page_data);
}
......@@ -337,7 +337,7 @@ class Admin extends CI_Controller
redirect(site_url('admin/frontend_settings'), 'refresh');
}
$page_data['page_name'] = 'frontend_settings';
$page_data['page_name'] = 'setting/frontend_settings';
$page_data['page_title'] = get_phrase('frontend_settings');
$this->load->view('backend/index', $page_data);
}
......@@ -361,7 +361,7 @@ class Admin extends CI_Controller
redirect(site_url('admin/payment_settings'), 'refresh');
}
$page_data['page_name'] = 'payment_settings';
$page_data['page_name'] = 'setting/payment_settings';
$page_data['page_title'] = get_phrase('payment_settings');
$this->load->view('backend/index', $page_data);
}
......@@ -378,7 +378,7 @@ class Admin extends CI_Controller
redirect(site_url('admin/smtp_settings'), 'refresh');
}
$page_data['page_name'] = 'smtp_settings';
$page_data['page_name'] = 'setting/smtp_settings';
$page_data['page_title'] = get_phrase('smtp_settings');
$this->load->view('backend/index', $page_data);
}
......@@ -394,7 +394,7 @@ class Admin extends CI_Controller
redirect(site_url('admin/instructor_settings'), 'refresh');
}
$page_data['page_name'] = 'instructor_settings';
$page_data['page_name'] = 'setting/instructor_settings';
$page_data['page_title'] = get_phrase('instructor_settings');
$this->load->view('backend/index', $page_data);
}
......@@ -404,7 +404,7 @@ class Admin extends CI_Controller
if ($this->session->userdata('admin_login') != true) {
redirect(site_url('login'), 'refresh');
}
$page_data['page_name'] = 'theme_settings';
$page_data['page_name'] = 'setting/theme_settings';
$page_data['page_title'] = get_phrase('theme_settings');
$this->load->view('backend/index', $page_data);
}
......@@ -731,7 +731,7 @@ class Admin extends CI_Controller
$this->session->set_flashdata('flash_message', get_phrase('lesson_has_been_deleted_successfully'));
redirect('admin/course_form/course_edit/' . $course_id);
} elseif ($param1 == 'filter') {
redirect('admin/lessons/' . $this->input->post('course_id'));
redirect(' ssons/' . $this->input->post('course_id'));
}
$page_data['page_name'] = 'lessons';
$page_data['lessons'] = $this->crud_model->get_lessons('course', $course_id);
......@@ -781,7 +781,7 @@ class Admin extends CI_Controller
}
}
$page_data['languages'] = $this->crud_model->get_all_languages();
$page_data['page_name'] = 'manage_language';
$page_data['page_name'] = 'setting/manage_language';
$page_data['page_title'] = get_phrase('multi_language_settings');
$this->load->view('backend/index', $page_data);
}
......@@ -954,7 +954,7 @@ class Admin extends CI_Controller
redirect(site_url('login'), 'refresh');
$page_data['application_details'] = $this->crud_model->get_application_details();
$page_data['page_name'] = 'about';
$page_data['page_name'] = 'setting/about';
$page_data['page_title'] = get_phrase('about');
$this->load->view('backend/index', $page_data);
}
......
......@@ -87,7 +87,7 @@ class Home extends CI_Controller {
$page_data['courses'] = $courses;
}
$page_data['page_name'] = "courses_page";
$page_data['page_name'] = "course/courses_page";
$page_data['page_title'] = get_phrase('courses');
$page_data['layout'] = $layout;
$page_data['selected_category_id'] = $selected_category_id;
......@@ -106,13 +106,13 @@ class Home extends CI_Controller {
public function course($slug = "", $course_id = "") {
$this->access_denied_courses($course_id);
$page_data['course_id'] = $course_id;
$page_data['page_name'] = "course_page";
$page_data['page_name'] = "course/course_page";
$page_data['page_title'] = get_phrase('course');
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
}
public function instructor_page($instructor_id = "") {
$page_data['page_name'] = "instructor_page";
$page_data['page_name'] = "instructor/instructor_page";
$page_data['page_title'] = get_phrase('instructor_page');
$page_data['instructor_id'] = $instructor_id;
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
......@@ -122,7 +122,7 @@ class Home extends CI_Controller {
if ($this->session->userdata('user_login') != true) {
redirect(site_url('home'), 'refresh');
}
$page_data['page_name'] = "my_courses";
$page_data['page_name'] = "my_all/my_courses";
$page_data['page_title'] = get_phrase("my_courses");
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
}
......@@ -144,13 +144,13 @@ class Home extends CI_Controller {
$this->session->set_flashdata('flash_message', get_phrase('message_sent!'));
redirect(site_url('home/my_messages/read_message/' . $param2), 'refresh');
}
$page_data['page_name'] = "my_messages";
$page_data['page_name'] = "my_all/my_messages";
$page_data['page_title'] = get_phrase('my_messages');
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
}
public function my_notifications() {
$page_data['page_name'] = "my_notifications";
$page_data['page_name'] = "my_all/my_notifications";
$page_data['page_title'] = get_phrase('my_notifications');
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
}
......@@ -161,7 +161,7 @@ class Home extends CI_Controller {
}
$my_courses = $this->crud_model->get_courses_by_wishlists();
$page_data['my_courses'] = $my_courses;
$page_data['page_name'] = "my_wishlist";
$page_data['page_name'] = "my_all/my_wishlist";
$page_data['page_title'] = get_phrase('my_wishlist');
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
}
......@@ -177,7 +177,7 @@ class Home extends CI_Controller {
$config['base_url'] = site_url('home/purchase_history');
$this->pagination->initialize($config);
$page_data['per_page'] = $config['per_page'];
$page_data['page_name'] = "purchase_history";
$page_data['page_name'] = "my_all/purchase_history";
$page_data['page_title'] = get_phrase('purchase_history');
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
}
......@@ -188,13 +188,13 @@ class Home extends CI_Controller {
}
if ($param1 == 'user_profile') {
$page_data['page_name'] = "user_profile";
$page_data['page_name'] = "profile/user_profile";
$page_data['page_title'] = get_phrase('user_profile');
}elseif ($param1 == 'user_credentials') {
$page_data['page_name'] = "user_credentials";
$page_data['page_name'] = "profile/user_credentials";
$page_data['page_title'] = get_phrase('credentials');
}elseif ($param1 == 'user_photo') {
$page_data['page_name'] = "update_user_photo";
$page_data['page_name'] = "profile/update_user_photo";
$page_data['page_title'] = get_phrase('update_user_photo');
}
$page_data['user_details'] = $this->user_model->get_user($this->session->userdata('user_id'));
......@@ -366,7 +366,7 @@ class Home extends CI_Controller {
}
$page_data['course_id'] = $course_id;
$page_data['page_name'] = 'lessons';
$page_data['page_name'] = 'lesson/lessons';
$page_data['page_title'] = $course_details['title'];
$this->load->view('lessons/index', $page_data);
}
......@@ -391,7 +391,7 @@ class Home extends CI_Controller {
$this->session->set_userdata('layout', 'list');
}
$page_data['layout'] = $this->session->userdata('layout');
$page_data['page_name'] = 'courses_page';
$page_data['page_name'] = 'course/courses_page';
$page_data['search_string'] = $search_string;
$page_data['page_title'] = get_phrase('search_results');
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
......@@ -433,19 +433,19 @@ class Home extends CI_Controller {
}
public function about_us() {
$page_data['page_name'] = 'about_us';
$page_data['page_name'] = 'footer/about_us';
$page_data['page_title'] = get_phrase('about_us');
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
}
public function terms_and_condition() {
$page_data['page_name'] = 'terms_and_condition';
$page_data['page_name'] = 'footer/terms_and_condition';
$page_data['page_title'] = get_phrase('terms_and_condition');
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
}
public function privacy_policy() {
$page_data['page_name'] = 'privacy_policy';
$page_data['page_name'] = 'footer/privacy_policy';
$page_data['page_title'] = get_phrase('privacy_policy');
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
}
......@@ -479,7 +479,7 @@ class Home extends CI_Controller {
$this->load->view('frontend/'.get_frontend_settings('theme').'/index', $page_data);
}
public function edit_course($param1 = "", $param2 = "") {
public function nurse($param1 = "", $param2 = "") {
if ($this->session->userdata('user_login') != 1){
redirect('home', 'refresh');
}
......
......@@ -1879,6 +1879,7 @@ class Crud_model extends CI_Model {
}
public function edit_organ($param1) {
$data['code'] = html_escape($this->input->post('code'));
$data['name'] = html_escape($this->input->post('name'));
$data['parent_id'] = html_escape($this->input->post('parent_id'));
$data['slug'] = slugify(html_escape($this->input->post('name')));
......
......@@ -44,7 +44,7 @@ class User_model extends CI_Model {
return $this->db->get('users');
}
} else {
return 0;
return $this->db->get('users');
}
}
......
......@@ -18,8 +18,8 @@
<form class="required-form" action="<?php echo site_url('admin/organization/add'); ?>" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="code"><?php echo get_phrase('organ_code'); ?></label>
<input type="text" class="form-control" id="code" name = "code" value="<?php echo substr(md5(rand(0, 1000000)), 0, 10); ?>" readonly>
<label for="code"><?php echo get_phrase('organ_code'); ?><span class="required">*</span></label>
<input type="text" class="form-control" id="code" name = "code" value="" require>
</div>
<div class="form-group">
......
......@@ -20,8 +20,8 @@ $organ_details = $this->crud_model->get_organ_details_by_id($organ_id)->row_arra
<form class="required-form" action="<?php echo site_url('admin/organization/edit/'.$organ_id); ?>" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="code"><?php echo get_phrase('organ_title'); ?></label>
<input type="text" class="form-control" id="code" name = "code" value="<?php echo $organ_details['code']; ?>" readonly>
<label for="code"><?php echo get_phrase('organ_code'); ?><span class="required">*</span></label>
<input type="text" class="form-control" id="code" name = "code" value="<?php echo $organ_details['code']; ?>" require>
</div>
<div class="form-group">
......
......@@ -6,6 +6,24 @@
$organization = $this->crud_model->get_organization_all($children_org,$is_supper_admin)->result_array();
$number = $this->session->userdata('account_type');
$result = account_type($number, $is_supper_admin, $children_org);
function children_orgs($organization, $parent_id = 0, $text = "")
{
foreach($organization as $k=>$organ)
{
if($organ['parent_id'] == $parent_id)
{
echo '<option value=\''.$organ['id'].'\'';
if($is_supper_admin == 0) {
if($organ['id'] == $organization_id) echo 'disabled'; };
if($organ['id'] == $user_data['organization_id']) echo 'selected';
echo '>'.$text.' '.$organ['name'].'</option>';
$id = $organ['id'];
unset($organization[$k]);
children_orgs($organization, $id, $text."--");
}
}
}
?>
<div class="row ">
<div class="col-xl-12">
......@@ -83,16 +101,19 @@
<div class="col-md-9">
<select class="form-control select2" data-toggle="select2" name="organization_id" id="organization_id">
<option value="2"><?php echo get_phrase('none'); ?></option>
<?php foreach ($organization as $organ):
if($children_org != array()) {?>
<option value="<?php echo $organ['id']; ?>"
<?php if ($is_supper_admin == 1){} else { if($organ['id'] == $organization_id || $organ['parent_id'] == 0) echo 'disabled'; }
if($organ['id'] == $user_data['organization_id']) echo 'selected' ?>><?php echo $organ['name']; ?></option>
<?php } else { ?>
<?php
if($children_org != array()) {
if($is_supper_admin == 0) {
children_orgs($organization, $user_data['organization_id']);
} else {
children_orgs($organization);
}
} else {
foreach ($organization as $organ): ?>
<option value="<?php echo $organ['id']; ?>"
<?php if($organ['parent_id'] == 0) echo 'disabled';
if($organ['id'] == $user_data['organization_id']) echo 'selected' ?>><?php echo $organ['name']; ?></option>
<?php } endforeach; ?>
<?php endforeach;} ?>
</select>
</div>
</div>
......
......@@ -35,7 +35,7 @@
<script src="<?php echo site_url('assets/backend/js/custom.js');?>"></script>
<!-- Dashboard chart's data is coming from this file -->
<?php include 'admin/dashboard-chart.php'; ?>
<?php include 'admin/dashboard/dashboard-chart.php'; ?>
<script type="text/javascript">
$(document).ready(function() {
......
......@@ -6,13 +6,13 @@ $course_details_url = site_url("home/course/".slugify($course_details['title']).
<div class="container-fluid course_container">
<!-- Top bar -->
<div class="row">
<div class="col-lg-9 course_header_col">
<div class="col-lg-8 course_header_col">
<h5>
<img src="<?php echo base_url().'uploads/system/logo-light-sm.png';?>" height="25"> |
<?php echo $course_details['title']; ?>
</h5>
</div>
<div class="col-lg-3 course_header_col">
<div class="col-lg-4 course_header_col">
<a href="javascript::" class="course_btn" onclick="toggle_lesson_view()"><i class="fa fa-arrows-alt-h"></i></a>
<a href="<?php echo $my_course_url; ?>" class="course_btn"> <i class="fa fa-chevron-left"></i> <?php echo get_phrase('my_courses'); ?></a>
<a href="<?php echo $course_details_url; ?>" class="course_btn"><?php echo get_phrase('course_details'); ?> <i class="fa fa-chevron-right"></i></a>
......
......@@ -53,8 +53,9 @@
*
* NOTE: If you change these, also change the error_reporting() code below
*/
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'production');
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
error_log('123');
/*
*---------------------------------------------------------------
* ERROR REPORTING
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment