public function insertAction($args) { /* Premier prix */ $id = '0'; $rank = 1; $title = $_POST['first-price-title']; $image_link = $_FILES['first-price-img']['name']; $description = $_POST['first-price-desc']; $id_contest = $_POST['id_cont']; /* Deuxième prix */ $rank2 = 2; $title2 = $_POST['second-price-title']; $image_link2 = $_FILES['second-price-img']['name']; $description2 = $_POST['second-price-desc']; /* Premier prix */ $rank3 = 3; $title3 = $_POST['third-price-title']; $image_link3 = $_FILES['third-price-img']['name']; $description3 = $_POST['third-price-desc']; /* Enregistrement Premier Prix */ if (!empty($title)) { $addPriceObj1 = new priceModel($id, $rank, $title, $image_link, $description, $id_contest); $addPriceObj1->save(); } /* Enregistrement Deuxième Prix */ if (!empty($title2)) { $addPriceObj2 = new priceModel($id, $rank2, $title2, $image_link2, $description2, $id_contest); $addPriceObj2->save(); } /* Enregistrement Troisième Prix */ if (!empty($title3)) { $addPriceObj3 = new priceModel($id, $rank3, $title3, $image_link3, $description3, $id_contest); $addPriceObj3->save(); } header("Location: /dashboard"); }
<?php include "dashboardHead.php"; $contestListObj = new contestModel(); $contests = $contestListObj->getAllContest(); $pricesListObj = new priceModel(); $pricesListObj->getAll(true); ?> <div id="wrapper"> <div id="page-wrapper"> <div class="container-fluid"> <!-- Page Heading --> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">Modifier un concours</h1> <ol class="breadcrumb"> <li><i class="fa fa-dashboard"></i> <a href="/dashboard">Dashboard</a></li> <li class="active"><i class="fa fa-edit"></i> Modifier un concours</li> </ol> </div> </div><!-- /.row --> <div class="form-content"> <form method="post" class="search-contest col-md-6"> <div class="box-body"> <label>Sélectionnez l'application pour modifier ses informations</label> <select name="contest-name" id="select-contest-name"> <option value="no-value"></option> <?php
</script> <!-- Bannière & Title --> <?php $contestObj = new contestModel(); $contestObj->getOneByActive(true); $title = $contestObj->getTitle(); $description = $contestObj->getDescription(); $id_contest = $contestObj->getId(); $banner = $contestObj->getBanner(); $color = $contestObj->getColorTheme(); $_SESSION['color'] = $color; $_SESSION['idContest'] = $idContest; $priceObj1 = new priceModel(); $priceObj1->getAll(true); $priceCountObj = new priceModel(); $nbPrice = $priceCountObj->countRow(); if (!empty($id_contest)) { ?> <div id="banner" class="container-fluid" style="background: url(<?php echo $banner; ?> ) no-repeat center fixed;"> <div class="overlay" style="background-color: rgba(0, 0, 0, 0.7)"> <div class="banner-content row"> <div class="holder"> <div class="inner"> <h1 class="contest-title"><?php echo $title;