Skip to content

Commit

Permalink
detalle venta y token (test)
Browse files Browse the repository at this point in the history
  • Loading branch information
rirodlar committed Oct 24, 2013
1 parent 319d7ed commit b3067c0
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
Empty file removed README2
Empty file.
84 changes: 84 additions & 0 deletions detalleVenta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>

<div data-role="page">

<div data-role="header">
<h1>detalle de venta</h1>
</div><!-- /header -->

<div data-role="content">
<ul data-role="listview" data-inset="true" id="lista">

</ul>
<script>
$(document).ready(function() {
$.ajax({
url: 'http://iworld.ingehost.cl/movil/detalleventa/2?format=json',
type: 'GET',
dataType: 'json',
success: function(data) {
$('#formaDePago').text(data.formaDePago);
$('#total').text(data.total);
$('#vendedor').text(data.vendedor);

},
error: function() { alert('no se puedo!'); },
beforeSend: setHeader
});
});

function setHeader(xhr) {
xhr.setRequestHeader('Authorization', 'Token 89c44636e3f071baa0f67fe4964e6ae244d0fad7');
}
</script>

<h2>
Detalle venta
</h2>
<div class="ui-grid-a">
<div class="ui-block-a">
Forma de Pago:
</div>
<div class="ui-block-b" id="formaDePago">
</div>
<div class="ui-block-a">
Total:
</div>
<div class="ui-block-b"id="total">
</div>
<div class="ui-block-a">
Vendedor
</div>
<div class="ui-block-b"id="vendedor">
</div>
</div>
<h2>
Productos
</h2>
<ul data-role="listview" data-divider-theme="b" data-inset="true">
<li data-theme="c">
<a href="#" data-transition="slide">
Button
</a>
</li>
</ul>
</div><!-- /content -->

<div data-role="footer">
<h4>Page Footer</h4>
</div><!-- /footer -->
</div><!-- /page -->

</body>
</html>
25 changes: 25 additions & 0 deletions token.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5//EN"
"http://www.w3.org/TR/html5/html5.dtd"
>
<html lang="en">
<head>

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<title>test token></title>
</head>
<body>
<!-- Insert your content here -->
<script>
$.ajax({

url: 'http://iworld.ingehost.cl/api-loggin/',
data: {username: "admin", password: "admin" },
type: 'post',
crossDomain: true,
dataType: 'json',
success: function(data) { alert("token: " +data.token); },
error: function() { alert('Failed!'); },

});</script>
</body>
</html>

0 comments on commit b3067c0

Please sign in to comment.