105 lines
3.0 KiB
PHP
105 lines
3.0 KiB
PHP
![]() |
<?php
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* NIJZ - čiščenje baze (uporabnikov in anket, ki niso njihovi)
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
|
||
|
die();
|
||
|
|
||
|
/*ini_set('display_errors', '1');
|
||
|
ini_set('display_startup_errors', '1');
|
||
|
error_reporting(E_ALL);*/
|
||
|
|
||
|
include_once('../../function.php');
|
||
|
include_once('../../vendor/autoload.php');
|
||
|
|
||
|
|
||
|
|
||
|
// Dobimo seznam vseh uporabnikov, ki imajo tudi uredniski dostop na anketah, kjer imajo dostop spodnji uporabniki
|
||
|
/*
|
||
|
@nijz.si
|
||
|
@nijz.co
|
||
|
@nijz-rs.si
|
||
|
@raziskavatrga.si
|
||
|
@raziskavetrga.si
|
||
|
*/
|
||
|
|
||
|
|
||
|
|
||
|
// Loop po anketah, kjer je avtor z zgornjim mailom
|
||
|
$sql = sisplet_query("SELECT a.id AS ank_id, a.naslov, u.id AS usr_id, u.email
|
||
|
FROM srv_anketa a, users u
|
||
|
WHERE a.insert_uid=u.id
|
||
|
AND (LOWER(u.email) LIKE '%@nijz.si%'
|
||
|
OR LOWER(u.email) LIKE '%@nijz.co%'
|
||
|
OR LOWER(u.email) LIKE '%@nijz-rs.si%'
|
||
|
OR LOWER(u.email) LIKE '%@raziskavatrga.si%'
|
||
|
OR LOWER(u.email) LIKE '%@raziskavetrga.si%'
|
||
|
)
|
||
|
");
|
||
|
|
||
|
while($row = mysqli_fetch_array($sql)){
|
||
|
|
||
|
// Pogledamo, ce ima dostop do ankete tudi kdo drug
|
||
|
$sqlD = sisplet_query("SELECT u.email
|
||
|
FROM srv_dostop d, users u
|
||
|
WHERE d.ank_id='".$row['ank_id']."' AND d.uid=u.id
|
||
|
");
|
||
|
|
||
|
if(mysqli_num_rows($sqlD) > 0){
|
||
|
|
||
|
echo '1 - ANKETA '.$row['ank_id'].' - '.$row['naslov'];
|
||
|
echo '<br>';
|
||
|
|
||
|
while($rowD = mysqli_fetch_array($sqlD)){
|
||
|
echo $rowD['email'];
|
||
|
echo '<br>';
|
||
|
}
|
||
|
|
||
|
echo '<br>';
|
||
|
echo '<br>';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
// Loop po anketah, kjer ima uporabnik z zgornjim mailom dodeljen dostop
|
||
|
$sql = sisplet_query("SELECT d.ank_id, d.uid id AS usr_id, u.email
|
||
|
FROM srv_dostop d, users u
|
||
|
WHERE d.uid=u.id
|
||
|
AND (LOWER(u.email) LIKE '%@nijz.si%'
|
||
|
OR LOWER(u.email) LIKE '%@nijz.co%'
|
||
|
OR LOWER(u.email) LIKE '%@nijz-rs.si%'
|
||
|
OR LOWER(u.email) LIKE '%@raziskavatrga.si%'
|
||
|
OR LOWER(u.email) LIKE '%@raziskavetrga.si%'
|
||
|
)
|
||
|
");
|
||
|
|
||
|
while($row = mysqli_fetch_array($sql)){
|
||
|
|
||
|
// Pogledamo, ce je avtor ankete kdo drug
|
||
|
$sqlA = sisplet_query("SELECT u.email
|
||
|
FROM srv_anketa a, users u
|
||
|
WHERE a.id='".$row['ank_id']."' AND a.insert_uid=u.id
|
||
|
");
|
||
|
|
||
|
if(mysqli_num_rows($sqlA) > 0){
|
||
|
|
||
|
echo '2 - ANKETA '.$row['ank_id'];
|
||
|
echo '<br>';
|
||
|
|
||
|
while($rowA = mysqli_fetch_array($sqlA)){
|
||
|
echo $rowA['email'];
|
||
|
echo '<br>';
|
||
|
}
|
||
|
|
||
|
echo '<br>';
|
||
|
echo '<br>';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
?>
|