/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Lost::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); 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, 'cat_id' => $this->cat_id, 'user_id' => $this->user_id, 'date' => $this->date]); $query->andFilterWhere(['like', 'image', $this->image])->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'status_m', $this->status_m])->andFilterWhere(['like', 'status_f', $this->status_f])->andFilterWhere(['like', 'description', $this->description]); return $dataProvider; }
top: 23%; right: 25%; } </style> <div class="content"> <!-- Staff Slider--> <div class="container"> <a href="#" class="next-staff"></a> <a href="#" class="prev-staff"></a> <div class="staff-slider" data-snap-ignore="true"> <?php $premiums = Lost::find()->where(['status_p' => 1])->all(); foreach ($premiums as $premium) { $user = User::findOne(['id' => $premium['user_id']]); $category = Cats::findOne(['id' => $premium['cat_id']]); $category1 = Cats::findOne(['id' => $premium['cat_1']]); $category2 = Cats::findOne(['id' => $premium['cat_2']]); $category3 = Cats::findOne(['id' => $premium['cat_3']]); ?> <div> <a href="#popup" class="lost follow" lost_id="<?php echo $premium['id']; ?> " elan_type="lost" > <span class="premium-span">
use dosamigos\datetimepicker\DateTimePicker; use common\models\Lost; /* @var $this yii\web\View */ /* @var $model common\models\Premiums */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="premiums-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'lost_id')->dropDownList(ArrayHelper::map(Lost::find()->all(), 'id', 'id'), ['promt' => 'Select Category']); ?> <?php echo $form->field($model, 'amount')->textInput(['maxlength' => 8]); ?> <?php echo DateTimePicker::widget(['model' => $model, 'attribute' => 'start_date', 'language' => 'en', 'size' => 'ms', 'inline' => true, 'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd - HH:ii:ss P', 'todayBtn' => true]]); ?> <?php echo DateTimePicker::widget(['model' => $model, 'attribute' => 'end_date', 'language' => 'en', 'size' => 'ms', 'inline' => true, 'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd - HH:ii:ss P', 'todayBtn' => true]]); ?>
</p> <div class="decoration2"></div> <?php } } catch (Exception $e) { } ?> </div> <div class="one-third-responsive last-column"> <?php $c_1 = Lost::find()->where(['status_m' => 'active'])->andWhere(['cat_1' => $model->id])->limit(4)->offset(8)->all(); $c_2 = Lost::find()->where(['status_m' => 'active'])->andWhere(['cat_2' => $model->id])->limit(4)->offset(8)->all(); $c_3 = Lost::find()->where(['status_m' => 'active'])->andWhere(['cat_3' => $model->id])->limit(4)->offset(8)->all(); $c_id = Lost::find()->where(['status_m' => 'active'])->andWhere(['cat_id' => $model->id])->limit(4)->offset(8)->all(); if ($c_1) { $losts = $c_1; } if ($c_2) { $losts = $c_2; } if ($c_3) { $losts = $c_3; } if ($c_id) { $losts = $c_id; } try { foreach ($losts as $lost) { $user = User::findOne(['id' => $lost['user_id']]);
<?php /* @var $this yii\web\View */ $this->title = 'Admin'; ?> <div class="site-index"> <div class="jumbotron"> <h1>Cəmi elan sayı</h1> <?php $lost_all = \common\models\Lost::find()->count(); $found_all = \common\models\Found::find()->count(); $count_all = $lost_all + $found_all; $lost_premium = \common\models\Lost::find()->where(['status_p' => 1])->count(); $lost_active = \common\models\Lost::find()->where(['status_m' => 'active'])->count(); $lost_inactive = \common\models\Lost::find()->where(['status_m' => 'inactive'])->count(); $found_active = \common\models\Found::find()->where(['status_m' => 'active'])->count(); $found_inactive = \common\models\Found::find()->where(['status_m' => 'inactive'])->count(); ?> <p class="lead"><?php echo $count_all; ?> </p> <p><a class="btn btn-lg btn-success" href="http://etap.az/">Sayta keç</a></p> </div> <div class="body-content"> <div class="row"> <div class="col-lg-4">
?> </a></h2> </div> <div class="lf-block"> <h2 class="found-button tab-but-2"><a><?php echo yii::t('yii', 'FOUND'); ?> </a></h2> </div> </div> <div class="decoration2"></div> <div class="one-responsive tab-content tab-content-1"> <?php $losts = Lost::find()->where(['user_id' => $model->id])->all(); foreach ($losts as $lost) { $user = User::findOne(['id' => $lost['user_id']]); $category = Cats::findOne(['id' => $lost['cat_id']]); $category1 = Cats::findOne(['id' => $lost['cat_1']]); $category2 = Cats::findOne(['id' => $lost['cat_2']]); $category3 = Cats::findOne(['id' => $lost['cat_3']]); ?> <p class="user-list-follow"> <?php if ($lost['image']) { ?> <img src="/admin/<?php echo $lost['image']; ?> " alt="img">
<p> <?php echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a('Delete', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'image', 'value' => '/frontend/web/' . $model->image, 'format' => ['image', ['width' => '100', 'height' => '100']]], 'title', 'cat_id', 'user_id', 'date', 'status_m', 'status_f', 'description', 'note']]); ?> <?php $posts = Lost::find()->where(['title' => $model->title])->andWhere('id != :id', ['id' => $model->id])->limit(10)->asArray()->all(); if ($posts) { foreach ($posts as $post) { ?> <a href="<?php echo $url = Url::to(['lost/view', 'id' => $post['id']]); ?> "><?php echo $post['title']; ?> </a> <?php } } ?>
<?php use common\models\Lost; if (isset($_POST['lost_id']) && !empty($_POST['lost_id'])) { $lost = (int) $_POST['lost_id']; // $connection = new \yii\db\Connection([ // 'dsn' => 'mysql:host=localhost;dbname=etap', // 'username' => 'root', // 'password' => '', // ]); // $connection->open(); //$query = $connection->createCommand('SELECT * FROM lost WHERE id=$lost'); $query = Lost::find()->where(['id' => $lost])->all(); $q = mysql_fetch_assoc($query); $name = $q['user_id']; $cat_1 = $q['cat_1']; $cat_2 = $q['cat_2']; $cat_id = $q['cat_id']; $city = $q['city_id']; $description = $q['description']; $phone = $q['user_phone']; $result = <<<HTML <a href="#" class="close-popup">Tamam<i class="fa fa-close"></i></a> <div class="popup-content"> <div>test</dev> <div class="quote-slider full-bottom" data-snap-ignore="true"> <div> <img src="/newtemp/images/highlights/1.jpg" alt="img"> </div>
<i class="fa fa-angle-right"></i> <?php //=$category->title_az ?> </em><em class="user-lf">Itirilib</em></strong> <a href="#popup" class="follow">Ətraflı</a> </p> <div class="decoration2"></div> <?php } ?> </div> <div class="one-third-responsive last-column"> <?php $losts = Lost::find()->where(['status_m' => 'active'])->limit(4)->offset(8)->all(); foreach ($losts as $lost) { $user = User::findOne(['id' => $lost['user_id']]); $category = Cats::findOne(['id' => $lost['cat_id']]); $category1 = Cats::findOne(['id' => $lost['cat_1']]); $category2 = Cats::findOne(['id' => $lost['cat_2']]); $category3 = Cats::findOne(['id' => $lost['cat_3']]); ?> <p class="user-list-follow"> <?php if ($lost['image']) { ?> <img src="/admin/<?php echo $lost['image']; ?> " alt="img">