Exemple #1
0
<?php

error_reporting(null);
date_default_timezone_set('Asia/Shanghai');
require __DIR__ . "/vendor/autoload.php";
include "medoo.php";
$databases = new medoo();
$app = new \Slim\Slim(array("mode" => "product", "templates.path" => __DIR__ . "/templates"));
$app->get("/index", function () use($app) {
    try {
        $app->render("firstindex.html");
    } catch (Exception $e) {
        $app->notfound();
    }
});
$app->get("/secindex", function () use($app) {
    try {
        $app->render("secindex.html");
    } catch (Exception $e) {
        $app->notfound();
    }
});
$app->get("/thirdindex/:uid/:type", function ($uid, $type) use($app, $databases) {
    try {
        $ftype = $app->getCookie("ctype");
        $stype = $app->getCookie("csectype");
        $ttype = $app->getCookie("csort");
        $f = $databases->insert("history", array("uuid" => $uid, "ftype" => $ftype, "stype" => $stype, "ttype" => $ttype));
        if ($type > 2) {
            $datas = $databases->select("user", "expire", array("uuid" => $uid, "ORDER" => array("id DESC", "time DESC")));
            if (count($datas) > 0) {