Workgroup seminar
function berechne_semester($datumbezug,$dbg)
{
$helper = explode(".",$datumbezug);
$bezug_jahr = $helper[2];
$bezug_monat = $helper[1];
//Neu:
if($bezug_monat>=1 && $bezug_monat<=3) $bezug_jahr--;
$bezug_jahr_pluseins = $bezug_jahr+1;
$bezug_tag = $helper[0];
if ($dbg=='1') echo 'From berechne_semester J:',$bezug_jahr,'-','M:', $bezug_monat,'-','T:', $bezug_tag;
$semester='';
if($bezug_monat>=4 && $bezug_monat<=9) $semester='SS'.$bezug_jahr;
elseif($bezug_monat>=1 && $bezug_monat<=3) $semester='WS'.$bezug_jahr.'/'.substr($bezug_jahr_pluseins, -2);
elseif($bezug_monat>=10 && $bezug_monat<=12) $semester='WS'.$bezug_jahr.'/'.substr($bezug_jahr_pluseins, -2);
else $semester='NotAvail';
if ($dbg=='1') echo ' -> ',$semester,'';
return $semester;
}
function network_approved($dbg)
{
$retval=0;
$client_ip=$_SERVER['REMOTE_ADDR'];
$client_useraddr = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$client_ip_arr = explode('.',$client_ip);
if($client_ip_arr[0]=='134' && $client_ip_arr[1]=='91')
{
// Bereich 134.91.163
if($client_ip_arr[2]=='163')
$retval=1;
}
//elseif($client_ip_arr[0]=='132' && $client_ip_arr[1]=='252')
// {
// Bereich 132.252. VPN Bereiche (Info T. Berger, 2021-05-07)
// $retval=1;
// }
if($dbg == '1')
{
echo ' Debug messages from network_approved function: ';
echo '
'; echo ' IP-number: ',$client_ip,'
'; echo ' DNS name: ', $client_useraddr,'
'; echo ' Octets: ', $client_ip_arr[0],' ',$client_ip_arr[1],' ',$client_ip_arr[2],' ',$client_ip_arr[3],'
'; echo ' Retval: ', $retval,'
( Access '; if ($retval=='0') echo 'not '; echo 'allowed )'; } return $retval; } function checkdoi($doistring,$dbg) { $retval=0; // Rules for valid Digital Object Identifier (according ISO 26324) // 0) Logical length > 10 // 1) Starting with "10." // 2) "/" is at position 8 // 3) Value in from string pos 4 bis 7 is >=1000 if (strlen($doistring)>10) if(strncmp($doistring,'10.',3)==0) if(substr_compare($doistring, '/',7,1)==0) if(intval(substr($doistring,3,4))>=1000) $retval=1; if($dbg==1) { echo 'strlen: ',strlen($doistring),' '; echo ' strncmp: ',strncmp($doistring,'10.',3),' '; echo ' substr_comp: ',substr_compare($doistring, '/',7,1),' '; echo ' intval: ',intval(substr($doistring,3,4)),' '; echo ' substr: ',substr($doistring,3,4),' '; echo ' returnvalue:', $retval; } return $retval; } function checklink($doistring,$dbg) { $retval=0; if($dbg==1) { echo ' returnvalue: ',$retval,' '; } return $retval; } function url_ok($urlstring,$dbg) { $retval=1; return $retval; } function display_agseminar_header() { header('Content-Type: text/html; charset=ISO-8859-1'); $mysqli = mysqli_connect("db13.zim.uni-duisburg-essen.de","hp0052","Mvxod0n7rzuB","hp0052_7"); $SelectString = 'SELECT * FROM agseminar_orga_enu'; $Ergebnis = mysqli_query($mysqli, $SelectString); if (!mysqli_connect_errno()) { $db_output = mysqli_fetch_assoc($Ergebnis); $heute=date('d.m.Y'); echo '';
echo '';
echo '
';
mysqli_close($mysqli);
}
else echo 'Arbeitsgruppen - Seminar Header: Database error!
';
}
//
if (network_approved(0)==1)
{
//echo '
'; if(!mysqli_connect_errno()) { $Ergebnis=mysqli_query($mysqli,$SelectString); echo '';
echo '
';
if ($entries>0)
printf("Anzahl Einträge: %d
",$entries); else printf("Noch keine Einträge vorhanden!
"); mysqli_close($mysqli); } else echo 'Arbeitsgruppen - Seminar: Datenbankfehler!
';
?>
'; echo ' IP-number: ',$client_ip,'
'; echo ' DNS name: ', $client_useraddr,'
'; echo ' Octets: ', $client_ip_arr[0],' ',$client_ip_arr[1],' ',$client_ip_arr[2],' ',$client_ip_arr[3],'
'; echo ' Retval: ', $retval,'
( Access '; if ($retval=='0') echo 'not '; echo 'allowed )'; } return $retval; } function checkdoi($doistring,$dbg) { $retval=0; // Rules for valid Digital Object Identifier (according ISO 26324) // 0) Logical length > 10 // 1) Starting with "10." // 2) "/" is at position 8 // 3) Value in from string pos 4 bis 7 is >=1000 if (strlen($doistring)>10) if(strncmp($doistring,'10.',3)==0) if(substr_compare($doistring, '/',7,1)==0) if(intval(substr($doistring,3,4))>=1000) $retval=1; if($dbg==1) { echo 'strlen: ',strlen($doistring),' '; echo ' strncmp: ',strncmp($doistring,'10.',3),' '; echo ' substr_comp: ',substr_compare($doistring, '/',7,1),' '; echo ' intval: ',intval(substr($doistring,3,4)),' '; echo ' substr: ',substr($doistring,3,4),' '; echo ' returnvalue:', $retval; } return $retval; } function checklink($doistring,$dbg) { $retval=0; if($dbg==1) { echo ' returnvalue: ',$retval,' '; } return $retval; } function url_ok($urlstring,$dbg) { $retval=1; return $retval; } function display_agseminar_header() { header('Content-Type: text/html; charset=ISO-8859-1'); $mysqli = mysqli_connect("db13.zim.uni-duisburg-essen.de","hp0052","Mvxod0n7rzuB","hp0052_7"); $SelectString = 'SELECT * FROM agseminar_orga_enu'; $Ergebnis = mysqli_query($mysqli, $SelectString); if (!mysqli_connect_errno()) { $db_output = mysqli_fetch_assoc($Ergebnis); $heute=date('d.m.Y'); echo '
',$db_output["seminar_header"],''; echo ' "',$db_output["seminar_name"],'" | ||
| Date: ',$db_output["seminar_dayname"],', ',$db_output["seminar_timerange"],' '; echo 'Contact person: ',$db_output["contact1"],', ',$db_output["contact2"],' | ||
| For requests regarding the talks please ask the corresponding author. | ||
| AG seminar '; echo berechne_semester($heute,0); echo ' (current date: ',$heute,' )'; echo ' |
Arbeitsgruppen - Seminar Header: Database error!
Please try again!
';
}
//
if (network_approved(0)==1)
{
//echo 'Hier geht es zum Archiv
'; } display_agseminar_header(); //agseminar_dbversion.php (extended view) // 0 : keine Sperre, 1 : wird nicht öffentlich gezeigt, 2 : keine DOI & Links header('Content-Type: text/html; charset=ISO-8859-1'); $entries=0; $jahr="0"; $semesterid="0"; $heute=date('d.m.Y'); $semesterid = berechne_semester($heute,0); //if (isset($_GET["jahr"])) $jahr = $_GET["jahr"]; //if (isset($_GET["semesterid"])) $semesterid = $_GET["semesterid"]; $orwhitelist=array('dateup','datedown'); if (isset($_GET["order"]) && in_array($_GET["order"],$orwhitelist)) { if($_GET["order"]=='dateup') $sqloutputorder='ORDER BY datum ASC'; if($_GET["order"]=='datedown') $sqloutputorder='ORDER BY datum DESC'; } else $sqloutputorder = 'ORDER BY datum ASC'; //Datenbank Verbindung herstellen $mysqli = mysqli_connect("db13.zim.uni-duisburg-essen.de","hp0052","Mvxod0n7rzuB","hp0052_7"); $SelectString = 'SELECT * FROM agseminar WHERE semester = "'.$semesterid.'" '.$sqloutputorder; //echo '$SelectString: ',$SelectString,''; //echo 'Nur für ',$semesterid,'
'; //echo 'Zurück zur Gesamtliste'; if(!mysqli_connect_errno()) { $Ergebnis=mysqli_query($mysqli,$SelectString); echo '
| '; echo 'Date '; echo '↑'; echo ' ↓'; echo ' | Speaker | '; if (network_approved(0)==1) { echo 'Title | '; //echo 'Additional information | DOI | '; } elseif (network_approved(0)==2) { // Links sollen öffentlich nicht angezeigt werden (gem. Farle, 2021-04-28) echo 'Title | '; //echo 'Additional information | DOI | '; echo 'Link | '; } echo '
|---|---|---|---|---|---|---|---|---|
| ',$db_output["datum"],'';
echo ' '; // if($db_output["semester"] != "NotAvailab") // echo '',$db_output["semester"],''; // else // echo $db_output["semester"]; // echo ' Ed ',date('Y', strtotime($db_output["datum"])),''; echo ' | ';
echo '',$db_output["sprecher"],' | '; echo '',$db_output["titel"],' | '; echo ''; if ($db_output["locked"]==0) { if(strlen($db_output["text"])) echo $db_output["text"]; else;// echo '-'; } else echo '-'; echo ' | '; echo ''; if ($db_output["locked"]==0) { if (network_approved(0)==1 && checkdoi($db_output["dois"],0)==1) { echo 'DOI'; } else { //if(strlen($db_output["dois"])) echo $db_output["dois"]; else echo '-'; } } else echo '-'; echo ' | '; } echo '
",$entries); else printf("Noch keine Einträge vorhanden!
"); mysqli_close($mysqli); } else echo '