コード例 #1
0
require_once "models/dbcontroller.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
//Prevent the user visiting the logged in page if he is not logged in
if (!isUserLoggedIn()) {
    header("Location: admin.php");
    die;
}
if (isset($_POST['date']) && isset($_POST['title']) && isset($_POST['description'])) {
    if ($_POST['date'] == "") {
        header("location: admin_corso_completo.php?msg=emptydate");
        die;
    }
    $originalDate = $_POST['date'];
    $myDateTime = DateTime::createFromFormat('d/m/Y', $originalDate);
    $date = $myDateTime->format('Y-m-d');
    if ($_POST['title'] == "") {
        header("location: admin_corso_completo.php?msg=emptytitle");
        die;
    }
    $title = htmlentities($_POST['title']);
    $desc = $_POST['description'];
    if (dbcontroller::createLezioneCorsoCompleto($date, $title, $desc)) {
        header("location: admin_corso_completo.php?msg=success");
    } else {
        header("location: admin_corso_completo.php?msg=errordb");
    }
} else {
    header("location: admin_corso_completo.php?msg=error");
}
コード例 #2
0
    die;
}
//Prevent the user visiting the logged in page if he is not logged in
if (!isUserLoggedIn()) {
    header("Location: login.php");
    die;
}
if (isset($_GET['id'])) {
    if (is_numeric($_GET['id'])) {
        $id = $_GET['id'];
        require_once "models/dbcontroller.php";
        $corsi = dbcontroller::getLezioniDelCorsoCompleto();
        $ids = array();
        foreach ($corsi as $corso) {
            $ids[] = $corso['_id'];
        }
        if (in_array($id, $ids)) {
            if (dbcontroller::deleteCorsoMonotematico($id)) {
                header("location: admin_corso_completo.php?msg=success-delete");
            } else {
                header("location: admin_corso_completo.php?msg=error-delete-db");
            }
        } else {
            header("location: admin_corso_completo.php?msg=error-delete");
        }
    } else {
        header("location: admin_corso_completo.php?msg=error-delete");
    }
} else {
    header("location: admin_corso_completo.php?msg=error-delete");
}
コード例 #3
0
if (isset($_POST['image-1']) && isset($_POST['image-2'])) {
    if (is_numeric($_POST['image-1']) && is_numeric($_POST['image-2'])) {
        $id1 = $_POST['image-1'];
        $id2 = $_POST['image-2'];
        require_once "models/dbcontroller.php";
        $images = dbcontroller::getHomeSliderList();
        $flag1 = false;
        $flag2 = false;
        foreach ($images as $img) {
            if ($img['_id'] == $id1) {
                $flag1 = true;
            }
            if ($img['_id'] == $id2) {
                $flag2 = true;
            }
        }
        if ($flag1 && $flag2) {
            if (dbcontroller::swapImagesHomeSlider($id1, $id2)) {
                header("location: admin_home.php?msg=success-swap");
            } else {
                header("location: admin_home.php?msg=error-db-swap");
            }
        } else {
            header("location: admin_home.php?msg=error-swap");
        }
    } else {
        header("location: admin_home.php?msg=error-swap");
    }
} else {
    header("location: admin_home.php?msg=error-swap");
}
コード例 #4
0
ファイル: get_max_umid_habanero.php プロジェクト: fEDUntu/GSP
<?php

// servizio php per il progetto Habanero (id_progetto == 0)
require_once "models/db-settings.php";
require_once "models/dbcontroller.php";
$max_umid = dbcontroller::getValue("max_umid", 0);
echo json_encode($max_umid, JSON_NUMERIC_CHECK);
コード例 #5
0
}
require_once "models/admin_C.php";
require_once "models/dbcontroller.php";
require_once "models/admin_head.php";
require_once "models/admin_bodytop.php";
require_once "models/admin_navigation.php";
//------------------------CHECK JAVASCRIPT ----------------------------
?>

<noscript>
    <center>Per usufruire delle funzioni del portale web abilitare Javascript nel proprio Browser di navigazione.</center> 
    <style>div { display:none; }</style>
</noscript>
<?php 
$corso_completo = dbcontroller::getCorsoCompleto();
$lezioni = dbcontroller::getLezioniDelCorsoCompleto();
if (isset($_GET['msg'])) {
    ?>
 <div class="container"> <?php 
    $msg = $_GET['msg'];
    switch ($msg) {
        // messaggi d'errore di update-price.php
        case "emptyprice":
            echo '<div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                Errore: inserire nuovo prezzo
                </div>';
            break;
        case "insert-a-number":
            echo '<div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
コード例 #6
0
ファイル: process_maxvalues.php プロジェクト: fEDUntu/GSP
     }
 }
 $u_min = dbcontroller::getValue("min_umid", $_POST['id_progetto']);
 // get temp_min
 if ($u_max <= $u_min[0] || $u_max >= 100) {
     if ($_POST['id_progetto'] == 2) {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_caprile_pesaro.php?modifica=consistency_data_error");
         die;
     } else {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_natta_milano.php?modifica=consistency_data_error");
         die;
     }
 }
 // SE I CHECK SONO SODDISFATTI procedo con le modifiche dei valori
 $check1 = dbcontroller::setTempMax($t_max, $_POST['id_progetto']);
 $check2 = dbcontroller::setUmidMax($u_max, $_POST['id_progetto']);
 if ($check1 and $check2) {
     if ($_POST['id_progetto'] == 2) {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_caprile_pesaro.php?modifica=all");
         die;
     } else {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_natta_milano.php?modifica=all");
         die;
     }
 } else {
     if ($_POST['id_progetto'] == 2) {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_caprile_pesaro.php?error=db");
         die;
     } else {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_natta_milano.php?error=db");
         die;
コード例 #7
0
ファイル: via_caprile_pesaro.php プロジェクト: fEDUntu/GSP
require_once "models/bodytop.php";
require_once "models/navigation.php";
require_once "models/dbcontroller.php";
$info_temp = dbcontroller::checkValoriChart("temp", 2);
$info_umid = dbcontroller::checkValoriChart("umid", 2);
$max_temp = dbcontroller::getValue("max_temp", 2);
$min_temp = dbcontroller::getValue("min_temp", 2);
$max_umid = dbcontroller::getValue("max_umid", 2);
$min_umid = dbcontroller::getValue("min_umid", 2);
//check se esistono dati disponibili nel database
$NODATI = 0;
if ($info_temp or $info_umid) {
    $NODATI = 1;
}
$soglia_temp = dbcontroller::getValue("max_temp", 2);
$soglia_umid = dbcontroller::getValue("max_umid", 2);
$superata_temp = false;
$superata_umid = false;
// CHECK valori temperature che superano la soglia
for ($i = 0; $i <= count($info_temp) - 1; $i++) {
    //echo $info_temp[$i]["valore"] . " ";
    if ($info_temp[$i]["valore"] >= $soglia_temp[0]) {
        $superata_temp = true;
    }
}
// CHECK valori umidità che superano la soglia
for ($i = 0; $i <= count($info_umid) - 1; $i++) {
    if ($info_umid[$i]["valore"] >= $soglia_umid[0]) {
        $superata_umid = true;
    }
}
コード例 #8
0
if (!isUserLoggedIn()) {
    header("Location: admin.php");
    die;
}
if (isset($_POST['date']) && isset($_POST['title']) && isset($_POST['description']) && isset($_POST['price'])) {
    if ($_POST['date'] == "") {
        header("location: admin_corsi.php?msg=emptydate");
        die;
    }
    $originalDate = $_POST['date'];
    $myDateTime = DateTime::createFromFormat('d/m/Y', $originalDate);
    $date = $myDateTime->format('Y-m-d');
    if ($_POST['title'] == "") {
        header("location: admin_corsi.php?msg=emptytitle");
        die;
    }
    $title = htmlentities($_POST['title']);
    $desc = $_POST['description'];
    if ($_POST['price'] == "") {
        header("location: admin_corsi.php?msg=emptyprice");
        die;
    }
    $price = htmlentities($_POST['price']);
    if (dbcontroller::createCorsoMonotematico($date, $title, $desc, $price)) {
        header("location: admin_corsi.php?msg=success");
    } else {
        header("location: admin_corsi.php?msg=errordb");
    }
} else {
    header("location: admin_corsi.php?msg=error");
}
コード例 #9
0
            echo '<div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                Errore: nome foto già esistente
                </div>';
            break;
        case "error-invalid-name":
            echo '<div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                Errore: nome dell\'immagine non valido, controllare che non vi siano spazi
                </div>';
            break;
    }
    ?>
 </div> <?php 
}
$eventi = dbcontroller::getEventi();
//variabili per gestire l'edit degli eventi
$edit = isset($_GET['edit']) ? $edit = $_GET['edit'] : NULL;
$i = 1;
$current_event = 0;
// utilizzata per ciclare sui vari eventi in array_values e viene incrementata ad ogni ciclo
?>

<div class="container">

     
    <div class="row">
        <div class="box">
            <hr><h2 class="text-center intro-text">Inserisci Evento</h2><hr>
            <form method="post" onsubmit="return checkFields(['date', 'title'])" enctype="multipart/form-data" action="insert-evento.php" class="edit-box-0">
                <p>Data* <br><input type="text" name="date" class="datepicker" readonly="readonly"></p>
コード例 #10
0
<?php

$currentPageName = "corso completo";
$dropdown = true;
require_once "models/C.php";
require_once "models/dbcontroller.php";
require_once "models/head.php";
require_once "models/bodytop.php";
require_once "models/navigation.php";
$corso_completo = dbcontroller::getCorsoCompleto();
$corsi_singoli = dbcontroller::getLezioniDelCorsoCompleto();
?>
<div class="container">
  <div class="row">
    <div class="box">
      <hr>
      <h2 class="intro-text text-center">IL CORSO DI CUCINA COMPLETO</h2>
      <hr>
      <div class="col-lg-12">
        
      <?php 
echo $corso_completo[0]['notes'];
?>
        
      <div class="text-center">
        <p>
      <?php 
echo "€ " . $corso_completo[0]['price'];
?>
        
        </p>
コード例 #11
0
ファイル: update-menu.php プロジェクト: fEDUntu/ladolcenoteca
    die;
}
$num_sections = count($menu_section);
for ($i = 1; $i <= $num_sections; $i++) {
    if (isset($_POST['text' . $i])) {
        $text = $_POST['text' . $i];
        $return_value = false;
        switch ($i) {
            case 1:
                $return_value = dbcontroller::updateMenu($text, "null", "null", "null", "null");
                break;
            case 2:
                $return_value = dbcontroller::updateMenu("null", $text, "null", "null", "null");
                break;
            case 3:
                $return_value = dbcontroller::updateMenu("null", "null", $text, "null", "null");
                break;
            case 4:
                $return_value = dbcontroller::updateMenu("null", "null", "null", $text, "null");
                break;
            case 5:
                $return_value = dbcontroller::updateMenu("null", "null", "null", "null", $text);
                break;
        }
        if ($return_value) {
            header("location: admin_menu.php?msg=success");
        } else {
            header("location: admin_menu.php?msg=errordb");
        }
    }
}
コード例 #12
0
if (!isUserLoggedIn()) {
    header("Location: login.php");
    die;
}
if (isset($_GET['id'])) {
    if (is_numeric($_GET['id'])) {
        $id = $_GET['id'];
        require_once "models/dbcontroller.php";
        $images = dbcontroller::getHomeSliderList();
        $ids = array();
        foreach ($images as $image) {
            $ids[] = $image['_id'];
        }
        if (in_array($id, $ids)) {
            if (dbcontroller::deleteHomeSlider($id)) {
                if (unlink("images/home-slider/" . dbcontroller::getImageNameByID($images, $id))) {
                    header("location: admin_home.php?msg=successdelete");
                } else {
                    header("location: admin_home.php?msg=db-error");
                }
            } else {
                header("location: admin_home.php?msg=error");
            }
        } else {
            header("location: admin_home.php?msg=error");
        }
    } else {
        header("location: admin_home.php?msg=error");
    }
} else {
    header("location: admin_home.php?msg=error");
コード例 #13
0
ファイル: process_minvalues.php プロジェクト: fEDUntu/GSP
     }
 }
 $u_max = dbcontroller::getValue("max_umid", $_POST['id_progetto']);
 // get max_umid
 if ($u_min <= 0 || $u_min >= $u_max[0]) {
     if ($_POST['id_progetto'] == 2) {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_caprile_pesaro.php?modifica=consistency_data_error");
         die;
     } else {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_natta_milano.php?modifica=consistency_data_error");
         die;
     }
 }
 // SE I CHECK SONO SODDISFATTI procedo con le modifiche dei valori
 $check1 = dbcontroller::setTempMin($t_min, $_POST['id_progetto']);
 $check2 = dbcontroller::setUmidMin($u_min, $_POST['id_progetto']);
 if ($check1 and $check2) {
     if ($_POST['id_progetto'] == 2) {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_caprile_pesaro.php?modifica=all");
         die;
     } else {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_natta_milano.php?modifica=all");
         die;
     }
 } else {
     if ($_POST['id_progetto'] == 2) {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_caprile_pesaro.php?error=db");
         die;
     } else {
         header("Location: http://192.168.33.10/Green-School-Project/admin_via_natta_milano.php?error=db");
         die;
コード例 #14
0
ファイル: admin_home.php プロジェクト: fEDUntu/ladolcenoteca
require_once "models/dbcontroller.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
require_once "models/admin_C.php";
require_once "models/admin_head.php";
require_once "models/admin_bodytop.php";
require_once "models/admin_navigation.php";
//------------------------CHECK JAVASCRIPT ----------------------------
?>
<noscript>
    <center>Per usufruire delle funzioni del portale web abilitare Javascript nel proprio Browser di navigazione.</center> 
    <style>div { display:none; }</style>
</noscript>
<?php 
$home_slider = dbcontroller::getHomeSliderList();
if (isset($_GET['msg'])) {
    ?>
 <div class="container"> <?php 
    $msg = $_GET['msg'];
    switch ($msg) {
        // messaggi d'errore di upload-image-home.php
        case "success":
            echo '<div class="alert alert-success alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                Caricamento immagine avvenuto con successo
                </div>';
            break;
        case "invalid-file":
            echo '<div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
コード例 #15
0
ファイル: admin_corsi.php プロジェクト: fEDUntu/ladolcenoteca
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
require_once "models/admin_C.php";
require_once "models/dbcontroller.php";
require_once "models/admin_head.php";
require_once "models/admin_bodytop.php";
require_once "models/admin_navigation.php";
//------------------------CHECK JAVASCRIPT ----------------------------
?>
<noscript>
    <center>Per usufruire delle funzioni del portale web abilitare Javascript nel proprio Browser di navigazione.</center> 
    <style>div { display:none; }</style>
</noscript>
<?php 
$corsi_monotematici = dbcontroller::getCorsiMonotematici();
if (isset($_GET['msg'])) {
    ?>
 <div class="container"> <?php 
    $msg = $_GET['msg'];
    switch ($msg) {
        // messaggi d'errore di delete-corso-monotematico.php
        case "success-delete":
            echo '<div class="alert alert-success alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                Cancellazione del corso monotematico avvenuta con successo
                </div>';
            break;
        case "error-delete-db":
            echo '<div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
コード例 #16
0
ファイル: index.php プロジェクト: fEDUntu/GSP
<?php

$currentPageName = "Homepage";
require_once "models/C.php";
require_once "models/head.php";
require_once "models/bodytop.php";
require_once "models/navigation.php";
require_once "models/dbcontroller.php";
$info = dbcontroller::getInfoScuole();
//echo $info[0]["indirizzo"];
//Scuola di riferimento: via Natta, Milano (id = 7)
?>
    <head>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
        <meta charset="utf-8">
        <title>Simple markers</title>
        <style>
            html, body {
                height: 100%;
                margin: 0;
                padding: 0;
            }
            #map {
                height: 300px;
            }
        </style>
    </head>

    <body>
        <div id="map"></div>
        <script>
コード例 #17
0
ファイル: menu.php プロジェクト: fEDUntu/ladolcenoteca
<?php

$currentPageName = "menu";
require_once "models/C.php";
require_once "models/dbcontroller.php";
require_once "models/head.php";
require_once "models/bodytop.php";
require_once "models/navigation.php";
$menu = dbcontroller::getMenu();
?>
<div class="container">
  <?php 
foreach ($menu_section as $section) {
    if (count($menu) != 0) {
        echo '<div class="row">';
        echo '<div class="box text-center">';
        echo '<hr><h2 class="text-center intro-text">' . $section[0] . '</h2><hr>';
        echo array_values($menu)[0][$section[1]];
        echo '</div>';
        echo '</div>';
    } else {
        echo '<div class="row">';
        echo '<div class="box text-center">';
        echo '<hr><h2 class="text-center intro-text">' . "Non sono presenti eventi" . '</h2><hr>';
        echo array_values($menu)[0][$section[1]];
        echo '</div>';
        echo '</div>';
    }
}
?>
</div>
コード例 #18
0
}
if (isset($_FILES['immagine-slider'])) {
    if ($_FILES['immagine-slider']['type'] != "image/jpg" && $_FILES['immagine-slider']['type'] != "image/jpeg") {
        header("location: admin_home.php?msg=invalid-file");
    } else {
        if (!preg_match('/\\s/', $_FILES['immagine-slider']['name'])) {
            if (!file_exists("./images/home-slider/" . $_FILES['immagine-slider']['name'])) {
                $tempPos = $_FILES['immagine-slider']['tmp_name'];
                $destPos = "./images/home-slider/" . $_FILES['immagine-slider']['name'];
                include 'models/SimpleImage.php';
                $image = new SimpleImage();
                $image->load($_FILES['immagine-slider']['tmp_name']);
                $image->resize($width_image_slider, $height_image_slider);
                $image->save("./images/home-slider/" . $_FILES['immagine-slider']['name']);
                //move_uploaded_file($tempPos, $destPos);
                require_once "models/dbcontroller.php";
                if (dbcontroller::addHomeSlider($_FILES['immagine-slider']['name'])) {
                    header("location: admin_home.php?msg=success");
                } else {
                    header("location: admin_home.php?msg=errordb");
                }
            } else {
                header("location: admin_home.php?msg=name-already-exist");
            }
        } else {
            header("location: admin_home.php?msg=error-invalid-name");
        }
    }
} else {
    header("location: admin_home.php");
}
コード例 #19
0
ファイル: corsi.php プロジェクト: fEDUntu/ladolcenoteca
<?php

$currentPageName = "corsi monotematici";
$dropdown = true;
require_once "models/C.php";
require_once "models/dbcontroller.php";
require_once "models/head.php";
require_once "models/bodytop.php";
require_once "models/navigation.php";
$corsi_monotematici_futuri = dbcontroller::getCorsiMonotematiciFuturi(date('Y-m-d'));
$corsi_monotematici_passati = dbcontroller::getCorsiMonotematiciPassati(date('Y-m-d'));
?>
<div class="container">
  <div class="row">
    <div class="box">
      <hr>
      <h2 class="intro-text text-center">I NOSTRI<b> CORSI MONOTEMATICI</b></h2>
      <hr>
      <div class="col-lg-12"><p>
        La Dolcenoteca organizza corsi Lorem ipsum dolor sit amet, 
        consectetur adipiscing elit. Nunc placerat diam quis nisl vestibulum dignissim. 
        In hac habitasse platea dictumst. Interdum et malesuada fames ac ante ipsum primis in faucibus. 
        Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
        </p></div>
    </div>
  </div>
  <?php 
if (count($corsi_monotematici_futuri) <= 0) {
    ?>
  <div class="row">
    <div class="box">
コード例 #20
0
 static function updateNoteCorsoCompleto($note)
 {
     if (count(dbcontroller::getCorsoCompleto()) == 0) {
         global $mysqli;
         $stmt = $mysqli->prepare("INSERT INTO lde_complete_course (notes) VALUES (?)");
         if ($stmt != false) {
             $stmt->bind_param("s", $note);
             $stmt->execute();
             return true;
         } else {
             return false;
         }
     } else {
         global $mysqli;
         $stmt = $mysqli->prepare("UPDATE lde_complete_course SET notes = (?)");
         if ($stmt != false) {
             $stmt->bind_param("s", $note);
             $stmt->execute();
             return true;
         } else {
             return false;
         }
     }
 }
コード例 #21
0
<?php

$currentPageName = "update-notes";
require_once "models/config.php";
require_once "models/admin_C.php";
require_once "models/dbcontroller.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
//Prevent the user visiting the logged in page if he is not logged in
if (!isUserLoggedIn()) {
    header("Location: admin.php");
    die;
}
if (isset($_POST['note'])) {
    $note = $_POST['note'];
    if (dbcontroller::updateNoteCorsoCompleto($note)) {
        header("location: admin_corso_completo.php?msg=note-success");
    } else {
        header("location: admin_corso_completo.php?msg=note-errordb");
    }
} else {
    header("location: admin_corso_completo.php?msg=note-error");
}
コード例 #22
0
            $ids[] = $image['_id'];
        }
        // se l'immagine è presente nell'array appena creato, cancellala
        if (in_array($id, $ids)) {
            if (unlink("images/events/" . dbcontroller::getImageEventiByID($images, $id))) {
                header("location: admin_eventi.php?msg=successdelete");
            } else {
                header("location: admin_eventi.php?msg=image-not-found");
            }
        }
        // qui avviene la cancellazione dell'evento da db
        $eventi = dbcontroller::getEventi();
        $ids = array();
        foreach ($eventi as $evento) {
            $ids[] = $evento['_id'];
        }
        if (in_array($id, $ids)) {
            if (dbcontroller::deleteEvento($id)) {
                header("location: admin_eventi.php?msg=success-delete");
            } else {
                header("location: admin_eventi.php?msg=error-delete-db");
            }
        } else {
            header("location: admin_eventi.php?msg=error-delete");
        }
    } else {
        header("location: admin_eventi.php?msg=error-delete");
    }
} else {
    header("location: admin_eventi.php?msg=error-delete");
}
コード例 #23
0
ファイル: get_max_temp_vanilla.php プロジェクト: fEDUntu/GSP
<?php

// servizio php per il progetto Vanilla (id_progetto == 0)
require_once "models/db-settings.php";
require_once "models/dbcontroller.php";
$max_temp = dbcontroller::getValue("max_temp", 2);
echo json_encode($max_temp, JSON_NUMERIC_CHECK);
コード例 #24
0
ファイル: index.php プロジェクト: fEDUntu/ladolcenoteca
" class="active"></li><?php 
    } else {
        ?>
<li data-target="#carousel-example-generic" data-slide-to="<?php 
        $i;
        ?>
"></li><?php 
    }
}
?>
          </ol>

          <!-- Wrapper for slides -->
          <div class="carousel-inner">
              <?php 
$sliderPics = dbcontroller::getHomeSliderList();
$first = true;
foreach ($sliderPics as $pic) {
    if ($first) {
        ?>
                    <div class="item active">
                      <!--<img src="images/home-slider/<?php 
        echo $pic['url'];
        ?>
" alt="<?php 
        echo ownfuncs::generateAltImage($pic['url']);
        ?>
"/>   -->
                    <div class="carousel-caption"></div>
                    </div>
                  <?php 
コード例 #25
0
                header("location: admin_eventi.php?msg=emptydate");
                die;
            } else {
                // preparazione formato data mysql
                $parts = explode('/', $text);
                $date = "{$parts['2']}-{$parts['1']}-{$parts['0']}";
                $return_value = dbcontroller::updateEvento($_POST['id'], "null", $date, "null", "null");
                // MODIFICA DATA
                break;
            }
        case 3:
            $return_value = dbcontroller::updateEvento($_POST['id'], "null", "null", $text, "null");
            // MODIFICA DESCRIZIONE
            break;
        case 4:
            $return_value = dbcontroller::updateEvento($_POST['id'], "null", "null", "null", $text);
            // //MODIFICA FOTO
            break;
    }
    if ($return_value) {
        header("location: admin_eventi.php?msg=success_update");
    } else {
        header("location: admin_eventi.php?msg=errordb");
    }
}
/*
  for ($i; $i<=$num_sections; $i++)
  {
 if (isset($_POST['text'.$_POST['i']]))
 {
   $text = $_POST['text'.$_POST['i']];
コード例 #26
0
    if (isset($_FILES['flyer'])) {
        if ($_FILES['flyer']['type'] != "image/jpg" && ($_FILES['flyer']['type'] != "image/jpeg" && is_uploaded_file($_FILES['flyer']['tmp_name']))) {
            header("location: admin_eventi.php?msg=error1");
        } else {
            if (!preg_match('/\\s/', $_FILES['flyer']['name'])) {
                if (!file_exists("./images/events/" . $_FILES['flyer']['name'])) {
                    $tempPos = $_FILES['flyer']['tmp_name'];
                    $destPos = "./images/events/" . $_FILES['flyer']['name'];
                    include 'models/SimpleImage.php';
                    $image = new SimpleImage();
                    $image->load($_FILES['flyer']['tmp_name']);
                    //$image->resize($width_image_slider,$height_image_slider);
                    $image->save("./images/events/" . $_FILES['flyer']['name']);
                    //move_uploaded_file($tempPos, $destPos);
                    require_once "models/dbcontroller.php";
                    if (dbcontroller::createEvento($title, $date, $descrizione, $url_flyer, "")) {
                        header("location: admin_eventi.php?msg=success");
                    } else {
                        header("location: admin_eventi.php?msg=errordb");
                    }
                } else {
                    header("location: admin_eventi.php?msg=name-already-exist");
                }
            } else {
                header("location: admin_eventi.php?msg=error-invalid-name");
            }
        }
    } else {
        header("location: admin_eventi.php");
    }
} else {
コード例 #27
0
ファイル: eventi.php プロジェクト: fEDUntu/ladolcenoteca
<?php

$currentPageName = "eventi";
require_once "models/C.php";
require_once "models/dbcontroller.php";
require_once "models/head.php";
require_once "models/bodytop.php";
require_once "models/navigation.php";
$eventi = dbcontroller::getEventi();
$flyers = dbcontroller::getImmaginiEventi();
//[_id][foto]
?>
<div class="container">
  <?php 
foreach ($eventi as $evento) {
    if (count($eventi) != 0) {
        list($sett, $giorno, $mese, $anno) = explode('-', date("w-d-n-Y", strtotime($evento['data'])));
        $data_ITA = $giorni[$sett] . ', ' . $giorno . ' ' . $mesi[$mese] . ' ' . $anno;
        echo '<div class="row">';
        echo '<div class="box">';
        echo '<div class="col-lg-12">';
        echo '<div class="date">' . $data_ITA . '</div>';
        echo '<hr><h2 class="text-center intro-text">' . $evento['titolo'] . '</h2><hr>';
        echo $evento['descrizione'];
        ?>
<!--<img src="images/events/<?php 
        if ($evento['foto'] != NULL) {
            echo $evento['foto'];
        }
        ?>
" class="img-responsive">--><?php 
コード例 #28
0
            if (isset($_POST['date']) && isset($_POST['title']) && isset($_POST['description'])) {
                if ($_POST['date'] == "") {
                    header("location: admin_corso_completo.php?msg=emptydate");
                    die;
                }
                $originalDate = $_POST['date'];
                $myDateTime = DateTime::createFromFormat('d/m/Y', $originalDate);
                $date = $myDateTime->format('Y-m-d');
                if ($_POST['title'] == "") {
                    header("location: admin_corso_completo.php?msg=emptytitle");
                    die;
                }
                $title = htmlentities($_POST['title']);
                $desc = $_POST['description'];
                //se e' tutto ok chiamo il metodo passando id + tutti i nuovi valori
                if (dbcontroller::updateLezioneCorsoCompleto($id, $date, $title, $desc)) {
                    header("location: admin_corso_completo.php?msg=success-update");
                } else {
                    header("location: admin_corso_completo.php?msg=error-update-db");
                }
            } else {
                header("location: admin_corso_completo.php?msg=error");
            }
        } else {
            header("location: admin_corso_completo.php?msg=error-update");
        }
    } else {
        header("location: admin_corso_completo.php?msg=error-update");
    }
} else {
    header("location: admin_corso_completo.php?msg=error-update");