Example #1
0
require_once './src/models/Utils.fonction.php';
if (isset($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $action = '';
}
if (isset($_SESSION['manager'])) {
    var_dump($_REQUEST);
    $template = new Template();
    $db = new PDO('mysql:host=localhost;dbname=eii2', 'root', '');
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
    $manager = new Manager($db);
    switch ($action) {
        case 'all':
            $produits = $manager->getAllClient();
            $content = $template->toutLesClients($produits, "allProduct");
            $message = 'allClient';
            include_once "./src/vue/v_gclient.php";
            break;
        case 'excel':
            // Nous donnons un chemin à notre fichier ici
            $workbook = new Spreadsheet_Excel_Writer('test.xls');
            $worksheet =& $workbook->addWorksheet('My first worksheet');
            $worksheet->write(0, 0, 'Nom');
            $worksheet->write(0, 1, 'Age');
            $worksheet->write(1, 0, 'John Smith');
            $worksheet->write(1, 1, 30);
            $worksheet->write(2, 0, 'Johann Schmidt');
            $worksheet->write(2, 1, 31);
            $worksheet->write(3, 0, 'Juan Herrera');
            $worksheet->write(3, 1, 32);