本文整理匯總了PHP中CHtml::ajaxButton方法的典型用法代碼示例。如果您正苦於以下問題:PHP CHtml::ajaxButton方法的具體用法?PHP CHtml::ajaxButton怎麽用?PHP CHtml::ajaxButton使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CHtml
的用法示例。
在下文中一共展示了CHtml::ajaxButton方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
public function run()
{
$htmlOptions = array('class' => 'callBtn');
if (!Yii::app()->cdr->app_id) {
$htmlOptions['disabled'] = 'disabled';
}
echo CHtml::ajaxButton('', ['/call/call'], ['type' => 'POST', 'data' => 'to=' . $this->fixNumber($this->to), 'success' => 'function(msg){alert(msg);}'], $htmlOptions);
}
示例2: ajaxRefresh
//.........這裏部分代碼省略.........
$error = Yii::t('mc', 'Permission denied.');
} else {
if (!McBridge::get()->serverCmd($server->id, 'backup status', $backup)) {
$error = McBridge::get()->lastError();
}
}
$dis = array('disabled' => 'disbled');
$start = $download = false;
$cls = 'flash-success';
switch ($backup[0]['status']) {
case 'none':
$content = Yii::t('mc', 'No backup in progress');
$start = true;
break;
case 'done':
$content = Yii::t('mc', 'Backup done, ready for download. (Created: {date})', array('{date}' => @date('Y-m-d H:i', $backup[0]['time'])));
$start = $download = true;
break;
case 'running':
$content = Yii::t('mc', 'Backup in progress, please wait');
break;
case 'error':
default:
if (!$error) {
$error = $backup[0]['message'];
}
$content = $error ? $error : Yii::t('mc', 'Error during backup, please check the daemon log');
$cls = 'flash-error';
$start = true;
break;
}
echo '<div class="' . $cls . '">' . CHtml::encode($content) . '</div>';
if (Yii::app()->user->can($server->id, 'start backup')) {
echo CHtml::ajaxButton(Yii::t('mc', 'Start'), '', array('type' => 'POST', 'data' => array('ajax' => 'start', Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => 'backup_response'), $start ? array() : $dis);
}
if (@is_readable($backup[0]['file'])) {
$opt = $download ? array() : $dis;
$opt['onClick'] = 'backup_download()';
echo CHtml::button(Yii::t('mc', 'Download'), $opt);
} else {
if (@$backup[0]['ftp']) {
echo '<br/>';
echo '<br/>';
if (@Yii::app()->params['ftp_client_disabled'] !== true) {
echo Yii::t('mc', 'You can use the {link} to access your backup. For all other FTP clients, please use the information below.', array('{link}' => CHtml::link('Multicraft FTP client', array('/ftpClient', 'id' => $server->id))));
echo '<br/>';
echo '<br/>';
}
echo Yii::t('mc', 'The backup is available as "<b>{file}</b>" on the following FTP server:', array('{file}' => CHtml::encode(basename($backup[0]['file'])))) . '<br/>';
$ftp = explode(':', $backup[0]['ftp']);
$ip = @$ftp[0];
$port = @$ftp[1];
$dmn = Daemon::model()->findByPk($server->daemon_id);
if ($dmn && isset($dmn->ftp_ip) && isset($dmn->ftp_port)) {
$ip = $dmn->ftp_ip;
$port = $dmn->ftp_port;
}
$attr = array();
$attr[] = array('label' => Yii::t('mc', 'Host'), 'value' => $ip);
$attr[] = array('label' => Yii::t('mc', 'Port'), 'value' => $port);
$attr[] = array('label' => Yii::t('mc', 'User'), 'value' => Yii::app()->user->name . '.' . $server->id);
$attr[] = array('label' => Yii::t('mc', 'Password'), 'value' => Yii::t('mc', 'Your Multicraft login password'));
$this->widget('zii.widgets.CDetailView', array('data' => array(), 'attributes' => $attr));
} else {
if ($download) {
echo Yii::t('mc', 'Your backup is available as "<b>{file}</b>" in your servers base directory.', array('{file}' => CHtml::encode(basename($backup[0]['file']))));
示例3: array
<?php
$this->Widget('zii.widgets.jui.CJuiDialog', array('id' => 'modal', 'options' => array('title' => 'Edit Countries', 'autoOpen' => false, 'modal' => 'true', 'width' => '800', 'height' => '353', 'scrolling' => 'no', 'resizable' => false, 'position' => 'center', 'draggable' => true)));
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'add-modal', 'options' => array('title' => 'Create New Country', 'autoOpen' => false, 'modal' => 'true', 'width' => '520', 'height' => '365', 'scrolling' => 'no', 'resizable' => false, 'position' => 'center', 'draggable' => true)));
$this->renderPartial('_newcountry', array('model' => new Country()));
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>
<div class="span9">
<div class="pull-right">
<?php
echo CHtml::ajaxButton(Yii::t('admin', 'Create New Country'), '#', array('type' => "POST", 'dataType' => 'json', 'onClick' => 'js:jQuery($("#add-modal")).dialog("open")'), array('id' => 'btnModalLogin', 'name' => 'btnModalLogin', 'class' => 'btn btn-primary'));
?>
</div>
<h3>Edit Countries</h3>
<div class="editinstructions">
<div class="span8">
<?php
echo Yii::t('admin', 'Note, the Zip Validation field uses RegEx expressions, or can be left blank to allow any postal code format. Please check our online guide for help with this field. To delete an entry, edit the Country name and wipe out the text.');
?>
</div>
<div class="clearfix search">
<div class="pull-right">
<?php
echo CHtml::beginForm($this->createUrl('shipping/countries'), 'get');
?>
<?php
echo CHtml::textField('q', Yii::app()->getRequest()->getQuery('q'), array('id' => 'xlsSearch', 'placeholder' => 'SEARCH...', 'submit' => ''));
?>
<?php
echo CHtml::endForm();
示例4:
<tr>
<th><?php
echo $sms->getAttributeLabel('updated');
?>
</th>
<td><?php
echo $sms->updated;
?>
</td>
</tr>
<tr>
<th><?php
echo $sms->getAttributeLabel('created');
?>
</th>
<td><?php
echo $sms->created;
?>
</td>
</tr>
</table>
</div>
<?php
if (!isset($_GET['sms_command_id'])) {
?>
<?php
echo CHtml::ajaxButton('Update', $this->createUrl('admin/sendsmscommand', ['sms_command_id' => $sms->sms_command_id]), ['success' => 'js:function(string){ $("#sms_status").html(string); }']);
?>
<?php
}
}
示例5: array
<h1>Crear Relación de Bienes Faltantes</h1>
<h2>Paso 2: Especificar Bienes Muebles Faltantes</h2>
<?php
echo $this->renderPartial('_search_bm', array('bien' => $bien, 'fbmid' => $_GET['id']));
?>
<div style="background-color:#CDE; padding: 5px; text-align:right;">
<div id="data" style="min-height:100px;">
<?php
$this->renderPartial('_content');
?>
</div>
<?php
$options = array('update' => '#data2', 'type' => 'post', 'data' => array('fbmid' => $_GET['id']));
echo CHtml::ajaxButton('Agregar', CController::createUrl('fbm3/AgregarAjax'), $options, array('class' => 'button blue'));
?>
</div>
<div style="margin:10px 0">
<div class="table-grey" style="min-height:150px">
<h2>Bienes Muebles Adscritos</h2>
<div id="data2">
<?php
$this->renderPartial('_content2');
?>
</div>
</div>
<script>
function prueba() {
<?php
echo CHtml::ajax(array('type' => 'POST', 'url' => array("fbm3/ActualizarAjax"), 'update' => '#data2', 'data' => array('fbmid' => $_GET['id'])));
示例6: array
<div class="form">
<p class="note"><span class="required">*</span> หมายเหตุ : คลิกค้างที่รายชื่อและลากเพื่อย้ายตำแหน่ง</p>
<div style="cursor: move">
<?php
// Organize the dataProvider data into a Zii-friendly array
$items = CHtml::listData($dataProvider->getData(), 'link_id', 'name_th');
// Implement the JUI Sortable plugin
$this->widget('zii.widgets.jui.CJuiSortable', array('id' => 'orderList', 'items' => $items));
// Add a Submit button to send data to the controller
?>
</div><br/>
<div class="row buttons">
<?php
echo CHtml::ajaxButton('บันทึกการเปลี่ยนแปลง', '', array('type' => 'POST', 'htmlOptions' => array('style' => 'cursor: pointer'), 'data' => array('Order' => 'js:$("ul#orderList").sortable("toArray").toString()'), 'success' => 'function(){
alert("บันทึกข้อมูลเรียบร้อยแล้ว");
var win=window.open(baseUrl,"_self");
with(win.document)
{
close();
}
}
'));
?>
<?php
echo CHtml::Button('ยกเลิก', array('onClick' => 'window.location="' . Yii::app()->createUrl('link') . '"'));
?>
</div>
</div>
示例7: array
<?php
//echo $form->labelEx($model, 'message');
?>
<?php
echo $form->textArea($model, 'message', array('rows' => '8', 'class' => 'form-control', 'id' => 'request-message'));
?>
<?php
echo $form->error($model, 'message');
?>
</div>
<div class="modal-footer">
<hr/>
<?php
echo CHtml::ajaxButton(Yii::t('SpaceModule.views_space_requestMembership', 'Send'), array('//space/space/requestMembershipForm', 'sguid' => $space->guid), array('type' => 'POST', 'beforeSend' => 'function(){ jQuery("#send-loader").removeClass("hidden"); }', 'success' => 'function(html){ $("#globalModal").html(html); }'), array('class' => 'btn btn-primary'));
?>
<button type="button" class="btn btn-primary"
data-dismiss="modal"><?php
echo Yii::t('SpaceModule.views_space_requestMembership', 'Close');
?>
</button>
<div class="col-md-1 modal-loader">
<div id="send-loader" class="loader loader-small hidden"></div>
</div>
</div>
<?php
示例8: array
echo $form->label($bien, 'codigo');
echo $form->textField($bien, 'codigo', array('size' => 10, 'maxlength' => 6)) . ' ';
$options = array('update' => '#data', 'type' => 'post', 'data' => array('codigo' => 'js:function() { return $("#Bienmueble_codigo").val(); }'));
echo CHtml::ajaxButton('Buscar', CController::createUrl('traspaso/SearchAjax'), $options, array('class' => 'button grey'));
?>
</div>
<div id="data" style="min-height:100px">
<?php
$this->renderPartial('_ajaxContent');
?>
</div>
<?php
$options2 = array('update' => '#data2', 'type' => 'post', 'data' => array());
echo CHtml::ajaxButton('Agregar', CController::createUrl('traspaso/adscribirAjax'), $options2, array('class' => 'button grey'));
?>
<div style="margin:10px 0">
<div class="table-grey" style="min-height:150px">
<h2>Bienes Muebles Adscritos</h2>
<table class="items">
<thead>
<tr><th colspan="3" style="text-align:center;">Clasificacion</th>
<th rowspan="2" style="text-align:center;">Placa</th>
<th rowspan="2" style="text-align:center;">Descripcion</th>
<th rowspan="2" style="text-align:center;">Cantidad</th>
<th rowspan="2" style="text-align:center;">Valor Unitario</th>
<th rowspan="2"></th>
</tr>
<tr><th style="text-align:center;">Grupo</th>
<th style="text-align:center;">SubGrupo</th>
示例9: array
echo CHtml::textArea("email", "", array("placeholder" => "", "class" => "textbox1", "style" => "height:10px"));
?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 top30">
<?php
// echo CHtml::submitButton('Submit', array('class' => 'button1'));
?>
<?php
echo CHtml::ajaxButton($text = 'Submit', $url = createUrl('customer/feedback', array('id' => getCurCusId())), $ajaxOptions = array('type' => 'POST', 'dataType' => 'json', 'success' => 'formSaved()', 'data' => 'js:{
email:document.getElementById("email").value,
// calldate:document.getElementById("Customer_call_date").value,
// opportunity_given:document.getElementById("opportunity_given").value,
yt0:1,
}'), array('class' => 'btn btn-primary pull-right bts'));
?>
<?php
echo CHtml::endForm();
?>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function setOppr(fld)
{
$("input:hidden[name=opportunity_given]").val(fld);
示例10: array
echo GxHtml::encode($model->getRelationLabel('photos'));
?>
</label>
<?php
$this->widget('CMultiFileUpload', array('name' => 'photos', 'accept' => 'jpg|png|jpeg', 'max' => 3, 'remove' => Yii::t('ui', 'Remove'), 'htmlOptions' => array('size' => 25)));
if ($model->teacherPhotos) {
echo "<fieldset><legend>Photos</legend><ul>";
foreach ($model->teacherPhotos as $img) {
$thumbImage = new Image(Yii::getPathOfAlias('webroot') . '/' . $img->photo);
$img_url = $thumbImage->createThumb(110, 70);
/*$thumbImage->resize(110, 70,Image::AUTO);
$arr = explode("/",$img->photo);
$file_name = $arr[count($arr)-1];
$thumb = Yii::getPathOfAlias('webroot') . '/resources/images/110x70/' . $file_name;
$thumbImage->save($thumb);*/
echo "<li id='img_" . $img->id . "'><img src='" . $img_url . "' />" . CHtml::ajaxButton('Xóa', $this->createUrl('delphoto', array('id' => $img->id)), array('success' => 'js:function(){$("#img_' . $img->id . '").remove()}')) . "</li>";
}
echo "</ul></fieldset>";
}
?>
</div>
<!-- row -->
<label><?php
//echo GxHtml::encode($model->getRelationLabel('videos'));
?>
</label>
<?php
//echo $form->checkBoxList($model, 'videos', GxHtml::encodeEx(GxHtml::listDataEx(Video::model()->findAllAttributes(null, true)), false, true));
?>
<div class="row">
<?php
示例11: array
echo '</td></tr></table></div>';
echo '<div class="sd_form_row" style="background:#F7F7F7;">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10%">
';
echo 'Course:</td><td>';
echo CHtml::dropDownList('cid', '', $data, array('prompt' => 'Select', 'style' => 'width:190px;', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('students/students/batch'), 'update' => '#batch_id', 'data' => 'js:$(this).serialize()')));
echo '</td>';
echo '<td>Batch:</td><td>';
$data1 = CHtml::listData(Batches::model()->findAll(array('order' => 'name DESC')), 'id', 'name');
echo CHtml::activeDropDownList($model, 'batch_id', $data1, array('prompt' => 'Select', 'id' => 'batch_id'));
?>
</td><td>
<?php
echo CHtml::ajaxButton("Apply", CController::createUrl('/site/manage'), array('data' => 'js:$("#search-form").serialize()', 'update' => '#student_panel_handler', 'type' => 'GET'), array('id' => 'student-batch-but'));
?>
<?php
$this->endWidget();
?>
</td>
</tr>
</table>
</div>
</div>
<div id="filter_action">
<div class="filter_con">
<div class="filterbxcntnt_inner_bot" >
<div class="filterbxcntnt_left" style="left:0px;"><strong>Active Filters:</strong></div>
示例12: foreach
if (isset($volumenes) && count($volumenes) > 0) {
?>
<table id="table" class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Nombre del Volumen</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
if (count($volumenes) > 0) {
foreach ($volumenes as $volumen) {
if ($volumen->tieneExpediente_did == 1) {
echo '<tr><td>' . $volumen->nombre . '</td><td class="text-center">' . CHtml::ajaxButton("Ver Expedientes con Oliver", CController::createUrl('coleccion/verexp', array("id" => $volumen->id)), array('update' => '#exp'), array('class' => 'btn btn-warning', 'id' => $volumen->id)) . '</td></tr>';
} else {
$idArchivo = ArchivoHistorico::model()->find("coleccion_did = :c and volumen_did = :v", array(":c" => $volumen->coleccion_did, ":v" => $volumen->id));
if (isset($idArchivo) && !empty($idArchivo)) {
echo '<tr><td>' . $volumen->nombre . '</td><td class="text-center">' . CHtml::link("Ver Imágenes", array('coleccion/verimagenes', 'id' => $idArchivo->id), array('target' => '_blank', 'class' => 'btn btn-warning')) . '</td></tr>';
} else {
echo '<tr><td>' . $volumen->nombre . '</td><td class="text-center"></td></tr>';
}
}
}
}
?>
</tbody>
</table>
<?php
示例13: array
<?php
echo $form->error($model, 'email');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'password');
?>
<?php
echo $form->passwordField($model, 'password', array('size' => 30, 'maxlength' => 512));
?>
<?php
echo CHtml::ajaxButton('Auto Gen', $this->createUrl('registration/genkey'), array('success' => 'js:function(result){ ' . '$(".password-helper").html("New Password: "+result+""); ' . '$("#' . CHtml::activeId($model, 'password') . '").val(result); ' . '}'));
?>
<span class="password-helper"></span>
<p class="hint password-hint">
<?php
echo UserModule::t("Minimal password length 6 symbols.");
?>
</p>
<?php
echo $form->error($model, 'password');
?>
</div>
<div class="row">
<?php
示例14: array
<div class="wide form">
<?php
$form = $this->beginWidget('CActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'post'));
?>
<div class="row">
<?php
echo $form->label($bien, 'codigo');
echo $form->textField($bien, 'codigo', array('size' => 6, 'maxlength' => 7));
?>
</div>
<div class="row buttons">
<?php
echo CHtml::ajaxButton('Buscar', CController::createUrl('updateAjax'), array('update' => '#data', 'type' => 'post', 'data' => array('codigo' => 'js:function() { return $("#Bienmueble_codigo").val(); }', 'fbmid' => $fbmid)), array('class' => 'button blue'));
?>
</div>
<?php
$this->endWidget();
?>
</div><!-- search-form -->
示例15: array
<div class="translation_user">
<aside>
<p>Сутності</p>
<?php
echo CHtml::ajaxButton('Локейшени', CController::createUrl('/translation/viewtranslate'), array('dataType' => 'json', 'type' => 'post', 'data' => array('table' => 'location'), 'success' => "function(data) {\n \$('#content').html(data);\n }"), array('style' => 'height: 30px; width:250px; left:0px;', 'id' => 'translate-location'));
echo CHtml::ajaxButton('Типи', CController::createUrl('/translation/viewtranslate'), array('dataType' => 'json', 'type' => 'post', 'data' => array('table' => 'type'), 'success' => "function(data) {\n \$('#content').html(data);\n }"), array('style' => 'height: 30px; width:250px; left:0px;', 'id' => 'translate-type'));
?>
</aside>
<article>
<div class="language_buttons">
<?php
echo CHtml::ajaxlink('EN', CController::createUrl('/translation/viewtranslate'), array('dataType' => 'json', 'type' => 'post', 'data' => array('lan_id' => '2', 'table' => $table), 'success' => "function(data) {\n \$('#content').html(data);\n }"), array('style' => 'height: 30px; width:250px; left:0px;', 'id' => 'translate-language_en'));
echo CHtml::ajaxlink('UA', CController::createUrl('/translation/viewtranslate'), array('dataType' => 'json', 'type' => 'post', 'data' => array('lan_id' => '1', 'table' => $table), 'success' => "function(data) {\n \$('#content').html(data);\n }"), array('style' => 'height: 30px; width:250px; left:0px;', 'id' => 'translate-language_ua'));
echo CHtml::ajaxlink('PL', CController::createUrl('/translation/viewtranslate'), array('dataType' => 'json', 'type' => 'post', 'data' => array('lan_id' => '3', 'table' => $table), 'success' => "function(data) {\n \$('#content').html(data);\n }"), array('style' => 'height: 30px; width:250px; left:0px;', 'id' => 'translate-language_pl'));
?>
<div class="lan">
<ul id="nav">
<li><a href=""title="ua"><img src="../../../images/ua.jpg" /></a>
<ul>
<li class="uz"><a href=""title="pl"><img src="../../../images/pl.jpg" /></a> </li>
<li class="uz"><a href=""title="en"><img src="../../../images/en.jpg" /></a> </li>
</ul>
</ul>
</div>
<div class="navigator-search">
<form class="form-search" method="post" action="index.php?r=site/search">
<input type="search" name="search" placeholder="пошук" value=""/>
<input id="link" type="hidden" name ="id" value="google" />
<input type="submit" value=""/>
</form>