Commit 84c2f9dd authored by Shakarim Sapa's avatar Shakarim Sapa

Merge remote-tracking branch 'origin/master'

parents c5a41876 83131e64
......@@ -16,15 +16,16 @@ return [
'modules' => [
'languages' => ['class' => 'common\modules\languages\Module'],
'content' => ['class' => 'common\modules\content\Module'],
'bids' => ['class' => 'common\modules\bids\Module'],
'faq' => ['class' => 'common\modules\faq\Module'],
'reviews' => ['class' => 'common\modules\reviews\Module'],
'users' => ['class' => 'common\modules\users\users'],
'testings' => ['class' => 'common\modules\testings\Module'],
'main' => ['class' => 'common\modules\main\main'],
'rbac' => ['class' => 'common\modules\rbac\rbac'],
'utility' => ['class' => 'c006\utility\migration\Module'],
'triggers' => ['class' => 'common\modules\triggers\Module'],
'school' => ['class' => 'common\modules\school\Module'],
'rbac' => ['class' => 'common\modules\rbac\rbac'],
],
'components' => [
'session' => [
......
......@@ -2,5 +2,4 @@
return [
'adminEmail' => 'admin@example.com',
'name' => 'Арт Проект',
'frontUrl' => 'http://task-on.com'
];
......@@ -27,9 +27,9 @@ $base_url =
// Get domain portion
$_SERVER['HTTP_HOST']; // DON'T TOUCH (base url (only domain) of site (without final /)).
$upload_dir = '/source/'; // path from base_url to base of upload folder (with start and final /)
$current_path = '../source/'; // relative path from filemanager folder to upload folder (with final /)
$current_path = '../../../frontend/web/uploads/source/'; // relative path from filemanager folder to upload folder (with final /)
//thumbs folder can't put inside upload folder
$thumbs_base_path = '../thumbs/'; // relative path from filemanager folder to thumbs folder (with final /)
$thumbs_base_path = '../../../frontend/web/uploads/thumbs/'; // relative path from filemanager folder to thumbs folder (with final /)
// OPTIONAL SECURITY
// if set to true only those will access RF whose url contains the access key(akey) like:
......
......@@ -3,4 +3,5 @@ return [
'adminEmail' => 'admin@example.com',
'supportEmail' => 'support@example.com',
'user.passwordResetTokenExpire' => 3600,
'frontUrl' => 'http://task-on.com'
];
<?php
namespace common\modules\bids;
/**
* bids module definition class
*/
class Module extends \common\components\WebModule
{
/**
* @inheritdoc
*/
public $controllerNamespace = 'common\modules\bids\controllers';
public static $active = true;
public $menu_icons = 'fa fa-inbox';
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// custom initialization code goes here
}
public static function name()
{
return 'Управление заявками';
}
public static function description()
{
return 'Управление заявками';
}
public static function version()
{
return '1.0';
}
public static function adminMenu()
{
return array(
'Список заявок' => '/bids/bid-admin/manage',
);
}
}
<?php
namespace common\modules\bids\controllers;
use Yii;
use common\modules\bids\models\Bid;
use common\modules\bids\models\SearchBid;
use common\components\AdminController;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* BidAdminController implements the CRUD actions for Bid model.
*/
class BidAdminController extends AdminController
{
public static function actionsTitles(){
return [
'Manage' => 'Управление заявками',
'Create' => 'Добавление заявки',
'Update' => 'Редактирование заявки',
'Delete' => 'Удаление заявки',
'View' => 'Просмотр заявки',
];
}
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all Bid models.
* @return mixed
*/
public function actionManage()
{
$searchModel = new SearchBid();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('manage', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Bid model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new Bid model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new Bid();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing Bid model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Bid model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Bid model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Bid the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Bid::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
<?php
namespace common\modules\bids\controllers;
use Yii;
use yii\helpers\Json;
use yii\web\NotFoundHttpException;
use yii\widgets\ActiveForm;
use yii\web\Response;
use yii\web\UploadedFile;
use common\modules\bids\models\Bid;
/**
* BidAdminController implements the CRUD actions for Bid model.
*/
class BidController extends \common\components\BaseController
{
public static function actionsTitles()
{
return [
'Add' => 'Добавление заявки',
];
}
/**
* Lists all Bid models.
* @return mixed
*/
public function actionAdd()
{
$model = new Bid;
$model->scenario = Yii::$app->request->post('scenario');
if(Yii::$app->request->isAjax)
{
$model->load(Yii::$app->request->post());
$model->file = UploadedFile::getInstance($model, 'file');
Yii::$app->response->format = Response::FORMAT_JSON;
if($model->validate())
{
if($model->file)
{
$model->upload();
$model->file = null;
}
$model->save();
$model->send();
return ['success' => true];
}
else
{
return ActiveForm::validate($model);
}
}
else
{
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
<?php
namespace common\modules\bids\models;
use Yii;
/**
* This is the model class for table "bids".
*
* @property integer $id
* @property string $name
* @property string $phone
* @property string $file
* @property string $text
*/
class Bid extends \common\components\ActiveRecordModel
{
const SCENARIO_PROJECT = 'project';
const SCENARIO_CALLBACK = 'callback';
const FILE_FOLDER = '/uploads/bids/';
public $file;
/**
* @inheritdoc
*/
public static function tableName()
{
return 'bids';
}
/**
* @inheritdoc
*/
public function name()
{
return 'Заявки';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['name', 'phone', 'email'], 'required', 'on' => self::SCENARIO_PROJECT],
[['email'], 'email', 'on' => self::SCENARIO_PROJECT],
[['name', 'phone'], 'required', 'on' => self::SCENARIO_CALLBACK],
[['file'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif, xls, xlsx, doc, docx, pdf'],
[['text'], 'string'],
[['name'], 'string', 'max' => 100],
[['phone'], 'string', 'max' => 30],
[['email'], 'string', 'max' => 70],
[['filename'], 'string', 'max' => 50],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => '#',
'name' => 'Имя',
'phone' => 'Телефон',
'email' => 'Email',
'filename' => 'Прикрепленный файл',
'file' => 'Прикрепленный файл',
'text' => 'Сообщение',
'created_at' => 'Дата добавления',
'updated_at' => 'Дата обновления',
];
}
public function getUrl()
{
return Yii::$app->params['frontUrl'] . self::FILE_FOLDER . $this->filename;
}
private function getPath()
{
return Yii::getAlias('@frontend/web') . self::FILE_FOLDER;
}
public function upload()
{
if(!file_exists($this->getPath()))
{
mkdir($this->getPath(), 0777, true);
}
$this->filename = date('dmYHis-') . uniqid() . '.' . $this->file->extension;
$this->file->saveAs($this->getPath() . $this->filename);
}
public function send()
{
}
}
<?php
namespace common\modules\bids\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\modules\bids\models\Bid;
/**
* SearchBid represents the model behind the search form about `common\modules\bids\models\Bid`.
*/
class SearchBid extends Bid
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id'], 'integer'],
[['name', 'phone', 'email', 'filename', 'text', 'created_at'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Bid::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'created_at' => ($this->created_at?strtotime($this->created_at):$this->created_at),
]);
$query->andFilterWhere(['like', 'name', $this->name])
->andFilterWhere(['like', 'phone', $this->phone])
->andFilterWhere(['like', 'email', $this->email])
->andFilterWhere(['like', 'filename', $this->filename])
->andFilterWhere(['like', 'text', $this->text]);
return $dataProvider;
}
}
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\modules\bids\models\Bid */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="bid-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'file')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'text')->textarea(['rows' => 6]) ?>
<div class="form-group">
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\modules\bids\models\SearchBid */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="bid-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id') ?>
<?= $form->field($model, 'name') ?>
<?= $form->field($model, 'phone') ?>
<?= $form->field($model, 'file') ?>
<?= $form->field($model, 'text') ?>
<div class="form-group">
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\modules\bids\models\Bid */
$this->title = 'Create Bid';
$this->params['breadcrumbs'][] = ['label' => 'Bids', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="bid-create">
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use common\modules\bids\models\Bid;
/* @var $this yii\web\View */
/* @var $searchModel common\modules\bids\models\SearchBid */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Bids';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="bid-index">
<p>
<?= Html::a('Добавить', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= \common\components\zii\AdminGrid::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
'id',
'name',
'phone',
'email:email',
[
'attribute' => 'filename',
'format' => 'html',
'value' => function($model)
{
return ($model->filename?Html::a($model->filename, $model->getUrl()):null);
}
],
'text:ntext',
[
'attribute' => 'created_at',
'format' => ['date', 'php:d.m.Y H:i:s']
],
[
'class' => 'common\components\ColorActionColumn',
'template' => '{view} {update}',
]
],
]); ?>
</div>
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\modules\bids\models\Bid */
$this->title = 'Update Bid: ' . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Bids', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="bid-update">
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\modules\bids\models\Bid */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Bids', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="bid-view">
<p>
<?= Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'name',
'phone',
'email:email',
'file',
'text:ntext',
[
'attribute' => 'created_at',
'format' => ['date', 'php:d.m.Y H:i:s']
],
[
'attribute' => 'updated_at',
'format' => ['date', 'php:d.m.Y H:i:s']
],
],
]) ?>
</div>
......@@ -20,10 +20,10 @@ class BlockAdminController extends AdminController
public static function actionsTitles(){
return [
'Manage' => 'Управление блоками',
'Create' => 'Добавление контента',
'Update' => 'Редактирование контента',
'Delete' => 'Удаление контента',
'View' => 'Просмотр контента',
'Create' => 'Добавление блока',
'Update' => 'Редактирование блока',
'Delete' => 'Удаление блока',
'View' => 'Просмотр блока',
];
}
......
......@@ -119,6 +119,8 @@ class CoContentLang extends \common\components\ActiveRecordModel
$arrWhatReplaceNext[] = '[about-reviews]';
$arrReplaceNext[] = CoBlocks::printStaticBlock('about-reviews', true);
$arrWhatReplaceNext[] = '[reviews]';
$arrReplaceNext[] = CoBlocks::printStaticBlock('reviews', true);
$arrWhatReplaceNext[] = '[content-phone]';
$arrReplaceNext[] = \common\models\Settings::getValue('content-phone');
$arrWhatReplaceNext[] = '[cases]';
......
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use \yii\helpers\ArrayHelper;
use \common\modules\content\models\CoCategory;
/* @var $this yii\web\View */
......
......@@ -13,10 +13,6 @@ return [
'elements' => [
'title' => [
'type' => 'text',
],
'lang' => [
'type' => 'dropdownlist',
'items' => ArrayHelper::map(\common\modules\languages\models\Languages::find()->all(),'code','name')
],
($model->photo?Html::img(\Yii::$app->params['frontUrl'] . Reviews::PHOTO_FOLDER . $model->photo):''),
'image' => ['type' => 'file', 'class' => 'form-control',],
......
......@@ -101,7 +101,7 @@ class Reviews extends \common\components\ActiveRecordModel
[['text', 'state', 'attendant_products'], 'string'],
[['admin_id'], 'adminIdValidate'],
[['date', 'answer', 'good', 'bad', 'date_create', 'notification_date', 'rate_usability', 'rate_loyality', 'rate_profit', 'title', 'order', 'photo', 'state', 'video'], 'safe'],
[['lang'], 'string', 'max' => 2],
// [['lang'], 'string', 'max' => 2],
[['title'], 'string', 'max' => 250],
[['email', 'video'], 'string', 'max' => 255]
];
......
<?php
namespace common\modules\school\components;
class Utilities
{
public static function checkurl($url) {
// режем левые символы и крайние пробелы
$url=trim($url);
// если пусто - выход
if (strlen($url)==0) return 1;
//проверяем УРЛ на правильность
if (!preg_match("~^(?:(?:https?|ftp|telnet)://(?:[a-z0-9_-]{1,32}".
"(?::[a-z0-9_-]{1,32})?@)?)?(?:(?:[a-z0-9-]{1,128}\.)+(?:com|net|".
"org|mil|edu|arpa|gov|biz|info|aero|inc|name|[a-z]{2})|(?!0)(?:(?".
"!0[^.]|255)[0-9]{1,3}\.){3}(?!0|255)[0-9]{1,3})(?:/[a-z0-9.,_@%&".
"?+=\~/-]*)?(?:#[^ '\"&<>]*)?$~i",$url,$ok))
return -1; // если не правильно - выход
// если нет протокала - добавить
if (!strstr($url,"://")) $url="http://".$url;
// заменить протокол на нижний регистр: hTtP -> http
$url=preg_replace("~^[a-z]+~ie","strtolower('\\0')",$url);
return $url;
}
}
\ No newline at end of file
......@@ -3,8 +3,9 @@
namespace common\modules\school\controllers;
use common\components\BaseController;
use common\modules\school\models\Courses;
use common\modules\school\models\SearchCourses;
use common\modules\school\models\SearchLessons;
class CourseController extends BaseController
{
......@@ -25,8 +26,13 @@ class CourseController extends BaseController
return $this->render('index', ['dataProvider' => $dataProvider]);
}
public function actionView()
public function actionView($id)
{
return $this->render('view');
$model = Courses::findOne($id);
$searchModel = new SearchLessons();
$search['course_id'] = $id;
$dataProvider = $searchModel->search($search);
return $this->render('view', ['dataProvider' => $dataProvider, 'model' => $model]);
}
}
......@@ -61,7 +61,7 @@ class CoursesAdminController extends AdminController
'Добавить курс'
];
if($model->load(Yii::$app->request->post())){
if($model->load(Yii::$app->request->post()) && $model->validate()){
//Try to get file info
$model->upload_image = \yii\web\UploadedFile::getInstance($model, 'upload_image');
//If received, then I get the file name and asign it to $model->image in order to store it in db
......@@ -70,8 +70,7 @@ class CoursesAdminController extends AdminController
$model->image = $image_name;
}
//I proceed to validate model. Notice that will validate that 'image' is required and also 'image_upload' as file, but this last is optional
if ($model->validate() && $model->save()) {
$model->save();
//If all went OK, then I proceed to save the image in filesystem
if(!empty($model->upload_image)){
......@@ -79,7 +78,6 @@ class CoursesAdminController extends AdminController
}
return $this->redirect(['view', 'id' => $model->id]);
}
}
else
{
$form = new \common\components\BaseForm('/common/modules/school/forms/CourseForm', $model);
......@@ -99,7 +97,7 @@ class CoursesAdminController extends AdminController
];
$model = $this->findModel($id);
if($model->load(Yii::$app->request->post())){
if($model->load(Yii::$app->request->post()) && $model->validate()){
//Try to get file info
$model->upload_image = \yii\web\UploadedFile::getInstance($model, 'upload_image');
......@@ -109,8 +107,7 @@ class CoursesAdminController extends AdminController
$model->image = $image_name;
}
//I proceed to validate model. Notice that will validate that 'image' is required and also 'image_upload' as file, but this last is optional
if ($model->validate() && $model->save()) {
$model->save();
//If all went OK, then I proceed to save the image in filesystem
if(!empty($model->upload_image)){
......@@ -118,7 +115,6 @@ class CoursesAdminController extends AdminController
}
return $this->redirect(['view', 'id' => $model->id]);
}
}
else
{
$form = new \common\components\BaseForm('/common/modules/school/forms/CourseForm', $model);
......@@ -136,10 +132,11 @@ class CoursesAdminController extends AdminController
return $this->redirect(['manage']);
}
public function actionManage()
{
$searchModel = new SearchCourses();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider = $searchModel->search(Yii::$app->request->queryParams["SearchCourses"]);
\yii::$app->controller->page_title = 'Управление курсами';
......
......@@ -4,6 +4,8 @@ namespace common\modules\school\controllers;
use common\components\BaseController;
use common\modules\school\models\Lessons;
class LessonController extends BaseController
{
public static function actionsTitles()
......@@ -13,8 +15,9 @@ class LessonController extends BaseController
];
}
public function actionView()
public function actionView($id)
{
return $this->render('view');
$model = Lessons::findOne($id);
return $this->render('view', ['model' => $model]);
}
}
......@@ -106,7 +106,7 @@ class LessonsAdminController extends AdminController
public function actionManage()
{
$searchModel = new SearchLessons();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider = $searchModel->search(Yii::$app->request->queryParams["SearchLessons"]);
\yii::$app->controller->page_title = 'Управление уроками';
......@@ -114,7 +114,6 @@ class LessonsAdminController extends AdminController
'Управление уроками',
];
return $this->render('manage', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
......
......@@ -32,6 +32,7 @@ else {
$elements = [
'title' => ['type' => 'text'],
'description' => ['type' => 'textarea'],
'description_for_course' => ['type' => 'textarea'],
'type' => [
'type' => 'dropdownlist',
'items' => Courses::$type_list,
......
......@@ -11,6 +11,7 @@ $elements = [
'type' => 'dropdownlist',
'items' => ArrayHelper::map(Courses::find()->all(), 'id', 'title'),
],
'number' => ['type' => 'text'],
];
return [
......
......@@ -44,7 +44,8 @@ class Courses extends \common\components\ActiveRecordModel
'description' => 'Описание',
'type' => 'Тип курса',
'upload_image' => 'Изображения',
'spec_proposition' => 'Специальное предложение'
'spec_proposition' => 'Специальное предложение',
'description_for_course' => 'Описание для страницы курса'
];
}
......@@ -58,7 +59,7 @@ class Courses extends \common\components\ActiveRecordModel
[['type', 'spec_proposition'], 'integer', 'max' => 11],
[['title'], 'string', 'max' => 150],
[['image'], 'string', 'max' => 100],
[['description'], 'safe'],
[['description', 'description_for_course'], 'safe'],
[['upload_image'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'],
];
}
......@@ -103,10 +104,8 @@ class Courses extends \common\components\ActiveRecordModel
public function deleteFiles()
{
if($this->image)
{
if(file_exists($this->getPath() . $this->image))
{
if($this->image){
if(file_exists($this->getPath() . $this->image)){
unlink($this->getPath() . $this->image);
}
}
......
......@@ -2,7 +2,7 @@
namespace common\modules\school\models;
use Yii;
use common\modules\school\components\Utilities;
use common\modules\school\models\Courses;
......@@ -36,10 +36,10 @@ class Lessons extends \common\components\ActiveRecordModel
public function rules()
{
return [
[['title', 'text', 'video_id', 'course_id'], 'required'],
[['title', 'video_id', 'course_id', 'number'], 'required'],
[['title'], 'string', 'max' => 150],
[['video_id'], 'string', 'max' => 100],
[['course_id'], 'integer', 'max' => 11],
[['course_id', 'number'], 'integer', 'max' => 11],
[['text'], 'safe'],
];
}
......@@ -52,9 +52,10 @@ class Lessons extends \common\components\ActiveRecordModel
return [
'id' => 'ID',
'title' => 'Заголовок',
'text' => 'Текст',
'text' => 'Полезные материалы',
'video_id' => 'Код видео',
'course_id' => 'Курс',
'number' => 'Номер урока',
];
}
......@@ -71,4 +72,31 @@ class Lessons extends \common\components\ActiveRecordModel
{
return $this->hasOne(Courses::className(), ['id' => 'course_id']);
}
public function beforeSave($insert)
{
if (parent::beforeSave($insert)) {
$this->video_id = $this->getVideoId();
return $this->video_id;
}
else {
return false;
}
}
public function getVideoId()
{
if ($this->video_id) {
if (Utilities::checkUrl($this->video_id)) {
if (strrpos($this->video_id, '=')){
$this->video_id=substr($this->video_id, strrpos($this->video_id, '=')+1);
}
}
return $this->video_id;
}
else {
return false;
}
}
}
......@@ -42,19 +42,20 @@ class SearchCourses extends Courses
*/
public function search($params)
{
if ($params){
$params = array_filter($params);
$query = Courses::findByCondition($params);
}
else {
$query = Courses::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
}
$this->load($params);
if (!$this->validate()) {
/*if (!$this->validate()) {
// uncomment the following line if you do not want to any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
}*/
$query->andFilterWhere([
'id' => $this->id,
......@@ -65,6 +66,11 @@ class SearchCourses extends Courses
->andFilterWhere(['like', 'title', $this->title])
->andFilterWhere(['like', 'image', $this->image]);
$query->orderBy(['id' => SORT_DESC]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
return $dataProvider;
}
}
......@@ -18,7 +18,7 @@ class SearchLessons extends Lessons
public function rules()
{
return [
[['id', 'course_id'], 'integer'],
[['id', 'course_id', 'number'], 'integer'],
[['video_id', 'title'], 'safe'],
];
}
......@@ -41,27 +41,32 @@ class SearchLessons extends Lessons
*/
public function search($params)
{
if ($params){
$params = array_filter($params);
$query = Lessons::findByCondition($params);
}
else {
$query = Lessons::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
}
$this->load($params);
if (!$this->validate()) {
/*if (!$this->validate()) {
// uncomment the following line if you do not want to any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
}*/
$query->andFilterWhere([
'id' => $this->id,
'course_id' => $this->course_id,
'number' => $this->number,
]);
$query->andFilterWhere(['like', 'video_id', $this->video_id])
->andFilterWhere(['like', 'title', $this->title]);
$query->orderBy(['id' => SORT_ASC]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
return $dataProvider;
}
......
......@@ -26,8 +26,9 @@
<?php echo \yii\widgets\ListView::widget( [
'dataProvider' => $dataProvider,
'itemView' => 'item-view',
'itemOptions' => ['tag' => ''],
'options' => ['tag' => ''],
'itemOptions' => ['tag' => 'div'],
'options' => ['tag' => 'div'],
'emptyTextOptions' => [ 'tag' => 'div', 'class' => 'empty-text' ],
'layout' => '{items}<li><nav class="pages">{pager}</nav></li>',
'pager' => [
'class' => 'common\components\zii\FrontLinkPager',
......
<?php
use yii\helpers\Url;
?>
<div class="col-md-3 col-xs-6 col-sm-12">
<div class="ls_block_item">
<div class="line_ls">Урок <?php echo $model->number;?></div>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => $model->id]);?>" class="ls_block_title">
<?php echo $model->title;?>
</a>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => $model->id]);?>" class="ls_block_btn">
Смотреть
</a>
</div>
</div>
......@@ -15,7 +15,7 @@
<div class="blip_kurs">За просмотр этих курсов<br> мы заплатим 15 000 руб.</div>
<?php endif;?>
<div class="kurs_foot clearfix">
<a href="<?php echo Url::toRoute(['/school/course/view', 'id' => 1]);?>" class="kurs_bt">Подробнее</a>
<a href="<?php echo Url::toRoute(['/school/course/view', 'id' => $model->id]);?>" class="kurs_bt">Подробнее</a>
</div>
<div class="for_<?php echo $model->getClassCourse($model->type);?>">
<div class="r_<?php echo $model->getClassCourse($model->type);?>"></div>
......
......@@ -19,18 +19,16 @@
</div>
</div>
</section>
<section class="les_list_top">
<section class="les_list_top" style="background: url(<?php echo $model->getUrl($model->image);?>) no-repeat center center">
<div class="ls_top_over">
<div class="container">
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<h1 class="ls_title">
<span>Курс для менеджеров it-отрасли</span>
<span><?php echo $model->title;?></span>
</h1>
<div class="ls_subtitle">
<span>Если вы менеджер it отрасли или генеральный директоров в сфере</span>
<br>
<span>it отрасли, то вам будет полезно посмотреть этот учебный курс.</span>
<?php echo $model->description_for_course;?>
</div>
<br>
<div class="ls_txt"><span>В роликах будет рассказываться:</span></div>
......@@ -43,44 +41,27 @@
<section class="ls_list_block">
<div class="container">
<div class="row">
<div class="col-md-3 col-xs-6 col-sm-12">
<div class="ls_block_item">
<div class="line_ls">Урок 1</div>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => 1]);?>" class="ls_block_title">Как правильно принимать задачи от заказчика</a>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => 1]);?>" class="ls_block_btn">Смотреть</a>
</div>
</div>
<div class="col-md-3 col-xs-6 col-sm-12">
<div class="ls_block_item">
<div class="line_ls">Урок 99</div>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => 1]);?>" class="ls_block_title">Как правильно ставить задачу исполнителям</a>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => 1]);?>" class="ls_block_btn">Смотреть</a>
</div>
</div>
<div class="col-md-3 col-xs-6 col-sm-12">
<div class="ls_block_item ls_fine">
<div class="line_ls">Урок 3</div>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => 1]);?>" class="ls_block_title">Как правильно выстроить взаимоотношения с заказчиком</a>
<div class="ls_fine_txt">Урок просмотрен</div>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => 1]);?>" class="ls_block_btn">Продолжить</a>
</div>
</div>
<div class="col-md-3 col-xs-6 col-sm-12">
<div class="ls_block_item">
<div class="line_ls">Урок 4</div>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => 1]);?>" class="ls_block_title">Как научиться изменять стоимость проекта</a>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => 1]);?>" class="ls_block_btn">Смотреть</a>
</div>
</div>
</div>
<?php echo \yii\widgets\ListView::widget( [
'dataProvider' => $dataProvider,
'itemView' => 'item-view-lesson',
'itemOptions' => ['tag' => 'div'],
'options' => ['tag' => 'div'],
'emptyTextOptions' => [ 'tag' => 'div', 'class' => 'empty-text' ],
'layout' => '{items}<li><nav class="pages">{pager}</nav></li>',
'pager' => [
'class' => 'common\components\zii\FrontLinkPager',
'activePageCssClass' => 'is-active',
'prevPageLabel' => '<span class="glyphicon glyphicon-chevron-left"></span>Предыдущая',
'nextPageLabel' => 'Следующая<span class="glyphicon glyphicon-chevron-right"></span>',
'options' => [
'class' => 'pages-list',
],
],
] );
?>
<div class="row">
<div class="col-md-3 col-xs-6 col-sm-12">
<div class="ls_block_item">
<div class="line_ls">Урок 2</div>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => 1]);?>" class="ls_block_title">Как работать с материалом</a>
<a href="<?php echo Url::toRoute(['/school/lesson/view', 'id' => 1]);?>" class="ls_block_btn">Смотреть</a>
</div>
</div>
<div class="col-md-3 col-xs-6 col-sm-12">
<div class="ls_likes">
<div class="ls_likes_title">Нравится курс?</div>
......
......@@ -20,7 +20,7 @@
<div class="container">
<div class="row">
<div class="col-md-8 col-xs-8 col-sm-12">
<h1 class="vc-title">Урок 1. Курс для менеджеров it-отрасли вторая строка</h1>
<h1 class="vc-title">Урок <?php echo $model->number;?>. <?php echo $model->title;?></h1>
</div>
<div class="col-md-3 col-md-offset-1 col-xs-4 col-sm-12">
<ul class="sh_social">
......@@ -36,11 +36,16 @@
</div>
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="ytb_video">
<img src="/images/ytb_video.jpg" height="508" width="903" alt="">
<iframe width="903" height="508" src="https://www.youtube.com/embed/<?php echo $model->video_id ?>" frameborder="0" allowfullscreen></iframe>
</div>
<?php if($model->course->spec_proposition):?>
<div class="vc-subtitle">Оставляйте комментарии и проходите тестирование, что бы <span>получить приз 15 000 руб.</span></div>
<a href="#" class="vc-uslovia">Подробные условия конкурса</a>
<?php endif;?>
</div>
</div>
</div>
......@@ -62,62 +67,16 @@
</div>
</div>
</div>
<?php if($model->text):?>
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<h2>Полезные материалы</h2>
</div>
</div>
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<strong>“Пессимист - тот, кто жалуется на шум, когда стучит возможность”</strong>
<p>Сервис для закрепления и защиты своих проектов по поставке или внедрению продукции и решений Schneider Electric. Поставщики регистрируют проекты и предоставляют по ним ключевую информацию. Если проект будет защищен, в системе, то другой поставщик не сможет его выполнить.<br> Разработанный сервис позволяет пользователям, через личный кабинет, вносить <a href="#">заявки</a> на будущие проекты </p>
<p><img src="/images/test_img.jpg" height="145" width="230"> Сервис для закрепления и защиты своих проектов по поставке или внедрению продукции и решений Schneider Electric. Поставщики регистрируют проекты и предоставляют по ним ключевую информацию. Если проект будет защищен, в системе, то другой поставщик не сможет его выполнить.<br> Разработанный сервис позволяет пользователям, через личный кабинет, вносить заявки на будущие проекты и вести учет всех поданных ранее заявок.</p>
<p>Сервис для закрепления и защиты своих проектов по поставке или внедрению продукции и решений Schneider Electric. Поставщики регистрируют проекты и предоставляют по ним ключевую информацию. Если проект будет защищен, в системе, то другой поставщик не сможет его выполнить.</p>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6 col-sm-12">
<ol class="ol_list">
<li>Защита соединения TLS и/или SSL протоколом</li>
<li>Защита данных шифрованием</li>
<li>Двухфакторная аутентификация</li>
<li>Подтверждение операции по SMS или ЭЦП</li>
</ol>
</div>
<div class="col-md-6 col-xs-6 col-sm-12">
<ul class="ul_list">
<li>Защита соединения TLS и/или SSL протоколом</li>
<li>Защита данных шифрованием</li>
<li>Двухфакторная аутентификация</li>
<li>Подтверждение операции по SMS или ЭЦП</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="tb_vp">
<table width="940px">
<thead height="60px">
<tr>
<th width="310px">Тип взаимодействия с<br> заказчиком</th>
<th width="230px">Плюсы</th>
<th>Минусы</th>
</tr>
</thead>
<tbody><tr>
<th>Заказчик работает на прямую<br> с исполнителем</th>
<th>Вы экономите на менеджменте<br> Задачи выполняются быстрее</th>
<th>Есть риск увода специалиста<br> Нет защиты от негатива заказчика.<br> Сложнее предлагать новые услуги<br> Задачи выполняются не полностью, т.к. нет эксперта, кторый может корректно формулировать задачу</th>
</tr>
<tr>
<th>Заказчик работает на прямую<br> с исполнителем</th>
<th>Вы экономите на менеджменте<br> Задачи выполняются быстрее</th>
<th>Есть риск увода специалиста<br> Нет защиты от негатива заказчика.<br> Сложнее предлагать новые услуги<br> Задачи выполняются не полностью, т.к. нет эксперта, кторый может корректно формулировать задачу</th>
</tr>
</tbody></table>
</div>
</div>
</div>
<?php echo $model->text;?>
<?php endif;?>
<div class="row">
<div class="col-md-6 col-xs-6 col-sm-12">
<i class="ai_format"></i>
......
......@@ -21,10 +21,17 @@ use common\modules\school\models\Courses;
'filterModel' => $searchModel,
'columns' => [
'title',
'video_id',
[
'attribute' => 'video_id',
'filter' => false,
'value' => function($model)
{
return $model->video_id;
}
],
[
'attribute' => 'course_id',
'filter' => Html::dropDownList('SearchCourses[course_id]',
'filter' => Html::dropDownList('SearchLessons[course_id]',
$searchModel->course_id,
ArrayHelper::map(Courses::find()->all(),'id','title'),
['class'=>'form-control','prompt'=>'Курс']),
......@@ -33,6 +40,7 @@ use common\modules\school\models\Courses;
return $model->course->title;
}
],
'number',
[
'class' => 'common\components\ColorActionColumn',
'template' => '{view} {update}',
......
......@@ -3,8 +3,6 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use common\modules\school\models\Courses;
/* @var $this yii\web\View */
?>
......@@ -29,12 +27,9 @@ use common\modules\school\models\Courses;
'video_id',
[
'attribute' => 'course_id',
'filter' => false,
'value' => function($model)
{
return $model->course->title;
}
'value' => $model->course->title,
],
'number',
],
]) ?>
......
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160202_205332_add_field_to_lessons_table extends Migration
{
public function safeUp()
{
$this->addColumn('lessons', 'number', Schema::TYPE_INTEGER . '(11) NOT NULL');
}
public function safeDown()
{
$this->dropColumn('lessons', 'number');
}
}
<?php
use yii\db\Migration;
use yii\db\Schema;
class m160202_215135_add_field_to_courses_table extends Migration
{
public function safeUp()
{
$this->addColumn('courses', 'description_for_course', Schema::TYPE_TEXT . ' NOT NULL');
}
public function safeDown()
{
$this->dropColumn('courses', 'description_for_course');
}
}
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160204_090228_create_bids extends Migration
{
public function up()
{
$this->createTable('bids', [
'id' => Schema::TYPE_PK,
'name' => Schema::TYPE_STRING . '(100) DEFAULT NULL',
'phone' => Schema::TYPE_STRING . '(30) DEFAULT NULL',
'email' => Schema::TYPE_STRING . '(70) DEFAULT NULL',
'filename' => Schema::TYPE_STRING . '(50) DEFAULT NULL',
'text' => Schema::TYPE_TEXT . ' DEFAULT NULL',
'created_at' => Schema::TYPE_INTEGER . '(11) NOT NULL',
'updated_at' => Schema::TYPE_INTEGER . '(11) NOT NULL',
]);
}
public function down()
{
$this->dropTable('bids');
}
}
......@@ -20,6 +20,7 @@ return [
'faq' => ['class' => 'common\modules\faq\Module'],
'main' => ['class' => 'common\modules\main\main'],
'school' => ['class' => 'common\modules\school\Module',],
'bids' => ['class' => 'common\modules\bids\Module'],
'testings' => ['class' => 'common\modules\testings\Module',],
'sitemap' => [
'class' => 'himiklab\sitemap\Sitemap',
......@@ -157,7 +158,6 @@ return [
['pattern' => 'sitemap', 'route' => 'sitemap/default/index', 'suffix' => '.xml'],
'' => 'content/page/view',
'<page:(/)>' => 'content/page/view',
'reviews' => 'reviews/review/index',
'faq/view/all' => 'faq/faq/all',
'faq/<url>' => 'faq/faq/view',
......@@ -165,6 +165,7 @@ return [
'school' => 'school/course/index',
'school/course/<id>' => 'school/course/view',
'school/lesson/<id>' => 'school/lesson/view',
'<page:(/)>' => 'content/page/view',
'<_m>/<_c>/<_a>/<id:\d+>' => '<_m>/<_c>/<_a>',
'<_m>/<_c>/<_a>/<page>' => '<_m>/<_c>/<_a>',
......
<?php
return [
'About' => 'О компании',
'Portfolio' => 'Портфолио',
'Blog' => 'Блог',
'Contacts' => 'Контакты',
'Analytics school' => 'Школа аналитики',
];
\ No newline at end of file
<?php
use \common\modules\reviews\models\Reviews;
use yii\helpers\Html;
$reviews = Reviews::find()
->where(['state' => 'active'])
->orderBy('created_at DESC')
->all();
?>
<?php if($reviews) : ?>
<section class="rev_sec">
<div class="container">
<div class="row" style="margin-top:50px;">
<div class="col-md-12 col-xs-12 col-sm-12">
<span class="rev_title">Отзывы о нас</span>
</div>
</div>
<?php foreach ($reviews as $review) : ?>
<?php if(!$review->video) : ?>
<div class="row">
<?php if($review->photo) : ?>
<div class="col-md-3 col-xs-4 col-sm-12">
<div class="rev_img">
<img src="<?=Reviews::PHOTO_FOLDER . $review->photo?>">
</div>
</div>
<?php endif; ?>
<div class="col-md-8 col-xs-8 col-sm-12">
<div class="rev_name"><?=$review->title?></div>
<div class="rev_txt"><?=$review->text?></div>
</div>
</div>
<?php else : ?>
<div class="rev_video_block">
<div class="row">
<div class="col-md-6 col-xs-12 col-sm-12">
<div class="rev_video">
<iframe width="417" height="199" src="<?=$review->video?>" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="col-md-6 col-xs-12 col-sm-12">
<div class="rev_video_name"><?=$review->title?></div>
<div class="rev_video_desc">
<?=$review->text?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</section>
<?php endif; ?>
<?php echo $this->render('@app/views/layouts/footer'); ?>
\ No newline at end of file
......@@ -17,4 +17,9 @@
<?php $this->registerJsFile('/js/jquery-validate.min.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/jquery.mb.YTPlayer.min.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/jquery.PageScroll2id.min.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/inputmask.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/jquery.inputmask.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/inputmask.phone.extensions.js', ['position' => yii\web\View::POS_END ]);?>
<?php $this->registerJsFile('/js/common.js', ['position' => yii\web\View::POS_END ]);?>
\ No newline at end of file
<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use yii\helpers\Url;
use common\modules\bids\models\Bid;
?>
<style type="text/css">
.footer_form input,
.footer_form textarea {
margin-bottom: 9px;
}
.field-bid-file {
margin: 0;
}
</style>
<?php
$js = <<<JS
$('#bid-phone').inputmask("phone", {
url: "js/phone-codes/phone-codes.js",
});
$('form#form_foot').on('beforeSubmit', function(e) {
var form = $(this), xhr = new XMLHttpRequest, filebool = false, file, data = new FormData();
form.find('input, textarea').each(function(){
data.append($(this).attr('name'), $(this).val());
});
if(form.find('input[type=file]').length) {
file = form.find('input[type=file]')[0].files[0];
filebool = !filebool;
data.append("Bid[file]", file);
}
xhr.open("POST", '/bids/bid/add', true);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.send(data);
xhr.onreadystatechange = function()
{
if (xhr.readyState == 4){
try
{
var response = JSON.parse(xhr.responseText);
}
catch(e)
{
var response = xhr.responseText;
}
if(response.success)
{
form.find('input[name!="scenario"], textarea').val('');
}
}
}
}).on('submit', function(e){
return false;
});
JS;
$this->registerJs($js);
?>
<footer>
<div class="container">
<div class="row">
......@@ -5,16 +74,48 @@
<div class="calk_form">
<span class="calk_form__title">Рассчитать проект</span>
<span class="calk_form_subtitle">Готовы обсудить любой проект. Есть идея или готовое ТЗ по проекту - отправьте его нам</span>
<form class="footer_form" id="form_foot">
<input type="text" placeholder="Ваше имя*" name="name" class="footer_form__input field-input required alphanumeric">
<input type="tel" placeholder="Телефон*" name="phone" class="footer_form__input field-input required alphanumeric">
<input type="email" placeholder="E-mail*" class="footer_form__input field-input required email">
<textarea placeholder="Опишите в двух словах ваш проект" class="footer_form__textarea"></textarea>
<?php
$model = new Bid;
$model->scenario = Bid::SCENARIO_PROJECT;
$form = ActiveForm::begin([
'id' => 'form_foot',
'action' => '/',
'options' => [
'class' => 'footer_form',
'enctype' => 'multipart/form-data'
],
]); ?>
<?php echo Html::hiddenInput('scenario', $model->scenario); ?>
<?php echo $form->field($model, 'name')->textInput([
'placeholder' => 'Ваше имя*',
'class' => 'footer_form__input'
])->label(false); ?>
<?php echo $form->field($model, 'phone')->textInput([
'placeholder' => 'Телефон*',
'class' => 'footer_form__input'
])->label(false); ?>
<?php echo $form->field($model, 'email')->textInput([
'placeholder' => 'E-mail*',
'class' => 'footer_form__input'
])->label(false); ?>
<?php echo $form->field($model, 'text')->textArea([
'placeholder' => 'Опишите в двух словах ваш проект',
'class' => 'footer_form__textarea'
])->label(false); ?>
<div class="file-upload_block">
<div class="file_upload_bt">
<div class="file-upload">
<label>
<input type="file" name="file">
<?php echo $form->field($model, 'file')->fileInput()->label(false); ?>
<span>Выбрать файл</span>
</label>
</div>
......@@ -22,8 +123,10 @@
<div class="file_drop">Перетащите файл в данную область<br/> или выберите файл с компьютера</div>
</div>
</div>
<button class="btn-default save-button">Рассчитать проект</button>
</form>
<?php echo Html::submitButton('Рассчитать проект', ['class' => 'btn-default save-button']); ?>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
......@@ -41,7 +144,7 @@
<div class="row">
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="foot_logo">
<img src="images/foot_logo.png" height="51" width="192" alt="">
<img src="/images/foot_logo.png" height="51" width="192" alt="">
</div>
</div>
<div class="col-md-6 col-xs-6 col-sm-12">
......@@ -55,7 +158,7 @@
</ul>
</div>
<div class="col-md-3 col-xs-3 col-sm-12">
<div class="taskon"><img src="images/taskon.png" height="31" width="100" alt=""></div>
<div class="taskon"><img src="/images/taskon.png" height="31" width="100" alt=""></div>
<div class="copyring">Powered by Taskon <br /> Собственная разработка Арт Проект</div>
</div>
</div>
......
<?php
use yii\helpers\Html;
use yii\helpers\Url;
......@@ -9,11 +10,11 @@ use common\modules\languages\widgets\Languages;
<div class="toggle_block"><a href="#" class="toggle-mnu"><span></span></a></div>
<div class="phone_menu"><?=\common\models\Settings::getValue('content-phone')?></div>
<ul>
<li><?=Html::a('О компании', ['/about']);?></li>
<li><?=Html::a('Кейсы', ['/case']);?></li>
<li><?=Html::a('Блог', ['/#']);?></li>
<!-- <li><?=Html::a('Школа аналитики', ['/school']);?></li> -->
<li><?=Html::a('Контакты', ['/contacts']);?></li>
<li><?=Html::a(\Yii::t('menu', 'About'), ['/about']);?></li>
<li><?=Html::a(\Yii::t('menu', 'Portfolio'), ['/case']);?></li>
<li><?=Html::a(\Yii::t('menu', 'Blog'), ['/#']);?></li>
<!-- <li><?=Html::a(\Yii::t('menu', 'Analytics school'), ['/school']);?></li> -->
<li><?=Html::a(\Yii::t('menu', 'Contacts'), ['/contacts']);?></li>
</ul>
</nav>
......@@ -28,11 +29,11 @@ use common\modules\languages\widgets\Languages;
<div class="col-md-7 col-xs-6 col-sm-12">
<nav class="top_nav clearfix">
<ul>
<li><?=Html::a('О компании', ['/about']);?></li>
<li><?=Html::a('Кейсы', ['/case']);?></li>
<li><?=Html::a('Блог', ['/#']);?></li>
<!-- <li><?=Html::a('Школа аналитики', ['/school']);?></li> -->
<li><?=Html::a('Контакты', ['/contacts']);?></li>
<li><?=Html::a(\Yii::t('menu', 'About'), ['/about']);?></li>
<li><?=Html::a(\Yii::t('menu', 'Portfolio'), ['/case']);?></li>
<li><?=Html::a(\Yii::t('menu', 'Blog'), ['/#']);?></li>
<!-- <li><?=Html::a(\Yii::t('menu', 'Analytics school'), ['/school']);?></li> -->
<li><?=Html::a(\Yii::t('menu', 'Contacts'), ['/contacts']);?></li>
</ul>
</nav>
<?= Languages::widget();?>
......
......@@ -2,3 +2,4 @@
/index-test.php
/assets
/uploads/*
/source/*
\ No newline at end of file
......@@ -9578,7 +9578,7 @@ thead tr th {
}
.les_list_top {
background: url(../images/les_top_bg.jpg) no-repeat center center;
/*background: url(../images/les_top_bg.jpg) no-repeat center center;*/
width: 100%;
height: 377px;
background-size: cover;
......@@ -11453,3 +11453,9 @@ h6 {
margin-top: 30px;
}
}
.empty-text{
margin-bottom: 30px;
}
.row li{
list-style: none;
}
\ No newline at end of file
......@@ -347,36 +347,36 @@ $(document).ready(function() {
}
});
});
$(function () {
window.validation.init({
container: '.valid_form',
});
});
$(function () {
window.validation.init({
container: '.footer_form',
});
});
$(function () {
window.validation.init({
container: '.sect_cont_form',
});
});
$(function () {
window.validation.init({
container: '.validreg_form',
});
});
$(function () {
window.validation.init({
container: '.sh_reg_form',
});
});
$(function () {
window.validation.init({
container: '.keys_mail_form',
});
});
// $(function () {
// window.validation.init({
// container: '.valid_form',
// });
// });
// $(function () {
// window.validation.init({
// container: '.footer_form',
// });
// });
// $(function () {
// window.validation.init({
// container: '.sect_cont_form',
// });
// });
// $(function () {
// window.validation.init({
// container: '.validreg_form',
// });
// });
// $(function () {
// window.validation.init({
// container: '.sh_reg_form',
// });
// });
// $(function () {
// window.validation.init({
// container: '.keys_mail_form',
// });
// });
$(".toggle-mnu").click(function () {
$(".menu").toggleClass("menu_active");
});
......
This diff is collapsed.
(function(factory) {
if (typeof define === "function" && define.amd) {
define(["jquery"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"));
} else {
factory(jQuery);
}
}
(function($) {
window.dependencyLib = $;
return $;
}));
/*
Input Mask plugin extensions
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
Version: 0.0.0-dev
Optional extensions on the jquery.inputmask base
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define(["inputmask.dependencyLib", "inputmask"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask"));
} else {
factory(window.dependencyLib || jQuery, window.Inputmask);
}
}
(function($, Inputmask) {
//extra definitions
Inputmask.extendDefinitions({
"A": {
validator: "[A-Za-z\u0410-\u044F\u0401\u0451\u00C0-\u00FF\u00B5]",
cardinality: 1,
casing: "upper" //auto uppercasing
},
"&": { //alfanumeric uppercasing
validator: "[0-9A-Za-z\u0410-\u044F\u0401\u0451\u00C0-\u00FF\u00B5]",
cardinality: 1,
casing: "upper"
},
"#": { //hexadecimal
validator: "[0-9A-Fa-f]",
cardinality: 1,
casing: "upper"
}
});
Inputmask.extendAliases({
"url": {
definitions: {
"i": {
validator: ".",
cardinality: 1
}
},
mask: "(\\http://)|(\\http\\s://)|(ftp://)|(ftp\\s://)i{+}",
insertMode: false,
autoUnmask: false
},
"ip": { //ip-address mask
mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]",
definitions: {
"i": {
validator: function(chrs, maskset, pos, strict, opts) {
if (pos - 1 > -1 && maskset.buffer[pos - 1] !== ".") {
chrs = maskset.buffer[pos - 1] + chrs;
if (pos - 2 > -1 && maskset.buffer[pos - 2] !== ".") {
chrs = maskset.buffer[pos - 2] + chrs;
} else chrs = "0" + chrs;
} else chrs = "00" + chrs;
return new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs);
},
cardinality: 1
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
return maskedValue;
}
},
"email": {
mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,64}]@*{1,64}[.*{2,64}][.*{2,6}][.*{1,2}]",
greedy: false,
onBeforePaste: function(pastedValue, opts) {
pastedValue = pastedValue.toLowerCase();
return pastedValue.replace("mailto:", "");
},
definitions: {
"*": {
validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~\-]",
cardinality: 1,
casing: "lower"
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
return maskedValue;
}
},
"mac": {
mask: "##:##:##:##:##:##"
}
});
return Inputmask;
}));
This diff is collapsed.
This diff is collapsed.
/*
Input Mask plugin extensions
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
Version: 0.0.0-dev
Phone extension.
When using this extension make sure you specify the correct url to get the masks
$(selector).inputmask("phone", {
url: "Scripts/jquery.inputmask/phone-codes/phone-codes.json",
onKeyValidation: function () { //show some metadata in the console
console.log($(this).inputmask("getmetadata")["cd"]);
}
});
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define(["jquery", "inputmask"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"), require("./inputmask"));
} else {
factory(window.dependencyLib || jQuery, window.Inputmask);
}
}
(function($, Inputmask) {
Inputmask.extendAliases({
"phone": {
url: "phone-codes/phone-codes.js",
countrycode: "",
phoneCodeCache: {},
mask: function(opts) {
if (opts.phoneCodeCache[opts.url] === undefined) {
var maskList = [];
opts.definitions["#"] = opts.definitions["9"];
$.ajax({
url: opts.url,
async: false,
type: "get",
dataType: "json",
success: function(response) {
maskList = response;
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + " - " + opts.url);
}
});
opts.phoneCodeCache[opts.url] = maskList.sort(function(a, b) {
return (a.mask || a) < (b.mask || b) ? -1 : 1;
});
}
return opts.phoneCodeCache[opts.url];
},
keepStatic: false,
nojumps: true,
nojumpsThreshold: 1,
onBeforeMask: function(value, opts) {
var processedValue = value.replace(/^0{1,2}/, "").replace(/[\s]/g, "");
if (processedValue.indexOf(opts.countrycode) > 1 || processedValue.indexOf(opts.countrycode) === -1) {
processedValue = "+" + opts.countrycode + processedValue;
}
return processedValue;
}
},
"phonebe": {
alias: "phone",
url: "phone-codes/phone-be.js",
countrycode: "32",
nojumpsThreshold: 4
}
});
return Inputmask;
}));
/*
Input Mask plugin extensions
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
Version: 0.0.0-dev
Regex extensions on the jquery.inputmask base
Allows for using regular expressions as a mask
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define(["inputmask.dependencyLib", "inputmask"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask"));
} else {
factory(window.dependencyLib || jQuery, window.Inputmask);
}
}
(function($, Inputmask) {
Inputmask.extendAliases({ // $(selector).inputmask("Regex", { regex: "[0-9]*"}
"Regex": {
mask: "r",
greedy: false,
repeat: "*",
regex: null,
regexTokens: null,
//Thx to https://github.com/slevithan/regex-colorizer for the tokenizer regex
tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,
quantifierFilter: /[0-9]+[^,]/,
isComplete: function(buffer, opts) {
return new RegExp(opts.regex).test(buffer.join(""));
},
definitions: {
"r": {
validator: function(chrs, maskset, pos, strict, opts) {
var cbuffer = maskset.buffer.slice(),
bufferStr,
regexPart = "",
isValid = false,
openGroupCount = 0,
groupToken;
function RegexToken(isGroup, isQuantifier) {
this.matches = [];
this.isGroup = isGroup || false;
this.isQuantifier = isQuantifier || false;
this.quantifier = {
min: 1,
max: 1
};
this.repeaterPart = undefined;
}
function analyseRegex() {
var currentToken = new RegexToken(),
match, m, opengroups = [];
opts.regexTokens = [];
// The tokenizer regex does most of the tokenization grunt work
while (match = opts.tokenizer.exec(opts.regex)) {
m = match[0];
switch (m.charAt(0)) {
case "(": // Group opening
opengroups.push(new RegexToken(true));
break;
case ")": // Group closing
groupToken = opengroups.pop();
if (opengroups.length > 0) {
opengroups[opengroups.length - 1].matches.push(groupToken);
} else {
currentToken.matches.push(groupToken);
}
break;
case "{":
case "+":
case "*": //Quantifier
var quantifierToken = new RegexToken(false, true);
m = m.replace(/[{}]/g, "");
var mq = m.split(","),
mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]),
mq1 = mq.length === 1 ? mq0 : (isNaN(mq[1]) ? mq[1] : parseInt(mq[1]));
quantifierToken.quantifier = {
min: mq0,
max: mq1
};
if (opengroups.length > 0) {
var matches = opengroups[opengroups.length - 1].matches;
match = matches.pop();
if (!match.isGroup) {
groupToken = new RegexToken(true);
groupToken.matches.push(match);
match = groupToken;
}
matches.push(match);
matches.push(quantifierToken);
} else {
match = currentToken.matches.pop();
if (!match.isGroup) {
groupToken = new RegexToken(true);
groupToken.matches.push(match);
match = groupToken;
}
currentToken.matches.push(match);
currentToken.matches.push(quantifierToken);
}
break;
default:
if (opengroups.length > 0) {
opengroups[opengroups.length - 1].matches.push(m);
} else {
currentToken.matches.push(m);
}
break;
}
}
if (currentToken.matches.length > 0) {
opts.regexTokens.push(currentToken);
}
}
function validateRegexToken(token, fromGroup) {
var isvalid = false;
if (fromGroup) {
regexPart += "(";
openGroupCount++;
}
for (var mndx = 0; mndx < token.matches.length; mndx++) {
var matchToken = token.matches[mndx];
if (matchToken.isGroup === true) {
isvalid = validateRegexToken(matchToken, true);
} else if (matchToken.isQuantifier === true) {
var crrntndx = $.inArray(matchToken, token.matches),
matchGroup = token.matches[crrntndx - 1];
var regexPartBak = regexPart;
if (isNaN(matchToken.quantifier.max)) {
while (matchToken.repeaterPart && matchToken.repeaterPart !== regexPart && matchToken.repeaterPart.length > regexPart.length) {
isvalid = validateRegexToken(matchGroup, true);
if (isvalid) break;
}
isvalid = isvalid || validateRegexToken(matchGroup, true);
if (isvalid) matchToken.repeaterPart = regexPart;
regexPart = regexPartBak + matchToken.quantifier.max;
} else {
for (var i = 0, qm = matchToken.quantifier.max - 1; i < qm; i++) {
isvalid = validateRegexToken(matchGroup, true);
if (isvalid) break;
}
regexPart = regexPartBak + "{" + matchToken.quantifier.min + "," + matchToken.quantifier.max + "}";
}
} else if (matchToken.matches !== undefined) {
for (var k = 0; k < matchToken.length; k++) {
isvalid = validateRegexToken(matchToken[k], fromGroup);
if (isvalid) break;
}
} else {
var testExp;
if (matchToken.charAt(0) == "[") {
testExp = regexPart;
testExp += matchToken;
for (var j = 0; j < openGroupCount; j++) {
testExp += ")";
}
var exp = new RegExp("^(" + testExp + ")$");
isvalid = exp.test(bufferStr);
} else {
for (var l = 0, tl = matchToken.length; l < tl; l++) {
if (matchToken.charAt(l) === "\\") continue;
testExp = regexPart;
testExp += matchToken.substr(0, l + 1);
testExp = testExp.replace(/\|$/, "");
for (var j = 0; j < openGroupCount; j++) {
testExp += ")";
}
var exp = new RegExp("^(" + testExp + ")$");
isvalid = exp.test(bufferStr);
if (isvalid) break;
}
}
regexPart += matchToken;
}
if (isvalid) break;
}
if (fromGroup) {
regexPart += ")";
openGroupCount--;
}
return isvalid;
}
if (opts.regexTokens === null) {
analyseRegex();
}
cbuffer.splice(pos, 0, chrs);
bufferStr = cbuffer.join("");
for (var i = 0; i < opts.regexTokens.length; i++) {
var regexToken = opts.regexTokens[i];
isValid = validateRegexToken(regexToken, regexToken.isGroup);
if (isValid) break;
}
return isValid;
},
cardinality: 1
}
}
}
});
return Inputmask;
}));
/*
* Input Mask plugin for jquery
* http://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 0.0.0-dev
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define(["jquery", "inputmask"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"), require("./inputmask"));
} else {
factory(jQuery, window.Inputmask);
}
}
(function($, Inputmask) {
if ($.fn.inputmask === undefined) {
//jquery plugin
$.fn.inputmask = function(fn, options) {
var nptmask, input = this[0];
options = options || {};
if (typeof fn === "string") {
switch (fn) {
case "unmaskedvalue":
return input && input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();
case "remove":
return this.each(function() {
if (this.inputmask) this.inputmask.remove();
});
case "getemptymask":
return input && input.inputmask ? input.inputmask.getemptymask() : "";
case "hasMaskedValue": //check wheter the returned value is masked or not; currently only works reliable when using jquery.val fn to retrieve the value
return input && input.inputmask ? input.inputmask.hasMaskedValue() : false;
case "isComplete":
return input && input.inputmask ? input.inputmask.isComplete() : true;
case "getmetadata": //return mask metadata if exists
return input && input.inputmask ? input.inputmask.getmetadata() : undefined;
case "setvalue":
$(input).val(options);
if (input && input.inputmask !== undefined) {
$(input).triggerHandler("setvalue");
}
break;
case "option":
if (typeof options === "string") {
if (input && input.inputmask !== undefined) {
return input.inputmask.option(options);
}
} else {
return this.each(function() {
if (this.inputmask !== undefined) {
return this.inputmask.option(options);
}
});
}
break;
default:
options.alias = fn;
nptmask = new Inputmask(options);
return this.each(function() {
nptmask.mask(this);
});
}
} else if (typeof fn == "object") {
nptmask = new Inputmask(fn);
if (fn.mask === undefined && fn.alias === undefined) {
return this.each(function() {
if (this.inputmask !== undefined) {
return this.inputmask.option(fn);
} else nptmask.mask(this);
});
} else {
return this.each(function() {
nptmask.mask(this);
});
}
} else if (fn === undefined) {
//look for data-inputmask atributes
return this.each(function() {
nptmask = new Inputmask(options);
nptmask.mask(this);
});
}
};
}
return $.fn.inputmask;
}));
[
{ "mask": "+32(53)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Aalst (Alost)" },
{ "mask": "+32(3)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Antwerpen (Anvers)" },
{ "mask": "+32(63)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Arlon" },
{ "mask": "+32(67)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ath" },
{ "mask": "+32(50)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Brugge (Bruges)" },
{ "mask": "+32(2)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Brussel/Bruxelles (Brussels)" },
{ "mask": "+32(71)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Charleroi" },
{ "mask": "+32(60)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Chimay" },
{ "mask": "+32(83)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ciney" },
{ "mask": "+32(52)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Dendermonde" },
{ "mask": "+32(13)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Diest" },
{ "mask": "+32(82)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Dinant" },
{ "mask": "+32(86)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Durbuy" },
{ "mask": "+32(89)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Genk" },
{ "mask": "+32(9)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Gent (Gand)" },
{ "mask": "+32(11)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Hasselt" },
{ "mask": "+32(14)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Herentals" },
{ "mask": "+32(85)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Huy (Hoei)" },
{ "mask": "+32(64)##-##-##", "cc": "BE", "cd": "Belgium", "city": "La Louvière" },
{ "mask": "+32(16)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Leuven (Louvain)" },
{ "mask": "+32(61)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Libramont" },
{ "mask": "+32(4)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Liège (Luik)" },
{ "mask": "+32(15)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mechelen (Malines)" },
{ "mask": "+32(46#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" },
{ "mask": "+32(47#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" },
{ "mask": "+32(48#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" },
{ "mask": "+32(49#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" },
{ "mask": "+32(461)8#-##-##", "cc": "BE", "cd": "Belgium", "city": "GSM-R (NMBS)" },
{ "mask": "+32(65)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mons (Bergen)" },
{ "mask": "+32(81)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Namur (Namen)" },
{ "mask": "+32(58)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Nieuwpoort (Nieuport)" },
{ "mask": "+32(54)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ninove" },
{ "mask": "+32(67)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Nivelles (Nijvel)" },
{ "mask": "+32(59)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Oostende (Ostende)" },
{ "mask": "+32(51)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Roeselare (Roulers)" },
{ "mask": "+32(55)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ronse" },
{ "mask": "+32(80)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Stavelot" },
{ "mask": "+32(12)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Tongeren (Tongres)" },
{ "mask": "+32(69)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Tounai" },
{ "mask": "+32(14)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Turnhout" },
{ "mask": "+32(87)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Verviers" },
{ "mask": "+32(58)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Veurne" },
{ "mask": "+32(19)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Wareme" },
{ "mask": "+32(10)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Wavre (Waver)" },
{ "mask": "+32(50)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Zeebrugge" }
]
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment