Beispiel #1
0
<?php

session_start();
include_once '../includes/connection.php';
include_once '../includes/Contest.php';
$contest = new Contest();
if (isset($_SESSION['name']) and $_SESSION['id'] == '10207674962976867') {
    if (isset($_GET['id_event'])) {
        $id_news = $_GET['id_event'];
        $query = $pdo->prepare('DELETE FROM Concursos WHERE id_event = ?');
        $query->bindValue(1, $id_event);
        $query->execute();
        echo "<script type=\"text/javascript\">\n           alert('Se ha borrado correctamente el concurso');\n           history.go(-2);\n       </script>";
        exit;
    }
    $contests = $contest->fetch_all();
    ?>

    <html>
    <head>
        <title>Eliminar Concurso - Version editable</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    </head>

    <body>
    <div class="container">
        <!--<a href="index.php" id="logo">CMS</a>-->

        <br/>

        <h4>Selecciona un concurso para borrar</h4>
Beispiel #2
0
<?php

session_start();
include_once '../../TOMO2-Web/includes/connection.php';
include_once '../../TOMO2-Web/includes/Answer.php';
include_once '../../TOMO2-Web/PDO/AnswerModel.php';
include_once '../../TOMO2-Web/includes/Contest.php';
include_once '../../TOMO2-Web/PDO/ContestModel.php';
//include_once ('../img_bbdd/upload.php');
$conc = new Contest();
if (isset($_SESSION['name']) and $_SESSION['id'] == '10207674962976867') {
    $id_answer = $_GET['id_answer'];
    $id_event = $_GET['id_event'];
    $concursos = $conc->fetch_all();
    $answer = new Answer();
    $answerModel = new AnswerModel();
    $image = array(null);
    $directory = "img_bbdd/helados.jpg";
    /*
        if (isset($_GET['name'], $_GET['description'], $_GET['upload_date'], $_GET['image'], $_GET['link'], $_GET['active'])){
            $name = $_GET['name'];
            $description = nl2br($_GET['description']);
            $upload_date = $_GET['upload_date'];
            $link = $_GET['image'];
            $image = $_GET['link'];
            $active = $_GET['active'];
    
            if (empty($name) or empty($description) or empty($upload_date)){
                $error = 'There are some fields empty. The only empty field accepted is "image" or "link" field';
            } else {
                $query = $pdo->prepare('INSERT INTO Noticias (name, description, upload_date, image, link, active) VALUES (?, ?, ?, ?, ?, ?)');