/**
  * Returns this button.
  * @return string the rendering result
  */
 public function render()
 {
     $attributes = $this->attributes;
     if (isset(self::$coreTypes[$this->type])) {
         $method = self::$coreTypes[$this->type];
         if ($method === 'linkButton') {
             if (!isset($attributes['params'][$this->name])) {
                 $attributes['params'][$this->name] = 1;
             }
         } elseif ($method === 'htmlButton') {
             $attributes['type'] = $this->type === 'htmlSubmit' ? 'submit' : ($this->type === 'htmlReset' ? 'reset' : 'button');
             $attributes['name'] = $this->name;
         } else {
             $attributes['name'] = $this->name;
         }
         if ($method === 'imageButton') {
             return CHtml::imageButton(isset($attributes['src']) ? $attributes['src'] : '', $attributes);
         } elseif ($method === 'ajaxSubmitButton') {
             //no work
             return CHtml::ajaxSubmitButton('Submit', '/', array('type' => 'POST', 'update' => '#needForm'), array('type' => 'submit'));
         } else {
             return CHtml::$method($this->label, $attributes);
         }
     } else {
         $attributes['name'] = $this->name;
         ob_start();
         $this->getParent()->getOwner()->widget($this->type, $attributes);
         return ob_get_clean();
     }
 }
Example #2
0
 public static function ajaxSubmitButton($label, $url, $ajaxOptions = array(), $htmlOptions = array())
 {
     if (self::getJValidateInstance()->isEnabled()) {
         list($label, $htmlOptions) = self::getJValidateInstance()->ajaxSubmitButton($label, $url, $ajaxOptions, $htmlOptions);
         return parent::button($label, $htmlOptions);
     } else {
         return parent::ajaxSubmitButton($label, $url, $ajaxOptions, $htmlOptions);
     }
 }
Example #3
0
 /**
  * Generates a push button that can submit the current form in POST method.
  * @param string $label the button label
  * @param mixed $url the URL for the AJAX request. If empty, it is assumed to be the current URL. See {@link normalizeUrl} for more details.
  * @param array $ajaxOptions AJAX options (see {@link ajax})
  * @param array $htmlOptions additional HTML attributes. Besides normal HTML attributes, a few special
  * attributes are also recognized (see {@link clientChange} and {@link tag} for more details.)
  * @return string the generated button
  */
 public static function ajaxSubmitButton($label, $url, $ajaxOptions = array(), $htmlOptions = array())
 {
     if (isset($htmlOptions['id'])) {
         $id = $htmlOptions['id'];
         $cs = Yii::app()->getClientScript();
         $cs->registerScript('Yii.HHtml.#' . $id, "jQuery('body').off('click','#{$id}');");
     } else {
         $htmlOptions['id'] = Helpers::GetUniqeId();
     }
     if (!isset($htmlOptions['name'])) {
         $htmlOptions['name'] = Helpers::GetUniqeId();
     }
     return parent::ajaxSubmitButton($label, $url, $ajaxOptions, $htmlOptions);
 }
Example #4
0
    $echoSTR .= "<tr><td>" . $entry['title'] . "</td><td><a href='" . $entry['url'] . "'>Link</a></td></tr>";
}
$echoSTR .= "</table>";
echo $echoSTR;
$saveWidgetHeight = $this->controller->createUrl('/site/saveWidgetHeight');
Yii::app()->clientScript->registerScript('updateURLs', "\n    \$(document).ready(updateURLs());\n    function updateURLs(){\n        \$.ajax({\n            type: 'POST',\n            url: '" . $this->controller->createUrl('/site/getURLs?url=' . Yii::app()->request->requestUri) . "',\n            success:\n            function(data){\n                \$('#sites-box').html(data);\n            }\n        });\n    }\n;\n", CClientScript::POS_HEAD);
Yii::app()->clientScript->registerScript("topSitesResize", "\n\$('#sites-container').resizable({\n    handles: 's',\n    minHeight: 75,\n    alsoResize: '#sites-container, #sites-box',\n    stop: function(event, ui){\n        \$.post('" . Yii::app()->createUrl("/site/saveWidgetHeight") . "',           {Widget: 'TopSites',\n            Height: {topsitesHeight: parseInt(\$('topsites-box').css('height'))}\n            });\n    },\n});\n", CClientScript::POS_HEAD);
?>
</div>
<?php 
echo CHtml::beginForm();
?>
<div id='site-url-container' style="height: <?php 
echo $urlTitleContainerHeight;
?>
px; margin-bottom:35px;">
    Title: <?php 
echo CHtml::textField('url-title', '', array('style' => "height: " . $urlTitleHeight . "px;"));
?>
    <br/>
    Link: <?php 
echo CHtml::textField('url-url', '', array('style' => "height: " . $urlTitleHeight . "px;"));
?>
</div>
<?php 
echo CHtml::ajaxSubmitButton('Add Site', array('/site/addSite'), array('update' => 'site-box', 'success' => "function(response){\n            updateURLs();\n            \$('#url-title').val('');\n            \$('#url-url').val('');\n        }"), array('class' => 'x2-button', 'id' => 'submit-button'));
echo CHtml::endForm();
?>
</div></div></div>

            <?php 
echo $form->labelEx($model, 'date', array('class' => 'control-label col-sm-4'));
?>
            <div class="col-sm-8">
                <?php 
echo $form->dateField($model, 'date', array('class' => 'form-control'));
?>
                <?php 
echo $form->error($model, 'date', array('class' => 'text-danger'));
?>
            </div> 
        </div> 

        <div class="form-group">
            <div class="col-sm-8 col-sm-offset-4">
                <?php 
echo CHtml::ajaxSubmitButton("Add", CHtml::normalizeUrl(array('maternalhealth/addtts', 'render' => false)), array('dataType' => 'json', 'success' => 'function(data) {
                        if(data != null && data.status == "success") {
                            $("#tts-dialog").dialog("close");
                            location.reload();
                        }
                    }'), array('class' => 'btn btn-success', 'id' => 'closeTtsDialog'));
?>
            </div> 
        </div> 
    </fieldset>
    <?php 
$this->endWidget();
?>

</div><!-- form -->
Example #6
0
                     id="editIco" title="<?php echo Yii::t('module', '0373'); ?>"/>
            </a>
        </div>
    <?php
    }?>
    <a name="list">
    </a>

    <div onclick="showForm();">
        <?php $form=$this->beginWidget('CActiveForm', array(
            'id'=>'ajaxaddlecture-form',
        )); ?>
        <a href="#lessonForm">
            <?php echo CHtml::hiddenField('idmodule', $module->module_ID); ?>
            <?php
            echo CHtml::ajaxSubmitButton('', CController::createUrl('module/lecturesupdate'), array('update' => '#lessonForm'), array('id' => 'addLecture','title'=>Yii::t('module', '0374')));
            ?>
        </a>
        <?php $this->endWidget(); ?>
    </div>
<h2><?php echo Yii::t('module', '0225'); ?></h2>
<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'lectures-grid',
    'dataProvider' => $dataProvider,
    'emptyText' => Yii::t('module', '0375'),
    'columns' => array(
        array(
            'class'=>'CButtonColumn',
            'template'=>'{up}{down}{delete}',
            'headerHtmlOptions'=>array('style'=>'display:none'),
Example #7
0
echo $form->textField($model, 'reason', array('size' => 60, 'maxlength' => 120));
?>
		<?php 
echo $form->error($model, 'reason');
?>
	</div>

	<div class="row buttons">
		<?php 
//echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
         <?php 
echo CHtml::ajaxSubmitButton(Yii::t('Attendance', 'Save'), CHtml::normalizeUrl(array('StudentAttentance/EditLeave', 'render' => false)), array('success' => 'js: function(data) {
						$("#td' . $day . $emp_id . '").text("");
						$("#jobDialog123' . $day . $emp_id . '").html("<span class=\\"abs\\"></span>","");
						$("#jobDialog' . $day . $emp_id . '").dialog("close"); window.location.reload();
                    }'), array('id' => 'closeJobDialog' . $day . $emp_id, 'name' => 'save'));
?>
      <?php 
echo CHtml::ajaxSubmitButton(Yii::t('Attendance', 'Delete'), CHtml::normalizeUrl(array('StudentAttentance/DeleteLeave', 'render' => false)), array('success' => 'js: function(data) {
		                $("#td' . $day . $emp_id . '").text(" ");
		                $("#jobDialog' . $day . $emp_id . '").dialog("close"); window.location.reload();
                    }'), array('onClick' => 'return confirm("Are you sure?");', 'id' => 'closeJobDialog1' . $day . $emp_id, 'name' => 'delete'));
?>
	</div>

<?php 
$this->endWidget();
?>
</div>
</div><!-- form -->
Example #8
0
echo CHtml::hiddenField("thirdTable", "");
?>
                        <?php 
echo CHtml::hiddenField("thirdFile", "");
?>
                        <?php 
echo CHtml::hiddenField("perRequest", "10000");
?>
                        <div id="importCsvThirdStepResult">
                        	&nbsp;
                        </div> <!-- END div id="importCsvThirdStepResult" -->
                        <div id="importCsvThirdStepColumnsAndForm">
                            <div id="importCsvThirdStepColumns">&nbsp;</div><br/>
                            <?php 
echo CHtml::ajaxSubmitButton(Yii::t('importcsvModule.importcsv', 'Import'), '', array('success' => 'function(response){
										$("#importCsvThirdStepResult").html(response);
										$("html, body").animate({scrollTop:$("#content").position().top}, "slow")
									}'), array("class" => "formbut"));
?>
                        </div> <!-- END div id="importCsvThirdStepColumnsAndForm" -->
                        <?php 
echo CHtml::endForm();
?>
                    </div> <!-- END div id="importCsvThirdStep" -->
                    <br/>
                    <div class="csv_links">
                    <span id="importCsvBread1">&laquo; <?php 
echo CHtml::link(Yii::t('importcsvModule.importcsv', 'Start over'), array("/importcsv"));
?>
</span>
                    <span id="importCsvBread2"> &laquo; <a href="javascript:void(0)" id="importCsvA2"><?php 
echo Yii::t('importcsvModule.importcsv', 'Fields Delimiter') . ", " . Yii::t('importcsvModule.importcsv', 'Text Delimiter') . " " . Yii::t('importcsvModule.importcsv', 'and') . " " . Yii::t('importcsvModule.importcsv', 'Model');
Example #9
0
														<label class="control-label">原来的密码</label>
														<input type="password" class="form-control" name="oldPasswd" />
													</div>
													<div class="form-group">
														<label class="control-label">新密码</label>
														<input type="password" class="form-control" name ="newPasswd" />
													</div>
													<div class="form-group">
														<label class="control-label">确认密码</label>
														<input type="password" class="form-control" name ="repPasswd" />
													</div>
													<div class="margin-top-10">
														<?php 
echo CHtml::ajaxSubmitButton("保存密码", array("profile/ajaxUpdatePasswd"), array('type' => 'POST', 'update' => '#passwddiv', 'beforeSend' => 'function(){
            $("#passwddiv").html("loading");
            
        }', 'complete' => 'function(){
           // $("#passwddiv").html("complete");
            }'), array("class" => "btn green"));
?>
                                      
														<a href="#" class="btn default">取消</a>
													</div>
												<?php 
$this->endWidget();
?>
</form>
                                                                                        <div class="form-group" id="passwddiv" ></div>
											</div>
											<div id="tab_4-4" class="tab-pane">
												<form action="#" class="">
													<table class="table table-bordered table-striped">
Example #10
0
	<?php 
if ($model->alkardex_almacendocs->cestadovale == ESTADO_EFECTUADO and $model->alkardex_almacendocs->almacenmovimientos->signo < 0) {
    ?>
		<div class="row">
			<?php 
    echo CHtml::label('Punto expedicion', 'lblpuntoexped');
    ?>
			<?php 
    $datos1 = CHtml::listData(Puntodespacho::model()->findAll(" codcen='" . $model->codcentro . "'"), 'id', 'nombrepunto');
    echo CHtml::DropDownList('cbopuntoexped', 'codtcentro', $datos1, array('empty' => '--Selecc pto expedicion--'));
    ?>


			<?php 
    echo CHtml::ajaxSubmitButton("Pick", array("almacendocs/expedicion"), array("type" => "POST", "data" => array("codiguito" => "js:cbopuntoexped.value", "identidad" => "js:Almacendocs_id.value", "responsable" => "js:cboresponsable.value"), "update" => "#zonadespacho"), array('onClick' => 'Loading.show();Loading.hide(); return false;'));
    ?>
		</div>

		<?php 
    if (is_null($model->alkardex_almacendocs->codtrabajador) or empty($model->alkardex_almacendocs->codtrabajador)) {
        ?>
			<div class="row">
				<?php 
        echo CHtml::label('Responsable', 'Responsable');
        ?>
				<?php 
        $datos = CHtml::listData(VwTrabajadores::model()->findAll(array('order' => 'ap')), 'codigotra', 'nombrecompleto');
        echo CHtml::DropDownList('cboresponsable', 'responsable', $datos, array('empty' => '--Seleccione un responsable--'));
        ?>
			</div>
Example #11
0
<span class='shopping-cart' id='<?php 
echo $this->id;
?>
'>
<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'buy-form-' . $this->id, 'enableAjaxValidation' => true, 'htmlOptions' => array('style' => 'display:inline;')));
?>
	<?php 
echo $form->hiddenField($this->form, 'id', array('value' => $this->model->getId()));
?>
	<?php 
echo $form->textField($this->form, 'quantity', array('size' => 2, 'class' => 'input'));
?>
	<?php 
echo CHtml::ajaxSubmitButton('купить', '', array('success' => 'js:function(data){ $("#shoppingCart").html($(data).find("#shoppingCart").html()); }'));
?>
	<?php 
echo $form->error($this->form, 'quantity');
$this->endWidget();
?>
</span>
Example #12
0
?>
		<?php 
echo $form->textArea($model, 'comment');
?>
		<?php 
echo $form->error($model, 'comment');
?>
	</div>

	<div class="row shortrow buttons">
		<?php 
echo CHtml::ajaxSubmitButton(Yii::t('global', 'Send'), CHtml::normalizeUrl(array('wishlist/email', 'render' => false)), array('type' => "POST", 'dataType' => 'json', 'success' => 'js:function(data) {
					if (data.status=="success") {
						alert(data.message);
						$("#WishitemShare").dialog("close");
						$.ajax({url:data.url});
					} else { for(var key in data.errormsg) {
						var value = data.errormsg[key];
						$("#ShareForm_"+key+"_em_").html(value);
						$("#ShareForm_"+key+"_em_").show();
					}}
				 }'), array('id' => 'btnSendWishList'));
?>

	</div>

<?php 
$this->endWidget();
?>
</div><!-- form -->
Example #13
0
	<div class="row">
		<?php 
echo $form->labelEx($model, 'reason');
?>
		<?php 
echo $form->textField($model, 'reason', array('size' => 60, 'maxlength' => 120));
?>
		<?php 
echo $form->error($model, 'reason');
?>
	</div>
<br />
	<div class="row buttons">
		<?php 
//echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
         <?php 
echo CHtml::ajaxSubmitButton(Yii::t('attendance', 'Save'), CHtml::normalizeUrl(array('StudentAttentance/Addnew', 'render' => false)), array('success' => 'js: function(data) {
						$("#td' . $day . $emp_id . '").text("");
						$("#jobDialog123' . $day . $emp_id . '").html("<span class=\\"abs\\"></span>","");
						$("#jobDialog' . $day . $emp_id . '").dialog("close");
						window.location.reload();
                    }'), array('id' => 'closeJobDialog' . $day . $emp_id, 'name' => 'save'));
?>
	</div>

<?php 
$this->endWidget();
?>
</div>
</div><!-- form -->
Example #14
0
                                    <?php 
echo $form->labelEx($modelc, 'keterangancuti');
?>
                                     <div class="mws-form-item ">                                            
                                    <?php 
echo $form->textArea($modelc, 'keterangancuti', array('rows' => 6, 'cols' => 30, 'onkeypress' => "return \$(this).focusNextInputField(event)"));
?>
                                      </div>
                            </div>
                                </td>
                            </tr>
                      </table>
                                    
                 <div class="mws-button-row">
                    <?php 
echo CHtml::ajaxSubmitButton($modelc->isNewRecord ? 'Create' : 'Create', '', array('replace' => '#formTab .mws-panel-body'), array('class' => 'mws-button blue', 'type' => 'submit', 'onKeyPress' => 'return formSubmit(this,event)'));
echo "  ";
echo CHtml::ResetButton($modelc->isNewRecord ? 'Reset' : 'Reset', array('class' => 'mws-button green'));
?>

                </div>   
                    
                <?php 
$this->endWidget();
?>

            </div>
        </div>    	
    </div><!-- form -->
<?php 
//    $url = Yii::app()->createAbsoluteUrl('kepegawaian/karyawan/cuti');
Example #15
0
	
	</fieldset>
	
	<div class="submit-button-wrapper">
		<?php 
echo CHtml::ajaxSubmitButton('Envoyer', null, array('dataType' => 'html', 'type' => 'post', 'beforeSend' => 'function(){
			$("#newsletter-subscription-form").addClass("form-processing");
		}', 'success' => 'function(data) {
			var jsonData = $.parseJSON($("#newsletter-subscription-form-json", $("<div>" + data + "</div>")).html());
				
			$("#newsletter-subscription-form [id$=\\"_em_\\"]").text("");                                                    
		    $("#newsletter-subscription-form [id$=\\"_em_\\"]").hide();
			$("#newsletter-subscription-form *:input[type!=\\"submit\\"]").removeClass("error");
				
			if (jsonData.status == "success") {
				$("#newsletter-subscription-form *:input[type!=\\"submit\\"]").val("");
				$("#newsletter-subscription-form-confirmation").modal("show");
			} else {
			    $.each(jsonData, function(key, val) {
					$("#newsletter-subscription-form #"+key+"_em_").text(val);                                                    
					$("#newsletter-subscription-form #"+key+"_em_").show();
					$("#newsletter-subscription-form #"+key).addClass("error");
			    });
	        }  
			$("#newsletter-subscription-form").removeClass("form-processing");     
	    }'), array('class' => 'btn btn-success btn-processing', 'title' => 'Envoyer', 'id' => 'newsletter-subscription-form-submit-button', 'name' => 'newsletter-subscription-form-submit-button'));
?>
    </div>
	
	<div id="newsletter-subscription-form-confirmation" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="Confirmation" aria-hidden="true">
		<div class="modal-dialog modal-sm">
Example #16
0
				</div>
				</div>
				<div class="row">
				<div class="col-lg-12 col-md-12">
					<div class="form-group no-margin-hr dark">
						<?php 
echo $form->labelEx($changePassword, 'verifyPassword', array('class' => 'control-label'));
?>
					    <?php 
echo $form->textField($changePassword, 'verifyPassword', array('class' => 'form-control'));
?>
					</div>
					<?php 
// echo CHtml::button(Yii::t('site', 'Change password'), array('type'=>'submit', 'class'=>'btn btn-primary pull-right'));
?>
				<?php 
echo CHtml::ajaxSubmitButton(Yii::t('site', 'Change password'), Yii::app()->createUrl('/admin/users/update', array('id' => $user->id)), array('type' => 'POST', 'data' => 'js:{"ajax":"form-changepassword", "' . $csrfTokenName . '": "' . $csrfToken . '", "UserChangePassword[oldPassword]":$("#UserChangePassword_oldPassword").val(), "UserChangePassword[password]":$("#UserChangePassword_password").val(), "UserChangePassword[verifyPassword]":$("#UserChangePassword_verifyPassword").val()}', 'beforeSend' => 'js:function(data){
							    	if ($("#form-changepassword").valid()) { return true } else { return false }
				        		}', 'success' => "function(html) {\n\t\t\t\t\t\t\t\t     if (html.indexOf('{')==0) {\n\t\t\t\t\t\t\t\t     \tvar obj = jQuery.parseJSON(html);\n\t\t\t\t\t\t\t\t     \tvar mes = '';\n\t\t\t\t\t\t\t\t     \tif(obj.UserChangePassword_oldPassword)\n\t\t\t\t\t\t\t\t     \t\tmes = mes + obj.UserChangePassword_oldPassword + '<br>';\n\t\t\t\t\t\t\t\t     \tif(obj.UserChangePassword_password)\n\t\t\t\t\t\t\t\t     \t\tmes = mes + obj.UserChangePassword_password + '<br>';\n\t\t\t\t\t\t\t\t     \tif(obj.UserChangePassword_verifyPassword)\n\t\t\t\t\t\t\t\t     \t\tmes = mes + obj.UserChangePassword_verifyPassword + '<br>';\n\t\t\t\t\t\t\t\t        \$.growl.error({ message: mes});\n\t\t\t\t\t\t\t\t     }\n\t\t\t\t\t\t\t\t     else {\n\t\t\t\t\t\t\t\t     \t \$.growl.notice({ message: '" . Yii::t('site', 'Password saved successfully') . "' });\n\t\t\t\t\t\t\t\t     }\n\t\t\t\t\t\t\t\t}", 'error' => "function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\t\t\t\t     \$.growl.error({ message: textStatus +'  '+errorThrown});\n\t\t\t\t\t\t\t\t}"), array('encode' => false, 'class' => 'btn btn-primary pull-right'));
?>
				</div>
				</div>
				<?php 
$this->endWidget();
?>
			</div>
		
	</div>
</div>
</div>
<span class="status">&nbsp;</span>
		<?php 
echo $form->error($model, 'fees_payment_cheque_number');
?>
		
		
	</div>
	<!--
	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Search' : 'Save');
?>
	</div>-->
	<div class = "row_t_v">
		<?php 
//echo CHtml::button('Search', array('class'=>'submit','submit' => array('Cheque_search')));
?>

<?php 
echo CHtml::ajaxSubmitButton('Search', array('Cheque_result'), array('update' => '#test'), array('class' => 'submit'));
?>
	</div>
	
<?php 
$this->endWidget();
?>

</div><!-- form -->
<div id = "test">
	</div>
Example #18
0
			function (data){
				//alert('old: '+$('#note-box').html()+'<br><br>new: '+data);
				//if ($('#note-box').html().length < data.length) {	//only update if theres new data
				//alert('old: '+$('#note-box').html());
					$('#note-box').html(data);
					//$('#note-box').attr('scrollTop',$('#chat-box').attr('scrollHeight')); //scroll to bottom of window
				//}
			}
		});
	}
",CClientScript::POS_HEAD);
?>
<?php
echo CHtml::beginForm();

echo CHtml::textArea('note-message');
echo CHtml::ajaxSubmitButton(
	Yii::t('app','Add Note'),
	array('site/addPersonalNote'),
	array(
		'update'=>'#note-box',
		'success'=>"function(response) {
			updateNotes();
			$('#note-message').val('');
		}",
	),
	array('class'=>'x2-button')
);

echo CHtml::endForm();
?>
Example #19
0
            <div class="medium-6 large-3 columns">
                <?php echo CHtml::label('Tanggal Expire', 'tanggal_kadaluwarsa') ?>
                <?php echo CHtml::textField('tanggal_kadaluwarsa', '', array('placeholder' => 'yyyy-mm-dd')); ?>
            </div>
        </div>
        <div class="row">
            <div class="span-12 columns">
                <?php
                $focusSetelahTambah = $tipeCari > 1 ? "#barcode-pilih" : "#scan";
                echo CHtml::ajaxSubmitButton('Tambah (Alt+a)', $this->createUrl('tambahbarang', array(
                            'id' => $pembelianModel->id,)), array(
                    'type' => 'POST',
                    'success' => "function () {
                                        $.fn.yiiGridView.update('pembelian-detail-grid');
                                        updateTotal();
                                        $('{$focusSetelahTambah}').focus();
                                        $('#input-pemb-detail').slideUp(500);
                                    }"
                        ), array(
                    'id' => 'tombol-tambah',
                    'class' => 'tiny bigfont button',
                    'accesskey' => 'a'
                ));
                ?>
                <a class="tiny bigfont button" id="tombol-batal" href="#" accesskey="l" onclick="$('#input-pemb-detail').slideUp(500);">Bata<span class="ak">l</span></a>
            </div>
        </div>
    </div>
    <?php $this->endWidget(); ?>
</div>
		<?php 
echo $form->labelEx($model, 'emailaddress');
?>
		<?php 
echo $form->textField($model, 'emailaddress');
?>
		<?php 
echo $form->error($model, 'emailaddress');
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::ajaxSubmitButton('Save', array('bank/writecontact'), array('success' => 'function(data1)
		{
			var x = eval("(" + data1 + ")");
			document.getElementById("messages").innerHTML = x.div;
			if (x.status == "success")
			{
			  $.fn.yiiGridView.update("contactdatagrid");
			  $("#createdialog2").dialog("close");
			document.getElementById("messages").innerHTML = "";
			}
        }'));
?>
	</div>
<?php 
$this->endWidget();
?>
</div><!-- form -->
 public function renderTwoPaneSelection()
 {
     echo CHtml::ListBox($this->getListBoxName(), array(), $this->getObjectValues($this->getAssignedObjects()), array('multiple' => 'multiple'));
     $ajax = array('type' => 'POST', 'data' => array('yeah'), 'update' => '#' . $this->getListBoxName(true));
     echo CHtml::ajaxSubmitButton('<<', array('assign'), $ajax);
     $ajax = array('type' => 'POST', 'update' => '#not_' . $this->getListBoxName(true));
     echo CHtml::ajaxSubmitButton('>>', array('assign', 'revoke' => 1), $ajax);
     //,
     //$data['revoke']);
     echo CHtml::ListBox('not_' . $this->getListBoxName(), array(), $this->getObjectValues($this->getNotAssignedObjects()), array('multiple' => 'multiple'));
 }
Example #22
0
$this->beginWidget('bootstrap.widgets.TbModal', array('id' => 'feedback'));
?>

<?php 
$modelFeedback = new Feedback();
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('type' => 'vertical', 'id' => 'Feedback', 'enableAjaxValidation' => true, 'enableClientValidation' => false, 'clientOptions' => array('validationUrl' => $this->createUrl('feedback/create')), 'htmlOptions' => array('style' => 'margin: 0')));
?>

<div class="modal-header">
    <a class="close" data-dismiss="modal">&times;</a>
    <h4>Ajude-nos a fazer um bom serviço para você.</h4>
</div>

<div class="modal-body">
    <?php 
echo $form->textFieldRow($modelFeedback, 'nome', array('class' => '', 'placeholder' => 'Anônimo'));
echo $form->dropDownListRow($modelFeedback, 'tipo', array('Erro', 'Sugestão', 'Outro'), array());
echo $form->textAreaRow($modelFeedback, 'mensagem', array('rows' => 3, 'placeholder' => 'Descreva sua experiência e do que sentiu mais falta.'));
?>
</div>

<div class="modal-footer">
<?php 
echo CHtml::ajaxSubmitButton("Enviar", $this->createUrl('feedback/ajaxSave'), array('success' => 'js:function(html){alert("Obrigado =)");}'), array('data-dismiss' => 'modal', 'class' => 'btn btn-success'));
$this->widget('bootstrap.widgets.TbButton', array('label' => 'Cancelar', 'url' => '#', 'htmlOptions' => array('data-dismiss' => 'modal')));
?>
</div>

<?php 
$this->endWidget();
$this->endWidget();
Example #23
0
File: _form.php Project: hongha/web
                array('/comment/comment/create'),
		        array(
                    'replace'=>'#ext-comment-form-new',
                    'error'=>"function(){
                        $('#Comment_message').css('border-color', 'red');
                        $('#Comment_message').css('background-color', '#fcc');
                    }"
		        ),
		        array('id'=>'ext-comment-submit' . (isset($ajaxId) ? $ajaxId : ''), 'class'=>'btn-comment')
		    );
		} else {
			echo CHtml::ajaxSubmitButton('Update',
				
				array('/comment/comment/update', 'id'=>$comment->id,),
				array(
					'replace'=>'#ext-comment-form-edit-'.$comment->id,
					'error'=>"function(){
						$('#Comment_message').css('border-color', 'red');
						$('#Comment_message').css('background-color', '#fcc');
					}"
		        ),
		        array('id'=>'ext-comment-submit' . (isset($ajaxId) ? $ajaxId : ''), 'class'=>'btn-comment')
	        );
		}
		?>
	</div>

<?php $this->endWidget() ?>

</div><!-- form -->
<?php } ?>
Example #24
0
">
                        <a class='fa fa-close x2-icon-gray' href="#"></a>
                    </span>
                    <span class="error"></span>
                </div>
            </div>
        </div>

        <div class="row buttons last-button-row">
            <?php 
// if(is_file(__DIR__.'/inlineEmailForm_pro.php'))
// include('inlineEmailForm_pro.php');
echo CHtml::button(Yii::t('app', 'Cancel'), array('class' => 'x2-button right cancel-send-button x2-button-large'));
echo CHtml::ajaxSubmitButton(Yii::t('app', 'Send'), Yii::app()->controller->createUrl(isset($this->action) ? $this->action : 'inlineEmail', array('ajax' => 1, 'postReplace' => $this->postReplace, 'contactFlag' => $this->contactFlag, 'skipEvent' => $this->skipEvent)), array('beforeSend' => "setInlineEmailFormLoading", 'dataType' => 'json', 'success' => "function (data) {\n                        x2.inlineEmailEditorManager.handleInlineEmailActionResponse (data);\n                    }"), array('id' => 'send-email-button', 'class' => 'x2-button highlight x2-button-large', 'name' => 'InlineEmail[submit]', 'onclick' => '
                        if (!x2.isAndroid) window.inlineEmailEditor.updateElement();
                        // campaign test email-specific. Causes recordId to update
                        $("#InlineEmail_recordName").blur ();
                    '));
?>
        </div>
        <div class='clearfix'></div>
    </div>
        <?php 
$this->endWidget();
?>
    </div>
</div>

<?php 
if (!$this->disableTemplates) {
    ?>
																//return false;
														}', 'context' => 'js:this', 'beforeSend' => 'function(xhr,settings){
												        }', 'complete' => 'function(){
												        	//$("#pujaModal").html(json);
												        	//$("#pujaModal").dialog("close");
												            //alert("Puja exitosa!");
												            }');
if ($imagen->puja_indefinida == 0) {
    echo CHtml::Button('Puja Ilimitada', array('onclick' => '
														if(confirm("¿Esta seguro que desea realizar un puja ilimitada por esta obra?")){
																		$("input#pujailimitada").attr("value",1);
																		$("#' . $submitButtonId . '").trigger("click");
																	}
																    //alert($("input#pujailimitada").attr("value"));'));
}
echo CHtml::ajaxSubmitButton('Pujar', '', $ajaxPujar, array('id' => $submitButtonId));
?>

		</div>

	<?php 
$this->endWidget();
?>

  </div>
	
	<div id="resultado">
		
	</div>

	<?php 
Example #26
0
 00:00"/>
									</div>
									<div class="small-6 columns end">
										<label for="Filter_sampai">Sampai:</label>
										<input type="text" id="Filter_sampai" name="Filter[sampai]" class="tanggalwaktu" value="<?php 
echo date('Y-m-d');
?>
 23:59"/>
									</div>
								</div>
								<div class="row">
									<div class="small-6 columns">
										 <!--<input type="submit" value="Submit" class="tiny bigfont button"/>-->
										<?php 
//ajaxSubmitButton(string $label, mixed $url, array $ajaxOptions=array ( ), array $htmlOptions=array ( ))
echo CHtml::ajaxSubmitButton('Submit', $this->createUrl('monitordetailsummary', array('monitorId' => $monitor->id, 'serverId' => $server->id)), array('success' => 'function(data){' . 'isiSummary(data);' . '}'), array('class' => 'tiny bigfont button', 'id' => 'tombol-submit-filter'));
?>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
				<div class="medium-6 large-4 columns">
					<div class="panel">
						<h5>Summary</h5>
						<table class="detail-view" width="100%">
							<tbody>
								<tr>
									<th>Rata-rata</th>
									<td id="summary-rerata"></td>
Example #27
0
$post = new CoursePost();
?>
<div class="dxd-add-comment-form"  >
<?php 
$form = $this->beginWidget("bootstrap.widgets.TbActiveForm", array('id' => 'comment-form', 'enableAjaxValidation' => false));
?>
		
	<?php 
echo $form->textAreaRow($post, 'content', array('label' => false, 'class' => 'dxd-elastic-form dxd-add-comment-textarea', 'style' => 'width:97%', 'value' => "", 'placeHolder' => '我的评论'));
?>
    
	<?php 
if (isset($lessonId) && $lessonId) {
    echo CHtml::ajaxSubmitButton('发布', array('post/createInLesson', 'lessonId' => $lessonId), array('success' => 'onCommentSuccess'), array('class' => 'btn btn-primary pull-right', 'style' => 'display:none;', 'id' => 'dxd-lesson-post-btn'));
} else {
    echo CHtml::ajaxSubmitButton('发布', array('post/createInCourse', 'courseId' => $courseId), array('success' => 'onCommentSuccess'), array('class' => 'btn btn-primary pull-right', 'style' => 'display:none;', 'id' => 'dxd-lesson-post-btn'));
}
?>
    <?php 
$this->endWidget();
?>
    <div class="clearfix"></div>

</div>

    <script type="text/javascript">
    $('.dxd-add-comment-textarea').focus(function() {
        $(this).parents('.dxd-add-comment-form').find('.btn').fadeIn();
    }).blur(function(){
//        $(this).parents('.dxd-add-comment-form').find('.btn').fadeOut();
     });
?>

<div class="form">
<?php 
echo CHtml::beginForm();
?>

<div class="row">
<?php 
echo CHtml::label('Some text', 'some_text');
echo CHtml::textField('some_text', date('H:i:s'));
?>
</div>

<?php 
echo CHtml::ajaxSubmitButton('Submit request', array('ajax/reqTest03'), array('update' => '#req_res02'));
?>

<?php 
echo CHtml::endForm();
?>
</div><!-- form -->

<div id="req_res02">...</div>

<?php 
Yii::app()->sc->collect('php', Yii::app()->sc->getSourceToLine(__LINE__, __FILE__));
Yii::app()->sc->collect('php', Yii::app()->sc->getFunctionFromFile('public function actionReqTest03', 'protected/modules/AjaxModule/controllers/AjaxController.php'), false, true);
?>
</div><!-- demo box -->
Example #29
0
 *   used to endorse or promote products derived from this software without 
 *   specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
 * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 ********************************************************************************/
$this->pageTitle = Yii::app()->name . ' - Group Chat';
// add script to poll for new messageses
Yii::app()->clientScript->registerScript('updateChat', "\n\tsetInterval ('updateChat()', 1000);\t//update every 1 second\n\t\$(document).ready(updateChat());\t//update on page load\n\tfunction updateChat(){\n\t\t\$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: '" . $this->createUrl('site/getMessages') . "',\n\t\t\tsuccess:\n\t\t\tfunction (data){\n\t\t\t\t//alert('old: '+\$('#chat-box').html()+'<br><br>new: '+data);\n\t\t\t\t//if (\$('#chat-box').html().length < data.length) {\t//only update if theres new data\n\t\t\t\t//alert('old: '+\$('#chat-box').html());\n\t\t\t\t\t\$('#chat-box').html(data);\n\t\t\t\t\t\$('#chat-box').attr('scrollTop',\$('#chat-box').attr('scrollHeight')); //scroll to bottom of window\n\t\t\t\t//}\n\t\t\t}\n\t\t});\n\t}\n", CClientScript::POS_HEAD);
?>
<h2><?php 
echo Yii::t('app', 'Group Chat');
?>
</h2>
<div id="chat" class="full-screen">
<div id="chat-box"></div>
<?php 
echo CHtml::beginForm();
echo CHtml::textArea('chat-message', '');
echo CHtml::ajaxSubmitButton('Send', array('site/newMessage'), array('update' => '#chat-box', 'success' => "function(response) {\n\t\t\t\tupdateChat();\n\t\t\t\t\$('#chat-message').val('');\n\t\t}"), array('class' => 'x2-button'));
echo CHtml::endForm();
?>
</div>
Example #30
0
    echo $popupform->hiddenField($model, 'color');
}
?>

    <div class="row-fluid spaceafter">
		<?php 
echo $popupform->labelEx($model, 'gift_code');
?>
	    <?php 
echo $popupform->radioButtonList($model, 'gift_code', $model->lists, array('separator' => ''));
?>
		<?php 
echo $popupform->error($model, 'gift_code');
?>
    </div>

    <div class="row-fluid shortrow buttons">
        <?php 
echo CHtml::ajaxSubmitButton(Yii::t('global', 'Submit'), CHtml::normalizeUrl(array('wishlist/add', 'render' => false)), array('type' => "POST", 'success' => 'js:function(data) {
	                alert(data);
	                $("#WishitemShare").dialog("close");
                 }'), array('id' => 'btnAddWishList'));
?>

    </div>

<?php 
$this->endWidget();
?>
</div><!-- form -->