Docroot sub-apps beiratkozas/, iskolak/, phpext/; root PHPs crashadmin.php, crm_hardlock.class.php, login-external.php, tips.php, recaptchalib.php, configuration.php (74-byte MightySites multi-site stub, legit). public/ excluded (user data, ~219k files). Signed-off-by: LÁZÁR Imre <imre@illusion.hu> Assisted-by: claude-code@claude-opus-4-8
325 lines
15 KiB
PHP
325 lines
15 KiB
PHP
<?php
|
|
error_reporting(E_ERROR | E_PARSE);
|
|
|
|
if (!class_exists('crm_hardlock')) require_once("../common_cadline_libraries/crm_hardlock.class.php");
|
|
include('session.php');
|
|
|
|
$query = "SELECT * FROM `" . CRMADATBAZIS . "`.`courses` WHERE school_id = ? ORDER BY is_archive ASC, name ASC";
|
|
Database::getInstance()->query($query, array('i', $school_id));
|
|
$courses = Database::getInstance()->fetchAssoc();
|
|
|
|
define('_JEXEC', 1);
|
|
define('JPATH_BASE', '..');
|
|
require_once(JPATH_BASE . '/includes/defines.php');
|
|
require_once(JPATH_BASE . '/includes/framework.php');
|
|
|
|
if ($_SERVER['HTTP_HOST'] == 'www.archline.hu')
|
|
require_once('language/hu-HU.lang.php');
|
|
else
|
|
require_once('language/en-GB.lang.php');
|
|
|
|
$course_end = $home['end_of_course'];
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<link rel="shortcut icon" href="<?= $home['favicon'] ?>" type="image/vnd.microsoft.icon" />
|
|
<link rel="stylesheet" href="public/css/bootstrap.min.css?<?= time() ?>">
|
|
<link rel="stylesheet" href="https://unpkg.com/gijgo@1.9.13/css/gijgo.min.css" type="text/css" />
|
|
<link rel="stylesheet" href="public/css/main.css?<?= time() ?>" type="text/css" />
|
|
|
|
<script src="public/js/jquery.min.js" type="text/javascript"></script>
|
|
<script src="public/js/bootstrap.min.js?<?= time() ?>" type="text/javascript"></script>
|
|
<script src="public/js/gijgo.min.js" type="text/javascript"></script>
|
|
<script src="public/js/main.js?ver=3" type="text/javascript"></script>
|
|
|
|
<title><?= $home['home_page'] ?></title>
|
|
|
|
<?php if ($_SERVER['HTTP_HOST'] == 'www.archlinexp.com') : ?>
|
|
<style media="screen">
|
|
#pelda_excel {
|
|
margin-left: -30% !important;
|
|
}
|
|
</style>
|
|
<?php endif; ?>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="container">
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
<div class="collapse navbar-collapse" id="navbarNavDropdown">
|
|
<ul class="navbar-nav">
|
|
<li class="nav-item active">
|
|
<a class="nav-link" href="/iskolak"><?= $home['home_page'] ?> <span class="sr-only">(current)</span></a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="logout.php"><?= $home['logout'] ?></a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
<br />
|
|
<br />
|
|
|
|
<div class="container">
|
|
<div class="form-group">
|
|
<?php
|
|
echo "<select class='form-control' id='course'>";
|
|
foreach ($courses as $course) {
|
|
$begin = str_replace('-', '.', $course["from"]);
|
|
$end = str_replace('-', '.', $course["vegzes_ideje"]);
|
|
$c_end = str_replace('-', '.', $course["to"]);
|
|
$c_name = $course["name"];
|
|
$c_id = $course["id"];
|
|
|
|
if ($course['is_archive'] == 0)
|
|
echo "<option data-archive='" . $course['is_archive'] . "' value = '{$c_id}'>{$school_name} {$c_name} {$begin} - {$end} ({$course_end}: {$c_end})</option>";
|
|
else
|
|
echo "<option data-archive='" . $course['is_archive'] . "' value = '{$c_id}'>{$school_name} {$c_name}</option>";
|
|
}
|
|
echo "</select>";
|
|
?>
|
|
<input type="hidden" value="" id="c_end" />
|
|
<br />
|
|
|
|
<div id="archiv_text" class="row">
|
|
<div class="col-md-12">
|
|
<?= $home['archiv_desc'] ?>
|
|
</div>
|
|
</div>
|
|
<br />
|
|
<br />
|
|
|
|
<div id="modal-div" class="form-row">
|
|
<div class="col-sm-9">
|
|
<button class="btn btn-primary" data-toggle="modal" onclick="showAddModal()"><?= $home['add_new_student'] ?></button>
|
|
</div>
|
|
|
|
<div class="col-sm-3" id="h_div">
|
|
<h4><?= $home['import_from_excel'] ?>:</h4>
|
|
</div>
|
|
</div>
|
|
<br />
|
|
|
|
<form id="export-form" action="process.php" method="post">
|
|
<input type="hidden" name="action" value="excel_export" />
|
|
<input type="hidden" id="excel_c_id" name="excel_c_id" value="<?= $courses[0]["id"] ?>" />
|
|
|
|
<input type="submit" value="<?= $home['export_excel'] ?>" class="btn btn-info" />
|
|
</form>
|
|
|
|
<div style="display: flex; justify-content: flex-end">
|
|
<a href="<?= $home['sample_excel'] ?>" style="margin-right: 4%;"><button type="button" class="btn btn-info" id="pelda_excel" download><?= $home['download_sample'] ?></button></a>
|
|
</div>
|
|
<br />
|
|
|
|
<div id="file_input">
|
|
<input type="file" id="excl_file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
|
|
</div>
|
|
<br />
|
|
|
|
<div>
|
|
<button class="btn btn-info" id="excl_btn" onclick="readExcel()"><?= $home['import_students'] ?></button>
|
|
</div>
|
|
<br />
|
|
<br />
|
|
|
|
<div class="form-row">
|
|
<input type="text" class="form form-control col-md-4" id="search_name" id="search_btn" placeholder="<?= $home['search'] ?>..." />
|
|
<input type="checkbox" name="search_all" id="search_all">
|
|
<div id="search-txt"><label for="search_all"><?= $home['search_all'] ?></label></div>
|
|
<button style="margin-left: 5% !important;" type="button" class="btn btn-primary" id="email_btn" data-toggle="modal" data-target="#emailModal" onclick="emailModal()"><?= $home['send_email'] ?></button>
|
|
</div>
|
|
<br />
|
|
|
|
<div id="content">
|
|
<img src="public/loading.gif" id="loading_gif" style="display: none;" />
|
|
<table id="student_table" class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">#</th>
|
|
<th scope="col"><?= $home['name'] ?></th>
|
|
<th scope="col"><?= $home['email'] ?></th>
|
|
<th scope="col"><?= $home['telephone'] ?></th>
|
|
<th scope="col"><?= $home['status'] ?></th>
|
|
<th scope="col"><?= $home['serial_number'] ?></th>
|
|
<th scope="col"></th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<input type="hidden" id="school_id" value="<?= $school_id ?>" />
|
|
</div>
|
|
|
|
<!-- Email modal -->
|
|
<div class="modal fade" id="emailModal" tabindex="-1" role="dialog" aria-labelledby="emailModal" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="emailModalLabel"><?= $home['send_email'] ?></h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
<table id="emailToStudents" class="table table-striped">
|
|
<thead>
|
|
<th scope="col">
|
|
<div class="custom-control custom-checkbox">
|
|
<input type="checkbox" class="custom-control-input" id="checkAll">
|
|
<label class="custom-control-label" for="checkAll"></label>
|
|
</div>
|
|
</th>
|
|
<th scope="col"><?= $home['name'] ?></th>
|
|
<th scope="col"><?= $home['email'] ?></th>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal"><?= $home['close'] ?></button>
|
|
<button type="button" class="btn btn-success" onclick="sendEmail()" id="send_email_btn"><?= $home['send_email'] ?></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- New User Modal -->
|
|
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModal" aria-hidden="true">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="addModalLabel"><?= $home['add_new_student'] ?></h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="form-group">
|
|
<label><?= $home['name'] ?>:</label>
|
|
<input type="text" id="name" class="form-control" placeholder="<?= $home['name'] ?>" required />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label><?= $home['email'] ?>:</label>
|
|
<input type="text" id="email" class="form-control" placeholder="<?= $home['email'] ?>" required />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label><?= $home['confirm_email'] ?>:</label>
|
|
<input type="text" id="email2" class="form-control" placeholder="<?= $home['confirm_email'] ?>" required />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label><?= $home['telephone'] ?>:</label>
|
|
<input type="text" id="phone" class="form-control" placeholder="<?= $home['telephone'] ?>" <?= $_SERVER['HTTP_HOST'] == 'www.archline.hu' ? 'required' : '' ?> />
|
|
</div>
|
|
</div>
|
|
|
|
<div id="error_div" class="alert alert-danger" role="alert"></div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal"><?= $home['close'] ?></button>
|
|
<button type="button" class="btn btn-success" onclick="addRecord()"><?= $home['add'] ?></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Edit User Modal -->
|
|
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModal" aria-hidden="true">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="editModalLabel"><?= $home['edit_student'] ?></h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="form-group">
|
|
<label><?= $home['name'] ?>:</label>
|
|
<input type="text" id="updatename" class="form-control" placeholder="<?= $home['name'] ?>" required />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label><?= $home['email'] ?>:</label>
|
|
<input type="text" id="updateemail" class="form-control" placeholder="<?= $home['email'] ?>" required />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label><?= $home['confirm_email'] ?>:</label>
|
|
<input type="text" id="updateemail2" class="form-control" placeholder="<?= $home['confirm_email'] ?>" required />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label><?= $home['telephone'] ?>:</label>
|
|
<input type="text" id="updatephone" class="form-control" placeholder="<?= $home['telephone'] ?>" required />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label><?= $home['course'] ?>:</label>
|
|
<select class="form-control" id="courses">
|
|
<?php foreach ($courses as $course) : ?>
|
|
<option value="<?= $course['id'] ?>"><?= $course['name'] ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label><?= $home['status'] ?>:</label>
|
|
<select class="form-control" id="status">
|
|
<option value="1"><?= $home['active'] ?></option>
|
|
<option value="0"><?= $home['passive'] ?></option>
|
|
<option value="2"><?= $home['exam_passed'] ?></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="error_div2" class="alert alert-danger" role="alert"></div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal"><?= $home['close'] ?></button>
|
|
<button type="button" class="btn btn-success" onclick="updateUserDetails()"><?= $home['save'] ?></button>
|
|
<input type="hidden" id="hidden_user_id" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#search_name').on('input', function() {
|
|
readRecords();
|
|
});
|
|
|
|
// Draggable modals
|
|
$(".modal-header").on("mousedown", function(mousedownEvt) {
|
|
var $draggable = $(this);
|
|
var x = mousedownEvt.pageX - $draggable.offset().left,
|
|
y = mousedownEvt.pageY - $draggable.offset().top;
|
|
$("body").on("mousemove.draggable", function(mousemoveEvt) {
|
|
$draggable.closest(".modal-dialog").offset({
|
|
"left": mousemoveEvt.pageX - x,
|
|
"top": mousemoveEvt.pageY - y
|
|
});
|
|
});
|
|
|
|
$("body").one("mouseup", function() {
|
|
$("body").off("mousemove.draggable");
|
|
});
|
|
$draggable.closest(".modal").one("bs.modal.hide", function() {
|
|
$("body").off("mousemove.draggable");
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</html>
|