//$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 = '
';
$str .= '
ФИО |
Курс |
Электронная почта |
';
$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 .= '
'.$val['sokr'].' '.$val['fo'].' ('.$val['name'].') |
';
$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 .= '
'.$user["fio"].' |
'.$result[0].' |
'.$user["email"].' |
';
}
}
$str .= '
ПРЕПОДАВАТЕЛИ |
';
$kafs = $DB->QUR_SEL('SELECT * FROM acs_teachers GROUP BY kafedra');
if ($kafs) foreach($kafs as $key => $val) if ($key){
$str .= '
'.$val['kafedra'].' |
';
$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 .= '
'.$user["fio"].' |
'.$val2["dolgnost"].' |
'.$user["email"].' |
';
}
}
}
$str .= '
';
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 = '';
$str .= '
ФИО |
Зачетка |
Дисциплина |
Оценка |
Дата сдачи |
Преподаватель |
';
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 .= '
'.$student['fio'].' |
'.$student['num_zach'].' |
'.$val["name"].' |
'.$val['mark'].' |
'.date("d.m.Y", $val["date_end"]).' |
'.$prepod['fio'].' |
';
}
$str .= '
';
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']).'
';
}
}
}
//для рассылки
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."', 'Уважаемые студенты и сотрудники!__', '2', '1', ''); ");
}
}