Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = CsServices::find();
     $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;
     }
     $query->andFilterWhere(['id' => $this->id, 'industry_id' => $this->industry_id, 'action_id' => $this->action_id, 'object_id' => $this->object_id, 'unit_id' => $this->unit_id, 'process' => $this->process, 'geospecific' => $this->geospecific, 'added_by' => $this->added_by, 'added_time' => $this->added_time, 'hit_counter' => $this->hit_counter]);
     /*$query->andFilterWhere(['like', 'name', $this->name])
       ->andFilterWhere(['like', 'action', $this->action])
       ->andFilterWhere(['like', 'object_name', $this->object_name])
       ->andFilterWhere(['like', 'service_type', $this->service_type])
       ->andFilterWhere(['like', 'amount', $this->amount])
       ->andFilterWhere(['like', 'pic', $this->pic])
       ->andFilterWhere(['like', 'service_object', $this->service_object])
       ->andFilterWhere(['like', 'consumer', $this->consumer])
       ->andFilterWhere(['like', 'support', $this->support])
       ->andFilterWhere(['like', 'location', $this->location])
       ->andFilterWhere(['like', 'time', $this->time])
       ->andFilterWhere(['like', 'duration', $this->duration])
       ->andFilterWhere(['like', 'turn_key', $this->turn_key])
       ->andFilterWhere(['like', 'tools', $this->tools])
       ->andFilterWhere(['like', 'labour_type', $this->labour_type])
       ->andFilterWhere(['like', 'frequency', $this->frequency])
       ->andFilterWhere(['like', 'coverage', $this->coverage])
       ->andFilterWhere(['like', 'dat', $this->dat])
       ->andFilterWhere(['like', 'status', $this->status]);*/
     return $dataProvider;
 }
Exemplo n.º 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = CsServices::find();
     $query->joinWith(['t t']);
     //$query->joinWith(['object', 'products']);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 2]]);
     $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;
     }
     $query->andFilterWhere(['id' => $this->id, 'industry_id' => $this->industry_id, 'action_id' => $this->action_id, 'object_id' => $this->object_id]);
     $query->andFilterWhere(['like', 't.name', $this->name]);
     return $dataProvider;
 }
Exemplo n.º 3
0
 /**
  * Displays a single CsObjects model.
  * @param string $id
  * @return mixed
  */
 public function actionView($id)
 {
     $model = $this->findModel($id);
     $query = \common\models\CsObjectProperties::find()->where(['object_id' => $model->id]);
     if ($model->getPath($model)) {
         foreach ($model->getPath($model) as $key => $objectpp) {
             if ($objectPropertiespp = $objectpp->objectProperties) {
                 foreach ($objectPropertiespp as $objectPropertypp) {
                     if ($objectPropertypp->property_class != 'private') {
                         $query->orWhere(['object_id' => $objectpp->id]);
                     }
                 }
             }
         }
     }
     return $this->render('view', ['model' => $model, 'products' => new ActiveDataProvider(['query' => \common\models\CsProducts::find()->where(['object_id' => $model->id])]), 'issues' => new ActiveDataProvider(['query' => \common\models\CsObjectIssues::find()->where(['object_id' => $model->id])]), 'properties' => new ActiveDataProvider(['query' => $query->orderBy('property_type')->groupBy('id')]), 'methods' => new ActiveDataProvider(['query' => \common\models\CsServices::find()->where(['object_id' => $model->id])])]);
 }
Exemplo n.º 4
0
 /**
  * Displays a single CsIndustries model.
  * @param integer $id
  * @return mixed
  */
 public function actionView($title = null)
 {
     if (isset($title)) {
         $this->layout = '//index_service';
         $ind_tr = $this->findModelByTitle($title);
         // ako je našao ime usluge, renderuj stranicu - URL injection
         if ($ind_tr) {
             $model = $this->findModel($ind_tr->industry_id);
             $dataProvider_services = new ActiveDataProvider(['query' => CsServices::find()->where('industry_id=' . $model->id)]);
             $dataProvider_presentations = new ActiveDataProvider(['query' => CsServices::find()->where('industry_id=' . $model->id)]);
             $dataProvider_promotions = new ActiveDataProvider(['query' => CsServices::find()->where('industry_id=' . $model->id)]);
             $dataProvider_orders = new ActiveDataProvider(['query' => CsServices::find()->where('industry_id=' . $model->id)]);
             $dataProvider_providers = new ActiveDataProvider(['query' => CsServices::find()->where('industry_id=' . $model->id)]);
             return $this->render('view', ['model' => $model, 'dataProvider_services' => $dataProvider_services, 'dataProvider_presentations' => $dataProvider_presentations, 'dataProvider_promotions' => $dataProvider_promotions, 'dataProvider_orders' => $dataProvider_orders, 'dataProvider_providers' => $dataProvider_providers]);
         }
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 5
0
    /**
     * Renders the widget
     */
    public function run()
    {
        if ($this->cart['session'] != null) {
            ?>
		<div class="card_container <?php 
            echo $this->card_class;
            ?>
" id="card_container" style="float:none;">		       
	        <div class="header-context">
	            <div class="head lower gray-color regular">Vaša korpa</div>
	            <div class="subhead">Lorem ipsum</div>
	            <?php 
            echo Html::a('<i class="fa fa-trash-o"></i>', Url::to(['/empty-cart']), ['class' => 'btn btn-link', 'style' => 'width:100%']);
            ?>
	        </div>
	        <?php 
            foreach ($this->cart['session'] as $s) {
                $service = \common\models\CsServices::findOne($s['service']);
                ?>
			        <div class="secondary-context tease">
			            <p><?php 
                echo c($service->tName);
                ?>
</p>
			        </div>
	        <?php 
            }
            ?>
	        
	        <div class="action-area center">
	            <?php 
            echo Html::a('<i class="fa fa-shopping-cart"></i>&nbsp;' . Yii::t('app', 'Poruči'), Url::to(['/new-order', 'industry' => $this->cart['industry']]), ['class' => 'btn btn-info', 'style' => 'width:100%']);
            ?>
	        </div>		   
		</div>
<?php 
        }
    }
Exemplo n.º 6
0
            </div>
            <div class="secondary-context cont">
                <span><i class="fa fa-globe"></i>&nbsp;7.345</span>
                <span>&nbsp;<i class="fa fa-users"></i>&nbsp;468</span>
                <span>&nbsp;<i class="fa fa-rss fa-rotate-270"></i>&nbsp;223</span>
                <p>You have successfully created your Yii-powered application.</p>
            </div>
            <div class="action-area right">
                <?php 
echo Html::a('<i class="fa fa-shopping-cart"></i>&nbsp;' . Yii::t('app', 'Order'), Url::to(), ['class' => 'btn btn-success']);
?>
            </div>
        </a>
    </div>
    <?php 
$query = \common\models\CsServices::find();
$countQuery = clone $query;
$pages = new Pagination(['totalCount' => $countQuery->count()]);
$models = $query->offset($pages->offset)->limit($pages->limit)->all();
foreach ($models as $service) {
    echo ServiceBox::widget(['serviceId' => $service->id, 'containerOptions' => '', 'link' => '/s/' . mb_strtolower(str_replace(' ', '-', $service->t[0]->name)), 'image' => ['source' => 'info_docs' . substr($service->id, -1) . '.jpg'], 'name' => $service->t[0]->name, 'subhead' => $service->industry->t[0]->name, 'description' => $service->industry->t[0]->description, 'stats' => ['orders' => 346, 'providers' => 71, 'promotions' => 102], 'price' => ['amount' => rand(1000, 10000), 'currencyCode' => 'RSD', 'unit' => 'm'], 'actionButton' => '']);
}
?>
</div>    

        <div class="row">
            <div class="col-lg-4">
                <h2>Heading</h2>

                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
                    dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
 /**
  * Finds the Presentations model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Presentations the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findService($id)
 {
     if (($model = \common\models\CsServices::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 8
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getServices()
 {
     return $this->hasMany(CsServices::className(), ['unit_id' => 'id']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getService()
 {
     return $this->hasOne(CsServices::className(), ['id' => 'service_id']);
 }
Exemplo n.º 10
0
    
    </div>
    <div class="show_more"><?= Html::a('POKAŽI JOŠ', Url::to('/services'), array('class'=>'btn btn-default')); ?></div>
    <?php endif; */
}
?>
<!-- POPULAR SERVICES -->
<hr style="margin-top:0">
<div class="featured">
	<h2 style="text-align:left; margin:30px 0 10px 0;"><i class="fa fa-thumbs-o-up"></i> Preporučene usluge</h2>
	<p class="paragraph fs_11 gray_color margin-bottom-20"><?php 
echo Yii::t('app', 'Choose category by clicking on the colored boxes and then select one of the service industry from the list below.');
?>
</p>
	<?php 
foreach (CsServices::find()->where('industry_id=631 OR industry_id=681')->limit(4)->all() as $key => $service) {
    ?>
		<?php 
    echo $this->render('_card_comm.php', ['model' => $service]);
    ?>
	<?php 
}
// foreach ($sektor as $key=>$sek)
?>
</div>
<div class="show_more"><?php 
echo Html::a('POKAŽI JOŠ', Url::to('/services'), array('class' => 'btn btn-default'));
?>
</div>

Exemplo n.º 11
0
use yii\helpers\Url;
use kartik\widgets\ActiveForm;
use kartik\switchinput\SwitchInput;
use kartik\widgets\DatePicker;
use kartik\select2\Select2;
use yii\helpers\ArrayHelper;
use kartik\widgets\FileInput;
?>


<?php 
$form = kartik\widgets\ActiveForm::begin(['id' => 'form-horizontal', 'type' => ActiveForm::TYPE_HORIZONTAL, 'fullSpan' => 7, 'formConfig' => ['labelSpan' => 3, 'deviceSize' => ActiveForm::SIZE_MEDIUM], 'options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'service_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(\common\models\CsServices::find()->all(), 'id', 'name'), 'options' => ['placeholder' => 'Izaberite...'], 'language' => 'sr-Latn', 'changeOnReset' => false]);
?>

    <?php 
echo $form->field($model, 'object_property_id')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'requirement')->checkbox();
?>

    <?php 
echo $form->field($model, 'readOnly')->checkbox();
?>

    <div class="row" style="margin:20px;">
Exemplo n.º 12
0
 /**
  * Lists all CsServices models.
  * @return mixed
  */
 public function actionIndex()
 {
     $request = Yii::$app->request;
     $post = $request->post('CsServicesSearch');
     // industry
     if (isset($post['industry_id']) && $post['industry_id'] != null && $post['industry_id'] != '') {
         $industry = CsIndustries::findOne($post['industry_id']);
         return $this->redirect(['/services/i/' . slug($industry->tName)]);
     }
     // object
     if (isset($post['object_id']) && $post['object_id'] != null && $post['object_id'] != '') {
         $object = CsObjects::findOne($post['object_id']);
         return $this->redirect(['/services/o/' . slug($object->tName)]);
     }
     // product
     if (isset($post['product_id']) && $post['product_id'] != null && $post['product_id'] != '') {
         $product = CsProducts::findOne($post['product_id']);
         return $this->redirect(['/services/p/' . slug($product->name)]);
     }
     // action
     if (isset($post['action_id']) && $post['action_id'] != null && $post['action_id'] != '') {
         $action = CsActions::findOne($post['action_id']);
         return $this->redirect(['/services/a/' . slug($action->tName)]);
     }
     // service
     if (isset($post['id']) && $post['id'] != null && $post['id'] != '') {
         $service = CsServices::findOne($post['id']);
         return $this->redirect(['/s/' . slug($service->tName)]);
     }
     // tags
     if (isset($post['tag_id']) && $post['tag_id'] != null && $post['tag_id'] != '') {
         $tag = CsTags::findOne($post['tag_id']);
         switch ($tag->entity) {
             case 'action':
                 return $this->redirect(['/services', 'a' => $tag->entity_id]);
                 break;
             case 'object':
                 return $this->redirect(['/services', 'o' => $tag->entity_id]);
                 break;
             case 'industry':
                 return $this->redirect(['/services', 'i' => $tag->entity_id]);
                 break;
             case 'service':
                 $service = CsServices::findOne($tag->entity_id);
                 return $this->redirect(['/s/' . slug($service->tName)]);
                 break;
             default:
                 return $this->redirect(['/services']);
                 break;
         }
     }
     if (isset($post['name']) && $post['name'] != null && $post['name'] != '') {
         return $this->redirect(['/services', 'q' => $post['name']]);
     }
 }
Exemplo n.º 13
0
 public function getServices()
 {
     return $this->hasMany(CsServices::className(), ['id' => 'service_id'])->viaTable('order_services', ['order_id' => 'id']);
 }