632 lines
34 KiB
PHP
632 lines
34 KiB
PHP
<?php
|
|
/**
|
|
* /subs/register.php
|
|
* @version 1.1
|
|
* @desc register menu -> the core
|
|
* @author Fándly Gergő Zoltán (fandlygergo@gmail.hu, systemtest.tk)
|
|
* @copy 2017 Fándly Gergő Zoltán
|
|
* License:
|
|
Result Manager for managing results of students in bilingual school systems.
|
|
Copyright (C) 2017 Fándly Gergő Zoltán
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
**/
|
|
|
|
$oid=0;
|
|
?>
|
|
|
|
<div class="selfcenter">
|
|
<!-- language for jquery -->
|
|
<span id="registerDeleteConfirm" style="display: none"><?php echo $lang['delete_confirm'] ?></span>
|
|
<!-- filter -->
|
|
<div class="dropdown selfcenter" style="width: 95%" id="dd_filter">
|
|
<div class="dropdown header">
|
|
<a onclick="toggleDropdown('#dd_filter_content', '#dd_filter_img')">
|
|
<img class="icon" src="./res/plus.png" alt="plusminus" id="dd_filter_img">
|
|
<span><?php echo $lang['filter'] ?></span>
|
|
</a>
|
|
</div>
|
|
<div class="dropdown content" id="dd_filter_content">
|
|
<form method="POST" class="ajaxform" id="dd_filter_form" onsubmit="registerFilterApply()">
|
|
<input type="hidden" name="filter">
|
|
<p><?php echo $lang['search'].":" ?></p>
|
|
<input type="text" name="f_search" placeholder="<?php echo $lang['search']."..." ?>">
|
|
<hr>
|
|
<p><?php echo $lang['student'].":" ?></p>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..." ?>" onkeyup="search(this, '#studentSearch')">
|
|
<ul id="studentSearch">
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, fullname, class FROM users WHERE accesslevel=0 and id<>1 ORDER BY class ASC, fullname ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"checkbox\" name=\"f_student[]\" value=\"".$row['id']."\" id=\"o_".$oid."\">
|
|
<label for=\"o_".$oid."\">".$row['fullname']." (".$row['class'].")</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
<hr>
|
|
<p><?php echo $lang['contest'].":" ?></p>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..." ?>" onkeyup="search(this, '#contestSearch')">
|
|
<ul id="contestSearch">
|
|
<?php
|
|
$sql=$db->prepare("SELECT c.id, c.name_1, c.name_2, s.name_1 AS subject_1, s.name_2 AS subject_2, c.schoolyear FROM contests AS c INNER JOIN subjects AS s ON (s.id=c.subject) ORDER BY c.schoolyear DESC, s.name_1 ASC, s.name_2 ASC, c.name_1 ASC, c.name_2 ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"checkbox\" name=\"f_contest[]\" value=\"".$row['id']."\" id=\"o_".$oid."\">
|
|
<label for=\"o_".$oid."\">".$row['schoolyear']." - ".$row['name_1'].", ".$row['name_2']." (".$row['subject_1'].", ".$row['subject_2'].")</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
<hr>
|
|
<p><?php echo $lang['phase'].":" ?></p>
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, name_1, name_2 FROM phases ORDER BY name_1 ASC, name_2 ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<input type=\"checkbox\" name=\"f_phase[]\" value=\"".$row['id']."\" id=\"o_".$oid."\">
|
|
<label for=\"o_".$oid."\">".$row['name_1'].", ".$row['name_2']."</label>
|
|
<br>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
<hr>
|
|
<p><?php echo $lang['teacher'].":" ?></p>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..."?>" onkeyup="search(this, '#teacherSearch')">
|
|
<ul id="teacherSearch">
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, fullname FROM users WHERE id<>0 and accesslevel>0 ORDER BY fullname ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"checkbox\" name=\"f_teacher[]\" value=\"".$row['id']."\" id=\"o_".$oid."\">
|
|
<label for=\"o_".$oid."\">".$row['fullname']."</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
<hr>
|
|
<button type="submit" form="dd_filter_form"><?php echo $lang['apply'] ?></button>
|
|
<button type="button" onclick="registerFilterReset()"><?php echo $lang['reset'] ?></button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<hr class="placeholder">
|
|
<!-- new -->
|
|
<div class="dropdown selfcenter" style="width: 95%" id="dd_new">
|
|
<div class="dropdown header">
|
|
<a onclick="toggleDropdown('#dd_new_content', '#dd_new_img')">
|
|
<img class="icon" src="./res/plus.png" alt="plusminus" id="dd_new_img">
|
|
<span><?php echo $lang['new'] ?></span>
|
|
</a>
|
|
</div>
|
|
<div class="dropdown content" id="dd_new_content">
|
|
<form method="POST" class="ajaxform" id="dd_new_form" onsubmit="registerNew()">
|
|
<input type="hidden" name="new">
|
|
<table>
|
|
<tr>
|
|
<td><?php echo $lang['student'].": " ?></td>
|
|
<td>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..." ?>" onkeyup="search(this, '#studentSearchNew')">
|
|
<ul id="studentSearchNew">
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, fullname, class FROM users WHERE accesslevel=0 and id<>1 ORDER BY class ASC, fullname ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"radio\" name=\"student\" value=\"".$row['id']."\" id=\"o_".$oid."\" required>
|
|
<label for=\"o_".$oid."\">".$row['fullname']." (".$row['class'].")</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo $lang['contest'].": " ?></td>
|
|
<td>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..." ?>" onkeyup="search(this, '#contestSearchNew')">
|
|
<ul id="contestSearchNew">
|
|
<?php
|
|
$sql=$db->prepare("SELECT c.id, c.name_1, c.name_2, s.name_1 AS subject_1, s.name_2 AS subject_2 FROM contests AS c INNER JOIN subjects AS s ON (s.id=c.subject) WHERE c.schoolyear=:sy ORDER BY s.name_1 ASC, s.name_2 ASC, c.name_1 ASC, c.name_2 ASC");
|
|
$sql->execute(array(":sy"=>$schoolyear));
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"radio\" name=\"contest\" value=\"".$row['id']."\" id=\"o_".$oid."\" required>
|
|
<label for=\"o_".$oid."\">".$row['name_1'].", ".$row['name_2']." (".$row['subject_1'].", ".$row['subject_2'].")</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo $lang['phase'].": " ?></td>
|
|
<td>
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, name_1, name_2 FROM phases ORDER BY name_1 ASC, name_2 ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<input type=\"radio\" name=\"phase\" value=\"".$row['id']."\" id=\"o_".$oid."\" required>
|
|
<label for=\"o_".$oid."\">".$row['name_1'].", ".$row['name_2']."</label>
|
|
<br>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo $lang['teacher'].": " ?></td>
|
|
<td>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..."?>" onkeyup="search(this, '#teacherSearchNew')">
|
|
<ul id="teacherSearchNew">
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, fullname FROM users WHERE id<>0 and accesslevel>0 ORDER BY fullname ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"radio\" name=\"teacher\" value=\"".$row['id']."\" id=\"o_".$oid."\" required>
|
|
<label for=\"o_".$oid."\">".$row['fullname']."</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo $lang['place'].": " ?></td>
|
|
<td>
|
|
<?php
|
|
for($i=-3; $i<0; $i++){
|
|
echo "
|
|
<input type=\"radio\" name=\"place\" value=\"".$i."\" id=\"o_".$oid."\" required>
|
|
<label for=\"o_".$oid."\">".$lang['places'][$i]."</label>
|
|
<br>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
<input type="radio" name="place" value="0" id="o_<?php echo $oid ?>" required>
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['custom'] ?></label>
|
|
<br>
|
|
<div id="registerCustomPlaceNew" style="display: none">
|
|
<span><?php echo $lang['custom'].": "?></span>
|
|
<input type="number" name="place_c" placeholder="<?php echo $lang['place']."..." ?>" min=1>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo $lang['mention'].": " ?></td>
|
|
<td><textarea name="mention" cols="50" rows="5" placeholder="<?php echo $lang['mention']."..." ?>"></textarea></td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<br>
|
|
<button type="submit" form="dd_new_form"><?php echo $lang['ok'] ?></button>
|
|
<button type="reset" form="dd_new_form" onclick="toggleDropdown('#dd_new_content', '#dd_new_img')"><?php echo $lang['cancel'] ?></button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<hr class="placeholder">
|
|
<!-- Export -->
|
|
<div class="dropdown selfcenter" style="width: 95%" id="dd_export">
|
|
<div class="dropdown header">
|
|
<a onclick="toggleDropdown('#dd_export_content', '#dd_export_img')">
|
|
<img class="icon" src="./res/plus.png" alt="plusminus" id="dd_export_img">
|
|
<span><?php echo $lang['export'] ?></span>
|
|
</a>
|
|
</div>
|
|
<div class="dropdown content" id="dd_export_content">
|
|
<form method="POST" class="ajaxform" id="dd_export_form" onsubmit="registerExport()">
|
|
<h3><?php echo $lang['exportcolumn'].":" ?></h3>
|
|
<ul style="list-style: none">
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="id" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['id'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="student" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['student'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="class" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['class'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="subject_1" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['subject_1'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="subject_2" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['subject_2'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="contest_1" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['contest_1'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="contest_2" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['contest_2'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="contest_desc" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['contest_desc'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="ministry_support" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['ministry_support'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="ministry_place" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['ministry_place'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="phase_1" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['phase_1'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="phase_2" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['phase_2'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="teacher" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['teacher'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="place" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['place'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="mention" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['mention'] ?></label>
|
|
</li>
|
|
<li>
|
|
<input type="checkbox" name="export[]" value="schoolyear" id="o_<?php echo $oid ?>">
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['schoolyear'] ?></label>
|
|
</li>
|
|
</ul>
|
|
<hr>
|
|
<h3><?php echo $lang['filter'].":" ?></h3>
|
|
<p><?php echo $lang['search'].":" ?></p>
|
|
<input type="text" name="f_search" placeholder="<?php echo $lang['search']."..." ?>">
|
|
<hr>
|
|
<p><?php echo $lang['student'].":" ?></p>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..." ?>" onkeyup="search(this, '#studentSearch')">
|
|
<ul id="studentSearch">
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, fullname, class FROM users WHERE accesslevel=0 and id<>1 ORDER BY class ASC, fullname ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"checkbox\" name=\"f_student[]\" value=\"".$row['id']."\" id=\"o_".$oid."\">
|
|
<label for=\"o_".$oid."\">".$row['fullname']." (".$row['class'].")</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
<hr>
|
|
<p><?php echo $lang['contest'].":" ?></p>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..." ?>" onkeyup="search(this, '#contestSearch')">
|
|
<ul id="contestSearch">
|
|
<?php
|
|
$sql=$db->prepare("SELECT c.id, c.name_1, c.name_2, s.name_1 AS subject_1, s.name_2 AS subject_2, c.schoolyear FROM contests AS c INNER JOIN subjects AS s ON (s.id=c.subject) ORDER BY c.schoolyear ASC, s.name_1 ASC, s.name_2 ASC, c.name_1 ASC, c.name_2 ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"checkbox\" name=\"f_contest[]\" value=\"".$row['id']."\" id=\"o_".$oid."\">
|
|
<label for=\"o_".$oid."\">".$row['schoolyear']." - ".$row['name_1'].", ".$row['name_2']." (".$row['subject_1'].", ".$row['subject_2'].")</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
<hr>
|
|
<p><?php echo $lang['phase'].":" ?></p>
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, name_1, name_2 FROM phases ORDER BY name_1 ASC, name_2 ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<input type=\"checkbox\" name=\"f_phase[]\" value=\"".$row['id']."\" id=\"o_".$oid."\">
|
|
<label for=\"o_".$oid."\">".$row['name_1'].", ".$row['name_2']."</label>
|
|
<br>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
<hr>
|
|
<p><?php echo $lang['teacher'].":" ?></p>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..."?>" onkeyup="search(this, '#teacherSearch')">
|
|
<ul id="teacherSearch">
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, fullname FROM users WHERE id<>0 and accesslevel>0 ORDER BY fullname ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"checkbox\" name=\"f_teacher[]\" value=\"".$row['id']."\" id=\"o_".$oid."\">
|
|
<label for=\"o_".$oid."\">".$row['fullname']."</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
<hr>
|
|
<p><?php echo $lang['schoolyear'].":" ?></p>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..."?>" onkeyup="search(this, '#schoolyearSearch')">
|
|
<ul id="schoolyearSearch">
|
|
<?php
|
|
$sql=$db->prepare("SELECT DISTINCT schoolyear FROM register ORDER BY schoolyear ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"checkbox\" name=\"f_schoolyear[]\" value=\"".$row['schoolyear']."\" id=\"o_".$oid."\">
|
|
<label for=\"o_".$oid."\">".$row['schoolyear']."</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
<br>
|
|
<br>
|
|
<button type="submit" form="dd_export_form"><?php echo $lang['export'] ?></button>
|
|
<div id="export_progress" style="display: none">
|
|
<br>
|
|
<br>
|
|
<img class="icon" src="./res/loading.gif" alt="loading">
|
|
<span><?php echo $lang['preparing_download'] ?></span>
|
|
</div>
|
|
<div id="export_ready" style="display: none">
|
|
<br>
|
|
<br>
|
|
<span><?php echo $lang['download_ready'] ?></span>
|
|
<br>
|
|
<input type="hidden" id="download_file">
|
|
<button type="button" onclick="registerExportDownload()"><?php echo $lang['download'] ?></button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<hr class="placeholder"
|
|
<!-- edit -->
|
|
<div class="dropdown selfcenter" style="width: 95%; display: none" id="dd_edit">
|
|
<div class="dropdown header">
|
|
<span><?php echo $lang['edit'] ?></span>
|
|
</div>
|
|
<div class="dropdown content" style="display: block">
|
|
<form method="POST" class="ajaxform" id="dd_edit_form" onsubmit="registerSubmitEdit()">
|
|
<input type="hidden" name="edit">
|
|
<table>
|
|
<tr>
|
|
<td><?php echo $lang['student'].": " ?></td>
|
|
<td>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..." ?>" onkeyup="search(this, '#studentSearchNew')">
|
|
<ul id="studentSearchNew">
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, fullname, class FROM users WHERE accesslevel=0 and id<>1 ORDER BY class ASC, fullname ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"radio\" name=\"student\" value=\"".$row['id']."\" id=\"o_".$oid."\" required>
|
|
<label for=\"o_".$oid."\">".$row['fullname']." (".$row['class'].")</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo $lang['contest'].": " ?></td>
|
|
<td>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..." ?>" onkeyup="search(this, '#contestSearchNew')">
|
|
<ul id="contestSearchNew">
|
|
<?php
|
|
$sql=$db->prepare("SELECT c.id, c.name_1, c.name_2, s.name_1 AS subject_1, s.name_2 AS subject_2 FROM contests AS c INNER JOIN subjects AS s ON (s.id=c.subject) ORDER BY s.name_1 ASC, s.name_2 ASC, c.name_1 ASC, c.name_2 ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"radio\" name=\"contest\" value=\"".$row['id']."\" id=\"o_".$oid."\" required>
|
|
<label for=\"o_".$oid."\">".$row['name_1'].", ".$row['name_2']." (".$row['subject_1'].", ".$row['subject_2'].")</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo $lang['phase'].": " ?></td>
|
|
<td>
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, name_1, name_2 FROM phases ORDER BY name_1 ASC, name_2 ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<input type=\"radio\" name=\"phase\" value=\"".$row['id']."\" id=\"o_".$oid."\" required>
|
|
<label for=\"o_".$oid."\">".$row['name_1'].", ".$row['name_2']."</label>
|
|
<br>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo $lang['teacher'].": " ?></td>
|
|
<td>
|
|
<div class="searchbox">
|
|
<input type="text" form="" placeholder="<?php echo $lang['search']."..."?>" onkeyup="search(this, '#teacherSearchNew')">
|
|
<ul id="teacherSearchNew">
|
|
<?php
|
|
$sql=$db->prepare("SELECT id, fullname FROM users WHERE id<>0 and accesslevel>0 ORDER BY fullname ASC");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<li>
|
|
<input type=\"radio\" name=\"teacher\" value=\"".$row['id']."\" id=\"o_".$oid."\" required>
|
|
<label for=\"o_".$oid."\">".$row['fullname']."</label>
|
|
</li>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo $lang['place'].": " ?></td>
|
|
<td>
|
|
<?php
|
|
for($i=-3; $i<0; $i++){
|
|
echo "
|
|
<input type=\"radio\" name=\"place\" value=\"".$i."\" id=\"o_".$oid."\" required>
|
|
<label for=\"o_".$oid."\">".$lang['places'][$i]."</label>
|
|
<br>
|
|
";
|
|
$oid++;
|
|
}
|
|
?>
|
|
<input type="radio" name="place" value="0" id="o_<?php echo $oid ?>" required>
|
|
<label for="o_<?php echo $oid; $oid++ ?>"><?php echo $lang['custom'] ?></label>
|
|
<br>
|
|
<div id="registerCustomPlaceEdit" style="display: none">
|
|
<span><?php echo $lang['custom'].": "?></span>
|
|
<input type="number" name="place_c" placeholder="<?php echo $lang['place']."..." ?>" min=1>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo $lang['mention'].": " ?></td>
|
|
<td><textarea name="mention" cols="50" rows="5" placeholder="<?php echo $lang['mention']."..." ?>"></textarea></td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<br>
|
|
<button type="submit" form="dd_edit_form"><?php echo $lang['ok'] ?></button>
|
|
<button type="button" onclick="registerCancelEdit()"><?php echo $lang['cancel'] ?></button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<!-- submit new -->
|
|
<div class="dropdown selfcenter" style="width: 95%; display: none" id="dd_newSubmit">
|
|
<div class="dropdown header">
|
|
<span><?php echo $lang['newSubmit'] ?></span>
|
|
</div>
|
|
<div class="dropdown content" style="display: block">
|
|
<p><?php echo $lang['do_before_new_record'] ?></p>
|
|
<p><?php echo $lang['prev_found'].":" ?></p>
|
|
<table id="newSubmitPrevContent" style="text-align: left">
|
|
<thead>
|
|
<th><?php echo $lang['id'] ?></th>
|
|
<th data-breakpoints="xs sm md"><?php echo $lang['phase_1'] ?></th>
|
|
<th data-breakpoints="xs sm md"><?php echo $lang['phase_2'] ?></th>
|
|
<th data-breakpoints="xs sm md"><?php echo $lang['teacher'] ?></th>
|
|
<th data-breakpoints="xs sm md"><?php echo $lang['place'] ?></th>
|
|
<th data-breakpoints="xs sm md"><?php echo $lang['mention'] ?></th>
|
|
<th><?php echo $lang['tools'] ?></th>
|
|
</thead>
|
|
<tbody>
|
|
<!-- previous records -->
|
|
</tbody>
|
|
</table>
|
|
<hr>
|
|
<form method="POST" class="ajaxform" id="dd_newSubmit_form" onsubmit="registerNewSubmit()">
|
|
<input type="hidden" name="newSubmit">
|
|
<button type="submit"><?php echo $lang['finalize'] ?></button>
|
|
<button type="button" onclick="registerNewCancel()"><?php echo $lang['cancel'] ?></button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<hr class="placeholder">
|
|
<!-- list -->
|
|
<div id="listHolder">
|
|
<select id="schoolyear" onchange="registerLoadList()">
|
|
<?php
|
|
$sql=$db->prepare("SELECT DISTINCT schoolyear FROM register WHERE schoolyear<>:current ORDER BY schoolyear ASC");
|
|
$sql->execute(array(":current"=>$schoolyear));
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "<option value=\"".$row['schoolyear']."\">".$row['schoolyear']."</option>";
|
|
}
|
|
echo "<option value=\"".$schoolyear."\" selected>".$schoolyear."</option>";
|
|
?>
|
|
</select>
|
|
<div id="list" class="selfcenter">
|
|
<!-- list goes here -->
|
|
</div>
|
|
</div>
|
|
</div>
|