public function actionDynamicthana()
 {
     $data = Thana::model()->findAll('district_id= ' . (int) $_POST['Youtube']['district'] . ' AND published=1');
     $data = CHtml::listData($data, 'id', 'title');
     foreach ($data as $id => $value) {
         echo CHtml::tag('option', array('value' => $id), CHtml::encode($value), true);
     }
 }
Beispiel #2
0
 public static function getThana($id)
 {
     $value = Thana::model()->findByAttributes(array('id' => $id));
     if (empty($value->title)) {
         return 'Not set';
     } else {
         return $value->title;
     }
 }
Beispiel #3
0
<?php

$this->breadcrumbs = array('Youtubes' => array('admin'), 'Manage');
$this->menu = array(array('label' => 'Manage', 'url' => array('admin'), 'active' => true, 'icon' => 'icon-home'), array('label' => 'New', 'url' => array('create'), 'active' => true, 'icon' => 'icon-file'), array('label' => '', 'class' => 'search-button', 'url' => '#', 'active' => true, 'icon' => 'icon-search search-button'));
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('youtube-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
Yii::app()->clientScript->registerScript('re-install-date-picker', "\nfunction reinstallDatePicker(id, data) {\n    \$('#datepicker1').datepicker();\n    \$('#datepicker2').datepicker();\n}\n");
?>
<div class="search-form" style="display:none">
    <?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'youtube-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'id', 'type' => 'raw', 'value' => '$data->id', 'htmlOptions' => array('style' => "text-align:left;width:80px;", 'title' => 'ID')), 'youtube_id', array('name' => 'district', 'type' => 'raw', 'value' => 'District::getDistrict($data->district)', 'filter' => CHtml::activeDropDownList($model, 'district', CHtml::listData(District::model()->findAll(array('condition' => '', "order" => "title")), 'id', 'title'), array('empty' => 'All')), 'htmlOptions' => array('style' => "text-align:left;width:150px;", 'title' => 'District')), array('name' => 'thana', 'type' => 'raw', 'value' => 'Thana::getThana($data->thana)', 'filter' => CHtml::activeDropDownList($model, 'thana', CHtml::listData(Thana::model()->findAll(array('condition' => '', "order" => "title")), 'id', 'title'), array('empty' => 'All')), 'htmlOptions' => array('style' => "text-align:left;width:150px;", 'title' => 'Thana')), array('name' => 'published', 'header' => "Status", 'value' => '$data->published?Yii::t(\'app\',\'Active\'):Yii::t(\'app\', \'Inactive\')', 'filter' => array('' => Yii::t('app', 'All'), '0' => Yii::t('app', 'Inactive'), '1' => Yii::t('app', 'Active')), 'htmlOptions' => array('style' => "text-align:center;")), array('name' => 'featured', 'value' => '$data->featured?Yii::t(\'app\',\'Yes\'):Yii::t(\'app\', \'No\')', 'filter' => array('' => Yii::t('app', 'All'), '0' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes')), 'htmlOptions' => array('style' => "text-align:center;")), array('name' => 'created_on', 'value' => 'date("F j, Y, g:i A", strtotime($data->created_on))', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'created_on', 'htmlOptions' => array('id' => 'datepicker2', 'size' => '10'), 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'defaultOptions' => array('showOn' => 'focus', 'dateFormat' => 'yy-mm-dd', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => false)), true), 'htmlOptions' => array('style' => "text-align:center;")), array('class' => 'bootstrap.widgets.TbButtonColumn'))));
Beispiel #4
0
        <div class="span5">
            <?php 
echo $form->labelEx($model, 'district');
?>
            <?php 
echo District::get_district_list('Edirectory', 'district', $model->district);
?>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span5">
            <?php 
echo $form->labelEx($model, 'thana');
?>
            <?php 
echo Thana::get_thana_list('Edirectory', 'thana', $model->thana);
?>
        </div>
    </div>
    <?php 
echo $form->dropDownListControlGroup($model, 'published', array('1' => 'Yes', '0' => 'No'));
?>

    <div class="form-actions">
        <?php 
echo TbHtml::submitButton('Search', array('color' => TbHtml::BUTTON_COLOR_PRIMARY));
?>
    </div>

    <?php 
$this->endWidget();
 /**
  * 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 $id the ID of the model to be loaded
  * @return Thana the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Thana::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Beispiel #6
0
<div class="widget-box">
    <div class="widget-header">
        <h5>Details Directory (<?php 
echo $model->title;
?>
)</h5>
        <div class="widget-toolbar">
            <a data-action="settings" href="#"><i class="icon-cog"></i></a>
            <a data-action="reload" href="#"><i class="icon-refresh"></i></a>
            <a data-action="collapse" href="#"><i class="icon-chevron-up"></i></a>
            <a data-action="close" href="#"><i class="icon-remove"></i></a>
        </div>
        <div class="widget-toolbar">
            <?php 
echo CHtml::link('<i class="icon-pencil"></i>', array('update', 'id' => $model->id), array('data-rel' => 'tooltip', 'title' => 'Edit', 'data-placement' => 'bottom'));
?>
        </div>
        <div class="widget-toolbar">
            <?php 
echo CHtml::link('<i class="icon-plus"></i>', array('create'), array('data-rel' => 'tooltip', 'title' => 'Add', 'data-placement' => 'bottom'));
?>
        </div>
    </div><!--/.widget-header -->
    <div class="widget-body">
        <div class="widget-main">
            <?php 
$this->widget('zii.widgets.CDetailView', array('htmlOptions' => array('class' => 'table table-striped table-condensed table-hover'), 'data' => $model, 'attributes' => array('id', array('name' => 'category', 'type' => 'raw', 'value' => DirectoryCategory::getDirectoryCategory($model->category)), 'title', 'address', 'postcode', array('name' => 'country', 'type' => 'raw', 'value' => Country::getCountry($model->country)), array('name' => 'state', 'type' => 'raw', 'value' => State::getState($model->state)), array('name' => 'city', 'type' => 'raw', 'value' => City::getCity($model->city)), array('name' => 'district', 'type' => 'raw', 'value' => District::getDistrict($model->district)), array('name' => 'thana', 'type' => 'raw', 'value' => Thana::getThana($model->thana)), 'telephone', 'mobile', 'email', 'fax', 'website', 'details', array('name' => 'created_by', 'type' => 'raw', 'value' => UserAdmin::get_user_name($model->created_by)), array('name' => 'created_on', 'type' => 'raw', 'value' => UserAdmin::get_date_time($model->created_on)), array('name' => 'modified_by', 'type' => 'raw', 'value' => UserAdmin::get_user_name($model->modified_by)), array('name' => 'modified_on', 'type' => 'raw', 'value' => UserAdmin::get_date_time($model->modified_on)), array('name' => 'published', 'value' => $model->published ? "Yes" : "No"), 'hits')));
?>
        </div>
    </div><!--/.widget-body -->
</div><!--/.widget-box -->
Beispiel #7
0
<?php

$this->breadcrumbs = array('Youtubes' => array('admin'), $model->youtube_id);
$this->menu = array(array('label' => 'Manage', 'url' => array('admin'), 'active' => true, 'icon' => 'icon-home'), array('label' => 'New', 'url' => array('create'), 'active' => true, 'icon' => 'icon-file'), array('label' => 'Edit', 'url' => array('update', 'id' => $model->id), 'active' => true, 'icon' => 'icon-pencil'), array('label' => 'Delete', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?'), 'active' => true, 'icon' => 'icon-remove'));
?>

<div class="form-actions">
    <h2><?php 
echo $model->youtube_id;
?>
</h2>
</div>

<?php 
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('id', 'youtube_id', array('name' => 'district', 'type' => 'raw', 'value' => District::getDistrict($model->district)), array('name' => 'thana', 'type' => 'raw', 'value' => Thana::getThana($model->thana)), array('name' => 'published', 'type' => 'raw', 'value' => $model->published ? "Yes" : "No"), array('name' => 'featured', 'type' => 'raw', 'value' => $model->featured ? "Yes" : "No"), array('name' => 'created_on', 'type' => 'raw', 'value' => date("F j, Y, g:i A", strtotime($model->created_on))), 'created_by')));