Created
March 9, 2012 12:27
-
-
Save ronnysantana/2006318 to your computer and use it in GitHub Desktop.
jQuery AJAX Pagamento Direto MoIP * Débito Bancário
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if($_REQUEST['ajax'] == "true"){ | |
$json = json_decode(json_encode($_POST)); | |
if($json->banco == "Sel") { | |
die(); | |
} | |
$code = " | |
<a href='{$InstrucaoProcess}?token={$token}' target='_blank' > | |
<img src='images/DebitoBancarioImg_{$json->banco}.jpg' > | |
</a>"; | |
print $code; | |
die(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// no head adicione | |
{literal} | |
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<script language=JavaScript> | |
var id = location.search.split("?"); | |
var id = id[1].split("="); | |
var id = id[1]; | |
console.log(id); | |
$(document).ready(function(){ | |
$("#banco").change(function(e){ | |
$("#mensagem").fadeOut(); | |
$("#loader").fadeIn(); | |
e.preventDefault(); | |
$.ajax({ | |
type: 'POST', | |
url: 'ajaxrequest.html!viewinvoice!'+id, | |
data: $(this).serialize(), | |
success: function(data){ | |
$("#loader").fadeOut(); | |
$("#mensagem").fadeIn().html(data); | |
console.log(data); | |
} | |
}); | |
}); | |
}); | |
</script> | |
{/literal} | |
// logo abaixo do fechando if elseif $status eq "Collections" adicione | |
<!-- Debito Bancario --> | |
{if $paymentmethod=="Debito Bancário"} | |
<br/> | |
<form name='valid' id='valid' action=''> | |
<select id='banco' name='banco' style='width:200px; height:35px; padding-left:30px; cursor:pointer;'> | |
{php} | |
$bancos = array("Banco Do Brasil","Itau","Bradesco"); | |
print "<option value='Sel' >Selecione</option>"; | |
foreach($bancos as $banco) { | |
$banco_value = str_replace(" ","",$banco); | |
print "<option id='option' value='{$banco_value}'>{$banco}</option>"; | |
} | |
{/php} | |
</select> | |
</form> | |
<br/> | |
<div id='loader' style='display:none; width:30px; height:30px; position:absolute; left:50%; top:50%; margin-left:52px; margin-top:-75px;'><img src='http://www.livrariascuritiba.com.br/images/ajax-loader.gif'></div> | |
<div id='mensagem'></div> | |
{/if} | |
<!-- Debito Bancario --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment