<?php

/**
 * @var string $listClass
 * @var array $widgetParams
 */
echo \kartik\widgets\Typeahead::widget($widgetParams);
?>


Example #2
0
<?php

use yii\helpers\Html;
//use yii\bootstrap\ActiveForm;
use kartik\form\ActiveForm;
use kartik\widgets\Typeahead;
use yii\helpers\Url;
?>

<div class="system-article-search">
    <?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get', 'type' => ActiveForm::TYPE_INLINE]);
?>
	
<div class="input-group pull-right">
	<span class="input-group-btn">
    <?php 
echo Typeahead::widget(['name' => 'q', 'options' => ['placeholder' => 'search articles...'], 'scrollable' => true, 'pluginOptions' => ['highlight' => true], 'dataset' => [['datumTokenizer' => "Bloodhound.tokenizers.obj.whitespace('value')", 'display' => 'value', 'remote' => ['url' => Url::to(['article/search-list']) . '?q=%QUERY', 'wildcard' => '%QUERY']]]]);
?>
	</span>
	<?php 
echo Html::submitButton(Yii::t('backend', 'Search'), ['class' => 'btn btn-primary']);
?>
</div>   
    <?php 
ActiveForm::end();
?>
</div>
Example #3
0
    
        </script>-->

    <?php 
echo '<label class="control-label">Nama Mahasiswa</label>';
echo Typeahead::widget(['name' => 'FormIzin[nama_mahasiswa]', 'options' => ['placeholder' => 'Ketik Nama Mahasiswa', 'id' => 'nameMhs'], 'scrollable' => true, 'pluginOptions' => ['highlight' => true], 'dataset' => [['prefetch' => Url::to(['request/mahasiswalist']), 'limit' => 10]], 'pluginEvents' => ['typeahead:selected' => 'function() {
            var nama = $(this).val();
            
            $.getJSON("index.php?r=aitk/request/getmahasiswa",{name:nama}, function(data) {
             $("#dataMahasiswa").show();
             $("#namaMahasiswa").replaceWith("<p id =namaMahasiswa>"+data[0].nama_mahasiswa + "</p>");
             $("#nimMahasiswa").replaceWith("<p id =nimMahasiswa>"+data[0].nim + "</p>");
             $("#kelasMahasiswa").replaceWith("<p id =kelasMahasiswa>"+data[0].kelas + "</p>");
             $("#semesterMahasiswa").replaceWith("<p id =semesterMahasiswa>"+data[0].semester + "</p>");
             $("#waliMahasiswa").replaceWith("<p id =waliMahasiswa>"+data[0].wali + "</p>");
             $(".matakuliahIzin").replaceWith("<div class=matakuliahIzin style=\\" display:none\\"> </div>");
             $("#Krad").attr("checked" , false);$("#Srad").attr("checked" , false);

             $(".matakuliahIzin").append("<label class=\\"control-label\\" for=FormIzin[matakuliahList][]> Matakuliah Yang Tidak Di Ikuti</label> <br/> <br/>");
            $.each( data[0].matakuliah, function( key, value ) {
            $(".matakuliahIzin").append("<input  id=ck"+value.matakuliah.split(" ")[0] +" type=checkbox value ="+value.matakuliah+" name=FormIzin[matakuliahList][] class=mtkuliah ><label class=\\"control-label\\" for= "+value.matakuliah+" >"+value.matakuliah+"</label> </input>");
                        }); 

    });

}']]);
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 1, 'attributes' => ['waktuKeluar' => ['label' => 'Tanggal ', 'attributes' => ['tanggal_mulai' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\DateTimePicker', 'options' => ['options' => ['placeholder' => 'Time from...', 'id' => 'timeStart' . 'mulaiKeluar']]], 'tanggal_selesai' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\DateTimePicker', 'options' => ['options' => ['placeholder' => 'Time to...', 'id' => 'timeEnd' . 'Keluar']]]]], 'alasan_ijin' => ['label' => 'Alasan', 'type' => Form::INPUT_TEXTAREA, 'options' => ['placeholder' => 'Max 160 Characters', 'maxlength' => 160]], 'lampiran' => ['label' => 'Lampiran', 'type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter Lampiran Code If Exist', 'maxlength' => 160]]]]);
?>


    <div class="panel panel-info" id="dataMahasiswa" >
Example #4
0
            <div class="alert_handler">

            </div>
            <?php 
echo Html::beginForm();
?>
            <div class="col-md-4">
                <?php 
echo '<label class="control-label">Search by Barcode</label>';
echo Typeahead::widget(['name' => 'barcode_search', 'options' => ['placeholder' => 'Search for Product...', 'id' => 'barcode_search'], 'pluginOptions' => ['highlight' => true], 'pluginEvents' => ["typeahead:select" => 'function(ev, suggestion) { purchaseProduct(); }'], 'dataset' => [['datumTokenizer' => "Bloodhound.tokenizers.obj.whitespace('value')", 'display' => 'value', 'remote' => ['url' => Url::to(['products/product-list-barcode']) . '?q=%QUERY', 'wildcard' => '%QUERY'], 'limit' => 10]]]);
?>
            </div>
            <div class="col-md-8">
                <?php 
echo '<label class="control-label">Search by Name</label>';
echo Typeahead::widget(['name' => 'name_search', 'options' => ['placeholder' => 'Search for Product...', 'id' => 'name_search'], 'pluginOptions' => ['highlight' => true], 'pluginEvents' => ["typeahead:select" => 'function(ev, suggestion) { $("#barcode_search").val(suggestion.barcode); purchaseProduct();  }'], 'dataset' => [['datumTokenizer' => "Bloodhound.tokenizers.obj.whitespace('value')", 'display' => 'value', 'remote' => ['url' => Url::to(['products/product-list-name']) . '?q=%QUERY', 'wildcard' => '%QUERY'], 'limit' => 10]]]);
?>

            </div>
            <div class="clearfix"></div>
            <br/>
            <div class="col-md-12">
                <div class="form-group">
                    <?php 
echo Html::submitButton('Purchase', ['class' => 'btn btn-success', 'onclick' => 'purchaseProduct()']);
?>
                </div>
            </div>
            <?php 
echo Html::endForm();
?>
Example #5
0
    }
    //$labeloption = ['class'=> implode(' ', $class)];
    return Html::tag('span', Html::tag('input', '', $inputoption) . ' ' . $label);
}, 'itemOptions' => ['container' => ['class' => 'btn btn-primary'], 'class' => 'noicheck']]);
?>
         
    <div class="form-group" id="selected_id" style="display:none">
     </div>
    <div class="form-group" id="selected_items">
        <?php 
echo ListVenue::widget(['model' => $model]);
?>
     </div>
    <label class="control-label">Search Establishment / Venue</label>
    <?php 
echo Typeahead::widget(['name' => 'venue', 'id' => 'venue', 'options' => ['placeholder' => 'Type a venue or restaurant name to map with after city selection'], 'scrollable' => true, 'pluginEvents' => ['typeahead:selected' => "function(e,datum) {\n                        var array = \$.map(datum, function(value, index) {\n                            return [value];\n                        });\n                        console.log(array);\n                        //var reultString = array.toString();\n                        //var resultArray = reultString.split(',');\n                        //console.log(resultArray);\n                        var id =  array[0];\n                        \$('#selected_items').show();\n                        //console.log(id);\n                        var radio = \$(\"input[name='" . $model->formName() . "[eventtypeselector]']:checked\").val();\n                        //radioTypeEst = document.getElementById('radioEstablishment').checked;\n                        //radioTypeVenue = document.getElementById('radioVenue').checked;\n                        \n                        if(radio != 200 && radio != 1 && radio != 2 && radio != 3 ){\n                            radio = 0;\n                        }\n                        \n                        var icon = 'fa-tag';\n                        \n                        if(radio == 0){\n                            icon = 'fa-cutlery';\n                        }\n                        \n                        var countval = \$('#venueC').val();\n                        \n                         \n\n                        var maData = '<div id=\"venueArray[]\"><i class=\"fa '+icon+'\"></i>'+\$('#venue').val()+'<input type=\"hidden\"  value ='+id+' class=\"form-control\"  name=\"" . $model->formName() . "[venue]['+countval+'][venueId]\"><input type=\"hidden\" value ='+radio+' class=\"form-control\"  name=\"" . $model->formName() . "[venue]['+countval+'][venuetype]\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href= \"javascript:void(0);\" class=\"delete\">Delete</a></div>'\n                       countval++;\n                        \n                        \$('#venueC').val(countval);\n                        \$('#selected_items').append(maData);\n                       \n                        \$('#venue').val('');             \n\n                        //\$(this).data().term = null;\n                        //\$('.typeahead').typeahead('val', '');.\n\n                        }", 'typeahead:closed' => "function(){ \$('#venue').val('');}"], 'pluginOptions' => ['highlight' => true, 'minLength' => 1], 'dataset' => [['remote' => ['url' => Url::toRoute(['event/fetch-venue']) . '?q=%QUERY', 'replace' => new JsExpression("function (url, query){                                        \n                                        url = url.replace('%QUERY', query);\n                                        var type = \$(\"input[name='" . $model->formName() . "[eventtypeselector]']:checked\").val();\n                                        console.log('type:'+type);\n                                        \n                                        var city = \$('#" . Html::getInputId($model, 'cityId') . "').val();\n                                        console.log('city:'+city);\n                                        url = url+'&cityId='+city+'&type='+type;\n                                        return url;\n                                    }")], 'templates' => ['empty' => '<div class="text-error">No records found.</div>']]]]);
?>
    <?php 
//*/
?>
    
    <p><h4 class="box-title">More Details</h4></p> 
    
    <?php 
echo $form->field($model, 'description')->widget(CKEditor::className(), ['preset' => 'custom', 'clientOptions' => Yii::$app->params['ckeditor']['default']]);
?>
    <?php 
//$form->field($model, 'description')->textarea(['rows' => 10,'cols'=>80,'class'=>'textarea col-md-12','placeholder'=>'Please enter description here'])
?>
    
    <?php 
Example #6
0
        $(document).ready (function() {
            $("#nameMhs").change(function () {
            $("#kelasDropDown").attr("disabled", false);
            });

        }); 
', yii\web\View::POS_READY);
?>

    <script>
    </script>

    <?php 
echo ' <div id=searchNama> <label class="control-label">Search By Nama</label>';
echo Typeahead::widget(['name' => 'FormSearchReport[nama_mahasiswa]', 'options' => ['placeholder' => 'Ketik Nama Mahasiswa', 'id' => 'nameMhs'], 'scrollable' => true, 'pluginOptions' => ['highlight' => true], 'dataset' => [['prefetch' => Url::to(['request/mahasiswalist']), 'limit' => 10]], 'pluginEvents' => ['typeahead:selected' => 'function() {
                $("#kelasDropDown").attr("disabled" , true);
                $("#kelasDropDown").attr("value" , "");
                }']]);
echo '</div>';
?>

    <?php 
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 4, 'attributes' => ['kelas' => ['label' => 'Search By Kelas', 'type' => Form::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map(AitkRKelas::find()->all(), 'kelas_id', 'kode_kelas'), 'options' => ['id' => 'kelasDropDown', 'prompt' => '---', 'onchange' => '
                        var val =(this.value);
                        if(val!="") {
                        $("#nameMhs").attr("disabled", true);
                        }
                        else {
                        $("#nameMhs").attr("disabled", false);
                        }           
                    ']]]]);
?>