A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_URI::$config is deprecated
Filename: core/URI.php
Line Number: 102
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Router::$uri is deprecated
Filename: core/Router.php
Line Number: 128
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$benchmark is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$hooks is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$config is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$log is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$utf8 is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$uri is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$exceptions is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$router is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$output is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$security is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$input is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$lang is deprecated
Filename: core/Controller.php
Line Number: 83
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$db is deprecated
Filename: core/Loader.php
Line Number: 397
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_DB_mysqli_driver::$failover is deprecated
Filename: database/DB_driver.php
Line Number: 372
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Email
{
private $email_to = "no-responder@deguarda.com.uy";
private $nombre_to = "Deguarda";
private $responder = "";
private $nombreResponder = "";
private function enviarCompra($email, $asunto, $cuerpo, $asunto_bcc = "", $copia = "") {
$CI =& get_instance();
$CI->load->config('email');
$CI->load->library('email');
$from = $CI->config->item('smtp_user');
if ($this->responder == "") {
$this->responder = $from;
$this->nombreResponder = "DeGuarda";
}
// --- Enviar al destinatario principal ---
$CI->email->clear(); // Limpiar configuración previa
$CI->email->reply_to($this->responder, $this->nombreResponder);
$CI->email->set_mailtype("html");
$CI->email->from($from);
$CI->email->to("consultasdeguarda@gmail.com, deguardaweb@gmail.com, no-responder@deguarda.com.uy");
$CI->email->subject($asunto);
$CI->email->message($cuerpo);
$resultado_to = $CI->email->send();
// --- Enviar a copia oculta (BCC) si corresponde ---
if (!empty($copia) || !empty($asunto_bcc)) {
$CI->email->clear(); // Limpiar configuración previa
$CI->email->reply_to($this->responder, $this->nombreResponder);
$CI->email->set_mailtype("html");
$CI->email->from($from);
// Copias ocultas (pueden ser varias separadas por coma)
$CI->email->to($email); // Opcional: destinatario directo
//$CI->email->bcc("consultasdeguarda@gmail.com,deguardaweb@gmail.com,no-responder@deguarda.com.uy");
$CI->email->subject($asunto_bcc);
$CI->email->message($cuerpo); // Podrías cambiar el cuerpo si lo deseas
$resultado_bcc = $CI->email->send();
} else {
$resultado_bcc = true; // No hay BCC, consideramos éxito
}
// Resultado final
if ($resultado_to && $resultado_bcc) {
return 1;
} else {
return $CI->email->print_debugger();
}
}
private function enviarUsuario($email,$asunto, $cuerpo, $copia = "")
{
$CI =& get_instance();
$CI->load->config('email');
$CI->load->library('email');
$from = $CI->config->item('smtp_user');
if ($this->responder == "") {
$this->responder = $from;
$this->nombreResponder = "DeGuarda";
}
$to = $email;
$subject = $asunto;
$message = $cuerpo;
$CI->email->reply_to($this->responder, $this->nombreResponder);
$CI->email->set_mailtype("html");
$CI->email->from($from);
$CI->email->to($to);
//$CI->email->bcc("consultasdeguarda@gmail.com,deguardaweb@gmail.com,no-responder@deguarda.com.uy");
$CI->email->subject($subject);
$CI->email->message($message);
if ($CI->email->send()) {
return 1;
} else {
return $CI->email->print_debugger();
}
}
private function enviarnews($email,$asunto, $cuerpo, $copia = "")
{
$CI =& get_instance();
$CI->load->config('email');
$CI->load->library('email');
$from = $CI->config->item('smtp_user');
if ($this->responder == "") {
$this->responder = $from;
$this->nombreResponder = "DeGuarda";
}
$to = $email;
$subject = $asunto;
$message = $cuerpo;
$CI->email->reply_to($this->responder, $this->nombreResponder);
$CI->email->set_mailtype("html");
$CI->email->from($from);
//$CI->email->to($to);
$CI->email->to("consultasdeguarda@gmail.com, deguardaweb@gmail.com, no-responder@deguarda.com.uy");
$CI->email->subject($subject);
$CI->email->message($message);
if ($CI->email->send()) {
return 1;
} else {
return $CI->email->print_debugger();
}
}
private function enviar($email,$asunto, $cuerpo, $copia = "")
{
$CI =& get_instance();
$CI->load->config('email');
$CI->load->library('email');
$from = $CI->config->item('smtp_user');
if ($this->responder == "") {
$this->responder = $from;
$this->nombreResponder = "DeGuarda";
}
$to = $email;
$subject = $asunto;
$message = $cuerpo;
$CI->email->reply_to($this->responder, $this->nombreResponder);
$CI->email->set_mailtype("html");
$CI->email->from($from);
$CI->email->to($to);
$CI->email->bcc("consultasdeguarda@gmail.com, deguardaweb@gmail.com, no-responder@deguarda.com.uy");
$CI->email->subject($subject);
$CI->email->message($message);
if ($CI->email->send()) {
return 1;
} else {
return $CI->email->print_debugger();
}
}
public function enviar_emailEnvio(
$idEnvio,
$tipoDescuento,
$bines,
$nombre,
$local,
$telefono,
$email,
$direccion,
$departamento,
$ciudad,
$puerta,
$comentariosEnvio,
$ci,
$totalpago,
$costoenvio,
$carrito,
$carro_cant,
$opcion_entrega,
$cuponPrecio = 0
) {
$costoenvio = round($costoenvio);
if ($opcion_entrega == 'retiro') {
$cuerpo = CABEZAL_EMAIL . '
Datos de Retiro
Local: ' . $local . '
Nombre: ' . $nombre . '
Teléfono: ' . $telefono . '
Email: ' . $email . '
Aclaraciones: ' . $comentariosEnvio . '
'
;
} else {
$cuerpo = CABEZAL_EMAIL . '
Datos de Envío
Nombre: ' . $nombre . '
Teléfono: ' . $telefono . '
Email: ' . $email . '
Departamento: ' . $departamento . '
Barrio/Localidad: ' . $ciudad . '
Dirección: ' . $direccion . '
N° Puerta: ' . $puerta . '
Aclaraciones: ' . $comentariosEnvio . '
';
}
$cuerpo .= '
Detalle de la Compra
| Producto |
Precio Unidad/KG |
Cantidad |
Total |
';
foreach ($carrito as $key => $item) {
if ($item['options']['gramos'] !== false && is_numeric($item['options']['gramos']) && $item['options']['gramos'] != 0) {
$precioTotal = ($item['price'] / 1000) * $item['options']['gramos'];
$cantidad = $item['options']['gramos'] . "gr";
} else {
$precioTotal = $item['price'] * $item['qty'];
$cantidad = $item['qty'];
}
$cuerpo .= '
| ' . $item["name"] . ' |
$U ' . $item["price"] . ' |
' . $cantidad . ' |
$U ' . number_format($precioTotal, 2) . ' |
';
}
// Línea divisoria
$cuerpo .= ' |
';
// Fila para el costo de envío
$cuerpo .= '
| Costo de Envío: |
$U ' . number_format($costoenvio, 2) . ' |
';
// Fila para el descuento (si aplica)
if ($cuponPrecio != 0 && $tipoDescuento == 'cupon') {
$descuento = ($totalpago * $cuponPrecio) / 100;
$cuerpo .= '
| Cupón Aplicado: |
- $U ' . number_format($descuento, 2) . ' |
';
$totalpago = $totalpago + $costoenvio - $descuento;
} elseif ($tipoDescuento == 'bines') {
$cuerpo .= '
| Descuento Aplicado: |
- $U ' . number_format($bines, 2) . ' |
';
$totalpago = $totalpago + $costoenvio - $bines;
} else {
$totalpago = $totalpago + $costoenvio;
}
// Línea divisoria antes del total
$cuerpo .= ' |
';
// Fila del total
$cuerpo .= '
| Total (' . $carro_cant . ' Items): |
$U ' . number_format($totalpago, 2) . ' |
';
$cuerpo .= '
NOTA: Los precios pueden variar una vez seleccionado su producto.
En caso de que el ítem seleccionado sea más pesado, deberá abonar la diferencia del mismo y en el caso de que el ítem pese menos de lo indicado en el precio publicado de la web, Deguarda le reintegrará la diferencia.
';
PIE_EMAIL;
if($opcion_entrega=='envios'){
$asunto='VENTA WEB DELIVERY - ID: '.$idEnvio;
}else{
$asunto='VENTA WEB PICKUP - ID: ' .$idEnvio.' - Local'.$local;
}
$this->email_to = $email;
//$this->email_to = 'andresforastier@gmail.com';
$this->nombre_to = "Sr./Sra.";
//$this->enviar("Compra DeGuarda", $cuerpo);
//$this->email_to = 'deguardaweb@gmail.com';
//$this->email_to = $email;
$this->nombre_to = "DeGuarda";
return $this->enviarCompra($email,$asunto, $cuerpo,'Gracias por tu compra - DeGuarda', 'consultasdeguarda@gmail.com, deguardaweb@gmail.com');
}
public function enviar_emailRetiros(
$emailRetiro,
$local,
$nombreRetiro,
$telefonoRetiro,
$comentariosRetiro,
$totalpago,
$carrito,
$carro_cant,
$cuponNombre = "",
$cuponPrecio = 0
) {
$cuerpo = CABEZAL_EMAIL . '
Datos de Envío
Local de compra: ' . $local . '
Nombre: ' . $nombreRetiro . '
Teléfono: ' . $telefonoRetiro . '
Email: ' . $emailRetiro . '
Aclaraciones: ' . $comentariosRetiro . '
Detalle de la Compra
| Producto |
Precio |
Cantidad |
Total |
';
foreach ($carrito as $key => $item) {
$cuerpo .= '
| ' . $item["name"] . ' |
$U ' . $item["price"] . ' |
' . $item["qty"] . ' |
$U ' . $item["price"] * $item["qty"] . ' |
';
}
$cuerpo .= ' ';
if ($cuponPrecio != 0) {
$descuento = ($totalpago * $cuponPrecio) / 100; // Calcula el descuento basado en el porcentaje
$cuerpo .= '| Cupón Aplicado |
|
| ';
$cuerpo .= '- $U ' . $descuento . ' | ';
// Actualiza el total sumando el costo de envío y aplicando el descuento
$totalpago = $totalpago - $descuento;
}else{
$totalpago = $totalpago;
}
$cuerpo .= '
| Total ' . $carro_cant . ' Items |
$U ' . $totalpago . ' |
NOTA: Los precios pueden variar una vez seleccionado su producto.
En caso de que el producto tenga un peso diferente a la opción seleccionada deberá abonar la diferencia o de lo contrario DeGuarda hará el reintegro correspondiente.
' .
PIE_EMAIL;
$this->email_to = $emailRetiro;
$this->nombre_to = "Sr./Sra.";
$this->enviar("Compra DeGuarda", $cuerpo);
$this->email_to = 'deguardaweb@gmail.com';
//$this->email_to = $email;
$this->nombre_to = "DeGuarda";
return $this->enviar($emailRetiro,"Venta DeGuarda", $cuerpo);
}
public function registro($email, $idUsuario, $nombre, $token, $autoPass = false)
{
$cuerpo = CABEZAL_EMAIL . '
|
Hola ' . $nombre . '
Para validar tu email y registrarte en nuestra web solamente tienes que entrar al siguiente link. ';
if ($autoPass) {
$cuerpo .= 'Contraseña automatica: ' . $email . ' ';
}
$cuerpo . ' |
' . PIE_EMAIL;
$this->email_to = $email;
$this->nombre_to = "Sr./Sra.";
return $this->enviarUsuario($email,"Confirmar email", $cuerpo);
}
public function contactar($nombre, $email, $mensaje)
{
$cuerpo = CABEZAL_EMAIL . '
Contacto
Nombre: ' . $nombre . '
Email: ' . $email . '
Mensaje: ' . $mensaje . '
|
' . PIE_EMAIL;
$this->responder = $email;
$this->nombreResponder = $nombre;
// $this->email_to = 'info@deguarda.com.uy';
$this->email_to = 'andresforastier@gmail.com';
$this->nombre_to = "Deguarda";
return $this->enviarnews($email,"Contacto Web", $cuerpo);
}
public function news($email)
{
$cuerpo = CABEZAL_EMAIL . '
Newsletter
Email: ' . $email . '
|
' . PIE_EMAIL;
$this->responder = $email;
// $this->nombreResponder = $nombre;
// $this->email_to = 'info@deguarda.com.uy';
$this->email_to = 'consultasdeguarda@gmail.com';
$this->nombre_to = "Deguarda";
return $this->enviarnews($email,"Suscripcion Newsletter", $cuerpo);
}
public function noche_quesos($nombre, $email, $aQueSeAnoto, $telefono, $fechaNQ,$monto,$idTransaccion)
{
$cuerpo = CABEZAL_EMAIL . '
Nombre: ' . $nombre . '
Email: ' . $email . '
Teléfono: ' . $telefono . '
Monto: $' . $monto . '
ID Transaccion: $' . $idTransaccion . ' ';
// Si aQueSeAnoto no es false, agregamos la fecha de la noche de quesos
if ($aQueSeAnoto !== false) {
$cuerpo .= 'Noche de quesos: ' . $fechaNQ . ' ';
$asunto2='Suscripcion a Noche de quesos';
}else{
$asunto2='Suscripcion a Club del queso';
}
$cuerpo .= ' |
' . PIE_EMAIL;
$this->responder = $email;
$this->nombreResponder = $nombre;
//$this->email_to = 'info@deguarda.com.uy';
$this->email_to = array($email);
//$this->email_to = "aforastier@hotmail.com,$email";
//$this->email_to = $email;
$this->nombre_to = "Deguarda";
return $this->enviar($email,$asunto2, $cuerpo);
}
public function noche_quesos_2($nombre, $email, $telefono, $texto)
{
$cuerpo = CABEZAL_EMAIL . '
Noche de quesos
Nombre: ' . $nombre . '
Email: ' . $email . '
Telefono: ' . $telefono . '
Fecha: ' . $texto . '
|
' . PIE_EMAIL;
$this->responder = $email;
$this->nombreResponder = $nombre;
//$this->email_to = 'andresforastier@gmail.com';
$this->email_to = 'consultasdeguarda@gmail.com';
$this->nombre_to = "Deguarda";
return $this->enviar($email,"Suscripcion noche de quesos", $cuerpo);
}
public function club_queson($nombre, $email, $telefono,$mensaje)
{
$cuerpo = CABEZAL_EMAIL . '
Noche de quesos
Nombre: ' . $nombre . '
Email: ' . $email . '
Telefono: ' . $telefono . '
Mensaje: ' . $mensaje . '
|
' . PIE_EMAIL;
$this->responder = $email;
$this->nombreResponder = $nombre;
// $this->email_to = 'info@deguarda.com.uy';
$this->email_to = 'consultasdeguarda@gmail.com';
$this->nombre_to = "Deguarda";
return $this->enviar($email,"Suscripcion a club de queso", $cuerpo);
}
public function recuperar_contra($email, $id, $codigo)
{
$cuerpo = CABEZAL_EMAIL . '
Para modificar la contraseña ingresá aquí
Con el código : ' . $codigo . '
|
' . PIE_EMAIL;
$this->email_to = $email;
$this->nombre_to = "no-responder";
return $this->enviarUsuario($email,"Recuperar contraseña DeGuarda", $cuerpo);
}
public function enviarCodigoNuevo($email, $nombre)
{
$cuerpo = CABEZAL_EMAIL . '
|
Hola ' . $nombre . '
Gracias por suscribirte a nuestro sitio web.
Aquí está el descuento que te prometí en la web:
Aplicando el código REGALO10 obtendrás un 10% off en tu primera compra.*
Si preferís ver los productos y comprar en persona, ¡Vení a visitarnos!
* Este cupón es válido para todos los productos que quieras en una sola compra, esto quiere decir que es válido solo para un uso por persona.
Click aquí para acceder al sitio
|
' . PIE_EMAIL;
return $this->enviarUsuario($email, "¡Bienvenida a DeGuarda! Tu cupón está dentro.", $cuerpo);
}
}
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$email is deprecated
Filename: core/Loader.php
Line Number: 1284
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$encryption is deprecated
Filename: core/Loader.php
Line Number: 1284
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 303
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: session_set_cookie_params(): Session cookie parameters cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 328
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 355
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 365
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 366
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 367
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 368
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 426
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: drivers/Session_files_driver.php
Line Number: 109
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 110
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: session_start(): Session cannot be started after headers have already been sent
Filename: Session/Session.php
Line Number: 137
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$session is deprecated
Filename: core/Loader.php
Line Number: 1284
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Productos::$cart is deprecated
Filename: core/Loader.php
Line Number: 1284
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Utilidades_modelo extends CI_Model
{
function __construct()
{
parent::__construct();
}
public function limpiar($texto)
{
$texto = $this->security->xss_clean($texto);
if (strrpos($texto, "removed") !== false) {
redirect(base_url());
}
return str_replace(array(";", "--", "DROP", "SELECT", "*", "'", '"'), "", $texto);
}
public function slug($url)
{
$url = strtolower($url);
$array = array("!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "/", ".", "'", '"', "-", " ");
$url = str_replace($array, "", $url);
$tabla = array('Š' => 'S', 'š' => 's', 'Ž' => 'Z', 'ž' => 'z', 'C' => 'C', 'c' => 'c', 'C' => 'C', 'c' => 'c', 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'A', 'Ç' => 'C', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ø' => 'O', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ý' => 'Y', 'Þ' => 'B', 'ß' => 'S', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'a', 'ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ð' => 'o', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ý' => 'y', 'ý' => 'y', 'þ' => 'b', 'ÿ' => 'y', 'R' => 'R', 'r' => 'r', ',' => '');
$url = strtr($url, $tabla);
$url = preg_replace('/[^a-zA-Z0-9]/i', '_', $url);
$url = trim($url);
$url = urlencode($url);
return $this->limpiar($this->db->escape_str($url));
}
public function cortarFrase($frase)
{
$maxPalabras = 25;
$palabras = explode(" ", $frase);
$numPalabras = count($palabras);
if ($numPalabras > $maxPalabras) {
return implode(" ", array_slice($palabras, 0, $maxPalabras)) . "...";
}
return $frase;
}
function updateQueryStringParameter($paramName, $paramValue, $remove = 0)
{
// Parse la URL para obtener los componentes
$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$urlParts = parse_url($url);
// Verifica si la URL tiene una cadena de consulta
if (isset($urlParts['query'])) {
// Parsea los parámetros de la cadena de consulta en un arreglo asociativo
parse_str($urlParts['query'], $queryParams);
} else {
// Si no hay cadena de consulta, inicializa un arreglo vacío
$queryParams = [];
}
if ($remove) {
// Si la bandera $remove es 1, verifica si el parámetro existe y solo elimina el valor específico
if (isset($queryParams[$paramName])) {
$paramValues = explode(',', $queryParams[$paramName]);
$paramValues = array_diff($paramValues, [$paramValue]);
if (empty($paramValues)) {
unset($queryParams[$paramName]);
} else {
$queryParams[$paramName] = implode(',', $paramValues);
}
}
} else {
// Agrega o actualiza el valor del parámetro sin reemplazar los existentes
if (isset($queryParams[$paramName])) {
$paramValues = explode(',', $queryParams[$paramName]);
$paramValues[] = $paramValue;
$queryParams[$paramName] = implode(',', $paramValues);
} else {
$queryParams[$paramName] = $paramValue;
}
}
// Reconstruye la cadena de consulta con los nuevos parámetros
$newQueryString = http_build_query($queryParams);
// Reconstruye la URL completa con la nueva cadena de consulta
$newUrl = $urlParts['scheme'] . '://' . $urlParts['host'] . $urlParts['path'];
if (!empty($newQueryString)) {
$newUrl .= '?' . $newQueryString;
}
// Agrega el fragmento, si existe
if (isset($urlParts['fragment'])) {
$newUrl .= '#' . $urlParts['fragment'];
}
return $newUrl;
}
public function crearCarrito()
{
$items = "";
foreach ($this->cart->contents() as $key => $item) {
$items .= $this->crearItemCarrito($item);
}
$iva = $this->cart->total() * IVA;
$datosCarrito = array(
"items" => $items,
"precioTotal" => $this->calcularTotalFinal($this->cart->contents())
);
if ($this->session->has_userdata('id')) {
$usuarioCompra = $this->db->query('SELECT u.habilitado
from usuarios u WHERE u.id="' . $this->session->userdata('id') . '" GROUP BY u.id')->row();
log_message("error", $this->db->last_query());
if ($usuarioCompra->habilitado == 1 || ($usuarioCompra->habilitado == 0)) {
$this->session->set_userdata('habilitadoCompra', true);
} else {
$this->session->set_userdata('habilitadoCompra', false);
}
}
$this->load->library('parser');
return $this->parser->parse('carrito/carrito', $datosCarrito, true);
}
private function crearItemCarrito($item)
{
//print_r($item);
// print "asdasda";
$option = $this->cart->product_options($item['rowid']);
if ($option['gramos'] != 'false' && $option['gramos'] != 0) {
// Formatear gramos o kilos
if ($option['gramos'] >= 1000) {
$peso = ($option['gramos'] / 1000) . "kg";
} else {
$peso = $option['gramos'] . "gr";
}
$nombre = ($item["qty"] > 1) ? $item['name'] . " x " . $peso : $peso;
$gramos = $peso;
} else {
$gramos = "(x " . $item['qty'] . ")";
$nombre = ($item["qty"] > 1) ? $item['name'] . " x " . $item['qty'] : $item['name'];
}
$productos = $this->db->query('SELECT p.familia FROM productos p WHERE p.id="' . $item['id'] . '" GROUP BY p.id')->row();
$precioUnidad=ceil($this->precioTotal($option['gramos'],$item['qty'],$item['price'],$option['precioProductoGramos']));
$datos = array(
"imagen" => $option['imagen'],
"nombre" => $item['name']." ".$gramos,
"precio" => $precioUnidad,
"rowId" => $item['rowid'],
"id" => $item['id'],
"slug" => $option['slug'],
"cantidad" => $item['qty'],
// "peso" => $option['peso'],
// "stylePeso" => ($productos->familia == 1) ? "" : "display:none;"
);
$this->load->library('parser');
return $this->parser->parse('carrito/item-carrito', $datos, true);
}
public function precioTotal($gramos='',$cantidad='',$precio='',$precioProductoGramos='')
{
//print $gramos;
if ($this->session->has_userdata('cuponNombre')) {
if($gramos=='false' or $gramos==0){
return $this->cart->total() - $this->session->userdata('cuponPrecio');
}else{
// return $this->calcularTotalGramos($gramos,$cantidad,$precio) - $this->session->userdata('cuponPrecio');
return $this->calcularTotalGramos($gramos,$cantidad,$precio);
}
//
}else{
if($gramos=='false' or $gramos==0){
//print $precioProductoGramos.'---'.$cantidad.'---'.$precio.'---'.$gramos;
return $this->calcularTotal($cantidad,$precio);
}else{
//print $precioProductoGramos.'---'.$cantidad.'---'.$precio.'---'.$gramos;
$r=$this->calcularTotalGramos($gramos,$cantidad,$precio);
return $r;
}
}
}
function calcularTotalFinal($cart) {
$total = 0;
foreach ($cart as $item) {
//print $item['options']['gramos']."--";
if ($item['options']['gramos'] != false && $item['options']['gramos'] != 0 && is_numeric($item['options']['gramos'])) {
// Si gramos no es false, calcular en base a gramos
$gramosEnKg = $item['options']['gramos'] / 1000; // Convertir a kilos
$subtotal = $gramosEnKg * $item['price']; // Precio por los gramos en kg
} else {
// Si gramos es false, calcular en base a qty * price
$subtotal = $item['qty'] * $item['price'];
}
$total += $subtotal; // Acumular al total
}
return $total;
}
public function precioTotal2()
{
//print $gramos;
if ($this->session->has_userdata('cuponNombre')) {
return $this->cart->total() - $this->session->userdata('cuponPrecio');
//
}else{
return $this->cart->total();
}
}
public function calcularTotalGramos($gramos,$cantidad,$precio)
{
//print "asdasdasd";
//print '---'.$cantidad.'---'.$precio.'---'.$gramos;
//var_dump($precio); // Para inspeccionar su valor
$total = 0;
// Calcular el subtotal basado en gramos
$total += ($precio / 1000) * $gramos;
return $total;
}
public function calcularTotal($cantidad,$precio)
{
$total = 0;
$total += ($precio * $cantidad);
return $total;
}
public function generarToken()
{
$key = '';
$pattern = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$max = strlen($pattern) - 1;
for ($i = 0; $i < 10; $i++)
$key .= $pattern[mt_rand(0, $max)];
return $key;
}
}
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /srv/www/deguarda.com.uy/htdocs/system/core/Exceptions.php:272)
Filename: core/Common.php
Line Number: 571
Backtrace:
An uncaught Exception was encountered
Type: RuntimeException
Message: /srv/www/deguarda.com.uy/htdocs/application/models/Utilidades_modelo.php exists, but doesn't declare class Utilidades_modelo
Filename: /srv/www/deguarda.com.uy/htdocs/system/core/Loader.php
Line Number: 341
Backtrace:
File: /srv/www/deguarda.com.uy/htdocs/application/controllers/Productos.php
Line: 7
Function: __construct
File: /srv/www/deguarda.com.uy/htdocs/index.php
Line: 315
Function: require_once