178 lines
5.8 KiB
PHP
178 lines
5.8 KiB
PHP
|
<?php
|
|||
|
try {
|
|||
|
$conn = new PDO("mysql:dbname=d02a1996;host=dd29132.kasserver.com", 'd02a1996', 'VaR3DFKpSThyBB7m');
|
|||
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|||
|
} catch(PDOException $e) {
|
|||
|
echo "Webseite wird momentan überarbeitet";
|
|||
|
}
|
|||
|
|
|||
|
function fetch_text($id) {
|
|||
|
global $conn;
|
|||
|
$stmt = $conn->prepare('select text from text where id = :id LIMIT 1;');
|
|||
|
$stmt->bindParam(':id', $id);
|
|||
|
$stmt->execute();
|
|||
|
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
|||
|
return $result['text'];
|
|||
|
}
|
|||
|
|
|||
|
function timeformat($time) {
|
|||
|
$t = strtotime($time);
|
|||
|
if(date('i', $t) != 0) {
|
|||
|
return strftime("%d.%m (%H.%M h)", $t);
|
|||
|
}
|
|||
|
return strftime("%d.%m (%H h)", $t);
|
|||
|
}
|
|||
|
|
|||
|
$stmt = $conn->prepare('select DISTINCT LPAD( month(time), 2, \'0\') as `nr` from events_onwebsite');
|
|||
|
$stmt->execute();
|
|||
|
|
|||
|
$first = true;
|
|||
|
$timetitle = '';
|
|||
|
$sitetitle = '';
|
|||
|
|
|||
|
foreach($stmt->fetchAll() as $month) {
|
|||
|
if(!$first){
|
|||
|
$timetitle .= '/';
|
|||
|
$sitetitle .= '/';
|
|||
|
}
|
|||
|
$timetitle .= '<span>'.$month['nr'].'</span>';
|
|||
|
$sitetitle .= $month['nr'];
|
|||
|
$first = false;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
?>
|
|||
|
<!DOCTYPE html>
|
|||
|
<html lang="en">
|
|||
|
<head>
|
|||
|
|
|||
|
<!-- Basic Page Needs
|
|||
|
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
|
|||
|
<meta name="google-site-verification" content="<?=fetch_text('google-site-verification');?>" />
|
|||
|
|
|||
|
<meta charset="utf-8">
|
|||
|
<title>Kartontage: <?=$sitetitle;?></title>
|
|||
|
<meta name="description" content="<?=fetch_text('meta_description');?>">
|
|||
|
<meta name="format-detection" content="telephone=no">
|
|||
|
<meta name="author" content="">
|
|||
|
|
|||
|
<!-- Mobile Specific Metas
|
|||
|
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|||
|
|
|||
|
<!-- FONT
|
|||
|
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
|
|||
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
|
|||
|
|
|||
|
<!-- CSS
|
|||
|
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
|
|||
|
<link rel="stylesheet" href="./static/css/normalize.css">
|
|||
|
<link rel="stylesheet" href="./static/css/skeleton.css">
|
|||
|
<link rel="stylesheet" href="./static/css/custom.css">
|
|||
|
|
|||
|
<!-- Scripts
|
|||
|
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
|
|||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
|||
|
<script type="text/javascript" src="./static/app.js"></script>
|
|||
|
|
|||
|
<!-- Favicon
|
|||
|
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
|
|||
|
<link rel="icon" type="image/png" href="./static/img/favicon.png">
|
|||
|
|
|||
|
</head>
|
|||
|
<body>
|
|||
|
|
|||
|
<!-- Primary Page Layout
|
|||
|
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
|
|||
|
|
|||
|
<div class="section">
|
|||
|
<div class="container header">
|
|||
|
<div class="row">
|
|||
|
<?php
|
|||
|
$stmt = $conn->prepare('select * from places');
|
|||
|
$stmt->execute();
|
|||
|
|
|||
|
$first = true;
|
|||
|
foreach($stmt->fetchAll() as $place) {
|
|||
|
?>
|
|||
|
<?php if(!$first){ ?>
|
|||
|
<div class="c-space"><a href="?"><img class="spacer" src="./static/img/spacer.png"/></a></div>
|
|||
|
<?php } $first = false;?>
|
|||
|
<div class="c"><a href="?places_id=<?=$place['id']?>"><img id="<?=$place['id']?>" src="./static/img/<?=$place['id']?>.png"/></a></div>
|
|||
|
<?php } ?>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="section">
|
|||
|
<div class="container">
|
|||
|
<div class="row">
|
|||
|
<?php
|
|||
|
$stmt = $conn->prepare('select * from places');
|
|||
|
if(isset($_GET["places_id"])){
|
|||
|
$stmt = $conn->prepare('select * from places where id = :id');
|
|||
|
$stmt->bindParam(':id', $_GET["places_id"]);
|
|||
|
}
|
|||
|
$stmt->execute();
|
|||
|
// set the resulting array to associative
|
|||
|
foreach($stmt->fetchAll() as $place) {
|
|||
|
?>
|
|||
|
<div class="one-half column<?php if(isset($_GET["places_id"])){echo " one";} if($place["id"] % 2){ echo " odd"; }else{ echo " even"; } ?>">
|
|||
|
<h3 class="title"><?=$timetitle;?></h3>
|
|||
|
<?php
|
|||
|
$stmt = $conn->prepare('select * from events_onwebsite where places_id = :id');
|
|||
|
$stmt->bindParam(':id', $place["id"]);
|
|||
|
$stmt->execute();
|
|||
|
foreach($stmt->fetchAll() as $event) {
|
|||
|
?>
|
|||
|
<div class="seperator">
|
|||
|
<div class="time"><?=timeformat($event['time']);?></div>
|
|||
|
<div class="head">
|
|||
|
<span>
|
|||
|
<?php if(strlen($event['url']) > 1 ) { ?>
|
|||
|
<a href="<?=$event['url'];?>"><?=$event['title'];?></a>
|
|||
|
<?php
|
|||
|
} else {
|
|||
|
echo $event['title'];
|
|||
|
}
|
|||
|
?>
|
|||
|
</span>
|
|||
|
<?php if(strlen($event['ticket']) > 1 ) { ?>
|
|||
|
<a href="<?=$event['ticket'];?>"><i class="fa fa-ticket" aria-hidden="true"></i></a>
|
|||
|
<?php } ?>
|
|||
|
</div>
|
|||
|
<div class="desc"><?=$event['description'];?></div>
|
|||
|
</div>
|
|||
|
<?php } ?>
|
|||
|
<div class="seperator">
|
|||
|
<?php if(strlen($place['time']) > 1 ) { ?>
|
|||
|
<div class="maintime"><?=$place['time'];?></div>
|
|||
|
<br/>
|
|||
|
<?php }
|
|||
|
if(strlen($place['url']) > 1 ) { ?>
|
|||
|
<a href="<?=$place['url'];?>" target="_blank">
|
|||
|
<i class="fa fa-facebook fa-2x"></i>
|
|||
|
</a>
|
|||
|
<?php } ?>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
<?php } ?>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="section">
|
|||
|
<div class="container footer">
|
|||
|
<div class="text">
|
|||
|
<?=fetch_text('impressum'); ?>
|
|||
|
</div>
|
|||
|
<div class="title">
|
|||
|
Impressum
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</body>
|
|||
|
</html>
|
|||
|
<?php
|
|||
|
$conn = null;
|
|||
|
?>
|