public function get_arrets($id = FALSE, $direction = FALSE) { if (!is_numeric($id) || !is_numeric($direction)) { retour('Merci de vous rapporter à la notice de l\'api', FALSE); } $chemin = $this->arrets_model->get_arrets($id, $direction); retour('Arrets de la ligne', TRUE, $chemin); }
public function get_by_arret_current($id_ligne, $id_arret, $sens, $nb, $jour = NULL) { if (!is_numeric((int) $id_arret) || !is_numeric((int) $sens)) { retour('Merci de vous rapporter à la notice de l\'api', FALSE); } $horaires['horaires'] = $this->horaires_model->get_liste_current($id_ligne, $id_arret, $sens, $nb, $jour); retour('Horaire à l\'arret', TRUE, $horaires); }
public function rt_liste() { $args = "objectid,type_intervention,commune,adresse,niveau_gene,descr_gene1,descr_gene2,descr_gene3,date_debut,date_fin"; $travaux = json_decode(file_get_contents("https://geoservices.grand-nancy.org/arcgis/rest/services/public/VOIRIE_Info_Travaux_Niveau/MapServer/0/query?text=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&objectIds=&where=1%3D1&time=&returnIdsOnly=false&returnGeometry=true&maxAllowableOffset=&outSR=4326&outFields=" . $args . "&f=pjson")); foreach ($travaux->features as $value) { $date = new DateTime(); $date->setTimestamp(substr($value->attributes->DATE_DEBUT, 0, -3)); $date_debut = $date->format('Y-m-d H:i'); $date->setTimestamp(substr($value->attributes->DATE_FIN, 0, -3)); $date_fin = $date->format('Y-m-d H:i'); $result[] = array('lat' => $value->geometry->y, 'lng' => $value->geometry->x, 'niveau_gen' => $value->attributes->NIVEAU_GENE, 'adresse' => $value->attributes->ADRESSE, 'commune' => $value->attributes->COMMUNE, 'type_inter' => $value->attributes->TYPE_INTERVENTION, 'date_debut' => $date_debut, 'date_fin' => $date_fin, 'descr_gene' => $value->attributes->DESCR_GENE1, 'descr_ge_1' => $value->attributes->DESCR_GENE2, 'descr_ge_2' => $value->attributes->DESCR_GENE3); } $retour['travaux'] = $result; retour('liste des travaux', TRUE, $retour); }
public function chemin($id = FALSE, $direction = FALSE) { if (!is_numeric($id) || !is_numeric($direction)) { retour('Merci de vous rapporter à la notice de l\'api', FALSE); } $ligne['chemin'] = $this->lignes_model->get_chemin($id, $direction); $json = '{"success": true, "msg": "chemin", "chemin" : ' . $ligne['chemin'] . '}'; if (isset($_GET['callback'])) { header('Access-Control-Allow-Origin: *'); header('content-type: application/json; charset=utf-8'); echo $_GET['callback'] . '(' . $json . ')'; } else { header('Access-Control-Allow-Origin: *'); header('content-type: application/json; charset=utf-8'); echo $json; } //retour('Chemin de la ligne', TRUE, $ligne); }
public function index() { $autopis['autopis'] = $this->autopis_model->get_liste(); retour('liste des voitures de location Autopi', TRUE, $autopis); }
public function rapport() { $info = $this->input->post(NULL, TRUE); $erreur = FALSE; //var_dump($info); exit; if ($info['id_ligne'] === FALSE || empty($info['id_ligne'])) { $erreur = TRUE; $retour['id_ligne'] = ""; } if ($info['id_arret'] === FALSE || empty($info['id_arret'])) { $erreur = TRUE; $retour['id_arret'] = ""; } if ($info['probleme'] === FALSE || empty($info['probleme']) || $info['probleme'] === "null") { $erreur = TRUE; $retour['probleme'] = ""; } if ($erreur === TRUE) { retour('Merci de remplir les champs necessaire.', FALSE); } if (!isset($info['nom_ligne']) || empty($info['nom_ligne'])) { $info['nom_ligne'] = NULL; } if (!isset($info['nom_arret']) || empty($info['nom_arret'])) { $info['nom_arret'] = NULL; } if (!isset($info['tps_retard']) || empty($info['tps_retard'])) { $info['tps_retard'] = NULL; } if (!isset($info['tps_avance']) || empty($info['tps_avance'])) { $info['tps_avance'] = NULL; } if (!isset($info['heure']) || empty($info['heure']) || $info['heure'] === "h") { $info['heure'] = NULL; } if (!isset($info['min']) || empty($info['min']) || $info['min'] === "min") { $info['min'] = NULL; } if (!isset($info['num_bus']) || empty($info['num_bus'])) { $info['num_bus'] = NULL; } if (!isset($info['email']) || empty($info['email'])) { $info['email'] = NULL; } if (!isset($info['remarque']) || empty($info['remarque'])) { $info['remarque'] = NULL; } if (!isset($info['date']) || empty($info['date'])) { $info['date'] = date('Y-m-d H:i:s', time()); } else { $date = explose_date_fr($info['date']); $info['date'] = $date['annee'] . '-' . $date['mois'] . '-' . $date['jour'] . ' ' . $date['h'] . ':' . $date['m'] . ':' . $date['s']; if ($info['date'] > date('Y-m-d H:i:s', time())) { retour('Merci de ne pas anti-dater vos rapports.', FALSE); } } $result = $this->rapport_model->add($info); if ($result === TRUE) { $prob = array('retard', 'avance', 'never', 'pasarret', 'surpop', 'accident', 'controleur', 'compliment', 'remarque', 'incident'); if (in_array($info['probleme'], $prob)) { $numligne = explode("-", $info['nom_ligne']); $message = $info['nom_prob'] . " à l'arret " . $info['nom_arret'] . " ligne " . trim($numligne[0]) . " direction " . $info['nom_sens'] . " #ReseauStan"; $connection = $this->twitteroauth->create(); $data = array('status' => $message); $result = $connection->post('statuses/update', $data); } retour('Votre rapport a bien été soumis.', TRUE, $info); } retour('erreur', FALSE, $info); }
public function get($id) { $parking['parking'] = $this->parking_model->get($id); retour('parking', TRUE, $parking); }
public function bus() { $arrets = $this->realtime_model->get(); retour('bus temps reel', TRUE, array('bus' => $arrets)); }
public function get_by_arret_current($id_arret, $nb, $jour = NULL) { $horaires['horaires'] = $this->sncf_horaires_model->get_liste_current($id_arret, $nb, $jour); retour('Horaire à l\'arret', TRUE, $horaires); }
public function nb_rapport_by_arret($type, $id_arret) { $retour = $this->stats_model->nb_rapport_by_arret_total($id_arret); retour('nb_rapport_by_arret', TRUE, $retour); }
public function get($id) { $velo['velo'] = $this->velos_model->get($id); retour('Velo', TRUE, $velo); }