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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
    header("Access-Control-Allow-Origin: *");
    header('Content-Type: application/json; charset=UTF-8');

	require_once("repositories/LocalRepository.php");
    require_once("repositories/CommentRepository.php");
    require_once("constants.php");

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

	//$params = json_decode($_REQUEST["params"], true);

    //$input = file_get_contents('php://input');
    $params = json_decode(file_get_contents('php://input'), true);

	$conn;
	$risposta = array();
	$repo;
    $object;

	try {
    	$conn = new PDO("mysql:host=".DB_SERVERNAME.";dbname=".DB_NAME, DB_USERNAME, DB_PASSWORD);
    	$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    	//echo "Connesso con successo al DB";

        /* ============= SUPPORTO IMMAGINI NEI COMMENTI DROPPATO =============== */

        /*$type = $params["type"];

        if ($type=="local") {
            $repo = new LocalRepository($conn);
        } else if ($type=="comment") {
            $repo = new CommentRepository($conn);
        } else {
            $risposta = createErrorMessage(1, "Parametro \"type\" non valido");
            $risposta["type"]   = "error";
        }*/

        /* =========== FINE SUPPORTO IMMAGINI NEI COMMENTI DROPPATO ============= */

        $repo = new LocalRepository($conn);

    	$object = $repo->getImages($params["id"]);

        $risposta["id"]     = $params["id"];
        //$risposta["type"]   = $type;
        $risposta["imgs"]   = $object->imgs;
        $risposta["return"] = 0;		

    }
	catch(PDOException $e)
    {
   		echo $e->getMessage();
        $risposta = createErrorMessage(1, "Errore DB");
   		//$risposta["return"] = 1;
    }

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

?>

Commits for Nextrek/Android/SmartCharging/endPoints/nightly/get_immagini.php

Diff revisions: vs.
Revision Author Commited Message
707 Diff Diff FSallustio picture FSallustio Mon 07 Sep, 2015 15:59:18 +0000
706 Diff Diff FSallustio picture FSallustio Mon 07 Sep, 2015 15:50:07 +0000
537 Diff Diff FSallustio picture FSallustio Mon 24 Aug, 2015 14:46:21 +0000
517 Diff Diff FSallustio picture FSallustio Thu 20 Aug, 2015 14:25:03 +0000
415 Diff Diff FSallustio picture FSallustio Wed 22 Jul, 2015 08:27:42 +0000

Piccolo refactor dei file php...

400 Diff Diff FSallustio picture FSallustio Mon 20 Jul, 2015 10:23:38 +0000
378 Diff Diff FSallustio picture FSallustio Fri 17 Jul, 2015 10:31:22 +0000

[DA TESTARE E CORREGGERE] Gestione path immagini tramite costanti.

374 FSallustio picture FSallustio Fri 17 Jul, 2015 08:20:18 +0000

Creazione “branch” nightly