Nextrek
Diff Revisions
424
vs
517
for /Android/SmartCharging/endPoints/nightly/get_locals_by_user.php
|
@@ -2,12 +2,14 @@ |
2 |
2 |
|
header("Access-Control-Allow-Origin: *"); |
3 |
3 |
|
header('Content-Type: application/json; charset=UTF-8'); |
4 |
4 |
|
|
|
5 |
+ |
require_once("constants.php"); |
|
6 |
+ |
|
5 |
7 |
|
require_once("repositories/LocalRepository.php"); |
6 |
8 |
|
require_once("repositories/UserRepository.php"); |
7 |
9 |
|
|
8 |
|
- |
$servername = "localhost"; |
|
10 |
+ |
/*$servername = "localhost"; |
9 |
11 |
|
$username = "smartcharging"; |
10 |
|
- |
$password = "LXRLBaEAuRr7M7jY"; |
|
12 |
+ |
$password = "LXRLBaEAuRr7M7jY";*/ |
11 |
13 |
|
|
12 |
14 |
|
//$params = json_decode($_REQUEST["params"], true); |
13 |
15 |
|
|
|
@@ -20,7 +22,7 @@ |
20 |
22 |
|
$local_list; |
21 |
23 |
|
|
22 |
24 |
|
try { |
23 |
|
- |
$conn = new PDO("mysql:host=".$servername.";dbname=smartcharging", $username, $password); |
|
25 |
+ |
$conn = new PDO("mysql:host=".DB_SERVERNAME.";dbname=".DB_NAME, DB_USERNAME, DB_PASSWORD); |
24 |
26 |
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
25 |
27 |
|
//echo "Connesso con successo al DB"; |
26 |
28 |
|
|