EIOS/iup_check_dubls.php

99 lines
3.6 KiB
PHP
Raw Permalink Normal View History

2023-12-28 15:39:22 +03:00
<?php
include 'inc/_db.php';
include 'config.php';
//acs_iup_shahtplans_stroki надо контролировать чтобы не было экзамена и зачета в одной строке
//SELECT * FROM `acs_iup_shahtplans_stroki` WHERE `discip` LIKE "%Лаборант по%" AND `ekz`!="" AND `zach`!=""
$sql = 'SELECT * FROM `acs_iup_shahtplans_stroki` WHERE `ekz`!="" AND `zach`!=""';
$rez = $DB->QUR_SEL($sql);
if($rez){
echo '<h2>Дисциплины у которых экзамен и зачет</h2>';
echo '<table>';
echo '<tr>';
echo '<td>№</td>';
echo '<td>id_plans</td>';
echo '<td>discip</td>';
echo '<td>discid</td>';
echo '<td>kurs/sem</td>';
echo '<td>lek</td>';
echo '<td>lab</td>';
echo '<td>pr</td>';
echo '<td>srs</td>';
echo '<td>chasekz</td>';
echo '<td>zet</td>';
echo '<td>ekz</td>';
echo '<td>zach</td>';
echo '<td>vidkontr</td>';
echo '<td>kontrab</td>';
echo '<td>kontr</td>';
echo '<td>sessiya</td>';
echo '<td>dispovyb</td>';
echo '<td>kpro</td>';
echo '<td>krab</td>';
echo '</tr>';
foreach($rez as $key => $val)if($key){
//id,id_plans,discip,discid,kurs,sem,lek,lab,pr,srs,chasekz,zet,ekz,zach,vidkontr,kontrab,kontr,sessiya,dispovyb,kpro,krab
echo '<tr>';
echo '<td>'.$val['id'].'</td>';
echo '<td>'.$val['id_plans'].'</td>';
echo '<td>'.$val['discip'].'</td>';
echo '<td>'.$val['discid'].'</td>';
$c=''; if($val['kurs'] == $val['sem']) $c='style="color:red;"';
echo '<td '.$c.'>'.$val['kurs'].'/'.$val['sem'].'</td>';
echo '<td>'.$val['lek'].'</td>';
echo '<td>'.$val['lab'].'</td>';
echo '<td>'.$val['pr'].'</td>';
echo '<td>'.$val['srs'].'</td>';
echo '<td>'.$val['chasekz'].'</td>';
echo '<td>'.$val['zet'].'</td>';
echo '<td>'.$val['ekz'].'</td>';
echo '<td>'.$val['zach'].'</td>';
echo '<td>'.$val['vidkontr'].'</td>';
echo '<td>'.$val['kontrab'].'</td>';
echo '<td>'.$val['kontr'].'</td>';
echo '<td>'.$val['sessiya'].'</td>';
echo '<td>'.$val['dispovyb'].'</td>';
echo '<td>'.$val['kpro'].'</td>';
echo '<td>'.$val['krab'].'</td>';
echo '</tr>';
}
echo '</table>';
}
exit();
/*В ИУПАХ сохраняются дубляжи((( надо их убирать!*/
//SELECT * FROM `acs_iup_ocenki` WHERE `id_studentzayavks`=4642 ORDER BY `acs_iup_ocenki`.`predmet` ASC
$sql = 'SELECT id,id_studentzayavks,id_predmet FROM `acs_iup_ocenki` LIMIT 0,1000';
$rez = $DB->QUR_SEL($sql);
if($rez){
echo '<table>';
echo '<tr>';
echo '<td>№</td>';
echo '<td>Предмет</td>';
echo '<td>семсетр</td>';
echo '<td>Оценка</td>';
echo '<td>Тип</td>';
echo '<td>Время</td>';
echo '<td>Пользователь</td>';
echo '<td>Заявка</td>';
echo '</tr>';
foreach($rez as $key => $val)if($key){
$sql1 = 'SELECT * FROM `acs_iup_ocenki` WHERE `id_studentzayavks`='.$val['id_studentzayavks'].' AND id_predmet='.$val['id_predmet'].' AND id!='.$val['id'];
$rez1 = $DB->QUR_SEL($sql1);
if($rez1){
foreach($rez1 as $key1 => $val1)if($key1){
echo '<tr>';
echo '<td>'.$val1['id_predmet'].'</td>';
echo '<td>'.$val1['predmet'].'</td>';
echo '<td>'.$val1['semestr'].'</td>';
echo '<td>'.$val1['ocenka'].'</td>';
echo '<td>'.$val1['tip'].'</td>';
echo '<td>'.date('H:i d.m.Y',$val1['data_time']).'</td>';
echo '<td>'.$val1['id_user'].'</td>';
echo '<td>'.$val1['id_studentzayavks'].'</td>';
echo '</tr>';
}
}
}
echo '</table>';
}