"onClick" => "$(\\"#kelurahan_dialog\\").dialog(\\"close\\"); $(\\"#kelurahan_name\\").val(\\"$data->kelurahanname\\"); $(\\"#Bankaddress_kelurahanid\\").val(\\"$data->kelurahanid\\");"))'), 'kelurahanid', 'kelurahanname', array('class' => 'CCheckBoxColumn', 'name' => 'recordstatus', 'selectableRows' => '0', 'header' => 'Record Status', 'checked' => '$data->recordstatus'))));
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::Button('...', array('onclick' => '$("#kelurahan_dialog").dialog("open"); return false;'));
?>
		<?php 
echo $form->error($model, 'kelurahanid');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'subdistrictid');
echo $form->hiddenField($model, 'subdistrictid');
?>
          <input type="text" name="subdistrict_name" id="subdistrict_name" readonly value="<?php 
echo Subdistrict::model()->findByPk($model->subdistrictid) !== null ? Subdistrict::model()->findByPk($model->subdistrictid)->subdistrictname : '';
?>
">
          <?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'subdistrict_dialog', 'options' => array('title' => Yii::t('app', 'Subdistrict'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$subdistrict = new Subdistrict('searchwstatus');
$subdistrict->unsetAttributes();
// clear any default values
if (isset($_GET['Subdistrict'])) {
    $subdistrict->attributes = $_GET['Subdistrict'];
}
$this->widget('zii.widgets.grid.CGridView', array('id' => 'subdistrict-grid', 'dataProvider' => $subdistrict->Searchwstatus(), 'filter' => $subdistrict, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+",
                array("name" => "send_subdistrict",
                "id" => "send_subdistrict",
                "onClick" => "$(\\"#subdistrict_dialog\\").dialog(\\"close\\"); $(\\"#subdistrict_name\\").val(\\"$data->subdistrictname\\"); $(\\"#Bankaddress_subdistrictid\\").val(\\"$data->subdistrictid\\");"))'), 'subdistrictid', 'subdistrictname', array('class' => 'CCheckBoxColumn', 'name' => 'recordstatus', 'selectableRows' => '0', 'header' => 'Record Status', 'checked' => '$data->recordstatus'))));
$this->endWidget('zii.widgets.jui.CJuiDialog');
Ejemplo n.º 2
0
	<div class="row">
		<?php 
echo $form->label($model, 'en_name');
?>
		<?php 
echo $form->textField($model, 'en_name', array('maxlength' => 255));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'subdistrict_id');
?>
		<?php 
echo $form->dropDownList($model, 'subdistrict_id', GxHtml::listDataEx(Subdistrict::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All')));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'ar_name');
?>
		<?php 
echo $form->textField($model, 'ar_name', array('maxlength' => 255));
?>
	</div>

	<div class="row buttons">
		<?php 
echo GxHtml::submitButton(Yii::t('app', 'Search'));
Ejemplo n.º 3
0
		<?php 
echo $form->labelEx($model, 'en_name');
?>
		<?php 
echo $form->textField($model, 'en_name', array('maxlength' => 255));
?>
		<?php 
echo $form->error($model, 'en_name');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'subdistrict_id');
?>
		<?php 
echo $form->dropDownList($model, 'subdistrict_id', GxHtml::listDataEx(Subdistrict::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'subdistrict_id');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'ar_name');
?>
		<?php 
echo $form->textField($model, 'ar_name', array('maxlength' => 255));
?>
		<?php 
echo $form->error($model, 'ar_name');
?>
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Subdistrict::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Ejemplo n.º 5
0
echo $form->textField($model, 'en_name', array('maxlength' => 255));
?>
		<?php 
echo $form->error($model, 'en_name');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'governerate_id');
?>
		<?php 
echo $form->dropDownList($model, 'governerate_id', GxHtml::listDataEx(Governorate::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'governerate_id');
?>
		</div><!-- row -->

		<label><?php 
echo GxHtml::encode($model->getRelationLabel('subdistricts'));
?>
</label>
		<?php 
echo $form->checkBoxList($model, 'subdistricts', GxHtml::encodeEx(GxHtml::listDataEx(Subdistrict::model()->findAllAttributes(null, true)), false, true));
?>

<?php 
echo GxHtml::submitButton(Yii::t('app', 'Save'));
$this->endWidget();
?>
</div><!-- form -->
 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Kelurahan List';
     $pdf->AddPage('P');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $header = array('No', 'ID', 'Subdistrict', 'Kelurahan');
     $model = new Kelurahan('searchwstatus');
     $dataprovider = $model->searchwstatus();
     $dataprovider->pagination = false;
     $data = $dataprovider->getData();
     $cols = $dataprovider->getKeys();
     $dataku = array(count($data));
     //var_dump($dataku);
     $w = array(20, 25, 50, 50);
     $pdf->SetTableHeader();
     //Header
     for ($i = 0; $i < count($header); $i++) {
         $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
     }
     $pdf->Ln();
     $pdf->SetTableData();
     //Data
     $fill = false;
     $i = 0;
     foreach ($data as $datas) {
         $i = $i + 1;
         $pdf->Cell($w[0], 6, $i, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[1], 6, $datas['kelurahanid'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[2], 6, Subdistrict::model()->findbypk($datas['subdistrictid'])->subdistrictname, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[3], 6, $datas['kelurahanname'], 'LR', 0, 'L', $fill);
         $pdf->Ln();
         $fill = !$fill;
     }
     $pdf->Cell(array_sum($w), 0, '', 'T');
     // me-render ke browser
     $pdf->Output('kelurahan.pdf', 'D');
 }
Ejemplo n.º 7
0
<?php

$this->breadcrumbs = array($model->label(2) => array('index'), Yii::t('app', 'Manage'));
$this->menu = array(array('label' => Yii::t('app', 'List') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Create') . ' ' . $model->label(), 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('community-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1><?php 
echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2));
?>
</h1>

<p>
You may optionally enter a comparison operator (&lt;, &lt;=, &gt;, &gt;=, &lt;&gt; or =) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php 
echo GxHtml::link(Yii::t('app', 'Advanced Search'), '#', array('class' => 'search-button'));
?>
<div class="search-form">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'community-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', 'code', 'en_name', array('name' => 'subdistrict_id', 'value' => 'GxHtml::valueEx($data->subdistrict)', 'filter' => GxHtml::listDataEx(Subdistrict::model()->findAllAttributes(null, true))), 'ar_name', array('class' => 'CButtonColumn'))));