/** * Renders the data cell content. * * @param integer $row the row number (zero-based) * @param YdActiveRecord $data the data associated with the row */ protected function renderDataCellContent($row, $data) { ob_start(); parent::renderDataCellContent($row, $data); $parentContents = ob_get_clean(); if ($data instanceof CActiveRecord) { $links = is_callable(array($data, 'getMenuLinks')) ? call_user_func(array($data, 'getMenuLinks')) : array(); if ($links) { if (is_callable(array($data, 'getUrl'))) { $this->buttonOptions['type'] = TbHtml::BUTTON_TYPE_LINK; $this->buttonOptions['url'] = call_user_func(array($data, 'getUrl')); } echo '<div class="filter-container">'; $this->buttonOptions['split'] = true; echo TbHtml::buttonDropdown($parentContents, $links, $this->buttonOptions); echo '</div>'; } else { $url = is_callable(array($data, 'getUrl')) ? call_user_func(array($data, 'getUrl')) : false; if ($url) { $this->buttonOptions['class'] = isset($this->buttonOptions['class']) ? $this->buttonOptions['class'] . ' btn' : 'btn'; echo TbHtml::link($parentContents, $url, $this->buttonOptions); } else { echo TbHtml::button($parentContents, $this->buttonOptions); } } } else { echo TbHtml::button($parentContents, $this->buttonOptions); } }
public function renderImages() { $html = <<<EOF <div id='imagesnow' style='display:none;min-height:330px;border:1px dashed slategray;overflow-x:scroll;' onload="startimagesnow"> <ul id="sortable"></ul> </div> EOF; echo CHtml::openTag('div', array('class' => 'controls')); echo $html; echo TbHtml::button("图片预览", array('id' => 'Post_togglemagesnow')); echo TbHtml::button("上传图片", array('id' => 'Post_selectImage')); echo TbHtml::activeHiddenField($this->model, 'images'); echo CHtml::closeTag('div'); }
attr_table.append(tr); }); '); ?> <div class="form aform"> <?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'attribute-form', 'enableAjaxValidation' => false)); ?> <div class="row-fluid"> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'product-attribute-grid', 'type' => array(TbHtml::GRID_TYPE_STRIPED, TbHtml::GRID_TYPE_BORDERED, TbHtml::GRID_TYPE_CONDENSED), 'dataProvider' => new CArrayDataProvider($attribute), 'columns' => array(array('class' => 'common.extensions.editable.EditableColumn', 'name' => 'attribute_id', 'header' => Yii::t('label', 'Attribute Name'), 'editable' => array('send' => 'never', 'title' => Yii::t('label', 'Enter Name'), 'emptytext' => Yii::t('label', 'Add Name'), 'source' => $this->createUrl('getAttributeName'), 'type' => 'select', 'onSave' => 'js: function(e, params) { updateInput("ProductAttribute", "attribute_id", jQuery(this).parent(), params.newValue); }')), array('class' => 'common.extensions.editable.EditableColumn', 'name' => 'text', 'header' => Yii::t('label', 'Text'), 'editable' => array('send' => 'never', 'title' => Yii::t('label', 'Enter Text'), 'emptytext' => Yii::t('label', 'Add Text'), 'type' => 'textarea', 'onSave' => 'js: function(e, params) { updateInput("ProductAttribute", "text", jQuery(this).parent(), params.newValue); }')), array('class' => 'bootstrap.widgets.TbButtonColumn', 'htmlOptions' => array('style' => 'width: 20px'), 'buttons' => array('delete' => array('label' => Yii::t('label', 'Delete'), 'options' => array("class" => "dattrval", 'title' => Yii::t('label', 'Delete')))), 'template' => ' {delete}')))); ?> <span class="span2 offset8"><?php echo TbHtml::button(Yii::t('label', 'Add Attribute'), array('class' => 'add-attr', 'color' => TbHtml::BUTTON_COLOR_PRIMARY)); ?> </span> </div> <?php $this->endWidget(); ?> </div><!-- form -->
<div class="col-md-3 col-sm-6"> <div class="span2"><?php echo $form->labelEx($model, 'transfer_to', array('class' => 'inline-labels')); ?> </div> <div class="span3"><?php echo $form->dropDownList($model, 'transfer_to', CHtml::listData(CommodityCategory::model()->findAll('path!=:path AND commodity_id=:commodity_id', array('path' => $consumable['category_id'], 'commodity_id' => $_GET['commodity_id'])), 'path', 'path'), array('span' => 2, 'prompt' => '---')); ?> </div> </div> </div> </tr> </table> <div style="text-align: center;"> <?php echo TbHtml::submitButton($model->isNewRecord ? 'Submit' : 'Update', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_DEFAULT, 'onclick' => 'js:document.location.href="http://localhost/asset_management/index.php/consumable/admin"')); ?> <?php echo TbHtml::button('Cancel', array('color' => TbHtml::BUTTON_COLOR_DANGER, 'size' => TbHtml::BUTTON_SIZE_DEFAULT, 'onclick' => 'history.go(-1)')); ?> </div> <br/> <?php $this->endWidget(); ?> </div><!-- form -->
<div class="well-button"> <?php echo TbHtml::Button('<i class="fa fa-arrow-left"></i> Back', array('onclick' => 'js:document.location.href="/mtcontrool/runs/create"', 'id' => 'b1', 'title' => 'Back', 'color' => TbHtml::BUTTON_COLOR_DEFAULT, 'size' => TbHtml::BUTTON_SIZE_SMALL, 'style' => 'color: green;')); ?> <?php echo TbHtml::submitButton('<i class="fa fa-check fa-lg"></i> Next', array('class' => 'btn btn-success btn-small pull-right', 'name' => 'confirm', 'style' => 'color: white; margin-left: 4px;', 'title' => 'Next', 'confirm' => 'Are you sure?')); ?> <?php echo TbHtml::button('<i class="fa fa-times fa-lg"></i> Cancel', array('onclick' => 'js:document.location.href="/mtcontrool"', 'color' => TbHtml::BUTTON_COLOR_DANGER, 'size' => TbHtml::BUTTON_SIZE_SMALL, 'title' => 'Cancel', 'class' => 'btn pull-right', 'style' => 'color: white;')); ?> </div> <div class="group-div"> <?php $this->widget('bootstrap.widgets.BootGroupGridView', array('id' => 'characteristic-quest', 'dataProvider' => $model->searchPlat($idPlat), 'selectableRows' => '500', 'summaryText' => 'Choose', 'extraRowColumns' => array('id_criteria'), 'extraRowExpression' => '"<b style=\\"font-size: 1.0em; color: #696969; aling: center;\\">".$data->idCriteria->name."</b>"', 'columns' => array(array('id' => 'selectedIds', 'class' => 'CCheckBoxColumn', 'value' => '$data->id', 'header' => 'foddo'), array('name' => 'All Characteristics', 'value' => '$data->name')))); ?> </div> <?php
<pre class="prettyprint linenums"> <?php TbHtml::pageHeader('Example page header', 'Subtext for header'); ?></pre> </section> <!-- Thumbnails ================================================== --> <section id="thumbnails"> <?php $thumbnail = array('image' => 'holder.js/260x180', 'url' => '#'); ?> <?php $captionThumbnail = array('image' => 'holder.js/300x200', 'label' => 'Thumbnail label', 'caption' => '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>' . TbHtml::button('Action', array('style' => 'primary')) . ' ' . TbHtml::button('Action')); ?> <div class="page-header"> <h1>Thumbnails <small>Grids of images, videos, text, and more</small> </h1> </div> <h2>Default thumbnails</h2> <div class="row-fluid"> <?php echo TbHtml::thumbnails(array($thumbnail, $thumbnail, $thumbnail, $thumbnail)); ?> </div>
foreach ($profileFields as $field) { if ($field->widgetEdit($profile)) { echo $field->widgetEdit($profile); } elseif ($field->range) { echo $form->dropDownListControlGroup($profile, $field->varname, Profile::range($field->range)); } elseif ($field->field_type == "TEXT") { echo $form->textAreaControlGroup($profile, $field->varname, array('rows' => 6, 'cols' => 50)); } else { echo $form->textFieldControlGroup($profile, $field->varname, array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255)); } } } ?> <?php if (UserModule::doCaptcha('registration')) { ?> <?php $this->widget('CCaptcha'); ?> <?php echo $form->textFieldControlGroup($model, 'verifyCode', array('hint' => UserModule::t("Please enter the letters as they are shown in the image above.") . UserModule::t("Letters are not case-sensitive."))); ?> <?php } ?>
/** * Renders the data cell content. * This method renders the view, update and toggle buttons in the data cell. * @param integer $row the row number (zero-based) * @param mixed $data the data associated with the row */ protected function renderDataCellContent($row, $data) { $checked = CHtml::value($data, $this->name); $toggleOptions = $this->toggleOptions; $toggleOptions['icon'] = $checked === null ? $this->emptyIcon : ($checked ? $this->checkedIcon : $this->uncheckedIcon); $toggleOptions['url'] = isset($toggleOptions['url']) ? $this->evaluateExpression($toggleOptions['url'], array('data' => $data, 'row' => $row)) : '#'; if (!$this->displayText) { $htmlOptions = TbArray::getValue('htmlOptions', $this->toggleOptions, array()); $htmlOptions['title'] = $this->getButtonLabel($checked); $htmlOptions['rel'] = 'tooltip'; echo CHtml::link(TbHtml::icon($toggleOptions['icon']), $toggleOptions['url'], $htmlOptions); } else { echo TbHtml::button($this->getButtonLabel($checked), $toggleOptions); } }
public function botonAsignar($idTutor, $idStudent) { if (empty($idTutor)) { return TbHtml::button("Tutor", array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'size' => TbHtml::BUTTON_SIZE_MINI, 'submit' => array('/students/students/view', 'id' => $idStudent))); } return ""; }
<?php $this->renderPartial('index', array('model'=>$model)); // muestra la galeria de imagenes // definida en index $this->widget('bootstrap.widgets.TbModal', array( 'id' => 'myModal', 'show'=>'true', // prepara el formulario para mostrarlo en modal, con el rederpartial, y la variable en true // lo que significa que no muestra en pantalla el _login, sino que // lo incluye dentro del widget 'content' => $this->renderPartial('_login', array('model'=>$model), true), //'footer' => array( //TbHtml::button('Save Changes', array('data-dismiss' => 'modal', 'color' => TbHtml::BUTTON_COLOR_PRIMARY)), //TbHtml::button('Close', array('data-dismiss' => 'modal')), //), )); ?> <div class='centrado mt40' > <?php echo TbHtml::button('Ingresar', array( 'color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_LARGE, 'icon'=>'user', 'data-toggle' => 'modal', 'data-target' => '#myModal', )); ?> </div>
<?php $this->widget('yiiwheels.widgets.select2.WhSelect2', array('asDropDownList' => false, 'name' => 'tenant', 'pluginOptions' => array('width' => '90%', 'initSelection' => 'js:function(element,callback){}', 'ajax' => array('url' => $this->createUrl('/transaction/AddPoint/GetTenant'), 'dataType' => 'json', 'data' => "js:function(term,page) {\n return {q: term};\n }", 'results' => "js:function(data,page) {\n return {results: data};\n }")))); ?> </div></div> <?php echo TbHtml::textFieldControlGroup('pointearned', '', array('label' => 'Point', 'readonly' => true)); ?> </div> <div class="span-8" style="margin-left:-2px"> <?php echo TbHtml::button('Add To List', array('style' => 'width:930px', 'id' => 'addtolist')); ?> </div> <div class="span-8" style="margin-left:-2px;margin-top:15px;"> <input type="hidden" id="table_length" name="table_length" value="0"/> <table class="items table table-striped table-bordered" style="width:930px"> <thead> <tr><th>ID Receipt</th><th>Receipt Date</th><th>Tenant</th><th>Payment</th><th>Total Purchase</th><th>Point Earned</th></tr> </thead> <tbody id="addtolistbody"> </tbody> </table> <h5 style="text-align:right;margin-right:120px">Grand Total Point Earned : <span id="grandtotal">0</span></h5> </div>
'size' => TbHtml::BUTTON_SIZE_SMALL, 'style'=>'margin:5px;', )); // prepara el formulario de contacto para modal $this->widget('bootstrap.widgets.TbModal', array( 'id' => 'myModal', 'header' => Yii::t('app', 'Add')." ".Yii::t('app', 'Contact'), 'content' => $this->renderPartial('//contacto/_form_osagrupacion', array('idosagrupacion'=>$model->idosagrupacion,'modelclass'=>get_class($model),'model' => $modelContacto), true), )); // boton para carga de contacto modal echo TbHtml::button(Yii::t('app', 'Add')." ".Yii::t('app', 'Contact'), array( 'color' => TbHtml::BUTTON_COLOR_INFO, 'size' => TbHtml::BUTTON_SIZE_SMALL, 'data-toggle' => 'modal', 'data-target' => '#myModal', )); }else{ echo '<div>'; echo TbHtml::labelTb('Debe guardar la OOSS de Agrupación antes de ingresar los datos de contacto.', array('color' => TbHtml::LABEL_COLOR_INFO, 'style' => 'margin-top:10px;font-size:11px;padding:10px;')); echo '</div>'; } ?> </div> </fieldset>
<div id='listado-funciones'> <?php foreach ($model->funciones as $funcion) { $this->renderPartial('/funciones/formulario', array('model' => $funcion)); } ?> </div> <i id="feedback-funcion" class="fa fa-3x" ></i><br/><br/> <?php echo TbHtml::button(' Agregar una función', array('class' => 'btn-agregar-funcion btn btn-success fa fa-2x fa-plus-circle center')); ?> </div> <?php } $this->widget('bootstrap.widgets.TbModal', array('id' => 'dlg-confiPvFuncion', 'header' => 'Selecciona el rango de fechas', 'content' => "<div is='dlg'></div>", 'footer' => implode(' ', array(TbHtml::button('Guardar cambios', array('data-dismiss' => 'modal', 'class' => 'btn btn-primary')), TbHtml::button('Cerrar', array('class' => 'btn', 'data-dismiss' => 'modal')))))); ?> <?php Yii::app()->clientScript->registerScriptFile("js/holder.js"); Yii::app()->clientScript->registerScript("subir-boleto", "\n\t\t\t\t\t\tvar ext= ['jpg','png','bmp','jpeg'];\n\t\t\t\t\$('#btn-subir-imabol').on('click',function(){ \$('#imabol').trigger('click'); });\n\t\t\t \$('#imabol').on('change',function(){\n\t\t\t\t\t if (\$(this).val()!='' && \$(this).val()!=null) {\n\t\t\t\t\t\t\t if (\$.inArray(\$(this).val().split('.').pop(),ext)==-1) {\n\t\t\t\t\t\t\t\t\t alert('El archivo no tiene extension xls, por favor seleccione otro.');\n\t\t\t\t\t\t\t\t\t\$(this).val('');\t\n\t\t\t\t\t\t}else{\t \n\t\t\t\t\t\t\t\tvar fd = new FormData();\n\t\t\t\t\t\t\t\tvar imagen = document.getElementById('imabol');\n\t\t\t\t\t\t\t\tfd.append('imagen', imagen.files[0]);\n\t\t\t\t\t\t\t\tfd.append('prefijo', 'boleto_');\n\t\t\t\t\t\t\t\t\$.ajax({\n\t\t\t\t\t\t\t\t\t\turl: '" . Yii::app()->createUrl('evento/subirImagen') . "',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\t\t\t\t\tdata: fd,\n\t\t\t\t\t\t\t\t\t\t\t\tprocessData: false, // tell jQuery not to process the data\n\t\t\t\t\t\t\t\t\t\t\t\tcontentType: false, // tell jQuery not to set contentType\n\t\t\t\t\t\t\t\t\t\t\t\tsuccess: function(data){ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (data) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\$('#Evento_EventoImaBol').val(data);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\$('#img-imabol').attr('src','../imagesbd/'+data);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t}).fail(function(){alert('Error!')});\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t }\n\t\t\t});\n\t\t\t\$('#btn-subir-imamin').on('click',function(){ \$('#imamin').trigger('click'); });\n\t\t\t \$('#imamin').on('change',function(){\n\t\t\t\t\t if (\$(this).val()!='' && \$(this).val()!=null) {\n\t\t\t\t\t\t\t if (\$.inArray(\$(this).val().split('.').pop(),ext)==-1) {\n\t\t\t\t\t\t\t\t\t alert('El archivo no tiene extension xls, por favor seleccione otro.');\n\t\t\t\t\t\t\t\t\t\$(this).val('');\t\n\t\t\t\t\t\t}else{\t \n\t\t\t\t\t\t\t\tvar fd = new FormData();\n\t\t\t\t\t\t\t\tvar imagen = document.getElementById('imamin');\n\t\t\t\t\t\t\t\tfd.append('imagen', imagen.files[0]);\n\t\t\t\t\t\t\t\tfd.append('prefijo', 'pv_');\n\t\t\t\t\t\t\t\t\$.ajax({\n\t\t\t\t\t\t\t\t\t\turl: '" . Yii::app()->createUrl('evento/subirImagen') . "',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\t\t\t\t\tdata: fd,\n\t\t\t\t\t\t\t\t\t\t\t\tprocessData: false, // tell jQuery not to process the data\n\t\t\t\t\t\t\t\t\t\t\t\tcontentType: false, // tell jQuery not to set contentType\n\t\t\t\t\t\t\t\t\t\t\t\tsuccess: function(data){ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (data) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\$('#Evento_EventoImaMin').val(data);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\$('#img-imamin').attr('src','../imagesbd/'+data);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t}).fail(function(){alert('Error!')});\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t }\n\t\t\t});\n "); ?> <?php if (isset($model) and is_object($model) and $model->EventoId) { Yii::app()->clientScript->registerScript('agregar-funcion', sprintf("\n\n\n\$('.btn-quitar-funcion').live('click',function(){\n\t\tif(confirm('¿Esta usted seguro de querer eliminar esta función? Esta operación es irreversible')){\t\t\t\n\t\t\tvar ff=\$(this).data('id');\n\t\t\t\$.ajax({\n\t\t\t\turl:'" . $this->createUrl('funciones/quitar') . "',\n\t\t\t\ttype:'post',\n\t\t\t\tdata:{eid:" . $model->EventoId . ",fid:ff},\n\t\t\t\tsuccess: function(){\n\t\t\t\t\t\$('#f-" . $model->EventoId . "-'+ff).remove();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n});\n\n\$('.btn-generar-arbol').live('click',function(){\n\t\tvar obj=\$(this);\n\t\tvar fid=obj.data('fid')\n\t\t\$.ajax({\n\t\t\t\turl:obj.attr('href'),\n\t\t\t\ttype:'POST',\n\t\t\t\tdata:{Funciones:{EventoId:" . $model->EventoId . ", FuncionesId:fid}},\n\t\t\t\tsuccess:function(resp){ \$('#arbol-'+fid).html(resp)}\n\t\t});\t\t\n\t\treturn false;\n});\n\n", $this->createUrl('funciones/insertar', array('eid' => $model->EventoId))), CClientScript::POS_READY); } Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . '/js/jquery.datetimepicker.js', CClientScript::POS_BEGIN); Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . '/js/evento.js'); Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl . '/css/jquery.datetimepicker.css'); ?>
echo TbHtml::beginForm(); ?> <div class="row-fluid"> <?php echo TbHtml::Label('Transaction Reference #', 'trans_id'); ?> <?php echo TbHtml::TextField('trans_id'); ?> <p class="hint"><?php echo Yii::t('label', "Please enter your Transaction Reference Number."); ?> </p> </div> <div class="row-fluid submit"> <?php echo TbHtml::button(yii::t('label', 'Get Status'), array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'submit' => '')); ?> </div> <?php echo TbHtml::endForm(); ?> </div><!-- form --> <?php } ?> </div> </div>
<div class="form aform"> <?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'special-form', 'enableAjaxValidation' => false)); ?> <div class="row-fluid"> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'product-special-grid', 'type' => array(TbHtml::GRID_TYPE_STRIPED, TbHtml::GRID_TYPE_BORDERED, TbHtml::GRID_TYPE_CONDENSED), 'dataProvider' => new CArrayDataProvider($special), 'columns' => array(array('class' => 'common.extensions.editable.EditableColumn', 'name' => 'c_group_id', 'header' => Yii::t('label', 'Customer Group'), 'editable' => array('send' => 'never', 'title' => Yii::t('label', 'Enter Customer Group'), 'emptytext' => Yii::t('label', 'Add Customer Group'), 'source' => $this->createUrl('getCustomerGroup'), 'type' => 'select', 'onSave' => 'js: function(e, params) { updateInput("ProductSpecial", "c_group_id", jQuery(this).parent(), params.newValue); }', 'validate' => 'validateNum')), array('class' => 'common.extensions.editable.EditableColumn', 'name' => 'priority', 'header' => Yii::t('label', 'Priority'), 'editable' => array('send' => 'never', 'title' => Yii::t('label', 'Enter Priority'), 'emptytext' => Yii::t('label', 'Add Priority'), 'type' => 'text', 'onSave' => 'js: function(e, params) { updateInput("ProductSpecial", "priority", jQuery(this).parent(), params.newValue); }', 'validate' => 'validateNum')), array('class' => 'common.extensions.editable.EditableColumn', 'name' => 'price', 'header' => Yii::t('label', 'Price'), 'editable' => array('send' => 'never', 'title' => Yii::t('label', 'Enter Price'), 'emptytext' => Yii::t('label', 'Add Price'), 'type' => 'text', 'onSave' => 'js: function(e, params) { updateInput("ProductSpecial", "price", jQuery(this).parent(), params.newValue); }', 'validate' => 'validateD')), array('class' => 'common.extensions.editable.EditableColumn', 'name' => 'date_start', 'header' => Yii::t('label', 'Start Date'), 'editable' => array('send' => 'never', 'title' => Yii::t('label', 'Start Date'), 'emptytext' => Yii::t('label', 'Start Date'), 'type' => 'date', 'format' => 'yyyy-mm-dd', 'onSave' => 'js: function(e, params) { updateInput("ProductSpecial", "date_start", jQuery(this).parent(), params.newValue); }', 'validate' => 'validateN')), array('class' => 'common.extensions.editable.EditableColumn', 'name' => 'date_end', 'header' => Yii::t('label', 'End Date'), 'editable' => array('send' => 'never', 'title' => Yii::t('label', 'End Date'), 'emptytext' => Yii::t('label', 'End Date'), 'type' => 'date', 'format' => 'yyyy-mm-dd', 'onSave' => 'js: function(e, params) { updateInput("ProductSpecial", "date_end", jQuery(this).parent(), params.newValue); }', 'validate' => 'validateN')), array('class' => 'bootstrap.widgets.TbButtonColumn', 'htmlOptions' => array('style' => 'width: 40px'), 'buttons' => array('delete' => array('label' => Yii::t('label', 'Delete'), 'options' => array("class" => "dspecialval", 'title' => Yii::t('label', 'Delete')))), 'template' => ' {delete}')))); ?> <span class="span2 offset8"><?php echo TbHtml::button(Yii::t('label', 'Add Special'), array('class' => 'add-special', 'color' => TbHtml::BUTTON_COLOR_PRIMARY)); ?> </span> </div> <?php $this->endWidget(); ?> </div><!-- form -->
?> <div id="grillapracticas"> </div> <div id="form2" class="mt30 oculto"> <?php // echo TbHtml::labelTb('Seleccionar Prácticas', array('color' => TbHtml::LABEL_COLOR_WARNING, 'style' => 'margin:20px 0 20px ;font-size:13px;padding:5px;')); echo TbHtml::checkBox('marcatodas', '', array( 'label' => TbHtml::labelTb('Seleccionar todas las Prácticas', array('color' => TbHtml::LABEL_COLOR_INFO, 'style' => 'font-size:13px;padding:7px;margin-left: -17px;',)), 'style'=>'float:right;margin-right:427px', )); echo TbHtml::button('Borrar Selección', array('color' => TbHtml::BUTTON_COLOR_DANGER, 'onclick'=>'js:$("#marcatodas").prop("checked",false);$("#rango").empty();', 'style'=>'float:right;', )); echo TbHtml::labelTb("Selecccionar rango de Prácticas",array('color' => TbHtml::LABEL_COLOR_INFO, 'style' => 'font-size:13px;padding:7px;margin: 36px 11px 0 2px ;')); echo TbHtml::ajaxLink(TbHtml::icon(TbHtml::ICON_PLUS), // $url array('Practica/Selectrango'), // array $ajaxoptions array( 'data' => 'js:($("select#idnomenclador").val()) &&($(".tipopract:checked").serialize()+ "&idnomenclador=" + $("select#idnomenclador").val())', 'type' => 'GET', 'dataType' => 'html', // 'data' => 'js:"nomenclador=" + $("select#idnomenclador option:selected").text()',
<h2>Stateful</h2> <div class="bs-docs-example"> <?php echo TbHtml::button('Loading state', array('loading' => 'Loading...', 'data-complete-text' => 'Loading state', 'color' => TbHtml::BUTTON_COLOR_PRIMARY, 'onclick' => new CJavaScriptExpression("\$(this).button('loading'); setTimeout(function() { \$(this).button('complete'); }.bind(this), 3000);"))); ?> </div> <pre class="prettyprint linenums"> <?php echo TbHtml::button('Loading state', array('loading' => 'Loading...', 'color' => TbHtml::BUTTON_COLOR_PRIMARY)); ?></pre> <h2>Single toggle</h2> <div class="bs-docs-example"> <?php echo TbHtml::button('Single toggle', array('toggle' => true, 'color' => TbHtml::BUTTON_COLOR_PRIMARY)); ?> </div> <pre class="prettyprint linenums"> <?php echo TbHtml::button('Single toggle', array('toggle' => true, 'color' => TbHtml::BUTTON_COLOR_PRIMARY)); ?></pre> </section> <!-- Images ================================================== --> <section id="images"> <div class="page-header"> <h1>Images</h1> </div>
'); //Yii::app()->clientScript->registerCss('tablas',' //TD{padding:5px !important;} //FORM {margin:5px;} //',CClientScript::POS_END) ?> <style type='text/css'> #contextMenu { position: absolute; display:none; } table{cursor:default;} </style> <?php $this->widget('bootstrap.widgets.TbModal', array('id' => 'modalTarjetas', 'header' => 'Tarjetas de credito', 'content' => '<div id="tarjetas"></div>', 'footer' => implode(' ', array(TbHtml::button('Cerrar', array('data-dismiss' => 'modal')))))); ?> <div id="contextMenu" class="dropdown clearfix"> <ul class="dropdown-menu" id="contextual" role="menu" aria-labelledby="dropdownMenu" style="display:block;position:static;margin-bottom:5px;"> <li><a tabindex="-1" href='#' onclick="window.location.href='<?php echo $this->createUrl('usuarios/historialCompras'); ?> &id='+currentId;" class="fa fa-dollar"> Historial de compras</a></li> <li> <?php echo TbHtml::link(' Tarjetas registradas', '#', array('style' => TbHtml::BUTTON_COLOR_PRIMARY, 'class' => 'fa fa-credit-card', 'size' => TbHtml::BUTTON_SIZE_LARGE, 'onclick' => "\$.ajax({\n\t\t\turl:'" . $this->createUrl('usuarios/verTarjetas') . "&id='+currentId,\n\t\t\tsuccess:function(data){ \$('#tarjetas').html(data);},\n\t})", 'data-toggle' => 'modal', 'data-target' => '#modalTarjetas')); ?> </li>
<?php echo TbHtml::checkBoxList('checkContracts', '', array('7.1, 7.2' => CHtml::encode('Does your app is a share source?'))); ?> <p><?php echo TbHtml::b('Audio and Video'); ?> </p> <?php echo TbHtml::checkBoxList('checkAudioAndVideo', '', array('9.1, 9.2' => CHtml::encode('Does your app is a music app?'), '9.3' => CHtml::encode('Does your app use voice call?'), '9.4' => CHtml::encode('Does your app have sounds?'))); ?> </div> <?php echo TbHtml::button('Back', array('onclick' => 'js:document.location.href="/mtcontrool/runs/create"', 'color' => TbHtml::BUTTON_COLOR_DEFAULT, 'size' => TbHtml::BUTTON_SIZE_LARGE)); ?> <?php echo TbHtml::link('Submit', array('runs/saveWPQuest', 'id' => $idRuns), array('class' => 'btn btn-success btn-large')); ?> <?php echo TbHtml::button('Cancel', array('onclick' => 'js:document.location.href="/mtcontrool"', 'color' => TbHtml::BUTTON_COLOR_DANGER, 'size' => TbHtml::BUTTON_SIZE_LARGE)); ?> <?php $this->endWidget(); ?>
} else { eT("Responses will be date stamped."); } ?> <span class='annotation'> <?php eT("Cannot be changed"); ?> </span> <?php echo CHtml::hiddenField('datestamp', $esrow['datestamp']); // Maybe use a readonly dropdown? ?> <?php } else { $this->widget('yiiwheels.widgets.switch.WhSwitch', array('name' => 'datestamp', 'value' => $esrow['datestamp'] == "Y", 'onLabel' => gT('On'), 'offLabel' => gT('Off'), 'events' => array('switchChange.bootstrapSwitch' => "function(event,state){\n if (\$('#anonymized').is(':checked') == true) {\n \$('#datestampModal').modal();\n }\n }"))); $this->widget('bootstrap.widgets.TbModal', array('id' => 'datestampModal', 'header' => gt('Warning', 'unescaped'), 'content' => '<p>' . gT("If the option -Anonymized responses- is activated only a dummy date stamp (1980-01-01) will be used for all responses to ensure the anonymity of your participants.") . '</p>', 'footer' => TbHtml::button('Close', array('data-dismiss' => 'modal')))); } ?> </div> </div> <!-- Save IP Address --> <div class="form-group"> <label class="col-sm-5 control-label" for='ipaddr'><?php eT("Save IP address:"); ?> </label> <div class="col-sm-7"> <?php if ($esrow['active'] == "Y") { if ($esrow['ipaddr'] != "Y") {
<div class="form"> <?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'runs-form', 'enableAjaxValidation' => false)); ?> <div class="well-button"> <?php echo TbHtml::Button('<i class="fa fa-arrow-left"></i> Back', array('onclick' => 'js:document.location.href="/mtcontrool"', 'id' => 'b1', 'title' => 'Back', 'color' => TbHtml::BUTTON_COLOR_DEFAULT, 'size' => TbHtml::BUTTON_SIZE_SMALL, 'style' => 'color: green;')); ?> <?php echo TbHtml::submitButton('<i class="fa fa-check fa-lg"></i> Create', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_SMALL, 'class' => 'btn pull-right', 'style' => 'color: white; margin-left: 4px;', 'title' => 'Create')); ?> <?php echo TbHtml::button('<i class="fa fa-times fa-lg"></i> Cancel', array('submit' => CHttpRequest::getUrlReferrer(), 'color' => TbHtml::BUTTON_COLOR_DANGER, 'size' => TbHtml::BUTTON_SIZE_SMALL, 'title' => 'Cancel', 'class' => 'btn pull-right', 'style' => 'color: white;')); ?> </div> <div class="well"> <p class="help-block"> Fields with <span class="required">*</span> are required. </p> <?php $user_Id = Yii::app()->user->id; ?> <?php echo $form->errorSummary($model); ?>
$this->widget('yiiwheels.widgets.daterangepicker.WhDateRangePicker', array('name' => 'fechas', 'pluginOptions' => array('format' => 'YYYY-MM-DD'), 'htmlOptions' => array('id' => 'fechas', 'placeholder' => 'Seleccione el rango de fechas'))); ?> <span class="add-on"><icon class="icon-calendar"></icon></span> </div> <br /> <br /> <?php //echo TbHtml::label('Archivo txt:','archivo', array('style'=>'display:inline-table;')); ?> <?php echo TbHtml::fileField('archivo'); ?> </div> <br /> <?php echo TbHtml::button(' Conciliar', array('id' => 'btn-subir', 'class' => 'btn btn-primary fa fa-compress')); $this->endWidget(); ?> </div> <div id='pbar' style="display:none"> <?php echo TbHtml::animatedProgressBar(100); ?> </div> </div> <div id='resultado'> </div> <?php Yii::app()->clientScript->registerScript("subir-conciliacion", "\n\t\t\t \$('#btn-subir').on('click',function(){\n\t\t\t\t\t if (\$('#archivo').val()!='' && \$('#archivo').val()!=null) {\n\t\t\t\t\t\t\t if (\$('#archivo').val().split('.').pop()!='txt') {\n\t\t\t\t\t\t\t\t\t alert('El archivo no tiene extension txt, por favor seleccione otro.');\n\t\t\t\t\t\t}else{\t \n\t\t\t\t\t\t\t\tconsole.log('subiendo ..');\n\t\t\t\t\t\t\t\tvar fd = new FormData(document.getElementById('upload-form'));\n\t\t\t\t\t\t\t\tfd.append('desde', \$('#fechas').val().substr(0,10));\n\t\t\t\t\t\t\t\tfd.append('hasta', \$('#fechas').val().substr(13,10));\n\t\t\t\t\t\t\t\t\$.ajax({\n\t\t\t\t\t\t\t\t\t\turl: '" . Yii::app()->createUrl('reportes/conciliar') . "',\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\t\t\t\t\tdata: fd,\n\t\t\t\t\t\t\t\t\t\t\t\tprocessData: false, // tell jQuery not to process the data\n\t\t\t\t\t\t\t\t\t\t\t\tcontentType: false, // tell jQuery not to set contentType\n\t\t\t\t\t\t\t\t\t\t\t\t//dataType:'json',\n\t\t\t\t\t\t\t\t\t\t\t\tbeforeSend:function(){ \$('#pbar').toggle(500);},\n\t\t\t\t\t\t\t\t\t\t\t\tsuccess: function(data){ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\$('#pbar').toggle();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\$('#resultado').html(data);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t}).fail(function(){alert('Error!')});\t\t\t \n\t\t\t\t\t\t}\t\n\t\t\t\t }\n\t\t\t});\n\n");
</div> <div class="row"> <?php echo $form->label($model, 'position'); ?> <?php echo $form->textField($model, 'position'); ?> </div> <div class="row"> <?php echo $form->label($model, 'visible'); ?> <?php echo $form->dropDownList($model, 'visible', ProfileField::itemAlias('visible')); ?> </div> <div class="row buttons"> <?php echo TbHtml::button(UserModule::t('Search'), array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'submit' => '')); ?> </div> <?php $this->endWidget(); ?> </div><!-- search-form -->
public function testButton() { $I = $this->codeGuy; $html = TbHtml::button('Button', array('class' => 'button', 'name' => 'button', 'color' => TbHtml::BUTTON_COLOR_PRIMARY, 'size' => TbHtml::BUTTON_SIZE_LARGE, 'block' => true, 'disabled' => true, 'loading' => 'Loading text', 'toggle' => true, 'icon' => TbHtml::ICON_CHECK)); $button = $I->createNode($html, 'button[type=button].btn'); $I->seeNodeCssClass($button, 'btn-primary btn-large btn-block disabled button'); $I->seeNodeAttributes($button, array('name' => 'button', 'data-loading-text' => 'Loading text', 'data-toggle' => 'button', 'disabled' => 'disabled')); $I->seeNodeChildren($button, array('i.icon-check')); $I->seeNodePattern($button, '/> Button$/'); }
echo TbHtml::encode(UserModule::t($field->title)); ?> :</strong> <?php echo TbHtml::encode($field->widgetView($model->profile) ? $field->widgetView($model->profile) : ($field->range ? Profile::range($field->range, $model->profile->getAttribute($field->varname)) : $model->profile->getAttribute($field->varname))); ?> </div> <br/> <?php } } } ?> <div class="row buttons"> <?php echo TbHtml::button(UserModule::t('Save'), array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'submit' => '')); ?> <?php echo TbHtml::linkButton(UserModule::t('Cancel'), array('color' => TbHtml::BUTTON_COLOR_DANGER, 'url' => Yii::app()->request->getUrlReferrer())); ?> </div> <?php $this->endWidget(); ?> </div><!-- form --> <div class="hlinks hide"> <div class="uid"><?php echo $model->id; ?>
</section> <!-- Modal ================================================== --> <section id="modals"> <div class="page-header"> <h1>Modal <small>TbModal.php</small></h1> </div> <div class="bs-docs-example"> <?php $this->widget('bootstrap.widgets.TbModal', array('id' => 'myModal', 'header' => 'Modal Heading', 'content' => '<p>One fine body...</p>', 'footer' => array(TbHtml::button('Save Changes', array('data-dismiss' => 'modal', 'color' => TbHtml::BUTTON_COLOR_PRIMARY)), TbHtml::button('Close', array('data-dismiss' => 'modal'))))); ?> <?php echo TbHtml::button('Click me to open modal', array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'size' => TbHtml::BUTTON_SIZE_LARGE, 'data-toggle' => 'modal', 'data-target' => '#myModal')); ?> </div> <pre class="prettyprint linenums"> <?php $this->widget('bootstrap.widgets.TbModal', array( 'id' => 'myModal', 'header' => 'Modal Heading', 'content' => '<p>One fine body...</p>', 'footer' => array( TbHtml::button('Save Changes', array('data-dismiss' => 'modal', 'color' => TbHtml::BUTTON_COLOR_PRIMARY)), TbHtml::button('Close', array('data-dismiss' => 'modal')), ), )); ?> <?php echo TbHtml::button('Click me to open modal', array(
/** * Renders the button */ public function renderButton() { if (!empty($this->buttonOptions) && is_array($this->buttonOptions)) { TbArray::defaultValue('data-toggle', 'modal', $this->buttonOptions); if ($this->remote !== null) { $this->buttonOptions['data-remote'] = CHtml::normalizeUrl($this->remote); } $selector = '#' . $this->htmlOptions['id']; $label = TbArray::popValue('label', $this->buttonOptions, 'button'); $attr = isset($this->buttonOptions['data-remote']) ? 'data-target' : 'href'; TbArray::defaultValue($attr, $selector, $this->buttonOptions); echo TbHtml::button($label, $this->buttonOptions); } }
/* @var $model ChangeLanguageForm */ /* @var $form TbActiveForm */ $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('layout' => TbHtml::FORM_LAYOUT_HORIZONTAL)); // Cache the contents of the form $cacheDependency = new CFileCacheDependency(Yii::app()->basePath . '/messages'); $cacheDuration = 60 * 60 * 24 * 365; if ($this->beginCache('ChangeLanguageModal', array('dependency' => $cacheDependency, 'duration' => $cacheDuration, 'varyByExpression' => function () { return implode('_', array(Yii::app()->user->role, Yii::app()->language)); }))) { // Notify administrators that changing the language here only affects them if (Yii::app()->user->getRole() === User::ROLE_ADMIN) { $settingsLink = CHtml::link(Yii::t('Settings', 'Settings'), $this->createUrl('setting/admin')); echo FormHelper::helpBlock(Yii::t('Language', 'To change the application language for all users go to {settingsUrl} instead', array('{settingsUrl}' => $settingsLink))); } echo $form->dropdownListControlGroup($model, 'language', LanguageManager::getAvailableLanguages()); echo $form->checkboxControlGroup($model, 'setDefault'); ?> <div class="form-actions"> <?php echo TbHtml::submitButton(Yii::t('ChangeLanguageForm', 'Change language'), array('color' => TbHtml::BUTTON_COLOR_PRIMARY)); ?> <?php echo TbHtml::button(Yii::t('ChangeLanguageForm', 'Close'), array('class' => 'btn-padded', 'color' => TbHtml::BUTTON_COLOR_INFO, 'data-toggle' => 'modal', 'data-target' => '#change-language-modal')); ?> </div> <?php $this->endCache(); } $this->endWidget();
?> <label class="text-info" for="to_date">End Date</label> <?php echo $form->textFieldControlGroup($report, 'to_date', array('class' => 'span2', 'maxlength' => 100, 'id' => 'dailysale_to_date', 'append' => '<i class="ace-icon fa fa-calendar"></i>', 'readonly' => true)); ?> <?php $this->widget('ext.calendar.Calendar', array('inputField' => 'dailysale_to_date', 'trigger' => 'dailysale_to_date', 'dateFormat' => '%d-%m-%Y')); ?> <?php echo TbHtml::button(Yii::t('app', 'Go'), array('size' => TbHtml::BUTTON_SIZE_MINI, 'title' => Yii::t('app', 'Go'), 'ajax' => array('type' => 'get', 'dataType' => 'json', 'beforeSend' => 'function() { $(".waiting").show(); }', 'complete' => 'function() { $(".waiting").hide(); }', 'url' => Yii::app()->createUrl('Report/SaleDaily/'), 'success' => 'function (data) { if (data.status==="success") { $("#sale_daily").html(data.div); } else { alert("Ooh snap, change a few things and try again!"); } }'))); ?> <?php $this->endWidget(); ?> <div id="sale_daily"> <?php
<?php $this->widget('bootstrap.widgets.TbAlert', array('block' => true)); echo TbHtml::button('Добавить читателя', array('style' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_SMALL, 'class' => 'btn btn-primary', 'data-toggle' => 'modal', 'data-target' => '#myModal')); $this->widget('bootstrap.widgets.TbGridView', array('dataProvider' => $model->search(), 'template' => "{items}", 'columns' => array(array('name' => 'reader_name', 'header' => 'Читатель', 'htmlOptions' => array('color' => 'width: 60px')), array('name' => 'reader_creation_date', 'header' => 'Дата Добавления'), array('name' => 'last_update', 'header' => 'Дата последнего обновления'), array('class' => 'CButtonColumn', 'template' => '{delete}{update}', 'buttons' => array('update' => array('label' => 'Редактировать', 'url' => '$this->grid->controller->createUrl("library/getReaderById", array("id"=>$data->id))', 'options' => array('ajax' => array('type' => 'GET', 'url' => 'js:$(this).attr("href")', 'success' => 'function(data){ openModal( "myModal", "Редактирование читателя", data); }'))), 'delete' => array('label' => 'Удалить', 'url' => '$this->grid->controller->createUrl("library/delete", array("book_id"=>$data->id, "model_name"=>"reader"))')))))); $this->widget('bootstrap.widgets.TbModal', array('id' => 'myModal', 'header' => 'Добавление читателя', 'content' => $this->renderPartial('_readerForm', array('model' => $model, 'request_url' => Yii::app()->createUrl('/library/library/addReader')), true))); ?> <script type="text/javascript"> function openModal( id, header, body){ var closeButton = '<button data-dismiss="modal" class="close" type="button">×</button>'; $("#" + id + " .modal-header").html( closeButton + '<h3>'+ header + '</h3>'); $("#" + id + " .modal-body").html(body); $("#" + id).modal("show"); } </script>