Cuenta.php
Código PHP :
<?php
session_start();
?>
<!DOCTYPE html>
<head>
<script src="scripts/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp;
try {
xmlHttp=new XMLHttpRequest();
return xmlHttp;
} catch (e) {
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
return xmlHttp;
} catch (e) {
try {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
return xmlHttp;
} catch (e) {
alert("Tu navegador no soporta AJAX!");
return false;
}}}
}
function Enviar(_pagina,capa)
{
var ajax;
ajax = ajaxFunction();
ajax.open("POST", _pagina, true);
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.onreadystatechange = function() {
if (ajax.readyState==1){
document.getElementById(capa).innerHTML = " Aguarde por favor...";
}
if (ajax.readyState == 4) {
document.getElementById(capa).innerHTML=ajax.responseText;
}}
$("#contenido").html('<img src="img/cargando.gif" id="img">');
ajax.send(null);
}
$(function()
{
$.ajax({
beforeSend: function(data) {
$('#contenido').html('<img src="img/cargando.gif" id="img">');
},
complete: function(){
$.get("usuario/Datos_p.php",function(date){
$("#contenido").html(date);
})
}
});
});
</script>
<script>
alert('hola')
$('#ocultar').hide();
</script>
<style>
#button{
padding: 10px 10px 10px 10px;
border: 1px
#DFDFDF solid;
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
background:
white url(img/degrade2.jpg) bottom repeat-x;
}
#img{
width:120px;
position: relative;
top:100px;
left:250px;
}
#enlaces{
text-decoration:none;
}
#enlaces a{
text-decoration:none;
color:black;
text-shadow:1px 3px 2px #EAEAEA;
}
#enlaces a:hover{
text-decoration:none;
color:red;
}
#enlaces a:active{
text-decoration:none;
color:red;
}
#enlaces li{
display: inline;
}
#contenido{
margin-left:30px;
}
#contenedor{
position:fixed;
left:0;
right:0;
text-align:center;
border:1px solid #000000;
-moz-box-shadow: 0 0 5px #888;
-webkit-box-shadow: 0 0 5px#888;
box-shadow: 0 0 5px #888;
background-color:#FFFFFF;
width:100%;
}
body{
background: url(img/body_bg.gif) repeat;
}
#contenido img
{
position: relative;
text-align:center;
}
.input{
border:1px solid #DFDFDF;
padding:0 15px;
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
font-size: 16px;
line-height:35px;
width:100px;
background: white url(img/degrade7.jpg) top repeat-x;
}
</style>
</head>
<body>
<div id="contenedor">
<ul id="enlaces">
<li><a href="javascript:Enviar('usuario/Datos_p.php','contenido')">Datos Personales</a></li>
<li><a href="javascript:Enviar('usuario/Datos_c.php','contenido')">Datos Complementarios</a></li>
<li><a href="javascript:Enviar('usuario/Pedidos.php','contenido')">Pedidos</a></li>
</ul>
</div>
<div id="contenido">
</div>
</body>
</html>
Pedidos.php
Código PHP :
<?php
session_start();
include_once('../class/pedido.php');
$pedido = new Pedido($_SESSION['customer_id']);
$lista=$pedido->Lista();
$lista1=$pedido->Ordenes();
?>
<!DOCTYPE html>
<head>
<style type="text/css">
#pedido{
top:100px;
position:relative;
}
#contenedor{
margin-top:10px;
position:fixed !important; right:0px; top:0px; z-index:10 !important;
}
</style>
</head>
<body>
<div id="pedido">
<?php
foreach($lista1 as $link)
{
echo '<a href="#">Orden #'.$link['order_id'].'</a>';
echo '<div id="ocultar">';
foreach($lista as $elemento){
echo '<table>';
echo '<th>Orden</th>';
echo '<th>Producto</th>';
echo '<th>Modelo</th>';
echo '<th>Cantidad</th>';
echo '<th>Precio</th>';
echo '<th>Total</th>';
echo '<tr>';
echo '<td>'.$link['order_id'].'</td>';
echo '<td>'.$elemento['name'].'</td>';
echo '<td>'.$elemento['model'].'</td>';
echo '<td>'.$elemento['quantity'].'</td>';
echo '<td>'.$elemento['price'].'</td>';
echo '<td>'.$elemento['total'].'</td>';
echo '</tr>';
echo '</table>';
}
echo '</div>';
}
?>
</div>
</body>
</html>
les agradezo de antemano su ayuda
