public function log_in($idMember)
 {
     $this->idMember = $idMember;
     $this->get_data_member();
     $this->verif_sessions();
     $bdd = new Bdd();
     $bdd->query('UPDATE ' . TABLE_MEMBERS . ' SET membre_last_up = ? WHERE membre_id = ?', array(time(), $this->getId()));
 }
 private function _rebuild_cache_templates_infos()
 {
     $bdd = new Bdd();
     $query = $bdd->query('SELECT * FROM ' . TABLE_CONFIG . ' WHERE config_name = "header" OR config_name = "footer"');
     $linesFile = array('<?php', '$templates_infos = array();');
     while ($fetch = $bdd->fetch($query)) {
         $infosPart = unserialize($fetch['config_value']);
         foreach ($infosPart as $k => $info) {
             $linesFile[] = '$templates_infos[\'' . $fetch['config_lang'] . '\'][\'' . $k . '\'] = \'' . $info . '\';';
         }
     }
     $linesFile[] = 'return $templates_infos;' . "\n" . '?>';
     file_put_contents(DIR_CACHE . 'templates_infos' . CACHE_LOAD, implode("\n", $linesFile));
     chmod(DIR_CACHE . 'templates_infos' . CACHE_LOAD, 0777);
     return $this->get_cache('templates_infos', CACHE_LOAD, true, true);
 }
Пример #3
0
<?php

header('Access-Control-Allow-Origin: *');
header('Content-type: application/json');
require_once "config.php";
require_once "class.bdd.php";
$bdd = new Bdd();
$post = $bdd->escape($_POST);
extract($post);
if (isset($latitude) && isset($longitude) && isset($status)) {
    $req = $bdd->query("INSERT INTO flag VALUES (DEFAULT, '{$latitude}', '{$longitude}', '{$status}')");
    if ($req === false) {
        die(json_encode(array("status" => "ERR", "error" => "Il manque des variables")));
    }
    die(json_encode(array("status" => "OK")));
} else {
    die(json_encode(array("status" => "ERR", "error" => "Il manque des variables")));
}