Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
	require ("LocalRepository.php");

	$servername = "localhost";
	$username = "smartcharging";
	$password = "LXRLBaEAuRr7M7jY";

	$params = json_decode($_GET["params"], true); //da portare su POST la richiesta

	$conn;
	$risposta = array();
	$local_repo;

	try {
    	$conn = new PDO("mysql:host=".$servername.";dbname=smartcharging", $username, $password);
    	$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    	//echo "Connesso con successo al DB";

    	$local_repo = new LocalRepository($conn);

    	$query_status = $local_repo->setLocalPosition($params["id"], $params["lat"], $params["lon"]);		
		$risposta["return"] = ($query_status==1) ? 0 : 1;
    }
	catch(PDOException $e)
    {
   		echo $e->getMessage();
   		$risposta["return"] = 1;
    }

    echo json_encode($risposta);
	$conn = null; //Close the connection to the DBMS

?>

Commits for Nextrek/Android/SmartCharging/endPoints/set_position.php

Diff revisions: vs.
Revision Author Commited Message
224 FSallustio picture FSallustio Wed 08 Jul, 2015 07:36:39 +0000

- Piccolo refactor (sia lato php che lato sql);
- set_position.php