bagi yang belum lihat artikel saya sebelumnya mungkin bisa dilihat dulu pda link yang ane kasih di atas tadi. Langsung saja pada komputer servernya Pilih Open Network and Sharing Center..
Setelah itu pilih Set up a wireless ad hoc
Hanya sekedar blog untuk sharing informasi tentang pengetahuan terutama programming, teknologi dan ilmu.
<?php echo CHtml::checkBox("load_ajax",false,array('id'=>'load_risk_all'));echo "Load All Risk Child";
$url=CController::createUrl('project/vieweach',array('project_id'=>$model->project_id));
Yii::app()->clientScript->registerScript("check",
'$("#load_risk_all").change(function(){
if($(this).is(":checked")){
$("#load_risk").load("'.$url.'");
$("#load_risk").fadeIn();
}else{
$("#load_risk").html("");
}
})
',
CClientScript::POS_READY);
?>
<div id="load_risk">
</div>
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view','vieweach'),//tambahkan view each disini
'users'=>array('@'),
),
public actionViewEach($project_id){
$criteria=new CDbCriteria();
$criteria->addColumnCondition(array('project_id'=>$project_id));
$provider=new CActiveDataProvider('Project',array('criteria'=>$criteria));
$this->renderPartial('/risk/view_each',array('provider'=>$provider),false,true);
}
<?php echo CHtml::checkbox("load risk",false,array("onChange"=>"js:yourcustomfunction()")); ?> //jangan lupa untuk meregister yourcustomfunction menggunakan registerScript
<div class="row">
<?php echo $form->dropDownList($model,'country_id',
CHtml::listData(Country::model()->findAll(), 'id', 'country_name'),
array('empty'=>'Select Country'))?>
</div>
Yup itu aja yang ditambahkan untuk membuat dropdown list di yii
$date = "2012-02-16"; $newdate = strtotime ( '-3 day' , strtotime ( $date ) ) ; //mengurangi 3 hari hasilnya 2012-02-13 $newdate2 = strtotime ( '+3 week' , strtotime ( $date ) ) ;//menambahkan 3 minggu $newdate3 = strtotime ( '-3 year' , strtotime ( $date ) ) ;//mengurangi 3 tahun $newdate = date ( 'Y-m-j' , $newdate ); //untuk menyimpan ke dalam variabel baru echo $newdate;
$d = mktime(0,0,0,$month,$day,$year);
$end_date = date("Y m d",strtotime("+2 days",$d));
//To add days to current date
date('Y-m-d', strtotime("+2 days"));
$this->widget('zii.widgets.jui.CJuiDatePicker',
array(
// you must specify name or model/attribute
//'model'=>$model,
//'attribute'=>'projectDateStart',
'name'=>'Project[projectDateStart]',
// optional: what's the initial value/date?
//'value' => $model->projectDateStart
'value' => '08/20/2010',
// optional: change the language
//'language' => 'de',
//'language' => 'fr',
//'language' => 'es',
'language' => 'pt-BR',
/* optional: change visual
* themeUrl: "where the themes for this widget are located?"
* theme: theme name. Note that there must be a folder under themeUrl with the theme name
* cssFile: specifies the css file name under the theme folder. You may specify a
* single filename or an array of filenames
* try http://jqueryui.com/themeroller/
*/
'themeUrl' => Yii::app()->baseUrl.'/css/jui' ,
'theme'=>'pool', //try 'bee' also to see the changes
'cssFile'=>array('jquery-ui.css' /*,anotherfile.css, etc.css*/),
// optional: jquery Datepicker options
'options' => array(
// how to change the input format? see http://docs.jquery.com/UI/Datepicker/formatDate
'dateFormat'=>'mm/dd/yy',
// user will be able to change month and year
'changeMonth' => 'true',
'changeYear' => 'true',
// shows the button panel under the calendar (buttons like "today" and "done")
'showButtonPanel' => 'true',
// this is useful to allow only valid chars in the input field, according to dateFormat
'constrainInput' => 'false',
// speed at which the datepicker appears, time in ms or "slow", "normal" or "fast"
'duration'=>'fast',
// animation effect, see http://docs.jquery.com/UI/Effects
'showAnim' =>'slide',
),
// optional: html options will affect the input element, not the datepicker widget itself
'htmlOptions'=>array(
'style'=>'height:30px;
background:#ffbf00;
color:#00a;
font-weight:bold;
font-size:0.9em;
border: 1px solid #A80;
padding-left: 4px;'
)
)
);
<?php $this->widget('application.extensions.emultiselect.EMultiSelect',
array('sortable'=>true/true, 'searchable'=>true/true));?>
<?php echo $form->dropDownList(new TProjectHasTUnit(),'unit_id_FK',$list,
array('multiple'=>'multiple',
'key'=>'unit_id', 'class'=>'multiselect')
); ?>
<?php $this->widget('application.extensions.emultiselect.EMultiSelect',
array('sortable'=>true/true, 'searchable'=>true/true));
$m=TUnit::model()->findAll();
$list=CHtml::listData($m,'unit_id','name');
if($model->isNewRecord){
echo $form->dropDownList(new TProjectHasTUnit(),'id_unit_kerja_FK',$list,
array('multiple'=>'multiple',
'key'=>'unit_id', 'class'=>'multiselect')
);
}else{
$selected_scope=TProjectHasTUnit::model()->findAllByAttributes(array('project_id_FK'=>$model->project_id));
$selected_key_scope=array();
foreach ($selected_scope as $val){
$selected_key_scope[]=$val->id_unit_kerja_FK;
}
echo $form->dropDownList(new TProjectHasTUnit(),'id_unit_kerja_FK',$list,
array('multiple'=>'multiple',
'key'=>'unit_id', 'class'=>'multiselect','options'=>$this->createOptions($selected_key_scope))
);
}
?>
public function createOptions($arraySelectedValue){
$selected_attr=array('selected'=>'selected');
$all=array();
foreach($arraySelectedValue as $val){
$all["$val"]=$selected_attr;
}
return $all;
}
Sip itu dulu post yiiframework pertama ane.. Maklum buat posting kalo lagi ada yang mau dishare aja..