CONSULTA SESSION FRAMEWORK KUMBIAPHP

132 views
Skip to first unread message

EDUARDYAZ

unread,
Jul 9, 2012, 10:59:41 AM7/9/12
to KumbiaPHP Framework
BUEN DIA A TODOS.

POR FAVOR SOLICITO DE SU AYUDA ESTOY CREANDO UN CARRO DE COMPRAS CON
LA VARIABLE DE SESSION PERO AL MOMENTO DE CAMBIARME DE PAGINA SE BORRA
EL CONTENIDO QUE ALMACENO EN EL CARRO NO SE SI EN ALGO ESTOY HACIENDO
MAL EL CODIGO QUE A CONTINUACION DETALLO ESTA EN LA VISTA DEL CARRO.

<?php
if (!isset($_SESSION)) {
session_start();
}
?>
<?php
if (isset($_POST["idtxt"])) {
$id = $_POST["idtxt"];
$nombre = $_POST["nombre"];
$carac = $_POST["carac"];
$precio = $_POST["precio"];
$cant = $_POST["unidad"];
$mi_carro[] = array('idtxt' => $id, 'nombre' => $nombre, 'carac'
=> $carac, 'precio' => $precio, 'cantidad' => $cant);
}
if (isset($_SESSION['carro'])) {
$mi_carro = $_SESSION['carrito'];
$id = $_POST["idtxt"];
$nombre = $_POST["nombre"];
$carac = $_POST["carac"];
$precio = $_POST["precio"];
$cant = $_POST["unidad"];
$mi_carro[] = array('idtxt' => $id, 'nombre' => $nombre, 'carac'
=> $carac, 'precio' => $precio, 'cantidad' => $cant);
}
if (isset($mi_carro)) {
$_SESSION['carrito'] = $mi_carro;
}
?>

<a href="/<?php echo basename(dirname(APP_PATH)) ?>/index/tienda/"
class="link brillolinkproducto" title="Detalle">regresar</a>

<table width="600" border="0" cellspacing="0">
<tr class="img cabecera titulocarrito">
<th width="115" scope="col"></th>
<th colspan="2" scope="col">DETALLE DE PRODUCTOS
SELECCIONADOS</th>
<th width="74" scope="col">TOTAL</th>
<th width="53" scope="col">&nbsp;</th>
</tr>
<?php
if (isset($mi_carro)) {
$total = 0;
for ($i = 0; $i < count($mi_carro); $i++) {
?>
<tr class="cabecera textofactura">
<th scope="col" class="textofactura"><?php echo
$mi_carro[$i]['nombre']; ?></th>
<th width="217" class="textofactura" scope="col"><?php
echo $mi_carro[$i]['carac']; ?></th>
<th width="131" class="textofactura" scope="col">$ <?php
echo $mi_carro[$i]['precio']; ?></th>

<th scope="col" class="textofactura">
<form name="actualizo" method="post"
action="">
<input name="id2" type="hidden" value="<?php echo $i ?>" />
<input name="cantidad2" type="text" value="<?php echo $mi_carro[$i]
['cantidad']; ?>" size="2" maxlength="2"/>
</th>
<th scope="col" class="textofactura"><input type=image
src="/<?php echo basename(dirname(APP_PATH)) ?>/img/images/update.png"
width="20" height="20" />
</form>
</th>
</tr>
<?php
$subt = $mi_carro[$i]['cantidad'];
$total = $total + $subt;
?>
<?php
}
}
?>

</table>

Belmar Santanilla Gutiérrez

unread,
Jul 9, 2012, 11:01:40 AM7/9/12
to kum...@googlegroups.com
Buenos días,

¿Amigo porque no estás utilizando la librería para el manejo de Sesiones que te da KumbiaPHP?


--
Viva KumbiaPHP Framework!
 http://www.kumbiaphp.com/
 Ha recibido este mensaje porque está suscrito a Grupo "KumbiaPHP Framework" de Grupos de Google.
 Para obtener más opciones, visita este grupo en http://groups.google.com/group/kumbia?hl=es.



--

______________________________________
Belmar Santanilla Gutiérrez
Lider en desarrollo 
Triada - Diseño y desarrollo web
Twitter: @NAIJULU

EDUARDYAZ

unread,
Jul 9, 2012, 11:06:24 AM7/9/12
to KumbiaPHP Framework
LA VERDA NO SE MUY BIEN SOBRE EL FUNCIONAMIENTO DE ESA LIBRERIA ME
PODRIAS POR FAVOR AYUDAR DONDE PUEDO ENCONTRAR INFORMACION SOBRE ESO,
O ALGUNA AYUDA??
MUCHAS GRACIAS


On 9 jul, 10:01, Belmar Santanilla Gutiérrez <belm...@gmail.com>
wrote:
> Buenos días,
>
> ¿Amigo porque no estás utilizando la librería para el manejo de Sesiones
> que te da KumbiaPHP?
>
> *Belmar Santanilla Gutiérrez*
> Lider en desarrollo
> Triada - Diseño y desarrollo web
> b.santani...@triada-web.com
> belm...@gmail.comwww.triada-web.com
> Cel: 301 535 52 34
> Twitter: @NAIJULU <http://www.twitter.com/NAIJULU>

Belmar Santanilla Gutiérrez

unread,
Jul 9, 2012, 11:08:06 AM7/9/12
to kum...@googlegroups.com
Mira la documentación http://wiki.kumbiaphp.com/KumbiaPHP_Framework_Versi%C3%B3n_1.0_Beta2#Libreria_Session su funcionamiento es muy simple y te ayudará a simplificar mucho tu código, la he usado y no me da ningún problema
Belmar Santanilla Gutiérrez

Lider en desarrollo 
Triada - Diseño y desarrollo web

Cel: 301 535 52 34
Twitter: @NAIJULU

dist...@gmail.com

unread,
Jul 9, 2012, 11:16:02 AM7/9/12
to kum...@googlegroups.com, EDUARDYAZ

EDUARDYAZ, no escribas todo en mayusculas, se hace mas dificil de leer y
pierde su semantica para resaltar.



El 09/07/12 17:06, EDUARDYAZ escribi�:
> LA VERDA NO SE MUY BIEN SOBRE EL FUNCIONAMIENTO DE ESA LIBRERIA ME
> PODRIAS POR FAVOR AYUDAR DONDE PUEDO ENCONTRAR INFORMACION SOBRE ESO,
> O ALGUNA AYUDA??
> MUCHAS GRACIAS
>
>
> On 9 jul, 10:01, Belmar Santanilla Guti�rrez <belm...@gmail.com>
> wrote:
>> Buenos d�as,
>>
>> �Amigo porque no est�s utilizando la librer�a para el manejo de Sesiones
>> que te da KumbiaPHP?
>>
>> El 9 de julio de 2012 09:59, EDUARDYAZ <wiled...@gmail.com> escribi�:
>>> Ha recibido este mensaje porque est� suscrito a Grupo "KumbiaPHP
>>> Framework" de Grupos de Google.
>>> Para obtener m�s opciones, visita este grupo en
>>> http://groups.google.com/group/kumbia?hl=es.
>>
>> --
>>
>> ______________________________________
>> *Belmar Santanilla Guti�rrez*
>> Lider en desarrollo
>> Triada - Dise�o y desarrollo web

EDUARDYAZ

unread,
Jul 9, 2012, 11:27:24 AM7/9/12
to KumbiaPHP Framework
Ok gracias lo tendre en cuenta la sugerencia

Edu. Flores

unread,
Jul 9, 2012, 3:15:20 PM7/9/12
to kum...@googlegroups.com
un simple Session::set('nombre','valor') para crear.
para tomar Session::get('nombre') y para validar si existe Session::has('nombre')

 Ha recibido este mensaje porque está suscrito a Grupo "KumbiaPHP Framework" de Grupos de Google.
 Para obtener más opciones, visita este grupo en http://groups.google.com/group/kumbia?hl=es.

Reply all
Reply to author
Forward
0 new messages