Exemple #1
0
<? 
// Array Helpers

$CourtGroundType= array( "Dur","Gazon","Synthétique","Terre battue" );
$CourtType=array("Public","Privé");
require_once '../../../Models/Courts.php';


// New Helper to use the functions
$id=$_GET["id"];
$Court= new CourtsModel();


// Performing a select with all "*" and specifiying the CourtId to edit
$results = $Court->SelectSpecific("*",array( "CourtId" => $id ));
$results=$results[0];

//If an edit is performed
if(! empty($_POST))
{
  $data=$_POST;
  if (!isset($data["CourtAvailSat"])) {
    $data["CourtAvailSat"]="off";
  }
   if (!isset($data["CourtAvailSun"])) {
    $data["CourtAvailSun"]="off";
  }
      
      $answer=$Court->Update($data,array( "CourtId" => $id ));
      header("Location: ./index.php");
}