コード例 #1
0
ファイル: routes.php プロジェクト: Bhayangrw/sillab
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
//login
Route::get('test', function () {
    $kelurahan = Kelurahan::all();
    $kepalaKeluarga = KepalaKeluarga::where('nama_kk', '=', 'Helmi')->first();
    return $kepalaKeluarga->kelurahan->nama_kelurahan;
});
Route::group(array('before' => 'auth'), function () {
    Route::get('logout', array('uses' => 'UserController@logout'));
    // Route yang ingin diproteksi simpan disini
    Route::get('/', function () {
        date_default_timezone_set("Asia/Bangkok");
        $tgl_reg = date("Y-m-d");
        $transdat = DB::table('v_datapasien')->where('tgl_reg', '=', $tgl_reg)->count();
        $transbil = Billing::where('tgl_reg', '=', $tgl_reg)->count();
        $transruj = ViewRujukandetail::where('tgl_reg', '=', $tgl_reg)->count();
        return View::make('index', compact('transbil', 'transruj', 'transdat'));
    });
    //dashboard
    Route::get('dashboard', 'DashboardController@index');
コード例 #2
0
echo CHtml::Button('...', array('onclick' => '$.fn.yiiGridView.update("city-grid");$("#city_dialog").dialog("open"); return false;'));
?>
		<?php 
echo $form->error($model, 'cityid');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'kelurahanid');
echo $form->hiddenField($model, 'kelurahanid');
?>
          <input type="text" name="kelurahan_name" id="kelurahan_name" readonly >
          <?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'kelurahan_dialog', 'options' => array('title' => Yii::t('app', 'Sub Subdistrict'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$kelurahan = new Kelurahan('searchwstatus');
$kelurahan->unsetAttributes();
// clear any default values
if (isset($_GET['Kelurahan'])) {
    $kelurahan->attributes = $_GET['Kelurahan'];
}
$this->widget('zii.widgets.grid.CGridView', array('id' => 'kelurahan-grid', 'dataProvider' => $kelurahan->Searchwstatus(), 'filter' => $kelurahan, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+",
                array("name" => "send_kelurahan",
                "id" => "send_kelurahan",
                "onClick" => "$(\\"#kelurahan_dialog\\").dialog(\\"close\\"); $(\\"#kelurahan_name\\").val(\\"$data->kelurahanname\\"); $(\\"#Customeraddress_kelurahanid\\").val(\\"$data->kelurahanid\\");"))'), array('name' => 'kelurahanid', 'visible' => false, 'value' => '$data->kelurahanid', 'htmlOptions' => array('width' => '1%')), 'kelurahanname')));
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::Button('...', array('onclick' => '$.fn.yiiGridView.update("kelurahan-grid");$("#kelurahan_dialog").dialog("open"); return false;'));
?>
		<?php 
echo $form->error($model, 'kelurahanid');
?>
コード例 #3
0
 /**
  * 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 = Kelurahan::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }