Example #1
0
 /**
  * {@inheritdoc}
  */
 public function create(Listing $listing)
 {
     $page = $listing->page();
     $pages = $listing->pagesCount();
     $links = ['prev' => null, 'next' => null, 'current' => $listing->page(), 'pages' => []];
     if (!$pages) {
         return $links;
     }
     if ($page > 1) {
         $links['prev'] = $listing->getPageUrl($page - 1);
     }
     if ($page < $pages) {
         $links['next'] = $listing->getPageUrl($page + 1);
     }
     // first and last always
     $links['pages'][1] = $listing->getPageUrl(1);
     $from = max($page - $this->back - 1, 2);
     $to = min($page + $this->forward + 1, $pages - 1);
     for ($i = $from; $i <= $to; $i++) {
         if ($i != 2 && $i != $pages - 1 && ($i == $page - $this->back - 1 || $i == $page + $this->forward + 1)) {
             // placeholders
             $links['pages'][$i] = null;
         } else {
             $links['pages'][$i] = $listing->getPageUrl($i);
         }
     }
     $links['pages'][$pages] = $listing->getPageUrl($pages);
     return $links;
 }
Example #2
0
 /**
  * Parse input into nodes
  *
  * @param  net.daringfireball.markdown.Input $lines
  * @return net.daringfireball.markdown.Node
  */
 public function parse($lines)
 {
     $empty = false;
     $target = null;
     $result = new Listing($this->type);
     while ($lines->hasMoreLines()) {
         $line = $lines->nextLine();
         // An empty line makes the list use paragraphs, except if it's the last line.
         if (0 === $line->length()) {
             $empty = true;
             continue;
         }
         // Indented elements form additional paragpraphs inside list items. If
         // the line doesn't start with a list bullet, this means the list is at
         // its end.
         if (preg_match('/^(\\s+)?([+*-]+|[0-9]+\\.) /', $line, $m) && !preg_match('/^(\\* ?){3,}$/', $line)) {
             $empty && ($result->paragraphs = true);
             $empty = false;
             // Check whether we need to indent / dedent the list level, or whether
             // the list item belongs to this list
             $level = strlen($m[1]) / 2;
             if ($level > $this->level) {
                 $lines->resetLine($line);
                 $target = $target ?: $result->add(new ListItem($result))->add(new Paragraph());
                 $target->add($this->enter(new self($this->type, $level))->parse($lines));
             } else {
                 if ($level < $this->level) {
                     $lines->resetLine($line);
                     break;
                 } else {
                     $target = $result->add(new ListItem($result))->add(new Paragraph());
                     $line->forward(strlen($m[0]));
                     $this->tokenize($line, $target);
                 }
             }
         } else {
             if ('  ' === substr($line, 0, 2)) {
                 // Add paragraph to existing list item
                 $paragraph = $result->last()->add(new Paragraph());
                 $line->forward(2);
                 $this->tokenize($line, $paragraph);
             } else {
                 $lines->resetLine($line);
                 break;
             }
         }
     }
     return $result;
 }
Example #3
0
 public function action_delete($id)
 {
     if (Session::has('id')) {
         $account = Account::find(Session::get('id'));
         $location = Location::find($id);
         $owner = Account::find($location->account_id);
         if ($account->id == $owner->id) {
             $listings = Listing::where_location_id($location->id);
             // foreach($listings as $listing)
             // {
             // 	$images = Image::where_listing_id($listing->id);
             // 	foreach($images as $image)
             // 	{
             // 		$image->delete();
             // 	}
             // 	$listing->delete();
             // }
             $location->delete();
             return Redirect::to('/account/myLocations/');
         } else {
             return Redirect::to('/');
         }
     } else {
         return Redirect::to('/');
     }
 }
Example #4
0
 public function run()
 {
     $box = Pages::getPageById(PAGE_PROPERTY_BOX);
     $model = new ProEnquiryProperty();
     $mListing = Listing::model()->findByPk($this->property_id);
     //        echo $mListing->property_name_or_address;die;
     Listing::ReplaceContentCmsPage($box, $mListing);
     $model->country_id = ActiveRecord::getDefaultAreaCode();
     if (isset(Yii::app()->user->id)) {
         $model->name = Yii::app()->user->title . ' ' . Yii::app()->user->first_name . ' ' . Yii::app()->user->last_name;
         $model->email = Yii::app()->user->email;
         if (Yii::app()->user->role_id != ROLE_REGISTER_MEMBER) {
             $model->email = Yii::app()->user->email_not_login;
         }
         $model->phone = Yii::app()->user->phone;
         $model->country_id = Yii::app()->user->country;
     }
     $this->dir = Yii::getPathOfAlias('application.components.views') . '/_agent_detail.php';
     $model->description = trim(strip_tags($box->content));
     if ($this->position == "bottom") {
         $this->render("enquiry_bottom", array('model' => $model, 'box' => $box, 'property_id' => $this->property_id, 'agent_id' => $this->agent_id, 'dir' => $this->dir, 'position' => 'bottom'));
     } else {
         $this->render("enquiry_right", array('model' => $model, 'box' => $box, 'property_id' => $this->property_id, 'agent_id' => $this->agent_id, 'dir' => $this->dir, 'position' => 'right'));
     }
 }
 /**
  * Display the specified resource.
  *
  * @param  string $location
  * @return Response
  */
 public function show()
 {
     $location = Input::get('location');
     $type = strtolower(Input::get('type'));
     $wildcardLocation = "%" . $location . "%";
     if (Input::has('type')) {
         $types = array('meeting-room', 'coworking', 'desk');
         if (!in_array($type, $types, true)) {
             return Redirect::to('/')->with('flash_message_404', "Sorry, we don't have that type of space so we brought you back home!");
         }
         $listings = Listing::with('thumbnail')->where('isPublic', '=', 1, "and")->where('space_type', '=', $type)->where('city', 'LIKE', $wildcardLocation)->orWhere('state', 'LIKE', $wildcardLocation)->orWhere('suburb', 'LIKE', $wildcardLocation)->orWhere('country', 'LIKE', $wildcardLocation)->orWhere('postcode', 'LIKE', $wildcardLocation)->get();
     } else {
         $listings = Listing::with('thumbnail')->where('isPublic', '=', 1, "and")->where('space_type', '=', $type)->where('city', 'LIKE', $wildcardLocation)->orWhere('state', 'LIKE', $wildcardLocation)->orWhere('suburb', 'LIKE', $wildcardLocation)->orWhere('country', 'LIKE', $wildcardLocation)->orWhere('postcode', 'LIKE', $wildcardLocation)->get();
     }
     $colNum = Listing::where('city', 'LIKE', $wildcardLocation)->orWhere('state', 'LIKE', $wildcardLocation)->orWhere('suburb', 'LIKE', $wildcardLocation)->orWhere('country', 'LIKE', $wildcardLocation)->where('isPublic', '=', '1')->count();
     switch ($colNum) {
         case 1:
             $colNum = 12;
             break;
         case 2:
             $colNum = 6;
             break;
         case 3:
             $colNum = 3;
             break;
     }
     $title = ucwords("Search: " . $type . " spaces in " . $location);
     return View::make('search.results')->with('listings', $listings)->with('title', $title)->with('colNum', $colNum);
 }
Example #6
0
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Listing::create([]);
     }
 }
Example #7
0
 public function getListingCount()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('user_id', $this->id);
     $criteria->compare('status', STATUS_ACTIVE);
     $criteria->compare('status_listing', STATUS_LISTING_ACTIVE);
     return Listing::model()->count($criteria);
 }
 /**
  * Revert the changes to the database.
  *
  * @return void
  */
 public function down()
 {
     //
     $listings = Listing::all();
     foreach ($listings as $listing) {
         $listing->delete();
     }
 }
Example #9
0
 function sort_link($link_order, $text, $order, $cur_page, $direction, $default_direction)
 {
     /*
      * 
      *<th><a class="sorting" href='<?= $base_url ?><?= $cur_page ?>/name/<?= Listing::reverse_direction($order == 'name' ? $direction : $default_direction) ?>'>Name</a></th>
      */
     return anchor($base_url . $cur_page . "/" . $order . "/" . Listing::reverse_direction($order == $link_order ? $direction : $default_direction), $text);
 }
 public function run()
 {
     $listingInfo = Listing::model()->findByPk($this->listing_id);
     if ($listingInfo) {
         $this->listing_title = $listingInfo->property_name_or_address;
     }
     $model = $this->searchReleatedListing();
     $this->render("listing_releated_page_thank_you/index", array('model' => $model));
 }
Example #11
0
 public function action_index()
 {
     $users_files = Listing::get_list();
     $users_files = array_diff($users_files, array('.', '..'));
     if (isset($_SESSION['user'])) {
         include_once dir . '/view/list.php';
     } else {
         header('Location: /');
     }
     return true;
 }
Example #12
0
 public function actionSearch($searchtext = '')
 {
     if ($searchtext == '') {
         $this->actionIndex(0);
         return;
     }
     $categories = array();
     $listings = Listing::model()->searchFrontendListings($searchtext);
     ViewsTrack::addCategoryView(0);
     $this->render('index', array('categories' => $categories, 'listings' => $listings));
 }
Example #13
0
 /**
  * @Author: ANH DUNG Aug 05, 2014
  * @Todo: CompanyEditContact at grid
  * @Param: $id list id 1,2,3 ...
  */
 public function actionCompanyListingMoveto($id)
 {
     try {
         $id = $this->FormatListId($id);
         $company_listing_type = $_GET['company_listing_type'];
         Listing::ChangeTypeByListId($id, $company_listing_type);
     } catch (Exception $ex) {
         echo $exc->getMessage();
         die;
     }
 }
 public function __construct(\SimpleXMLElement $xml)
 {
     parent::__construct($xml);
     $this->setIsRental(true);
     if (!in_array($this->getStatus(), $this->inactive)) {
         $this->setPrice((string) $xml->rent);
         $this->setCategory((string) $xml->category->attributes()->name);
         $this->setPaymentFreq((string) $xml->rent->attributes()->period);
         $this->setDisplayPrice((string) $xml->rent->attributes()->display);
         $this->setAvailable((string) $xml->dateAvailable);
     }
 }
 /**
  * Make changes to the database.
  *
  * @return void
  */
 public function up()
 {
     //
     $listings = Listing::all();
     foreach ($listings as $l) {
         for ($i = 0; $i < 5; $i++) {
             $image = new Image();
             $image->description = "PIC DESCRIPTIOIN";
             $image->listing_id = $l->id;
             $image->save();
         }
     }
 }
Example #16
0
 public function action_delete()
 {
     if (Session::has('id') && Auth::check() && Input::has('file') && Input::has('listing_id')) {
         $account = Account::find(Session::get('id'));
         $listing = Listing::find(Input::get('listing_id'));
         $location = Location::find($listing->location_id);
         if ($account->id == $location->account_id) {
             unlink(Input::get('file'));
         } else {
             die("Image does not belogn to user");
         }
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store($id)
 {
     $listing = Listing::where('isPublic', '=', 1)->where('id', '=', $id)->first();
     if (!$listing) {
         throw new \Symfony\Component\Routing\Exception\ResourceNotFoundException();
     }
     $input = Input::all();
     //return print_r($input,true);
     $yesterday = \Carbon\Carbon::now('Australia/Sydney');
     $yesterday = $yesterday->format('Y-m-d H:i:s');
     // return $yesterday;
     $rules = array('comments' => array('required', 'min:3'), 'user_phone' => array('required', 'min:9', 'max:30'), 'request_start_datetime' => array('required', 'date', 'dateformat: Y-m-d H:i:s', 'before: ' . $input['request_end_datetime']), 'request_end_datetime' => array('required', 'date', 'dateformat: Y-m-d H:i:s', 'after: ' . $yesterday));
     $validator = Validator::make($input, $rules);
     if ($validator->fails()) {
         return Redirect::back()->withInput($input)->withErrors($validator);
     }
     $comments = $this->sanitizeStringAndParseMarkdown($input['comments']);
     $authuser = Auth::user();
     $name = $authuser->name;
     $bookings = new Booking();
     $bookings->user_id = $authuser->id;
     $bookings->user_name = $name;
     $bookings->listing_id = $id;
     $bookings->user_phone = $input['user_phone'];
     $bookings->request_start_datetime = $input['request_start_datetime'];
     $bookings->request_end_datetime = $input['request_end_datetime'];
     $bookings->status = "Booking request submitted. Awaiting Open Source Collaborative Consumption Marketplace review.";
     $bookings->user_comments = $comments;
     $bookings->space_owner_id = $listing->owner_id;
     $address = $listing->address1 . ", " . $listing->suburb . ", " . $listing->city . " " . $listing->country;
     $data = $input;
     $data['address'] = $address;
     $data['title'] = $listing->title;
     $data['id'] = $id;
     $data['type'] = $listing->space_type;
     $data['user_name'] = $name;
     $data['status'] = $bookings->status;
     /* TODO: Make it email the user and space owner */
     Mail::send("booking.mail.newbookingfounders", $data, function ($message) {
         $message->to('*****@*****.**')->subject('New booking on Open Source Collaborative Consumption Marketplace');
     });
     $email = Auth::user()->email;
     Mail::send("booking.mail.newbookinguser", $data, function ($message) use($email) {
         $message->to($email)->subject('Your new booking on Open Source Collaborative Consumption Marketplace!');
     });
     $bookings->save();
     return Redirect::to('dashboard')->with('flash_message_good', "Your booking has been sent. We'll be in touch soon with confirmation or questions!");
 }
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate($id)
 {
     if (!empty($id) && !Yii::app()->user->isGuest) {
         $user_email = Yii::app()->user->name;
         $userModel = User::model()->findByAttributes(array('user_email' => $user_email));
         $listingId = $id;
         $listingModel = Listing::model()->findByPk($listingId);
         $model = new Booking();
         $model->booking_listing_id = $listingModel->listing_id;
         $model->booking_user_id = $userModel->user_id;
         $model->booking_amount = $listingModel->listing_price;
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->booking_id));
         }
     } else {
         echo "Booking failed";
     }
 }
Example #19
0
     $model = ListingCompany::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 public function actionFieldClick($id, $field)
 {
     $model = Listing::model()->findByPk($id);
     if (!$model || !in_array($field, array('owner_contact'))) {
         throw new CHttpException(403, 'Permission denied.');
     }
     $lc = ListingClick::model()->findByAttributes(array('listing_id' => $id, 'user_id' => Yii::app()->user->id, 'field' => $field));
     if (!$lc) {
         $lc = new ListingClick();
         $lc->listing_id = $id;
         $lc->user_id = Yii::app()->user->id;
         $lc->field = $field;
         $lc->save();
Example #20
0
 public function action_index()
 {
     if (Auth::check()) {
         if (Session::has('id')) {
             if (Session::get('admin') == 1) {
                 $listings_count = Listing::count();
                 $successes = 0;
                 $money = 0;
                 $survey_results = Surveyresult::all();
                 foreach ($survey_results as $result) {
                     $money += $result->monetary_value;
                     $successes += $result->exchange_success;
                 }
                 $view = View::make('statistics.index')->with('title', 'Current Stats')->with('listings_count', $listings_count)->with('successes', $successes)->with('money', $money);
                 return $view;
             }
         }
     }
     return Redirect::to('/');
 }
Example #21
0
 public function actionSearch()
 {
     $this->checkRequest();
     $q = $this->q;
     $this->checkRequiredParams($q, array('token', 'user_id', 'status', 'type', 'page'));
     $this->checkToken();
     //same as login session
     $criteria = new CDbCriteria();
     $criteria->compare('user_id', $q->user_id);
     $criteria->compare('status_listing', $q->status);
     $criteria->compare('listing_type', $q->type);
     $criteria->limit = 20;
     $criteria->order = 'property_name_or_address ASC';
     $models = Listing::model()->findAll($criteria);
     $items = array();
     foreach ($models as $model) {
         $items[] = array('property_name_or_address' => $model->property_name_or_address, 'tenure' => Listing::getViewDetailTenure($model));
     }
     $result = ApiModule::$defaultSuccessResponse;
     $result['list'] = $items;
     $result['message'] = Yii::t('systemmsg', 'Query success');
     //always need
     ApiModule::sendResponse($result);
 }
Example #22
0
		<div class="col-sm-8">
			<?php 
echo $form->dropDownList($model, 'property_type', $types, array('empty' => 'Please Select', 'class' => 'form-control'));
?>
			<?php 
echo $form->error($model, 'property_type');
?>
		</div>
	</div>
	<div class="form-group">
		<?php 
echo $form->labelEx($model, 'room_type', array('class' => 'control-label col-sm-4'));
?>
		<div class="col-sm-8">
			<?php 
echo $form->dropDownList($model, 'room_type', Listing::getListOptionsBedroom(), array('empty' => 'Please Select', 'class' => 'form-control'));
?>
			<?php 
echo $form->error($model, 'room_type');
?>
		</div>
	</div>
	<div class="form-group">
		<?php 
echo $form->labelEx($model, 'room_size', array('class' => 'control-label col-sm-4'));
?>
		<div class="col-sm-8">
			<?php 
echo $form->textField($model, 'room_size', array('class' => 'form-control number_only', 'placeholder' => 'enter text...', 'style' => 'width:92px;display: inline-block;'));
?>
			<?php 
Example #23
0
	<link href="../main.css" rel="stylesheet">
</head>
<body>
	<h1>ALTITUDE DEBUG PAGE</h1>
	<section  style="max-width: 50%;">
		<h2>Listing</h2>
		<?php 
$table = "users";
?>
		<h4>Table "<?php 
echo $table;
?>
"</h4>
		<pre><?php 
try {
    $l = new Listing();
    $liste = $l->getList($table);
    $liste = $l->reindexList('id');
    //			Listing::array_reindex_by($liste, 'ref');
    print_r($liste);
    var_dump(Infos::colExists($table, 'name'));
} catch (Exception $e) {
    echo '<span class="red"><b>' . $e->getMessage() . '</b></span><br />';
    echo $e->getTraceAsString();
}
?>
</pre>
	</section>
	<section style="max-width: 50%;">
		<h2>Infos</h2>
		<h4>Table "users", action : update entry</h4>
Example #24
0
        echo strcmp($arrow_icon, 'up_sort') === 0 ? 'block' : 'none';
        ?>
" href="<?php 
        echo $base_url . $cur_page . '/' . $field . '/';
        echo Listing::reverse_direction($direction);
        ?>
">
							<i class="up_sort m_top_15"></i>
						</a>

						<a style="display:<?php 
        echo strcmp($arrow_icon, 'down_sort') === 0 ? 'block' : 'none';
        ?>
" href="<?php 
        echo $base_url . $cur_page . '/' . $field . '/';
        echo Listing::reverse_direction($direction);
        ?>
">
							<i class="down_sort m_top_15"></i>
						</a>
						
					</div>  
				<?php 
    } else {
        ?>
					
				<?php 
    }
    ?>
				</th>
				<?php 
Example #25
0
 public function order($app)
 {
     if (!$app->user->isLoggedIn()) {
         $app->output->json(array('error' => true, 'message' => 'You must be logged in to order items.'), 400);
     }
     $headers = getallheaders();
     if (empty($headers['X-CSRFToken']) || strcmp($headers['X-CSRFToken'], $app->user->session->csrf_token) != 0) {
         unset($_SESSION['order']);
         $app->logger->log('Invalid CSRFToken on Checkout', 'ERROR', array('provided_token' => $headers['X-CSRFToken'], 'real_token' => $app->user->session->csrf_token), 'user');
         $app->output->json(array('error' => true, 'message' => 'It looks like a user was trying to make a request on your behalf. Ensure that your system is secure and relogin.'), 400);
     }
     $order = null;
     $success = false;
     if (isset($_SESSION['order'])) {
         /* 
          * Edge case: user has reserved an order already
          */
         try {
             $order = Order::find($_SESSION['order']);
             if ($order->status == Order::STATUS_CANCELLED) {
                 throw new ActiveRecord\RecordNotFound();
             }
             $success = true;
         } catch (ActiveRecord\RecordNotFound $e) {
             unset($_SESSION['order']);
             $app->output->json(array('error' => true), 400);
         }
     } else {
         /* 
          * Typical scenario: generate an order from cart listings
          */
         $cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : array('listings' => array(), 'bulk' => array());
         if (empty($cart['bulk']) && empty($cart['listings'])) {
             $app->logger->log('Checkout with Empty Cart', 'ERROR', array(), 'user');
             $app->output->json(array('error' => true, 'message' => 'Your cart is empty.'), 400);
         }
         $user_id = $app->user->id;
         $cart = $_SESSION['cart'];
         $listings = array();
         // Grab unique listings first
         if (!empty($cart['listings'])) {
             $listings = Listing::find('all', array('conditions' => array('id IN (?)', array_map(function ($item) {
                 return $item['listing'];
             }, $cart['listings'])), 'include' => 'description'));
         }
         // Add in bulk purchases
         foreach ($cart['bulk'] as $description_id => $item) {
             if ($item['qty'] < 1) {
                 $app->logger->log('Invalid Quantity error on checkout', 'ERROR', array(), 'user');
                 $app->output->json(array('error' => true, 'message' => 'You have provided an invalid quantity for your item(s).'), 400);
             }
             $bulk_listings = Listing::find('all', array('conditions' => array('stage = ? AND description_id = ?', Listing::STAGE_LIST, $description_id), 'order' => 'price ASC', 'limit' => $item['qty']));
             if (count($bulk_listings) != $item['qty']) {
                 throw new Order_ReservationError();
             } else {
                 $listings = array_merge($listings, $bulk_listings);
             }
         }
         // Reserving Listings for this user
         $order = null;
         $success = Listing::transaction(function () use($listings, $user_id, &$order) {
             $total = 0.0;
             foreach ($listings as $idx => &$listing) {
                 if ($listing->stage != Listing::STAGE_LIST) {
                     return false;
                 }
                 $listing->setStage('order');
                 // If this is a parent listing, replace choose new parent for children
                 $children = $listing->children;
                 if (!empty($children)) {
                     $new_parent = end($children);
                     $listing->parent_listing_id = $new_parent->id;
                     $listing->save();
                     foreach ($children as $idx => $child_listing) {
                         $child_listing->parent_listing_id = $new_parent->id;
                         $child_listing->save();
                     }
                     $new_parent->parent_listing_id = null;
                     $new_parent->save();
                 }
                 $total += $listing->price;
             }
             $order = Order::create(['user_id' => $user_id, 'total' => $total]);
             $order->add($listings);
         });
     }
     // Initiate checkout via payment gateways
     try {
         if (!$success) {
             throw new Order_ReservationError();
         }
         $request = $app->router->flight->request();
         $_SESSION['cart'] = array('listings' => array(), 'bulk' => array());
         $_SESSION['order'] = $order->id;
         if ($request->query->checkout == 'coinbase') {
             // Checkout with Coinbase
             $order->provider = 'coinbase';
             $order->save();
             $coinbase = $app->payment->coinbase_button($order, array('success_url' => '/cart/process?checkout=coinbase', 'cancel_url' => '/cart/cancel'));
             $app->output->json(array('error' => false, 'url' => 'https://coinbase.com/checkouts/' . $coinbase->button->code));
         } else {
             if ($request->query->checkout == 'stripe') {
                 // Checkout with Stripe
                 $order->provider = 'stripe';
                 $order->save();
                 $result = $app->payment->stripe_charge($order, $request->data->stripe_token);
                 $app->output->json(array('error' => false, 'url' => $app->config->get('core.url') . '/cart/process?checkout=stripe&ch=' . $result->id));
             } else {
                 // Checkout with PayPal
                 $order->provider = 'paypal';
                 $order->save();
                 $checkout_url = $app->payment->paypal_SEC($order, '/cart/process', '/cart/cancel');
                 $app->output->json(array('error' => false, 'url' => $checkout_url));
             }
         }
     } catch (Order_ReservationError $e) {
         $app->logger->log('Checkout failed (' . get_class($e) . ')', 'ERROR', array('pathway' => 'order', 'exception' => $e), 'user');
         $app->output->json(array('error' => true, 'message' => 'There was an error ordering the items in your cart. You will be redirected back to your cart shortly.'), 500);
     } catch (Paypal_CheckoutError $e) {
         $app->logger->log('Checkout failed (' . get_class($e) . ')', 'ERROR', array('pathway' => 'order', 'exception' => $e), 'user');
         $app->output->json(array('error' => true, 'message' => 'There was an error setting up your PayPal Express Checkout. You will be redirected back to your cart shortly.'), 500);
     } catch (Stripe_CardError $e) {
         $body = $e->getJsonBody();
         $err = $body['error'];
         $app->logger->log('Checkout failed (' . get_class($e) . ')', 'ERROR', array('pathway' => 'order', 'message' => $err['message']), 'user');
         $app->output->json(array('error' => true, 'message' => 'There was an error processing your Stripe Checkout: ' . $err['message'] . ' You will be redirected back to your cart shortly.'), 500);
     } catch (Stripe_Error $e) {
         $app->logger->log('Checkout failed (' . get_class($e) . ')', 'ERROR', array('pathway' => 'order', 'exception' => $e), 'user');
         $app->output->json(array('error' => true, 'message' => 'There was an internal error processing your Stripe Checkout and has been logged. You will be redirected back to your cart shortly.'), 500);
     } catch (Exception $e) {
         $app->output->json(array('error' => true, 'message' => 'There was an internal error processing your checkout and has been logged. You will be redirected back to your cart shortly.'), 500);
         throw $e;
     }
 }
Example #26
0
 /**
  * test for grabbing a listing by a listing Type Id that doesn't exist
  */
 public function testGetInvalidListingTypeId()
 {
     $listing = Listing::getListingByTypeId($this->getPDO(), 1);
     $this->assertSame($listing->getSize(), 0);
 }
Example #27
0
if (isset($arrOrther['imageDefault']) && $arrOrther['imageDefault'] != '') {
    echo CHtml::image(Yii::app()->createAbsoluteUrl('upload/listing/' . $model->id . "/120x96/" . $arrOrther['imageDefault']), strip_tags($model->property_name_or_address));
}
?>
 
            </div>
            <!--<div style="float:right;margin-left:20px;">-->
            <div style="float:left;margin-left:10px;" class="listing-info">
                <h4 style="color:#34739B !important;font-weight: bold;font-size: 16px !important;"><?php 
echo strip_tags($model->property_name_or_address);
?>
</h4>
                            <div style="float:left; width: 400px;">
                                    <ul class="list-2">
                                        <li class="first"><?php 
echo Listing::getViewDetailPropertyType($model);
?>
</li>
                                        <li><?php 
echo $model->display_title != '' ? $model->display_title : $model->property_name_or_address;
?>
 </li>
                                        <li>Marketed by <?php 
if (isset($model->user->first_name)) {
    echo $model->user->first_name;
}
?>
                                            <?php 
if (isset($model->user->phone)) {
    echo "- Call : " . $model->user->phone;
}
Example #28
0
                <?php 
echo CHtml::dropDownList('LeaseTerm', $s_LeaseTerm, Listing::getDropdownlistWithTableName('ProMasterLeaseTerm', 'id', 'name'), array('empty' => 'Select', 'class' => 'form-control'));
?>
            </div>

            <div class="form-group sidebar-tab div_furnished_tenure_for_rent hide div_furnished_tenure">
                <label class="control-label">Furnished</label>
                <?php 
echo CHtml::dropDownList('furnished', $aFurnishingInclude, Listing::getDropdownlistWithTableName('ProMasterFurnished', 'id', 'name'), array('class' => 'form-control', 'empty' => 'All furnished'));
?>
            </div>

            <div class="form-group sidebar-tab div_furnished_tenure_for_sale hide div_furnished_tenure">
                <label class="control-label">Tenure</label>
                <?php 
echo CHtml::dropDownList('tenure', $sTenure, Listing::getDropdownlistWithTableName('ProMasterTenure', 'id', 'name'), array('class' => 'form-control', 'empty' => 'All tenure'));
?>
            </div>

            <div class="form-group sidebar-tab">
                <label class="control-label">Keywords</label>
                <input type="text" name="keywords" class="form-control" value="<?php 
echo $s_keywords;
?>
"  />
            </div>

            <p class="more more_search_options"><a href="javascript:void(0)">+ More search options</a></p>
            
            <div class="more_search_box" style="display: none;">
                <div class="form-group sidebar-tab">
Example #29
0
                </div>
            </div>

            <div class="anhdung_Tenant">
                <?php 
echo $form->labelEx($model, 'bedrooms', array('label' => 'Bedrooms', 'class' => 'lb'));
?>
                <div class="clearfix">
                    <div class="col-1">
                        <?php 
echo $form->dropDownList($model, 'min_bedroom', Listing::getListOptionsBedroom(), array('empty' => 'Minimum', 'id' => 'minimum_bedroom_engage_rent'));
?>
                    </div>
                    <div class="col-2">
                        <?php 
echo $form->dropDownList($model, 'max_bedroom', Listing::getListOptionsBedroom(), array('empty' => 'Maximum', 'id' => 'maximum_bedroom_engage_rent'));
?>
                         
                    </div>
                    <?php 
echo $form->error($model, 'min_bedroom');
?>
                    <?php 
echo $form->error($model, 'max_bedroom');
?>
                </div>
            </div>

            <div class="anhdung_Tenant">
                <?php 
echo $form->labelEx($model, 'floor_size', array('label' => 'Floor Size', 'class' => 'lb'));
Example #30
0
  *  vì ở trên host bị limit timeout cho 1 connection, ở local thì chạy trên browser được
  *  ở local sau khi chạy thì ra con số này: done in: 5333 Second <=> 88.883 Minutes
  * 
 ******** STEP TO UPDATE THIS 6-Digit Postal Code  *********/
 /** http://www.streetdirectory.com/sg/1-suites/1-lorong-20-geylang-398721/100869_51869.html
  * @Author: ANH DUNG Mar 04, 2015
  * @Todo: 6-Digit Postal Code Subscription
  * The latest update of the database is attached please.
     The data have been updated as at 10 Feb 2015.
  * @Link: verzview.com/verzpropertyinfo/demo2/site/importApi
  * @cron: s:39:" done in: 285  Second  <=> 4.75 Minutes";
  * s:39:" done in: 273  Second  <=> 4.55 Minutes";
  * s:48:" done in: 235  Second  <=> 3.91666666667 Minutes";
  */
 public function actionImportApi()
 {
     //        Yii::app()->setting->setDbItem('rss', 0); // for run cron NewsletterCommand
     //        echo Yii::app()->setting->getItem('rss');die;
     //        phpinfo();
     echo "need close this line to run. Please read careful step above";
     die;
     $from = time();
     set_time_limit(72000);
     //        $sql = "insert into {{_api_postcode}} ( postal_code ) values ( '019191K31 MAR0043MAR036999999' ),( '019191K31 MAR0043MAR036' ) ";
     //        Yii::app()->db->createCommand($sql)->execute();die;
     $root = ROOT . '/api';
     // ApiAddress, ApiBuilding, ApiPostcode, ApiStreets, ApiWalkup