public static function supprimer($classe, $condition = null)
 {
     $request = new Request('delete', $classe);
     if ($condition != null) {
         $request->setConditions($condition);
     }
     return $request->execute($classe);
 }
This is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

this software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this software. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
require_once "../config/config_base.php";
require_once CONFIG_DIR . "/config_db.php";
require_once INC_DIR . "/autoload.function.php";
$p = new Webpage("Gestion des Types de Billets");
$p->appendCssUrl("../css/index.css");
$p->appendJsUrl("../lib/jquery.min.js");
$content = "";
if (isset($_GET['id']) && $_GET['id'] != null) {
    $request = new Request('SELECT', 'Utilisateur');
    $request->setparams("id_user ,firstName, lastName");
    $request->setConditions("id_user = "******"<p>" . $joueur['firstName'] . " " . $joueur['lastName'] . "</p>";
    }
}
$p->appendContent($content);
echo $p->toHTML();
this software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this software. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
require_once "../config/config_base.php";
require_once CONFIG_DIR . "/config_db.php";
$content = "";
$id = null;
$name = "";
if (isset($_GET['id']) && $_GET['id'] != null) {
    $id = $_GET['id'];
    $request = new Request('SELECT', 'TypeBillet');
    $request->setparams("id_typeBillet, libTypeBillet");
    $request->setConditions("id_typeBillet = " . $id);
    foreach ($request->execute() as $billet) {
        $id = $billet['id_typeBillet'];
        $name = $billet['libTypeBillet'];
    }
} else {
    $content .= "<h3>Ajout d'un nouveau billet</h3>";
}
$content .= <<<HTML
<input type='text' id="{$id}" name='libTypeBillet' value='{$name}'></input>
HTML;
echo $content;
  <div id='matchs'>
  <script type="text/javascript">
\t \$("#competition").change(function(){
                  \$("option").each(function(){
\t\t\tif (this.selected){
\t\t\t\$("#area").load('../ajax/areaMatchs.php?id='+this.value);
                  }
                });
            });
\t
  </script>
HTML;
if (isset($_GET['id']) && $_GET['id'] != null) {
    $request = new Request('SELECT', 'infs3_prj13.Match');
    $request->setparams("*");
    $request->setConditions("id_competition = " . $_GET['id']);
    $count = 0;
    foreach ($request->execute() as $match) {
        $content .= <<<HTML
            <input type="checkbox" id="cb{$count}" value="{$match['id_match']}">
             <label for="cb{$count}">( {$match['rang']} , {$match['ordre']} )</label>
HTML;
        $count++;
    }
}
$content .= <<<HTML
  </div>
    <button id="ajouter">Ajouter</button>
    <script type="text/javascript">
        \$("#ajouter").click(function(){
            \$("#champ").load("../ajax/modifierMatch.php");
  <div id='matchs'>
  <script type="text/javascript">
\t \$("#competition").change(function(){
                  \$("option").each(function(){
\t\t\tif (this.selected){
\t\t\t\$("#gestion").load('../ajax/gestionTournoi.php?id='+this.value);
                  }
                });
            });
\t
  </script>
HTML;
if (isset($_GET['id']) && $_GET['id'] != null) {
    $request = new Request('SELECT', 'Utilisateur, ParticiperCompetition');
    $request->setparams("id_user ,firstName, lastName");
    $request->setConditions("id_user = id_joueur AND id_competition = " . $_GET['id']);
    $count = 0;
    $content .= '<ul>';
    foreach ($request->execute() as $joueur) {
        $content .= "<li><a href='fichePersonne.php?id=" . $joueur['id_user'] . "'>" . $joueur['firstName'] . " " . $joueur['lastName'] . "</a></li>";
    }
    $content .= '</ul>';
    $content .= <<<HTML
  <button id="launch">Générer les matchs pour la Compétition</button>
  <script type="text/javascript">
          \$("#launch").click(function(){
\t      \$.get("../ajax/genererMatchs.php?c="+{$_GET['id']});
\t      \$('#gestion').load('../ajax/gestionTournoi.php');
            });
</script>
HTML;
You should have received a copy of the GNU General Public License
along with this software. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
require_once "../config/config_base.php";
require_once CONFIG_DIR . "/config_db.php";
require_once INC_DIR . "/autoload.function.php";
$content = "Update effectuée";
if (isset($_GET['classe']) && $_GET['classe'] != null && isset($_GET['id']) && $_GET['id'] != null && isset($_GET['data']) && $_GET['data'] != null) {
    $request = new Request('SELECT', $_GET['classe']);
    $request->setparams('*');
    $id = 0;
    foreach ($request->execute() as $value) {
        foreach ($value as $key => $useless) {
            if (substr($key, 0, 3) == "id_") {
                $id = $key;
            }
        }
    }
    $data = json_decode($_GET['data']);
    $request = new Request('UPDATE', $_GET['classe']);
    $request->setparams($data);
    $request->setConditions($id . " = " . $_GET['id']);
    foreach ($request->execute() as $truc) {
        var_dump($truc);
    }
} else {
    $content = "Erreur lors de l'update";
}
echo $content;