コード例 #1
0
ファイル: offers-controller.php プロジェクト: jcodesdotme/pp
function insert()
{
    //print_r($_REQUEST);
    $offers = new Offers();
    $_REQUEST['image'] = Sessions::getUploadedOfferImage();
    $offers->setValues($_REQUEST);
    Debug::log($offers->bedType());
    $offers->setFromDate(date('Y-m-d', strtotime($_REQUEST['from_date'])));
    $offers->setToDate(date('Y-m-d', strtotime($_REQUEST['to_date'])));
    if ($offers->insert()) {
        //Sessions::setTourBannerId(mysql_insert_id());
        $complete = new ProfileCompletion();
        $complete->setHotelStepId($_REQUEST['hotel_step_id']);
        $complete->setHotelStep1(1);
        $complete->updateProfileCompletionStep('9');
        Common::jsonSuccess("Offer Added Successfully!");
        Sessions::setUploadedDestinationLogo('');
    } else {
        Common::jsonError("Error");
    }
}