This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set('Europe/Moscow'); | |
class Deploy { | |
/** | |
* A callback function to call after the deploy has finished. | |
* | |
* @var callback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'rails', '3.1.0' | |
# Админка | |
gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git' | |
# Пагинация | |
gem 'kaminari' | |
# Хлебные крошки |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- write message --> | |
<?php | |
$style = "display:none"; | |
if(Yii::app()->controller->action->id == 'errorsending') { | |
$style = ""; | |
if(CHtml::errorSummary($seller_model)){?> | |
<div class="error_explanation"> | |
<?php echo CHtml::errorSummary($seller_model, '');?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function actionSection($section) | |
{ | |
$model = Section::model()->findByAttributes(array('vis'=>'1'), | |
"url_alias=:section", | |
array(":section"=>$section)); | |
if(!$model || $model->pid){ | |
throw new CHttpException(404); | |
} | |
Controller::$current_section = $model->id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function actionSearch() | |
{ | |
if(!empty($_GET['search_text']) && is_array($_GET)) { | |
$condition = ""; | |
$search_text = urldecode($_GET['search_text']); | |
$words = explode(" ", $search_text); | |
$total_words = count($words); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SitemapController extends Controller | |
{ | |
private $site_url = "http://www.kluch-kmv.ru"; | |
public function actionIndex() | |
{ | |
$sitemap = '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; | |
$data = ' | |
<url> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html"> | |
<head> | |
<title>Zikkurat</title> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> | |
<link rel="stylesheet" type="text/css" href="css/nivo-slider.css"> | |
<link rel="stylesheet" type="text/css" href="css/anythingslider.css"> | |
<link rel="stylesheet" type="text/css" href="css/themes/default/default.css"> | |
<link rel="stylesheet" type="text/css" href="css/jcarousel/tango/skin.css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function uploadImages($images, $id, $description=false) | |
{ | |
$path = $_SERVER['DOCUMENT_ROOT'].Yii::app()->urlManager->baseUrl.'/content/realty/'; | |
$i = 0; | |
foreach ($images as $image => $pic) { | |
$image_name = md5(time().$pic.$i); | |
$i++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONTROLLER | |
public function actionCreate() | |
{ | |
$this->pageTitle = "Недвижимость"; | |
$model = new Realty(); | |
$realty_images = new RealtyImage(); | |
$sections = Section::model()->findAll('type=4'); | |
$sections_list = CHtml::listData($sections, 'id', 'name'); |