вот есть немного кода ЯваСкрипт| Код | function getGridByLotery(id, type) { $('#info_'+type).html(''); $('#viewData_'+type).html(''); $('#gridData_'+type).load('/lottery/ajaxGetGrid/',{ lottery_id:id, type: type }); }
function clearGrid(type) { $('#info_'+type).html(''); //$('#'+type+'_checkBtn').attr('disabled',"disabled"); $("#viewData_"+type).html(""); $('.'+type+'_gridCell').removeClass('activeCell').removeClass(type+'_selectCell'); }
function viewAqualRows(id, type, page) {
var selectedCells = new Array(); $.each($('.'+type+'_selectCell'), function(){ selectedCells.push($(this).get(0).id); return selectedCells; }); if (selectedCells.length >= 2) { $("#info_"+type).html(""); $("#viewData_"+type).html("<div style=\"width:100%; text-align: center; padding-top: 65px;\"><img src=\"/inc/images/loading.gif\" /></div>"); $.getJSON('/lottery/ajaxGetCoincideRows', { id: id ,type: type ,page: page ,selectedCells: selectedCells.join('|') }, function(json){ if(json.result){ $('#info_'+type).html('Count matches: <b>'+json.cnt+'</b>'); $("#viewData_"+type).html(json.html); } else { alert(json.message); } }); } else { alert('You must select at least two numbers. Try again.'); } }
|
РНР
| Код | <center> <div> <div id="gridData_exceptions"></div> <br/> <table> <tr> <td align="center"> <input type="button" class="button" id="exceptions_checkBtn" onclick="viewAqualRows({$lottery.id}, 'exceptions', 1);" value="Check"/> </td> <td width="4"> </td> <td align="center"> <input type="button" class="button" id="button4" onclick="clearGrid('exceptions');" value="Clear"/> </td> </tr> </table> </div> </center> ... {literal} <script type="text/javascript"> /* <![CDATA[ */ $(document).ready(function() { getGridByLotery({/literal}{$lottery.id}, 'perspectives'{literal}); getGridByLotery({/literal}{$lottery.id}, 'exceptions'{literal}); }); /* ]]> */ </script> {/literal}
|
как это все объединить? |