163 lines
5.2 KiB
PHP
163 lines
5.2 KiB
PHP
<?
|
||
//$DB_LMS = new DB('pox','pox','qH5cO0vQ6aoQ5z','localhost');
|
||
include 'inc/_db.php';
|
||
include 'inc/functions.php';
|
||
include 'config.php';
|
||
|
||
if (isset($_GET['print_users'])){
|
||
$str = '<table class="table table-bordered">';
|
||
|
||
$str .= '<tr>
|
||
<th>ФИО</th>
|
||
<th>Курс</th>
|
||
<th>Электронная почта</th>
|
||
</tr>';
|
||
|
||
$grupps = $DB->QUR_SEL('SELECT gr.*, gr.id as id_gr, fac.* FROM acs_grupp as gr, acs_faculties as fac WHERE gr.sokr NOT LIKE "%выпуск%" AND gr.id_facult = fac.id ');
|
||
if ($grupps) foreach ($grupps as $key => $val) if ($key){
|
||
$str .= '<tr>
|
||
<th colspan="3">'.$val['sokr'].' '.$val['fo'].' ('.$val['name'].')</th>
|
||
</tr>';
|
||
|
||
$students = $DB->QUR_SEL('SELECT * FROM acs_students WHERE id_grupp = "'.$val['id_gr'].'"');
|
||
|
||
if ($students) foreach ($students as $key2 => $val2) if ($key2){
|
||
|
||
$result = preg_replace("/[^,.0-9]/", '', $val['sokr']);
|
||
//echo $result;
|
||
|
||
|
||
|
||
$user = get_user($val2['id_user']);
|
||
$str .= '<tr>
|
||
<td>'.$user["fio"].'</td>
|
||
<td>'.$result[0].'</td>
|
||
<td>'.$user["email"].'</td>
|
||
</tr>';
|
||
}
|
||
}
|
||
|
||
$str .= '<tr>
|
||
<th colspan="3">ПРЕПОДАВАТЕЛИ</th>
|
||
</tr>';
|
||
|
||
$kafs = $DB->QUR_SEL('SELECT * FROM acs_teachers GROUP BY kafedra');
|
||
|
||
if ($kafs) foreach($kafs as $key => $val) if ($key){
|
||
$str .= '<tr>
|
||
<th colspan="3">'.$val['kafedra'].'</th>
|
||
</tr>';
|
||
|
||
$teachers = $DB->QUR_SEL('SELECT * FROM acs_teachers WHERE kafedra = "'.$val['kafedra'].'" AND NOT dolgnost LIKE "%студент%"');
|
||
if ($teachers){
|
||
foreach ($teachers as $key2 => $val2) if ($key2){
|
||
$user = get_user($val2['id_user']);
|
||
|
||
$str .= '<tr>
|
||
<td>'.$user["fio"].'</td>
|
||
<td>'.$val2["dolgnost"].'</td>
|
||
<td>'.$user["email"].'</td>
|
||
</tr>';
|
||
}
|
||
}
|
||
}
|
||
|
||
$str .= '</table>';
|
||
|
||
echo $str;
|
||
}
|
||
|
||
if (isset($_GET['sem'])){
|
||
$sem = $_GET['sem'];
|
||
|
||
//echo 'SELECT * FROM acs_liquidation WHERE semestr = "'.$sem.'" LIMIT 50';
|
||
|
||
$rez = $DB->QUR_SEL('SELECT * FROM acs_liquidation WHERE semestr = "'.$sem.'" ');
|
||
|
||
|
||
$str = '<table class="table table-bordered">';
|
||
$str .= '
|
||
<tr>
|
||
<th>ФИО</th>
|
||
<th>Зачетка</th>
|
||
<th>Дисциплина</th>
|
||
<th>Оценка</th>
|
||
<th>Дата сдачи</th>
|
||
<th>Преподаватель</th>
|
||
</tr>';
|
||
|
||
if ($rez) foreach ($rez as $key => $val) if ($key){
|
||
$student = get_new_student($val['id_student']);
|
||
$prepod = get_user($val['id_teacher']);
|
||
|
||
if ($student['fio'] == '') continue;
|
||
|
||
$str .= '
|
||
<tr>
|
||
<td>'.$student['fio'].'</td>
|
||
<td>'.$student['num_zach'].'</td>
|
||
<td>'.$val["name"].'</td>
|
||
<td>'.$val['mark'].'</td>
|
||
<td>'.date("d.m.Y", $val["date_end"]).'</td>
|
||
<td>'.$prepod['fio'].'</td>
|
||
</tr>';
|
||
}
|
||
$str .= '</table>';
|
||
|
||
echo $str;
|
||
}
|
||
|
||
if (isset($_GET['lms'])){
|
||
|
||
|
||
//$DB_LMS->QUR("INSERT INTO `pox`.`mdl_user` (`id`, `auth`, `confirmed`, `policyagreed`, `deleted`, `suspended`, `mnethostid`, `username`, `password`, `idnumber`, `firstname`, `lastname`, `email`, `emailstop`, `icq`, `skype`, `yahoo`, `aim`, `msn`, `phone1`, `phone2`, `institution`, `department`, `address`, `city`, `country`, `lang`, `calendartype`, `theme`, `timezone`, `firstaccess`, `lastaccess`, `lastlogin`, `currentlogin`, `lastip`, `secret`, `picture`, `url`, `description`, `descriptionformat`, `mailformat`, `maildigest`, `maildisplay`, `autosubscribe`, `trackforums`, `timecreated`, `timemodified`, `trustbitmask`, `imagealt`, `lastnamephonetic`, `firstnamephonetic`, `middlename`, `alternatename`, `moodlenetprofile`) VALUES (NULL, 'manual', '1', '0', '0', '0', '1', 'guest5', '$2y$10$1mmzNCrLfCEbIKvl1.VEjOeLxbCwWYlkxbEgO/Yw0cURETKX9a6Bq', '', 'Гость', ' ', 'root@localhost', '0', '', '', '', '', '', '', '', '', '', '', '', '', 'ru', 'gregorian', '', '99', '0', '0', '0', '0', '', '', '0', '', 'Этот - специальный пользователь, которому разрешен доступ только на чтение к некоторым курсам.', '1', '1', '0', '2', '1', '0', '0', '1649070128', '0', NULL, NULL, NULL, NULL, NULL, NULL);");
|
||
|
||
//DB_LMS
|
||
}
|
||
|
||
if (isset($_GET['email_support'])){
|
||
/*$mailbox = '{imap.yandex.ru:993/imap/ssl}INBOX';
|
||
if (!$inbox = imap_open($mailbox, '', '1!')) {
|
||
throw new Exception(imap_last_error());
|
||
}*/
|
||
|
||
$imap = imap_open("{imap.yandex.ru:993/imap/ssl}INBOX", "eios@mkgtu.ru", "Mkgtu08082022!");
|
||
$mails_id = imap_search($imap, 'ALL');
|
||
|
||
foreach ($mails_id as $num) {
|
||
// Заголовок письма
|
||
$header = imap_header($imap, $num);
|
||
var_dump($header);
|
||
|
||
// Тело письма
|
||
$body = imap_body($imap, $num);
|
||
var_dump($body);
|
||
}
|
||
|
||
$header = imap_header($imap, $num);
|
||
$header = json_decode(json_encode($header), true);
|
||
print_r($header);
|
||
|
||
imap_close($imap);
|
||
|
||
|
||
}
|
||
|
||
//без военника
|
||
if (isset($_GET['bez_voennika'])){
|
||
|
||
$rez = $DB->QUR_SEL('SELECT * FROM acs_users WHERE status = "1" ');
|
||
|
||
if ($rez){
|
||
foreach ($rez as $key => $val) if ($key){
|
||
echo $val['fio'].' - '.date('d.m.Y', $val['data_u']).'<br />';
|
||
}
|
||
}
|
||
}
|
||
|
||
//для рассылки
|
||
if (isset($_GET['rassilka'])){
|
||
for ($i = 1; $i < 32538; $i++){
|
||
echo htmlspecialchars("INSERT INTO `acs_pm` (`id`, `data_c`, `from_user`, `to_user`, `message`, `from_status`, `to_status`, `file`) VALUES (NULL, '1685528369', '7632', '".$i."', '<b>Уважаемые студенты и сотрудники!__</b>', '2', '1', ''); ");
|
||
}
|
||
} |