Ejemplo n.º 1
0
         $response["user"]["email"] = $user["email"];
         $response["user"]["created_at"] = $user["created_at"];
         $response["user"]["updated_at"] = $user["updated_at"];
         echo json_encode($response);
     } else {
         // user not found
         // echo json with error = 1
         $response["error"] = 1;
         $response["error_msg"] = "Incorrect email or password!";
         echo json_encode($response);
     }
 } else {
     if ($tag == 'sendRequest') {
         $email = $_POST['fromemail'];
         $toEmail = $_POST['toemail'];
         $fromid = $db->getUid($email);
         $toid = $db->getUid($toEmail);
         $relation = $db->getRelation($toid, $fromid);
         if ($relation == -1) {
             $relationOp = $db->getRelation($fromid, $toid);
             if ($relationOp == -1) {
                 $user = $db->updateRequest($fromid, $toid);
                 if ($user != false) {
                     // user found
                     // echo json with success = 1
                     $response["success"] = 1;
                     $response["success_msg"] = "Friend Request Sent";
                     echo json_encode($response);
                 } else {
                     // user not found
                     // echo json with error = 1
Ejemplo n.º 2
0
<?php

require_once 'include/DB_Functions.php';
$db = new DB_Functions();
$email = "*****@*****.**";
$emailId = $email;
$toId = $db->getUid($emailId);
$idArr = $db->getReminders($toId);
if ($idArr == -1) {
    $resp["reminders"] = "no reminders";
    echo json_encode($resp);
} else {
    $resp["id"] = $idArr;
    $resp["emails"] = $idArr;
    echo json_encode($resp);
}
/* $toEmail = "*****@*****.**";
      echo $db->deleteReminder(2);
      // echo $arr[0][0];
        /*
       
       echo ($db->getReminders(1));
        /*
       
       $fromid = $db->getUid($email);
       echo $fromid;
       $toid = $db->getUid($toEmail);
       echo "toid" . $toid;
       echo  $db->setReminder("Pick Me up", $fromid, $toid, 70.6588, -85.2365, "Charlotte", 50 );       /*
       if( $db->getRelation($fromid, $toid)==-1)
       {