Example #1
0
    $success = "0";
    $msg = "Incomplete Parameters";
    $data = array();
} else {
    $sql = "select * from users where verification_code=:token and is_deleted=0";
    $sth = $conn->prepare($sql);
    $sth->bindValue('token', $token);
    try {
        $sth->execute();
    } catch (Exception $e) {
        echo $e->getMessage();
    }
    $res = $sth->fetchAll();
    $uid = $res[0]['id'];
    if (count($res)) {
        $tnt = DataClass::get_friends($contacts, $uid);
        $data['profile'] = $tnt ? $tnt : [];
        if ($data) {
            $success = 1;
            $msg = "Profile Active";
        } else {
            $success = 0;
            $msg = "No Records Found";
        }
    } else {
        $success = 0;
        $msg = "Invalid User";
    }
}
// +-----------------------------------+
// + STEP 4: send json data			   +
Example #2
0
     $tnt1 = DataClass::get_all_contacts();
     foreach ($tnt1 as $r) {
         foreach ($contacts as $row) {
             $a = substr_compare($r['phone_number'], $row, -10, 10);
             if ($a == 0) {
                 $dict[] = $r['phone_number'];
             }
         }
     }
     if ($dict) {
         foreach ($dict as $key => $val) {
             $m = $val;
             $post_imgs .= $m . ',';
         }
         $num = rtrim($post_imgs, ', ');
         $tnt = DataClass::get_friends($num, $uid);
         $data['profile'] = $tnt ? $tnt : [];
         if ($data) {
             $success = 1;
             $msg = "Profile Active";
         } else {
             $success = 0;
             $msg = "No Records Found";
         }
     } else {
         $success = 0;
         $msg = "No Records Found";
     }
 } else {
     $success = 0;
     $msg = "Invalid User";