Example #1
0
 public function exportCSV()
 {
     $opts = Option::getAll($this->id);
     header("Content-type: text/csv");
     header("Content-Disposition: attachment; filename=" . $this->titre . ".csv");
     header("Pragma: no-cache");
     header("Expires: 0");
     foreach ($opts as $opt) {
         if ($opt->status == 'V') {
             echo $opt->id . "," . $opt->user_login . "," . $opt->user_prenom . "," . $opt->user_nom . "," . $opt->user_mail . "," . $opt->choice_name . "," . $opt->choice_price . "," . $opt->date_creation . "\n";
         }
     }
     exit;
 }
Example #2
0
    $app->response->redirect("install");
});
$app->get('/cron', function () use($app, $payutcClient, $admin) {
    $payutcClient = getPayutcClient("WEBSALE");
    $options = Option::getAll();
    foreach ($options as $opt) {
        if ($opt->status == 'W') {
            $desc = new Desc($opt->fk_desc_id);
            $funId = $desc->payutc_fun_id;
            $opt->checkStatus($payutcClient, $funId);
        }
    }
    $app->redirect('index');
});
$app->get('/callback', function () use($app, $payutcClient, $admin) {
    $payutcClient = getPayutcClient("WEBSALE");
    $options = Option::getAll(null, null, null, 'W');
    foreach ($options as $opt) {
        if ($opt->status == 'W') {
            $desc = new Desc($opt->fk_desc_id);
            $funId = $desc->payutc_fun_id;
            $opt->checkStatus($payutcClient, $funId);
        }
    }
    if ($_GET['url']) {
        $app->redirect($_GET['url']);
    } else {
        $app->redirect('index');
    }
});
$app->run();