Пример #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Warga_block::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]);
     $query->andFilterWhere(['like', 'RUMAH_BLOCK', $this->RUMAH_BLOCK]);
     return $dataProvider;
 }
Пример #2
0
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\Select2;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use kartik\widgets\DepDrop;
use kartik\widgets\TouchSpin;
/* @var $this yii\web\View */
/* @var $model ubud\dashboard\models\Warga_data */
/* @var $form yii\widgets\ActiveForm */
use ubud\dashboard\models\Warga_status;
use ubud\dashboard\models\Rt;
use ubud\dashboard\models\Warga_block;
$sttNm = ArrayHelper::map(Warga_status::find()->all(), 'ID', 'RUMAH_STATUS');
$dataRt = ArrayHelper::map(Rt::find()->all(), 'id_rt', 'ket_rt');
$dataBlock = ArrayHelper::map(Warga_block::find()->all(), 'RUMAH_BLOCK', 'RUMAH_BLOCK');
/* $aryBlok= [
		  ['RUMAH_BLOCK' => 1, 'DESCRIP' => 'G1'],		  
		  ['RUMAH_BLOCK' => 2, 'DESCRIP' => 'G2'],
		  ['RUMAH_BLOCK' => 3, 'DESCRIP' => 'G3'],
		  ['RUMAH_BLOCK' => 4, 'DESCRIP' => 'G4'],
		  ['RUMAH_BLOCK' => 5, 'DESCRIP' => 'G5'],
		  ['RUMAH_BLOCK' => 6, 'DESCRIP' => 'G6'],
		  ['RUMAH_BLOCK' => 7, 'DESCRIP' => 'G7'],
		  ['RUMAH_BLOCK' => 8, 'DESCRIP' => 'G8'],
		  ['RUMAH_BLOCK' => 9, 'DESCRIP' => 'G27'],
		  ['RUMAH_BLOCK' => 10, 'DESCRIP' => 'G28'],
		  ['RUMAH_BLOCK' => 11, 'DESCRIP' => 'G29'],
		  ['RUMAH_BLOCK' => 12, 'DESCRIP' => 'G30'],
		  ['RUMAH_BLOCK' => 13, 'DESCRIP' => 'G31'],
		  ['RUMAH_BLOCK' => 14, 'DESCRIP' => 'G32'],
Пример #3
0
 /**
  * Finds the Warga_block model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Warga_block the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Warga_block::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }