Example #1
0
function delete()
{
    $offerId = $_REQUEST['id'];
    $offers = new Offers();
    $offers->setId($offerId);
    $data = $offers->getById();
    $offers->extractor($data);
    $hotelID = $offers->hotelId();
    if ($offers->delete()) {
        $path = DOC_ROOT . 'uploads/special_offers/' . $offers->image();
        if (file_exists($path)) {
            unlink($path);
        }
        $specialOffers = new Offers();
        $specialOffers->setHotelId($hotelID);
        $specialOffers_rows = $specialOffers->getByHotelId();
        if (count($specialOffers_rows) == 0) {
            $complete = new ProfileCompletion();
            $complete->setHotelStepHotelsId($hotelID);
            $complete->setHotelStep1(0);
            $complete->updateProfileCompletionStepByHotel('9');
            Common::jsonSuccess("Offer Deleted Successfully", "setOfferStep");
        } else {
            Common::jsonSuccess("Offer Deleted Successfully");
        }
    } else {
        Common::jsonError("Error");
    }
}
Example #2
0
function addHotelFirstTime()
{
    $hotel = new Hotels();
    $members = new Members();
    $mailClass = new mailClass();
    $members->setMemberId(Sessions::getMemberId());
    $members->extractor($members->getMemberFromId());
    $hotel->setValues($_REQUEST);
    $hotel->setHotelSeoUrl($_REQUEST['seo']);
    $hotel_seo = $hotel->getHotelIdFromSeoName();
    if ($hotel_seo == 0) {
        $hotel_id = $hotel->addHotelFirstTime();
        if ($hotel_id) {
            //INFO: Log
            //$temp_hotel = $_REQUEST;
            //$TransactionLog=new TransactionLog($hotel_id,Libs::getKey('hotel_sections','Property Details'),'Insert',Sessions::getMemberId(),'hotels',$temp_hotel,'');
            //$TransactionLog->log();
            //$temp_hotel=null;
            //INFO: Log//
            $profilecomplete = new ProfileCompletion();
            $profilecomplete->setHotelStepHotelsId($hotel_id);
            $profilecomplete->setHotelStep1(1);
            $profilecomplete->newProfileCompletion();
            $mailClass->HotelRegistration($members->memberTitle(), $members->memberFirstName(), $members->memberLastName(), $members->memberEmail(), $_REQUEST['hotel_name'], $_REQUEST['hotel_email'], $_REQUEST['hotel_email']);
            $hotel = null;
        }
        echo $hotel_id;
    } else {
        echo "Failed";
    }
}
Example #3
0
function addHotelFirstTime()
{
    $hotel = new Hotels();
    $hotel->setValues($_REQUEST);
    $hotel->setHotelSeoUrl($_REQUEST['seo']);
    $hotel_id = $hotel->addHotelFirstTime();
    if ($hotel_id) {
        $profilecomplete = new ProfileCompletion();
        $profilecomplete->setHotelStepHotelsId($hotel_id);
        $profilecomplete->setHotelStep1(1);
        $profilecomplete->newProfileCompletion();
    }
    echo $hotel_id;
}