public static function delete($request, $response, $args, $app) { // todo echo '{}'; return; $db = open_db_pdo(); $sql = "SELECT * FROM participant WHERE meeting_id=:meeting_id AND id=:id;"; $stmt = $db->prepare($sql); $stmt->bindParam(":id", $args['id'], PDO::PARAM_INT); $stmt->bindParam(":meeting_id", $app->meetingId, PDO::PARAM_INT); $stmt->execute(); if ($stmt->rowCount() > 0) { echo 'Löschen nicht möglich!'; } else { $sql = "DELETE FROM participant WHERE MEETING_ID=:meeting_id AND STNO=:stno;"; $stmt = $db->prepare($sql); $stmt->bindParam(":stno", $_GET['stno'], PDO::PARAM_INT); $stmt->bindParam(":meeting_id", $_SESSION['meeting_id'], PDO::PARAM_INT); $stmt->execute(); $sql = "DELETE FROM competition_participant WHERE MEETING_ID=:meeting_id AND STNO=:stno;"; // Ersetzen durch Constraints in Datenbank!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! $stmt = $db->prepare($sql); $stmt->bindParam(":stno", $_GET['stno'], PDO::PARAM_INT); $stmt->bindParam(":meeting_id", $app->meetingId, PDO::PARAM_INT); $stmt->execute(); } return $response; }
<a class="btn btn-default" href="inc/certificate_generation.php?test&meeting_nr=<?php echo $_SESSION['meeting_id']; ?> " target="_blank"> Testurkunde drucken </a> </div> </div> </div> </div> <div class="col-md-7 col-lg-7 col-sm-12 col-xs-12"> <div class="panel panel-default"> <div class="panel-body"> <select class="form-control inline" style="width:130px" id="layout" onchange="load_layout(this.value);"> <?php $db = open_db_pdo(); $sql = "SELECT LAYOUT_NR FROM CERTIFICATE_LAYOUT WHERE MEETING_ID=:meeting_id ORDER BY LAYOUT_NR;"; $pdo = $db->prepare($sql); $pdo->bindParam(":meeting_id", $_SESSION['meeting_id'], PDO::PARAM_INT); $pdo->execute(); while ($ds = $pdo->fetch(PDO::FETCH_ASSOC)) { echo '<option value="' . $ds['LAYOUT_NR'] . '">Layout ' . $ds['LAYOUT_NR'] . '</option>'; } ?> </select> <button class="btn btn-success" onclick="new_layout();">Neues Layout</button> <button class="btn btn-danger" onclick="delete_layout();">Layout löschen</button> <div class="margin-top-xs"></div> <div class="panel-group" id="accordion"> <?php $fields = array(array('Überschrift', 'MEETING_HEADLINE', 1), array('Unterüberschrift', 'MEETING_SUBHEADLINE', 1), array('Ort', 'PLACE', 0), array('Datum', 'DATE', 0), array('Athlet', 'ATHLETE_NAME', 0), array('Verein', 'CLUB', 0), array('Platz', 'POSITION', 0), array('Wettbewerbsname', 'COMPETITION', 0), array('Altersklasse', 'AGE_CLASS', 0), array('Leistung', 'RESULT', 0));