if($ws->categoria_tiene_descuentos(21)>0){
$ct=$ws->traer_categoria(21);
$act=explode("|",$ct); ?>
- Camisas
} if($ws->categoria_tiene_descuentos(24)>0){
$ct=$ws->traer_categoria(24);
$act=explode("|",$ct); ?>
} if($ws->categoria_tiene_descuentos(23)>0){
$ct=$ws->traer_categoria(23);
$act=explode("|",$ct); ?>
} if($ws->categoria_tiene_descuentos(26)>0){
$ct=$ws->traer_categoria(26);
$act=explode("|",$ct); ?>
- Sacos
} if($ws->categoria_tiene_descuentos(25)>0){
$ct=$ws->traer_categoria(25);
$act=explode("|",$ct); ?>
} if($ws->categoria_tiene_descuentos(31)>0){
$ct=$ws->traer_categoria(31);
$act=explode("|",$ct); ?>
- Pantalones de colores
} if($ws->categoria_tiene_descuentos(32)>0){
$ct=$ws->traer_categoria(32);
$act=explode("|",$ct); ?>
} if($ws->categoria_tiene_descuentos(27)>0){
$ct=$ws->traer_categoria(27);
$act=explode("|",$ct); ?>
} if($ws->categoria_tiene_descuentos(35)>0){
$ct=$ws->traer_categoria(35);
$act=explode("|",$ct); ?>
} ?>
}
function navegacion($cat){
$ws=new webservice;
$bc="boton-camisas-up";
$bj="boton-jeans-up";
$bp="boton-playeras-up";
$bs="boton-sacos-up";
$bt="boton-pantalones-up";
$bjc="boton-colores-up";
switch($cat){
case 21:
$bc=str_replace("up","over",$bc);
break;
case 24:
$bj=str_replace("up","over",$bj);
break;
case 23:
$bp=str_replace("up","over",$bp);
break;
case 26:
$bs=str_replace("up","over",$bs);
break;
case 25:
$bt=str_replace("up","over",$bt);
break;
case 31:
$bjc=str_replace("up","over",$bjc);
break;
}
?>
$ct=$ws->traer_categoria(21);
$act=explode("|",$ct); ?>
- Camisas
$ct=$ws->traer_categoria(24);
$act=explode("|",$ct); ?>
- Jeans
$ct=$ws->traer_categoria(23);
$act=explode("|",$ct); ?>
- Sacos
$ct=$ws->traer_categoria(25);
$act=explode("|",$ct); ?>
$ct=$ws->traer_categoria(31);
$act=explode("|",$ct); ?>
- Pantalones de colores
$ct=$ws->traer_categoria(32);
$act=explode("|",$ct); ?>
$ct=$ws->traer_categoria(27);
$act=explode("|",$ct); ?>
}
function traer_producto($id){
$ws=new webservice;
// Traer los datos de la categoria
$ct=$ws->traer_producto($id);
// Traer los productos de la categoria
$act=explode("|",$ct);
return $act;
}
function tallas($id){
$ws=new webservice;
$tallas=$ws->traer_tallas($id);
$act=explode("|",$tallas);
$tot=count($act);
foreach($act as $val){
$cad.="$val";
if($cont<$tot-2){
if($cont<$tot-3)
$cad.=", ";
else
$cad.=" y ";
}
$cont++;
}
return $cad;
}
}?> class webservice{
// Acciones
//tc Traer los datos de la categoria
//pxc Traer productos por categoria
function tucurl($param=""){
$tuCurl = curl_init();
curl_setopt($tuCurl, CURLOPT_URL, "http://www.dotsandrags.mx/ws/index2.php$param");
curl_setopt($tuCurl, CURLOPT_RETURNTRANSFER, 1);
$tuData = curl_exec($tuCurl);
if(!curl_errno($tuCurl)){
$info = curl_getinfo($tuCurl);
} else {
echo 'Curl error: ' . curl_error($tuCurl);
}
return $tuData;
}
function traer_categoria($id){
// Traer los datos de toda la categoria tc
$param="?act=tc&id=$id";
$datos=$this->tucurl($param);
return $datos;
}
function categoria_tiene_descuentos($id){
$param="?act=ctd&id=$id";
$datos=$this->tucurl($param);
return $datos;
}
function traer_productos_por_categoria($categoria){
//pxc Traer productos por categoria
$param="?act=pxc&id=$categoria";
$datos=$this->tucurl($param);
return $datos;
}
function traer_productos_por_categoria_descuentos($categoria){
//pxc Traer productos por categoria con descuento
$param="?act=pxcd&id=$categoria";
$datos=$this->tucurl($param);
return $datos;
}
function traer_producto($id){
$param="?act=tp&id=$id";
$datos=$this->tucurl($param);
return $datos;
}
function traer_tallas($id){
$param="?act=tt&id=$id";
$datos=$this->tucurl($param);
return $datos;
print_r($datos);
}
}