jQuery('#verApostaDiv-'+id).slideDown(); } }); jQuery('.btn-success').click(function (){ debugger; var id = jQuery(this).attr('data-idConfronto'); var id_confronto = jQuery('#'+id).find('input[id=id_confronto]').val(); var placar_casa =jQuery('#'+id).find('input[id=placar_casa]').val(); var placar_visitante =jQuery('#'+id).find('input[id=placar_visitante]').val(); var id_user = jQuery('#'+id).find('input[id=id_user]').val(); var data = jQuery('#'+id).find('input[id=data]').val(); if(jQuery('.c'+id).val() !== '' && jQuery('.v'+id).val() !=='' && checkNumber(jQuery('.v'+id).val()) && checkNumber(jQuery('.c'+id).val())){ <?php echo Chtml::ajax(array('url' => array('aposta/createajax'), 'type' => 'post', 'data' => 'js:{id_confronto:id_confronto,placar_casa:placar_casa,placar_visitante:placar_visitante,id_user:id_user,data:data}', 'success' => "function(string){\n debugger;\n jQuery('#btn-'+id).html('ok');\n AtualizeApostas();\n }")); ?> }else { alert('dados Invalidos'); jQuery('#btn-'+id_confronto).html('Apostar'); jQuery('#btn-'+id_confronto).removeAttr('disabled'); } }); function checkNumber(valor) { var regra = /^[0-9]+$/; if (valor.match(regra)) { return true; }else{ return false;
<?php foreach ($files as $file) { ?> <div> <?php if ($file->hasError) { ?> <div class="errorSummary"><?php echo $file->errorMsg; ?> </div> <?php } else { ?> <?php echo CHtml::image($file->fileName, null, array('class' => 'uploaded_img')); ?> <?php echo CHtml::link(CHtml::image('/images/admin/actions/delete.png', 'Удалить'), '#', array('onclick' => Chtml::ajax(array('update' => '#uploaded_files', 'url' => $this->createUrl(''), 'type' => 'post', 'data' => array('key' => $file->key, 'id' => $file->id))))); ?> <?php } ?> </div> <?php } if (count($files) < 1) { ?> <p>Не было загружено ни одного файла</p> <?php }
<li class="active"><a href="index.php?r=confronto/index&id=4">D</a></li> <li class="active"><a href="index.php?r=confronto/index&id=5">E</a></li> <li class="active"><a href="index.php?r=confronto/index&id=6">F</a></li> <li class="active"><a href="index.php?r=confronto/index&id=7">G</a></li> <li class="active"><a href="index.php?r=confronto/index&id=8">H</a></li> <li class="active"><a href="index.php?r=confronto/index&id=10"> - 8ª</a></li> </ul> <div class="m-b-md"> <h3 class="m-b-none">Confrontos</h3> </div> <?php $this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view')); ?> </section> </section> <script> jQuery(function (){ jQuery('.summary').hide(); jQuery('.peguei').click(function(){ debugger; var id = jQuery(this).attr('data-id'); var pego = jQuery(this).attr('data-pego'); <?php echo Chtml::ajax(array('url' => array('poke/createajax'), 'type' => 'post', 'data' => 'js:{id:id,pego:pego}', 'success' => "function(string){\n debugger;\n location.reload();\n \n }")); ?> }); });</script>