Commit fb53bc79 by Trần Văn Minh

xóa git cho uploads và language

parent 91a82db4
/.idea /.idea
/uploads
/application/language
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
if ( ! function_exists('account_type')){
function account_type($number = "", $is_supper_admin = "", $children_org = '') {
if ($is_supper_admin == 1) {
$result = array(
array('id'=> 0, 'name'=> 'supper admin'),
array('id'=> 1, 'name'=> 'admin'),
array('id'=> 2, 'name'=> 'organization'),
array('id'=> 3, 'name'=> 'teacher'),
array('id'=> 4, 'name'=> 'student'),
);
} else
if($number == 1) {
$result = array(
array('id'=> 1, 'name'=> 'admin'),
array('id'=> 2, 'name'=> 'organization'),
array('id'=> 3, 'name'=> 'teacher'),
array('id'=> 4, 'name'=> 'student')
);
} else if ($number == 2) {
if ($children_org == array()) {
$result = array(
array('id'=> 3, 'name'=> 'teacher'),
array('id'=> 4, 'name'=> 'student')
);
} else {
$result = array(
array('id'=> 1, 'name'=> 'admin'),
array('id'=> 2, 'name'=> 'organization'),
array('id'=> 3, 'name'=> 'teacher'),
array('id'=> 4, 'name'=> 'student')
);
}
} else if ($number == 3) {
$result = array(
array('id'=> 4, 'name'=> 'student')
);
}
return $result;
}
}
if(!function_exists('name_account_type')) {
function name_account_type($number) {
switch($number) {
case 1:
$name = 'admin';
break;
case 2:
$name = 'organization';
break;
case 3:
$name = 'teacher';
break;
case 4:
$name = 'student';
break;
default:
$name = 'not_found';
}
return $name;
}
}
if( !function_exists('all_child_organization')){
function all_child_organization($organization_id) {
$CI =& get_instance();
$CI->load->database();
$sql = 'SELECT id ';
$sql .= ' FROM (SELECT * FROM organization ORDER BY parent_id, id) C, (SELECT @pv := ' .$organization_id. ') C2 ';
$sql .= ' WHERE FIND_IN_SET(parent_id, @pv) AND LENGTH(@pv := CONCAT(@pv, ",", id))';
$query = $CI->db->query($sql);
$result = $query->result_array();
$arr = array();
foreach($result as $res):
array_push($arr, $res['id']);
endforeach;
return $arr;
}
}
?>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<?php
/*
* English language
*/
$lang['text_rest_invalid_api_key'] = 'Invalid API key %s'; // %s is the REST API key
$lang['text_rest_invalid_credentials'] = 'Invalid credentials';
$lang['text_rest_ip_denied'] = 'IP denied';
$lang['text_rest_ip_unauthorized'] = 'IP unauthorized';
$lang['text_rest_unauthorized'] = 'Unauthorized';
$lang['text_rest_ajax_only'] = 'Only AJAX requests are allowed';
$lang['text_rest_api_key_unauthorized'] = 'This API key does not have access to the requested controller';
$lang['text_rest_api_key_permissions'] = 'This API key does not have enough permissions';
$lang['text_rest_api_key_time_limit'] = 'This API key has reached the time limit for this method';
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';
$lang['text_rest_unknown_method'] = 'Unknown method';
$lang['text_rest_unsupported'] = 'Unsupported protocol';
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<?php
/*
* English language
*/
$lang['text_rest_invalid_api_key'] = 'Invalid API key %s'; // %s is the REST API key
$lang['text_rest_invalid_credentials'] = 'Invalid credentials';
$lang['text_rest_ip_denied'] = 'IP denied';
$lang['text_rest_ip_unauthorized'] = 'IP unauthorized';
$lang['text_rest_unauthorized'] = 'Unauthorized';
$lang['text_rest_ajax_only'] = 'Only AJAX requests are allowed';
$lang['text_rest_api_key_unauthorized'] = 'This API key does not have access to the requested controller';
$lang['text_rest_api_key_permissions'] = 'This API key does not have enough permissions';
$lang['text_rest_api_key_time_limit'] = 'This API key has reached the time limit for this method';
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';
$lang['text_rest_unknown_method'] = 'Unknown method';
$lang['text_rest_unsupported'] = 'Unsupported protocol';
<!-- start page title -->
<div class="row ">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h4 class="page-title"> <i class="mdi mdi-apple-keyboard-command title_icon"></i> <?php echo get_phrase('add_new_organ'); ?></h4>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<div class="row justify-content-center">
<div class="col-xl-7">
<div class="card">
<div class="card-body">
<div class="col-lg-12">
<h4 class="mb-3 header-title"><?php echo get_phrase('organ_add_form'); ?></h4>
<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>
</div>
<div class="form-group">
<label for="name"><?php echo get_phrase('organ_title'); ?><span class="required">*</span></label>
<input type="text" class="form-control" id="name" name = "name" required>
</div>
<div class="form-group">
<label for="address"><?php echo get_phrase('organ_address'); ?></label>
<input type="text" class="form-control" id="address" name = "address">
</div>
<div class="form-group">
<label for="phone"><?php echo get_phrase('organ_phone'); ?></label>
<input type="text" class="form-control" id="phone" name = "phone">
</div>
<div class="form-group">
<label for="parent"><?php echo get_phrase('parent'); ?></label>
<select class="form-control select2" data-toggle="select2" name="parent_id" id="parent_id" onchange="checkorganType(this.value)">
<option value="0"><?php echo get_phrase('none'); ?></option>
<?php foreach ($organization as $organ): ?>
<?php if ($organ['parent_id'] == 0): ?>
<option value="<?php echo $organ['id']; ?>"><?php echo $organ['name']; ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group" id = "icon-picker-area">
<label for="font_awesome_class"><?php echo get_phrase('icon_picker'); ?></label>
<input type="text" id ="font_awesome_class" name="font_awesome_class" class="form-control icon-picker" autocomplete="off">
</div>
<div class="form-group" id = "thumbnail-picker-area">
<label> <?php echo get_phrase('organ_thumbnail'); ?> <small>(<?php echo get_phrase('the_image_size_should_be'); ?>: 400 X 255)</small> </label>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="organization_thumbnail" name="organization_thumbnail" accept="image/*" onchange="changeTitleOfImageUploader(this)">
<label class="custom-file-label" for="organization_thumbnail"><?php echo get_phrase('choose_thumbnail'); ?></label>
</div>
</div>
</div>
<button type="button" class="btn btn-primary" onclick="checkRequiredFields()"><?php echo get_phrase("submit"); ?></button>
</form>
</div>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<script type="text/javascript">
function checkorganType(organ_type) {
if (organ_type > 0) {
$('#thumbnail-picker-area').hide();
$('#icon-picker-area').hide();
}else {
$('#thumbnail-picker-area').show();
$('#icon-picker-area').show();
}
}
</script>
<?php
$organ_details = $this->crud_model->get_organ_details_by_id($organ_id)->row_array();
?>
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box ">
<h4 class="page-title"> <i class="mdi mdi-apple-keyboard-command title_icon"></i> <?php echo get_phrase('update_organ'); ?></h4>
</div>
</div>
</div>
<div class="row justify-content-md-center">
<div class="col-xl-6">
<div class="card">
<div class="card-body">
<div class="col-lg-12">
<h4 class="mb-3 header-title"><?php echo get_phrase('update_organ_form'); ?></h4>
<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>
</div>
<div class="form-group">
<label for="name"><?php echo get_phrase('organ_title'); ?><span class="required">*</span></label>
<input type="text" class="form-control" id="name" name = "name" value="<?php echo $organ_details['name']; ?>" required>
</div>
<div class="form-group">
<label for="address"><?php echo get_phrase('organ_address'); ?></label>
<input type="text" class="form-control" id="address" name = "address" value="<?php echo $organ_details['address']; ?>">
</div>
<div class="form-group">
<label for="phone"><?php echo get_phrase('organ_phone'); ?></label>
<input type="text" class="form-control" id="phone" name = "phone" value="<?php echo $organ_details['phone']; ?>">
</div>
<div class="form-group">
<label for="parent"><?php echo get_phrase('parent'); ?></label>
<select class="form-control select2" data-toggle="select2" name="parent_id" id="parent_id">
<option value="0"><?php echo get_phrase('none'); ?></option>
<?php foreach ($organization as $organ): ?>
<?php if ($organ['parent_id'] == 0): ?>
<option value="<?php echo $organ['id']; ?>" <?php if($organ_details['parent_id'] == $organ['id']) echo 'selected'; ?>><?php echo $organ['name']; ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group" id = "icon-picker-area">
<label for="font_awesome_class"><?php echo get_phrase('icon_picker'); ?></label>
<input type="text" id = "font_awesome_class" name="font_awesome_class" class="form-control icon-picker" value="<?php echo $organ_details['font_awesome_class']; ?>" autocomplete="off">
</div>
<div class="form-group" id = "thumbnail-picker-area">
<label><?php echo get_phrase('organization_thumbnail'); ?> <small>(<?php echo get_phrase('the_image_size_should_be'); ?>: 400 X 255)</small> </label>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="organization_thumbnail" name="organization_thumbnail" accept="image/*" onchange="changeTitleOfImageUploader(this)">
<label class="custom-file-label" for="organization_thumbnail"><?php echo get_phrase('choose_thumbnail'); ?></label>
</div>
</div>
</div>
<button type="button" class="btn btn-primary" onclick="checkRequiredFields()"><?php echo get_phrase("submit"); ?></button>
</form>
</div>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<script type="text/javascript">
function checkorganType(organ_type) {
if (organ_type > 0) {
$('#thumbnail-picker-area').hide();
$('#icon-picker-area').hide();
}else {
$('#thumbnail-picker-area').show();
$('#icon-picker-area').show();
}
}
$(document).ready(function () {
var parent_organ = $('#parent_id').val();
checkorganType(parent_organ);
});
</script>
<div class="row ">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h4 class="page-title"> <i class="mdi mdi-apple-keyboard-command title_icon"></i> <?php echo get_phrase('organization'); ?>
<a href="<?php echo site_url('admin/organ_form/add_organ'); ?>" class="btn btn-outline-primary btn-rounded alignToTitle"><i class="mdi mdi-plus"></i><?php echo get_phrase('add_new_organization'); ?></a>
</h4>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<div class="row">
<?php foreach ($organization->result_array() as $organ):
if($organ['parent_id'] > 0 )
continue;
$sub_organization = $this->crud_model->get_sub_organization($organ['id']); ?>
<div class="col-md-6 col-lg-6 col-xl-4 on-hover-action" id = "<?php echo $organ['id']; ?>">
<div class="card d-block">
<img class="card-img-top img-list" src="<?php echo base_url('uploads/thumbnails/organization_thumbnails/'.$organ['thumbnail']); ?>" alt="Card image cap">
<div class="card-body">
<h4 class="card-title mb-0"><i class="<?php echo $organ['font_awesome_class']; ?>"></i> <?php echo $organ['name']; ?></h4>
<small style="font-style: italic;"><p class="card-text"><?php echo count($sub_organization).' '.get_phrase('sub_organization'); ?></p></small>
</div>
<ul class="list-group list-group-flush">
<?php foreach ($sub_organization as $sub_organ): ?>
<li class="list-group-item on-hover-action" id = "<?php echo $sub_organ['id']; ?>">
<span><i class="<?php echo $sub_organ['font_awesome_class']; ?>"></i> <?php echo $sub_organ['name']; ?></span>
<span class="category-action" id = 'organ-delete-btn-<?php echo $sub_organ['id']; ?>' style="float: right; margin-left: 5px; display: none; height: 20px;">
<a href="javascript::" class="action-icon" onclick="confirm_modal('<?php echo site_url('admin/organization/delete/'.$sub_organ['id']); ?>');"> <i class="mdi mdi-delete" style="font-size: 18px;"></i></a>
</span>
<span class="category-action" id = 'organ-edit-btn-<?php echo $sub_organ['id']; ?>' style="float: right; display: none; height: 20px;">
<a href="<?php echo site_url('admin/organ_form/edit_organ/'.$sub_organ['id']); ?>" class="action-icon"> <i class="mdi mdi-pencil" style="font-size: 18px;"></i></a>
</span>
</li>
<?php endforeach; ?>
</ul>
<div class="card-body">
<a href = "<?php echo site_url('admin/organ_form/edit_organ/'.$organ['id']); ?>" class="btn btn-icon btn-outline-info btn-sm" id = "organ-edit-btn-<?php echo $organ['id']; ?>" style="display: none;" style="margin-right:5px;">
<i class="mdi mdi-wrench"></i> <?php echo get_phrase('edit'); ?>
</a>
<a href = "#" class="btn btn-icon btn-outline-danger btn-sm" id = "organ-delete-btn-<?php echo $organ['id']; ?>"style="float: right; display: none;" onclick="confirm_modal('<?php echo site_url('admin/organization/delete/'.$organ['id']); ?>');" style="margin-right:5px;">
<i class="mdi mdi-delete"></i> <?php echo get_phrase('delete'); ?>
</a>
</div> <!-- end card-body-->
</div> <!-- end card-->
</div>
<?php endforeach; ?>
</div>
<script type="text/javascript">
$('.on-hover-action').mouseenter(function() {
var id = this.id;
$('#organ-delete-btn-'+id).show();
$('#organ-edit-btn-'+id).show();
});
$('.on-hover-action').mouseleave(function() {
var id = this.id;
$('#organ-delete-btn-'+id).hide();
$('#organ-edit-btn-'+id).hide();
});
</script>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
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