123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?PHP
-
-
-
-
-
- $host = "localhost";
- $basedatos = "techos";
- $user = "pablo.puig1";
- $passw = "9NA3kSExI2fGE6eV";
-
- try{
- $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
- }
- catch(Exception $ex){
- print("Error connecting to database: ". $ex->getMessage()) and die();
- }
-
-
-
-
- header('Content-Type: application/json');
-
- $encodedData=file_get_contents('php://input');
- $decodedData=json_decode($encodedData, true);
-
- $FindEID=$decodedData["FindEID"];
-
- $query= "SELECT eid, name, start_date, end_date, participant_count, participant_limit, description from events";
- $stmt=mysqli_prepare($connection, $query);
- mysqli_stmt_execute($stmt);
-
- mysqli_stmt_bind_result($stmt, $eid, $name, $start_date, $end_date, $participant_count, $participant_limit, $description);
-
- while(mysqli_stmt_fetch($stmt)){
-
- $response[] = array("id"=>$eid, "activityName"=>$name, "subscribed"=> false, "icon"=> 'person-add-outline', "startDate"=>$start_date, "endDate"=>$end_date, "totalSubscribed"=>$participant_count, "maxSubscribed"=>$participant_limit, "activityDescription"=>$description);
-
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- echo json_encode($response);
-
-
-
-
- ?>
|