function getNewsFeeds()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $USERID = trim($_POST['userId']);
            //Get Request From Device
            $minPostId = trim($_POST['postId']);
            $getArrayList = array();
            if (isset($_POST['postId']) && $minPostId == "") {
                $result = $rm->fields_validation();
                return $result;
            }
            if ($USERID == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $result = $rm->getPosts($USERID, $minPostId);
                return $result;
            }
            // end of else first
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function getPostComments()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $postId = $rm->cleanData($_POST['postId']);
            $loggedInUserId = $rm->cleanData($_POST['userId']);
            $getArrayList = array();
            //echo $ENCRYPTEDPWD = md5($PASSWORD);
            //echo $ENCRYPTEDPWD = base64_decode($PASSWORD);
            //$ENCRYPTEDPWD=$PASSWORD;
            if ($postId == "" || $loggedInUserId == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $result = $rm->getAllPostComments($postId, $loggedInUserId);
                return $result;
            }
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
예제 #3
0
function getUserLoginDetails()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $USERNAME = trim($_REQUEST['userName']);
            //Get Request From Device
            $PASSWORD = trim($_REQUEST['passWord']);
            $getArrayList = array();
            //echo $ENCRYPTEDPWD = md5($PASSWORD);
            //echo $ENCRYPTEDPWD = base64_decode($PASSWORD);
            //$ENCRYPTEDPWD=$PASSWORD;
            if ($USERNAME == "" || $PASSWORD == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $result = $rm->login_success($USERNAME, $PASSWORD);
                return $result;
            }
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function forgetPassword()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $EMAILID = $_REQUEST['emailId'];
            if ($EMAILID == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $result = $rm->forgetPassword($EMAILID);
                return $result;
            }
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function getNotifications()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $USERID = trim($_POST['userId']);
            //Get Request From Device
            $getArrayList = array();
            if ($USERID == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $result = $rm->notificationList($USERID);
                return $result;
            }
            //end of first else
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
예제 #6
0
function checkBankBalance()
{
    //$companyId = $_REQUEST['companyId'];
    $bank_id = trim($_REQUEST['bankID']);
    $amount = trim($_REQUEST['amount']);
    $rm = new Response_Methods();
    if ($amount == "" || $bank_id == "") {
        $result = $rm->fields_validation();
        return $result;
    } else {
        $currentBalance = $rm->idToValue('initial_bank_balance', 'bank_details_t', 'bank_id', $bank_id);
        if ($currentBalance != 'NA') {
            if ($amount > $currentBalance) {
                $result = $rm->insufficientAmountJson();
                return $result;
            } else {
                $result = $rm->sufficientAmountJson();
                return $result;
            }
        } else {
            $result = $rm->get_anything_details_fail('Bank');
            return $result;
        }
    }
}
function userSearchList()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            if (isset($_POST['searchType']) && $_POST['searchType'] != '') {
                $searchType = trim($_POST['searchType']);
                //Get Request From Device	(trending, userName, petType)
            } else {
                $searchType = "trending";
            }
            $USERID = $_POST['userId'];
            $getArrayList = array();
            if ($searchType == "" || $USERID == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $result = $rm->getAllUsers($searchType, $USERID);
                return $result;
            }
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function getSingleUserSearchDetails()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $userId = $rm->cleanData($_POST['userId']);
            $loggedInUserId = $rm->cleanData($_POST['loggedInUserId']);
            $getArrayList = array();
            if ($userId == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $result = $rm->getSingleUserSearchDetails($userId, $loggedInUserId);
                return $result;
            }
            // end of else first
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function addCompanyDetails()
{
    $userID = trim($_REQUEST['userID']);
    $companyName = trim($_REQUEST['companyName']);
    //Get Request From Device
    $companyTanNo = trim($_REQUEST['companyTanNo']);
    $companyPanNo = trim($_REQUEST['companyPanNo']);
    $companyAddress = trim($_REQUEST['companyAddress']);
    $rm = new Response_Methods();
    if ($companyName == "" || $companyTanNo == "" || $companyPanNo == "" || $companyAddress == "") {
        $result = $rm->fields_validation();
        return $result;
    } else {
        date_default_timezone_set('Asia/Calcutta');
        $createdDate = date('Y-m-d H:i:s');
        $getList = array();
        $getFieldValue['login_user_id'] = $userID;
        $getFieldValue['company_name'] = $companyName;
        $getFieldValue['company_tan_no'] = $companyTanNo;
        $getFieldValue['company_pan_no'] = $companyPanNo;
        $getFieldValue['company_address'] = $companyAddress;
        $getFieldValue['company_created_date'] = $createdDate;
        $lastInsertId = $rm->insert_record($getFieldValue, 'company_details_t');
        if (!empty($lastInsertId)) {
            $result = $rm->companyRegisterSuccessJson($lastInsertId);
            return $result;
        } else {
            $result = $rm->companyRegisterFailJson();
            return $result;
        }
    }
}
예제 #10
0
function likePost()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $USERID = trim($_POST['userId']);
            //Get Request From Device
            $POSTID = trim($_POST['postId']);
            //Get Request From Device
            $getArrayList = array();
            if ($USERID == "" || $POSTID == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $checkLike = $rm->checkAlreadyLiked($USERID, $POSTID);
                if ($checkLike > 0) {
                    $result = $rm->alreadyLiked();
                    return $result;
                }
                date_default_timezone_set('Asia/Calcutta');
                $user_owner_id = $rm->idToValue('user_id_fk', 'news_feeds_t', 'post_id', $POSTID);
                //getting user owner id
                $createdDate = date('Y-m-d H:i:s');
                $getInsertFieldValue['user_id_fk'] = $USERID;
                $getInsertFieldValue['post_id_fk'] = $POSTID;
                $getInsertFieldValue['user_owner_id_fk'] = $user_owner_id;
                $getInsertFieldValue['likeDate_f'] = $createdDate;
                $lastInserted_user_id = $rm->insert_record($getInsertFieldValue, 'likes_t');
                if (!empty($lastInserted_user_id)) {
                    $sqlLikeCountUpdate = "update news_feeds_t set like_count_f= like_count_f+1 where post_id={$POSTID}";
                    mysql_query($sqlLikeCountUpdate, $GLOBALS['link']);
                    $deviceId = $rm->idToValue('device_id_f', 'user_details_t', 'user_id', $user_owner_id);
                    //getting deviceId
                    if ($deviceId != '') {
                        $message = "You have received a like on your post.";
                        $rm->sendPushNotification($deviceId, $message);
                    }
                    $result = $rm->getParticularPost($POSTID, $USERID);
                    return $result;
                } else {
                    $result = $rm->likeUnSuccessful();
                    return $result;
                }
            }
            // end of else first
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
예제 #11
0
function addFriendRequest()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $userId = trim($_POST['userId']);
            $friendId = trim($_POST['friendId']);
            if ($userId == "" || $friendId == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                if ($userId == $friendId) {
                    $result = $rm->friendRequestFailforSameUser();
                    return $result;
                } else {
                    $checkFriend = $rm->checkExistingFriendShip($userId, $friendId);
                    if ($checkFriend > 0) {
                        $result = $rm->friendshipAlreadyExists();
                        return $result;
                    }
                    date_default_timezone_set('Asia/Calcutta');
                    $createdDate = date('Y-m-d H:i:s');
                    $getList = array();
                    //preparing list and inserting values in friends_t table
                    $getInsertFieldValue['friend_one'] = $userId;
                    $getInsertFieldValue['friend_two'] = $friendId;
                    $getInsertFieldValue['created_date_f'] = $createdDate;
                    $lastInserted_friend_id = $rm->insert_record($getInsertFieldValue, 'friends_t');
                    if (!empty($lastInserted_friend_id)) {
                        $deviceId = $rm->idToValue('device_id_f', 'user_details_t', 'user_id', $friendId);
                        //getting deviceId
                        if ($deviceId) {
                            $message = "You have received a friend request in petbesties.";
                            $rm->sendPushNotification($deviceId, $message);
                        }
                        $result = $rm->friendRequestSuccess();
                        return $result;
                    } else {
                        $result = $rm->friendRequestFail();
                        return $result;
                    }
                }
            }
            // end of else first
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function updateRequestStatus()
{
    $userRequestID = trim($_REQUEST['user_request_id']);
    $requestStatus = trim($_REQUEST['status']);
    $lastInserted_payment_id = 0;
    $rm = new Response_Methods();
    if ($userRequestID == "" || $requestStatus == "") {
        $result = $rm->fields_validation();
        return $result;
    } else {
        if ($requestStatus == 'Accepted') {
            $fromBankID = $rm->idToValue('payment_from_bank_id', 'user_requests_t', 'user_request_id', $userRequestID);
            $toBankID = $rm->idToValue('payment_to_bank_id', 'user_requests_t', 'user_request_id', $userRequestID);
            $amount = $rm->idToValue('amount', 'user_requests_t', 'user_request_id', $userRequestID);
            $fromBankBalance = $rm->idToValue('initial_bank_balance', 'bank_details_t', 'bank_id', $fromBankID);
            $toBankBalance = $rm->idToValue('initial_bank_balance', 'bank_details_t', 'bank_id', $toBankID);
            if ($fromBankBalance < $amount) {
                $result = $rm->insufficient_balance();
                return $result;
            } else {
                if ($fromBankID != $toBankID) {
                    $fromBankBalance = $fromBankBalance - $amount;
                    $toBankBalance = $toBankBalance + $amount;
                }
                $updateFromBankBalance['initial_bank_balance'] = $fromBankBalance;
                $affectedRowsFrom = $rm->update_record($updateFromBankBalance, 'bank_details_t', 'bank_id', $fromBankID);
                $updateToBankBalance['initial_bank_balance'] = $toBankBalance;
                $affectedRowsTo = $rm->update_record($updateToBankBalance, 'bank_details_t', 'bank_id', $toBankID);
                $getInsertFieldValue['amount'] = $amount;
                $getInsertFieldValue['payment_from_bank_id'] = $fromBankID;
                $getInsertFieldValue['payment_to_bank_id'] = $toBankID;
                $getInsertFieldValue['user_request_id'] = $userRequestID;
                $lastInserted_payment_id = $rm->insert_record($getInsertFieldValue, 'payment_details_t');
                $login_user_id = $rm->idToValue('login_user_id', 'user_requests_t', 'user_request_id', $userRequestID);
                $gcm_regid = $rm->getUserGCMREGID($login_user_id);
                if ($gcm_regid != "" || $gcm_regid != "NA") {
                    $gcm = new GCM();
                    $registatoin_ids = array($gcm_regid);
                    $msg = "Request " . $requestStatus;
                    $message = array("Response" => $msg);
                    $resultPush = $gcm->send_notification($registatoin_ids, $message);
                }
                $getRegisterFieldValue['status'] = $requestStatus;
                $affectedRows = $rm->update_record($getRegisterFieldValue, 'user_requests_t', 'user_request_id', $userRequestID);
                if ($affectedRows >= 0) {
                    $result = $rm->requestStatusSuccess($lastInserted_payment_id);
                    return $result;
                } else {
                    $result = $rm->requestStatusFail();
                    return $result;
                }
            }
        }
    }
}
function getUserPhotos()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            /* yahan se*/
            $USERID = trim($_POST['userId']);
            //Get Request From Device
            //die('test');
            if (isset($_POST['postId'])) {
                $postId = trim($_POST['postId']);
                if ($postId == "" || $USERID == "") {
                    $result = $rm->fields_validation();
                    return $result;
                } else {
                    $result = $rm->getNextPhotos($USERID, $postId);
                    return $result;
                }
            } else {
                if ($USERID == "") {
                    $result = $rm->fields_validation();
                    return $result;
                } else {
                    $result = $rm->getPhotos($USERID);
                    return $result;
                }
            }
            /* yahan tak*/
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
예제 #14
0
function addComment()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            date_default_timezone_set('Asia/Calcutta');
            $comment = $rm->cleanData($_POST['comment']);
            //Get Request From Device
            $userId = $rm->cleanData($_POST['userId']);
            $postId = $rm->cleanData($_POST['postId']);
            $createdDate = date('Y-m-d H:i:s');
            $getArrayList = array();
            //echo $ENCRYPTEDPWD = md5($PASSWORD);
            //echo $ENCRYPTEDPWD = base64_decode($PASSWORD);
            //$ENCRYPTEDPWD=$PASSWORD;
            if ($comment == "" || $userId == "" || $postId == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $user_owner_id = $rm->idToValue('user_id_fk', 'news_feeds_t', 'post_id', $postId);
                $getInsertFieldValue['comment_text_f'] = $comment;
                $getInsertFieldValue['user_id_fk'] = $userId;
                $getInsertFieldValue['post_id_fk'] = $postId;
                $getInsertFieldValue['comment_Date'] = $createdDate;
                $getInsertFieldValue['user_owner_id_fk'] = $user_owner_id;
                $lastInsertedCommentId = $rm->insert_record($getInsertFieldValue, 'comments_t');
                if ($lastInsertedCommentId) {
                    $deviceId = $rm->idToValue('device_id_f', 'user_details_t', 'user_id', $user_owner_id);
                    //getting deviceId
                    if ($deviceId != '') {
                        $message = "You have received a comment on your post.";
                        $rm->sendPushNotification($deviceId, $message);
                    }
                    $result = $rm->addCommentSuccessJson($postId);
                    return $result;
                } else {
                    $result = $rm->addCommentFailJson();
                    return $result;
                }
            }
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function userForgetPassword()
{
    $rm = new Response_Methods();
    $EMAILID = $_REQUEST['emailId'];
    if ($EMAILID == "") {
        $result = $rm->fields_validation();
        return $result;
    } else {
        $result = $rm->userForgetPassword($EMAILID);
        return $result;
    }
}
function followFriend()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $userId = trim($_POST['userId']);
            $friendId = trim($_POST['friendId']);
            if ($userId == "" || $friendId == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                if ($userId == $friendId) {
                    $result = $rm->friendFollowSame();
                    return $result;
                } else {
                    date_default_timezone_set('Asia/Calcutta');
                    $createdDate = date('Y-m-d H:i:s');
                    $getList = array();
                    $checkFollow = $rm->checkExistingFollow($userId, $friendId);
                    if ($checkFollow > 0) {
                        $result = $rm->followAlreadyExists();
                        return $result;
                    }
                    //preparing list and inserting values in friends_t table
                    $getInsertFieldValue['follower_user_id_fk'] = $userId;
                    $getInsertFieldValue['following_user_id_fk'] = $friendId;
                    $getInsertFieldValue['follow_date_f'] = $createdDate;
                    $lastInserted_follow_id = $rm->insert_record($getInsertFieldValue, 'follow_t');
                    if (!empty($lastInserted_follow_id)) {
                        $result = $rm->makeFollowSuccess($userId, $friendId);
                        return $result;
                    } else {
                        $result = $rm->makeFollowFail();
                        return $result;
                    }
                }
            }
            // end of else first
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
예제 #17
0
function addUserRequest()
{
    //$companyId = $_REQUEST['companyId'];
    $login_user_id = trim($_REQUEST['userID']);
    $fromBankID = trim($_REQUEST['fromBankID']);
    $toBankID = trim($_REQUEST['toBankID']);
    //$paymentDate = trim($_REQUEST['paymentDate']);
    //$paymentReason = trim($_REQUEST['paymentReason']);
    $amount = trim($_REQUEST['amount']);
    $paymentType = trim($_REQUEST['paymentType']);
    $rm = new Response_Methods();
    if ($login_user_id == "" || $fromBankID == "" || $amount == "" || $paymentType == "") {
        $result = $rm->fields_validation();
        return $result;
    } else {
        date_default_timezone_set('Asia/Calcutta');
        $createdDate = date('Y-m-d H:i:s');
        $getList = array();
        //inserting payment details
        $getInsertFieldValue['login_user_id'] = $login_user_id;
        $companyID = $rm->idToValue('company_id', 'user_details_t', 'login_user_id', $login_user_id);
        $getInsertFieldValue['payment_from_bank_id'] = $fromBankID;
        $getInsertFieldValue['payment_to_bank_id'] = $toBankID;
        //$getInsertFieldValue['payment_date']=$paymentDate;
        //$getInsertFieldValue['payment_reason']=$paymentReason;
        $getInsertFieldValue['amount'] = $amount;
        $getInsertFieldValue['payment_type'] = $paymentType;
        $getInsertFieldValue['request_created_date'] = $createdDate;
        $getInsertFieldValue['company_id'] = $companyID;
        $lastInserted_user_request_id = $rm->insert_record($getInsertFieldValue, 'user_requests_t');
        if (!empty($lastInserted_user_request_id)) {
            //Do Transactions by updating bank current balance
            /* Sending Push Notification to Admin */
            $gcm_regid = $rm->getUserGCMREGID(2);
            if ($gcm_regid != "" || $gcm_regid != "NA") {
                $gcm = new GCM();
                $registatoin_ids = array($gcm_regid);
                $msg = "User Payment Request Made. Please Check";
                $message = array("Response" => $msg);
                $resultPush = $gcm->send_notification($registatoin_ids, $message);
            }
            $result = $rm->userRequestSuccessJson($lastInserted_user_request_id);
            return $result;
        } else {
            $result = $rm->userRequestFailJson();
            return $result;
        }
    }
}
function getPaymentReports()
{
    $userID = trim($_REQUEST['userID']);
    $payment_type = trim($_REQUEST['payment_type']);
    $from_date = trim($_REQUEST['from_date']);
    $to_date = trim($_REQUEST['to_date']);
    $rm = new Response_Methods();
    $paymentDetailsArray = array();
    if ($userID == "" || $payment_type == "" || $from_date == "" || $to_date == "") {
        $result = $rm->fields_validation();
        return $result;
    } else {
        $login_user_id = $rm->idToValue('login_user_id', 'user_details_t', 'user_id', $userID);
        echo $rm->getPaymentDetails($login_user_id, $payment_type, $from_date, $to_date);
    }
}
예제 #19
0
function editUserDetails()
{
    //$companyId = $_REQUEST['companyId'];
    $userFname = trim($_REQUEST['userFname']);
    $userLname = trim($_REQUEST['userLname']);
    $age = trim($_REQUEST['age']);
    $sex = trim($_REQUEST['sex']);
    $emailId = trim($_REQUEST['emailId']);
    $address = trim($_REQUEST['address']);
    $userType = trim($_REQUEST['userType']);
    $userID = trim($_REQUEST['userID']);
    /*
    $userImage = trim($_REQUEST['image']);		
    $userImage = trim($_REQUEST['image']['name']);		
    */
    $adminId = $_REQUEST['adminId'];
    $adminId = 'e-002';
    // need to be send in request..for time being using hardcoded values.
    $fullName = $userFname . ' ' . $userLname;
    //$Mobile = $_REQUEST['Phone'];
    $rm = new Response_Methods();
    if ($userFname == "" || $userLname == "" || $age == "" || $sex == "" || $emailId == "" || $address == "" || $userType == "" || $userID == "") {
        $result = $rm->fields_validation();
        return $result;
    } else {
        date_default_timezone_set('Asia/Calcutta');
        $createdDate = date('Y-m-d H:i:s');
        $getRegisterFieldValue['user_fname'] = $userFname;
        $getRegisterFieldValue['user_lname'] = $userLname;
        $getRegisterFieldValue['user_age'] = $age;
        $getRegisterFieldValue['user_sex'] = $sex;
        $getRegisterFieldValue['user_email_id'] = $emailId;
        $getRegisterFieldValue['user_address'] = $address;
        $getRegisterFieldValue['last_modified_date'] = $createdDate;
        //$lastInserted_user_id=$rm->insert_record($getRegisterFieldValue,'user_details_t');
        $affectedRows = $rm->update_record($getRegisterFieldValue, 'user_details_t', 'user_id', $userID);
        if ($affectedRows >= 0) {
            $result = $rm->userModifiedSuccess();
            return $result;
        } else {
            $result = $rm->userModifiedFail();
            return $result;
        }
    }
}
예제 #20
0
function getUserLoginDetails()
{
    $USERNAME = trim($_REQUEST['userName']);
    //Get Request From Device
    $PASSWORD = trim($_REQUEST['passWord']);
    $DEVICEID = $_REQUEST['DeviceId'];
    $rm = new Response_Methods();
    $getArrayList = array();
    //echo $ENCRYPTEDPWD = md5($PASSWORD);
    //echo $ENCRYPTEDPWD = base64_decode($PASSWORD);
    //$ENCRYPTEDPWD=$PASSWORD;
    if ($USERNAME == "" || $PASSWORD == "") {
        $result = $rm->fields_validation();
        return $result;
    } else {
        $result = $rm->login_success($USERNAME, $PASSWORD, $DEVICEID);
        return $result;
    }
}
function validateEmaiUser()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $emailId = $rm->cleanData($_POST['emailId']);
            $userName = $rm->cleanData($_POST['userName']);
            //die();
            $getArrayList = array();
            if ($emailId == "" || $userName == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $checkUser = $rm->checkUserValidation($userName, 'user_name_f');
                $checkEmail = $rm->checkUserValidation($emailId, 'email_f');
                if ($checkUser == 0) {
                    $result = $rm->userExistJson();
                    return $result;
                }
                if ($checkEmail == 0) {
                    $result = $rm->emailExistJson();
                    return $result;
                }
                if ($checkUser == 1 && $checkEmail == 1) {
                    $result = $rm->userEmailAvailable();
                    return $result;
                }
            }
            // end of else first
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
예제 #22
0
function getUserDetails()
{
    $companyID = trim($_REQUEST['companyID']);
    $rm = new Response_Methods();
    if ($companyID == "") {
        $result = $rm->fields_validation();
        return $result;
    }
    $userDetailsArray = array();
    $dataResultSet = $rm->getSpecificDetails($companyID, 'user_details_t', 'company_id');
    //$dataResultSet=$rm->getAllDetails('user_details_t');
    if (mysql_num_rows($dataResultSet) > 0) {
        while ($row = mysql_fetch_array($dataResultSet)) {
            /*					
            $getUserFields['userID']=$row['user_id'];			
            if($row['user_image']!='')					
            $userPic=$row['user_image'];
            else
            $userPic='noImage.jpg';					
            $getUserFields['image']="http://phbjharkhand.in/bookOfAccounts/userPics/$userPic";
            $getUserFields['login_user_id']=$row['login_user_id'];
            $cdate=$row['user_created_date'];
            $getUserFields['createdDate']=date('Y/m/d', strtotime($cdate));
            */
            $getUserFields['userID'] = $row['user_id'];
            $getUserFields['userFname'] = $row['user_fname'];
            $getUserFields['userLname'] = $row['user_lname'];
            $getUserFields['age'] = $row['user_age'];
            $getUserFields['sex'] = $row['user_sex'];
            $getUserFields['emailId'] = $row['user_email_id'];
            $userType = $rm->getUserType($row['login_user_id']);
            $getUserFields['userType'] = $userType;
            $getUserFields['address'] = $row['user_address'];
            array_push($userDetailsArray, $getUserFields);
        }
        $result = $rm->get_anything_details_success($userDetailsArray, 'User');
        return $result;
    } else {
        $result = $rm->get_anything_details_fail('User');
        return $result;
    }
}
function denyFriendRequest()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $userId = trim($_POST['userId']);
            $friendId = trim($_POST['friendId']);
            if ($userId == "" || $friendId == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                if ($userId == $friendId) {
                    $result = $rm->friendRequestFailforSameUser();
                    return $result;
                } else {
                    $sqlDenyFriend = "delete from friends_t where status='0' and (friend_one={$userId} OR friend_two={$userId})AND(friend_one={$friendId} OR friend_two={$friendId})";
                    mysql_query($sqlDenyFriend, $GLOBALS['link']);
                    $affectedRows = mysql_affected_rows();
                    if ($affectedRows > 0) {
                        $result = $rm->friendDeniedSuccess();
                        return $result;
                    } else {
                        $result = $rm->friendDeniedFailed();
                        return $result;
                    }
                }
            }
            // end of else first
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
예제 #24
0
function userDeActivate()
{
    $user_id = $_REQUEST['userID'];
    $rm = new Response_Methods();
    if ($user_id == "") {
        $result = $rm->fields_validation();
        return $result;
    } else {
        $getUpdateFieldValue['user_status'] = 0;
        $affectedRows = $rm->user_deactivate($user_id);
        //$affectedRows=$rm->update_record($getUpdateFieldValue,'login_t','login_user_id',$login_id);
        if ($affectedRows >= 0) {
            $result = $rm->userDeactivateSuccess();
            return $result;
        } else {
            $result = $rm->userDeactivateFail();
            return $result;
        }
    }
}
function updateComment()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $comment = $rm->cleanData($_POST['comment']);
            //Get Request From Device
            $commentId = $rm->cleanData($_POST['commentId']);
            $getArrayList = array();
            //echo $ENCRYPTEDPWD = md5($PASSWORD);
            //echo $ENCRYPTEDPWD = base64_decode($PASSWORD);
            //$ENCRYPTEDPWD=$PASSWORD;
            if ($comment == "" || $commentId == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $getInsertFieldValue['comment_text_f'] = $comment;
                $affectedRowsUpdateComment = $rm->update_record($getInsertFieldValue, 'comments_t', 'comment_id', $commentId);
                if ($affectedRowsUpdateComment > 0) {
                    $result = $rm->updateCommentSuccessJson($commentId);
                    return $result;
                } else {
                    $result = $rm->updateCommentFailJson();
                    return $result;
                }
            }
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function confirmFriendRequest()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $userId = trim($_POST['userId']);
            $friendId = trim($_POST['friendId']);
            if ($userId == "" || $friendId == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                if ($userId == $friendId) {
                    $result = $rm->friendRequestFailforSameUser();
                    return $result;
                } else {
                    $sqlConfirmFriend = "UPDATE friends_t SET status='1' WHERE (friend_one={$userId} OR friend_two={$userId})AND(friend_one={$friendId} OR friend_two={$friendId})";
                    if (mysql_query($sqlConfirmFriend, $GLOBALS['link'])) {
                        $result = $rm->friendRequestConfirmed();
                        return $result;
                    } else {
                        $result = $rm->friendRequestFailed();
                        return $result;
                    }
                }
            }
            // end of else first
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function deleteComment()
{
    //die('test');
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $commentId = $rm->cleanData($_POST['commentId']);
            $postId = $rm->cleanData($_POST['postId']);
            $getArrayList = array();
            //echo $ENCRYPTEDPWD = md5($PASSWORD);
            //echo $ENCRYPTEDPWD = base64_decode($PASSWORD);
            //$ENCRYPTEDPWD=$PASSWORD;
            if ($commentId == "" || $postId == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $affectedRowsDeleteComment = $rm->deleteComment($commentId);
                if ($affectedRowsDeleteComment > 0) {
                    $result = $rm->deleteCommentSuccessJson($postId);
                    return $result;
                } else {
                    $result = $rm->deleteCommentFailJson();
                    return $result;
                }
            }
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function changeLikeStatus()
{
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $postId = trim($_POST['postId']);
            //Get Request From Device
            $getArrayList = array();
            if ($postId == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $getUpdateLike['like_status_f'] = "0";
                $updateResult = $rm->update_record($getUpdateLike, 'likes_t', 'post_id_fk', $postId);
                if ($updateResult) {
                    $result = $rm->changeLikeStatusSuccess();
                    return $result;
                } else {
                    $result = $rm->changeLikeStatusFail();
                    return $result;
                }
            }
            // end of else first
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
function forgetPassword()
{
    //die('test');
    $rm = new Response_Methods();
    if ($_SERVER['REQUEST_METHOD'] == "GET") {
        $result = $rm->inValidServerMethod();
        return $result;
    }
    //Check request url is https or not
    if (!empty($_SERVER["HTTPS"])) {
        if ($_SERVER["HTTPS"] !== "off") {
            $EMAILID = $rm->cleanData(trim($_POST['emailId']));
            if ($EMAILID == "") {
                $result = $rm->fields_validation();
                return $result;
            } else {
                $checkEmail = $rm->checkUNEmail($EMAILID);
                if ($checkEmail['status'] == false) {
                    $result = $rm->emailNotAvailable();
                    return $result;
                } else {
                    //print_r($checkEmail);
                    //die();
                    $result = $rm->sendPasswordEmail($checkEmail['user_id']);
                    return $result;
                }
            }
        } else {
            $result = $rm->ssl_error();
            return $result;
        }
    } else {
        $result = $rm->ssl_error();
        return $result;
    }
}
예제 #30
0
function addBankDetails()
{
    echo 'test';
    //$companyId = $_REQUEST['companyId'];
    $companyID = trim($_REQUEST['companyID']);
    $custName = trim($_REQUEST['custName']);
    $accNumber = trim($_REQUEST['accNumber']);
    $bankName = trim($_REQUEST['bankName']);
    /*
    $bankAddress = trim($_REQUEST['bankAddress']);		
    if(isset($_REQUEST['micr']))
    $micr = trim($_REQUEST['micr']);
    else
    $micr = "NA";
    */
    $ifsc = trim($_REQUEST['ifsc']);
    $accType = trim($_REQUEST['accType']);
    $initialBalance = trim($_REQUEST['initialBalance']);
    //$Mobile = $_REQUEST['Phone'];
    $rm = new Response_Methods();
    if ($companyID == "" || $custName == "" || $accNumber == "" || $bankName == "" || $ifsc == "" || $accType == "" || $initialBalance == "") {
        //$sendMail=$rm->sendMailPasswordDetails($adminEmail,'test14521','sdfwd45487','Asif Anwar');
        $result = $rm->fields_validation();
        return $result;
    } else {
        $status = 0;
        date_default_timezone_set('Asia/Calcutta');
        $createdDate = date('Y-m-d H:i:s');
        /*
        			$result=$rm->getListDetails('user_id','user_fname','user_details_t');
        			if(mysql_num_rows($result)>0)
        				{
        					while($row=mysql_fetch_array($result))
        					{
        						echo $row['0'].' '.$row['1'];
        						echo '<br/>';
        					}
        				}
        
        				
        			//sample codes check for class Functions
        			
        			$result=$rm->getSpecificDetails(6,'user_details_t','user_id');	
        			if(mysql_num_rows($result)>0)
        				{
        					while($row=mysql_fetch_array($result))
        					{
        						echo $row['0'].' '.$row['1'];
        						echo '<br/>';
        					}
        				}
        */
        $getList = array();
        $getInsertFieldValue['company_id'] = $companyID;
        $getInsertFieldValue['account_holder_name'] = $custName;
        $getInsertFieldValue['account_number'] = $accNumber;
        $getInsertFieldValue['bank_name'] = $bankName;
        //$getInsertFieldValue['bank_address']=$bankAddress;
        $getInsertFieldValue['bank_ifsc'] = $ifsc;
        //$getInsertFieldValue['bank_micr']=$micr;
        $getInsertFieldValue['account_type'] = $accType;
        $getInsertFieldValue['initial_bank_balance'] = $initialBalance;
        $getInsertFieldValue['bank_created_date'] = $createdDate;
        $lastInserted_bank_id = $rm->insert_record($getInsertFieldValue, 'bank_details_t');
        if (!empty($lastInserted_bank_id)) {
            $result = $rm->bankRegisterSuccessJson($lastInserted_bank_id);
            return $result;
        } else {
            $result = $rm->bankRegisterFailJson();
            return $result;
        }
    }
}