150 lines
4.9 KiB
PHP
Executable File
150 lines
4.9 KiB
PHP
Executable File
<?php
|
||
include_once '../classes/TestProjektSmarty.class_subdir.php';
|
||
require_once("../config.inc.php");
|
||
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
||
$smarty = new SmartyAdmin();
|
||
require_once "../language/german.inc.php";
|
||
if (isset($_GET['action'])) {
|
||
$action = $_GET['action'];
|
||
} else {
|
||
$action = '';
|
||
}
|
||
|
||
|
||
if ($action == '') {
|
||
if($_SESSION["prx_dst_id"] == ''){
|
||
echo"<script type='text/javascript'>window.top.location.href = \"index.php\";</script>";
|
||
}
|
||
$dst_id = $_SESSION["prx_dst_id"];
|
||
|
||
# aktuelle Bewerbungen
|
||
$query1 = "SELECT a.ka_id, wu_id, vorname, nachname, date_format(a.datum, '%d.%m.%Y') datum_form
|
||
FROM bpm_dst_wunsch a, bpm_kandidat b
|
||
WHERE a.ka_id = b.ka_id
|
||
AND a.dst_id = '$dst_id'
|
||
AND archiv_dat != '0000-00-00 00:00:00'
|
||
ORDER BY a.datum desc";
|
||
|
||
$result1 = $db->query($query1) or die("Cannot execute query1");
|
||
|
||
|
||
while ($row1 = $result1->fetch_array()) {
|
||
|
||
$result_erg = $db->query("SELECT summe
|
||
FROM bpm_ergebnisse
|
||
WHERE ka_id= '$row1[ka_id]'
|
||
AND bestanden = '1'
|
||
ORDER BY eg_id desc
|
||
LIMIT 1");
|
||
$row_erg = $result_erg->fetch_array();
|
||
|
||
$result_file = $db->query("SELECT count(*) Anz
|
||
FROM bpm_upload
|
||
WHERE ka_id= '$row1[ka_id]'
|
||
AND upload_dat != '0000-00-00 00:00:00'
|
||
");
|
||
$row_file = $result_file->fetch_array();
|
||
|
||
if(!isset($zaehler) or $zaehler == 1){
|
||
$zaehler = 0;
|
||
}else{
|
||
$zaehler = 1;
|
||
}
|
||
|
||
if($row_file['Anz'] == 0){
|
||
$showfiles = 0;
|
||
}else{
|
||
$showfiles = 1;
|
||
}
|
||
|
||
$row1['showfiles'] = $showfiles;
|
||
$row1['zaehler'] = $zaehler;
|
||
$row1['testergebnis'] = $row_erg['summe'];
|
||
$table_data1[] = $row1;
|
||
}
|
||
|
||
$smarty->assign('table_data1', $table_data1);
|
||
}
|
||
if ($action == 'show') {
|
||
$dst_id = $_SESSION["prx_dst_id"];
|
||
$ka_id = $_GET['ka_id'];
|
||
|
||
# Pr<50>fen, ob DST anzeigeberechtigt ist
|
||
$result_anz = $db->query("SELECT count(*) Anz
|
||
FROM bpm_dst_wunsch
|
||
WHERE ka_id= $ka_id
|
||
AND dst_id =$dst_id");
|
||
$row_anz = $result_anz->fetch_array();
|
||
|
||
if($row_anz['Anz'] == 0){
|
||
exit;
|
||
}
|
||
|
||
# Pers<72>nliche Angaben
|
||
|
||
$result = $db->query("SELECT id, anrede, vorname, nachname, str, plz, ort
|
||
FROM bpm_kandidat
|
||
WHERE ka_id = '$ka_id'
|
||
LIMIT 1");
|
||
$row = @$result->fetch_array();
|
||
$id = $row['id'];
|
||
if($row['anrede'] == 'M'){
|
||
$anrede = 'Herr';
|
||
}else{
|
||
$anrede = 'Frau';
|
||
}
|
||
$smarty->assign('dok_anrede', $anrede);
|
||
$smarty->assign('dok_vorname', $row['vorname']);
|
||
$smarty->assign('dok_nachname', $row['nachname']);
|
||
$smarty->assign('dok_str', $row['str']);
|
||
$smarty->assign('dok_plz', $row['plz']);
|
||
$smarty->assign('dok_ort', $row['ort']);
|
||
|
||
# Dateien
|
||
$query1 = "SELECT file, beschreibung, date_format(upload_dat, '%d.%m.%Y - %H:%i') datum_form
|
||
FROM bpm_upload
|
||
WHERE ka_id = '$ka_id'
|
||
ORDER BY upload_dat desc";
|
||
|
||
$result1 = $db->query($query1) or die("Cannot execute query1");
|
||
|
||
while ($row1 = $result1->fetch_array()) {
|
||
if (file_exists($row1['file'])) {
|
||
$exists = 1;
|
||
} else {
|
||
$exists = 0;
|
||
}
|
||
$basename = basename($row1['file']);
|
||
$rep = $id . "_";
|
||
$row1['exists'] = $exists;
|
||
$row1['basename'] = str_replace($rep, '', $basename);
|
||
$row1['basename_link'] = urlencode($row1['file']);
|
||
$table_data1[] = $row1;
|
||
}
|
||
$smarty->assign('table_data1', $table_data1);
|
||
}
|
||
|
||
if ($action == 'archive') {
|
||
$dst_id = $_SESSION["prx_dst_id"];
|
||
$wu_id = $_GET['wu_id'];
|
||
|
||
# Pr<50>fen, ob DST anzeigeberechtigt ist
|
||
|
||
$result_anz = $db->query("SELECT count(*) Anz
|
||
FROM bpm_dst_wunsch
|
||
WHERE wu_id= $wu_id
|
||
AND dst_id =$dst_id");
|
||
$row_anz = $result_anz->fetch_array();
|
||
|
||
if($row_anz['Anz'] == 0){
|
||
exit;
|
||
}
|
||
|
||
$sql1 = $db->query( "UPDATE bpm_dst_wunsch
|
||
SET archiv_dat = '0000-00-00 00:00:00'
|
||
WHERE wu_id = $wu_id
|
||
" );
|
||
echo "<meta http-equiv=\"refresh\" content=\"0; URL=" . $_SERVER['PHP_SELF'] . "?\">";
|
||
|
||
|
||
}
|
||
$smarty->assign('action', "$action");
|
||
$smarty->display("$template/praxisstelle/$templatename");
|
||
?>
|