Beispiel #1
0
<? 
// Array Helpers
$TourCat= array( "Pré-minimes","Minimes","Cadets","Scolaires","Juniors","Seniors","Elites"
    );
$TourType= array( "Hommes","Femmes","Mixte","Famille");

$TourYear= array( date('Y'),date('Y', strtotime('+1 year')) ,date('Y', strtotime('+2 year')));
require_once '../../../Models/Tournaments.php';


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


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

//If an edit is performed
if(! empty($_POST))
{
      $data=$_POST;
      $answer=$Tour->Update($data,array( "TournamentId" => $id ));
      header("Location: ./index.php");
}

?>            

<h4>Ajouter un tournoi</h4>
Beispiel #2
0
<? 
// Include the file for the specific functions on Users
require_once '../../../Models/Tournaments.php';
// New Helper to use the functions
$id=$_GET["id"];
$Tour= new TournamentsModel();
// Performing a select with all "*" and specifiying the RoleId=2 for selecting only users
$results = $Tour->Delete(array( "TournamentId" => $id ));

header("Location: ./index.php");

?>
Beispiel #3
0
<?
// Include the file for the specific functions on Users
$TourCat= array( "Pré-minimes","Minimes","Cadets","Scolaires","Juniors","Seniors","Elites" );

$TourType= array( "Hommes","Femmes","Mixte","Famille");

$TourYear= array( date('Y'),date('Y', strtotime('+1 year')) ,date('Y', strtotime('+2 year')));

require_once '../../../Models/Tournaments.php';
if(!empty($_POST))
{
    
    $data=$_POST;
    $Tour= new TournamentsModel();
    $Tour->Insert($data);

}
?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
          <h4>Ajouter un tournoi</h4>
     
            <form  method="post">
            <select name="TournamentYear">
              <? foreach ($TourYear as $Year):?> 
                        <option value="<? echo $Year; ?>"><? echo $Year;?></option>           
                <? endforeach;?>
            </select>
           <select name="TournamentCategory">
                <? foreach ($TourCat as $Cat):?> 
                      <option value="<? echo $Cat; ?>"><? echo $Cat;?></option>           
                <? endforeach;?>