<?
php
session_start();
$carrito = $_SESSION['carrito'] ?? [];
// Eliminar producto del carrito
if (isset($_POST['eliminar'])) {
$producto_index = $_POST['producto_index'];
unset($carrito[$producto_index]); // Eliminar el producto
$_SESSION['carrito'] = array_values($carrito); // Reindexar el
carrito
}
$costo_envio = 15.00; //adicional de envio
?>
<!DOCTYPE html>
<html>
<head>
<title>Carrito de compras</title>
<link rel="stylesheet" href="styles.css">
</head>
<body align="center">
<h1>Carrito de compras</h1>
<table>
<tr>
<th>Producto</th>
<th>Cantidad</th>
<th>Precio</th>
<th>Total</th>
</tr>
<?php
$total_general = 0;
foreach ($carrito as $index => $item) {
$total = $item['precio'] * $item['cantidad'];
$total_general += $total;
?>
<tr>
<td><?php echo $item['nombre']; ?></td>
<td><?php echo $item['cantidad']; ?></td>
<td><?php echo $item['precio']; ?> us</td>
<td><?php echo $total; ?> us</td>
<td>
<form action="" method="POST">
<input type="hidden" name="producto_index"
value="<?php echo $index; ?>">
<button type="submit"
name="eliminar">Eliminar</button>
</form>
</td>
</tr>
<?php } ?>
</table>
<p>Subtotal: <?php echo $total_general; ?> us</p>
<p>Costo de envío: <?php echo $costo_envio; ?> us</p>
<?php $total_con_envio = $total_general + $costo_envio; ?>
<p><strong>Total con envío: <?php echo $total_con_envio; ?>
US</strong></p>
<a href="pago.php"><button type="submit">Pagar</button></a>
<form action="index.php" method="POST">
<button onclick="window.history.back()">Regresar</button>
</form>
</body>
</html>
<?php
$conn = new mysqli('localhost', 'root', '', 'empresa');
// Verificar si la conexión es exitosa
if ($conn->connect_error) {
die("Conexión fallida: " . $conn->connect_error);
} else {
echo "Conexión exitosa.........";
}
$query = "SELECT * FROM productos";
$result = $conn->query($query);
?>
<!DOCTYPE html>
<html>
<head>
<title>Catálogo de productos</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Catálogo de productos</h1>
<div class="catalogo">
<?php while($producto = $result->fetch_assoc()) { ?>
<div class="producto">
<img src="lenovo.jpg" alt="Laptop" width="10%">
<h2>Laptop</h2>
<p>Todos tipos de laptops</p>
<p>Precio: US$ 125.97</p>
<a href="producto.php">Ver producto</a>
</div>
<?php } ?>
</div>
</body>
<form action="index.php" method="POST">
<button onclick="window.history.back()">Regresar</button>
</form>
</html>
<?php
?>
<!DOCTYPE html>
<html>
<head>
<title>Confirmación de compra</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Compra confirmada</h1>
<p>Gracias por preferirnos. Su factura ha sido enviada, revice su
correo.</p>
</body>
<form action="index.php" method="POST">
<button onclick="window.history.home()">Incio</button>
</form>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Master Jimenez</title>
<link rel="stylesheet" href="styles.css">
<!-- Favicon -->
<link rel="icon" href="logo.png" type="image/x-icon">
</head>
<body>
<header>
<img src="joel.jpg" alt="Logo Empresa" width="10%"
style="centrar">
<nav>
<ul>
<li><a href="index.php">Inicio</a></li>
<li><a href="catalogo.php">Catálogo</a></li>
<li><a href="carrito.php">Carrito</a></li>
<li><a href="registro.php">Registro</a></li>
</ul>
</nav>
</header>
<section>
<h1>Misión</h1>
<p>se centra en la calidad de los productos y servicios, y en el
compromiso con la satisfacción del cliente.se centra en la calidad de los
productos y servicios, y en el compromiso con la satisfacción del
cliente....</p>
<h1>Visión</h1>
<p>La visión proporcionada establece un objetivo claro y
ambicioso para la empresa, al mismo tiempo que expresa un deseo de
impacto positivo en la comunidad y el medio ambiente....</p>
<h1>Valores</h1>
<ul>
<li>Integridad</li>
<li>Compromiso</li>
<li>Innovación</li>
</ul>
</section>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Autorizacion de Pago</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Inserte su tarjeta de crédito</h1>
<form action="confirmacion.php" method="POST">
<label for="tarjeta">Número de tarjeta:</label>
<input type="text" id="tarjeta" name="tarjeta" required>
<label for="expiracion">Fecha de expiración:</label>
<input type="month" id="expiracion" name="expiracion" required>
<label for="cvv">CVV:</label>
<input type="text" id="cvv" name="cvv" required>
<button type="submit">Pagar</button>
</form>
</body>
</html>
<?php
session_start();
$carrito = $_SESSION['carrito'] ?? [];
?>
<!DOCTYPE html>
<html>
<head>
<title>Laptop LENOVO LEGION 5</title>
<link rel="stylesheet" href="styles.css">
</head>
<<form action="index.php" method="POST">
<button onclick="window.history.carrito()">carrito</button>
</form>
<body>
<h1>LENOVO LEGION 5</h1>
<img src="lenovo.jpg" alt="Laptop" width="10%">
<p>Inter i9 4.5GHz</p>
<p>Precio: 2500.98</p>
<form action="" method="POST">
<input type="hidden" name="producto_nombre" value="LENOVO LEGION
5">
<input type="hidden" name="producto_precio" value="2500.98">
<input type="number" name="cantidad" value="1" min="1">
<button type="submit">Añadir al carrito</button>
</form>
<h1>LENOVO LEGION PRO 5</h1>
<img src="legion pro 5.jpg" alt="Laptop" width="10%">
<p>Inter i9 6.5GHz</p>
<p>Precio: 4000.00</p>
<form action="" method="POST">
<input type="hidden" name="producto_nombre" value="LENOVO LEGION
PRO 5">
<input type="hidden" name="producto_precio" value="4000.00">
<input type="number" name="cantidad" value="1" min="1">
<button type="submit">Añadir al carrito</button>
</form>
<h1>HP 2024</h1>
<img src="Hp.jpg" alt="Laptop" width="10%">
<p>Inter i7 3.5GHz</p>
<p>Precio: 1500.98</p>
<form action="" method="POST">
<input type="hidden" name="producto_nombre" value="HP 2024">
<input type="hidden" name="producto_precio" value="1500.98">
<input type="number" name="cantidad" value="1" min="1">
<button type="submit">Añadir al carrito</button>
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$nombre = $_POST['producto_nombre'];
$precio = $_POST['producto_precio'];
$cantidad = $_POST['cantidad'];
$envio = $_POST['envio'];
// Añadir producto al carrito
$carrito[] = ['nombre' => $nombre, 'precio' => $precio,
'cantidad' => $cantidad, 'envio' => $envio];
$_SESSION['carrito'] = $carrito;
echo "<p>$nombre añadido al carrito.</p>";
}
?>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Datos personales</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1 align="center" >Coloque su datos personales</h1>
<ul></ul>
<ul></ul>
<ul></ul>
<ul></ul>
...........................................................MASTER
JIMENEZ.............................................................
<ul></ul>
<ul></ul>
<ul></ul>
<form action="index.php" method="POST">
<label for="nombre">Nombre:</label>
<input type="text" id="nombre" name="nombre" required>
<label for="direccion">Dirección:</label>
<input type="text" id="direccion" name="direccion" required>
<label for="telefono">Teléfono/Celular:</label>
<input type="tel" id="telefono" name="telefono" required>
<label for="Correo">Correo:</label>
<input type="Mail" id="Correo" name="Correo" required>
<button type="submit">Registrar</button>
<button onclick="window.history.back()">Regresar</button>
</form>
</body>
</button>
</html>
/* Resetear estilos y definir fuentes */
body, h1, h2, h3, p {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
/* Estilos generales */
body {
background-color: #3cbdd7;
color: #000000;
line-height: 1.6;
}
.container {
width: 80%;
margin: auto;
overflow: hidden;
}
/* Estilos para la barra de navegación */
.navbar {
background: #333;
color: #fff;
overflow: hidden;
}
.navbar a {
float: left;
display: block;
color: #5e9fea;
text-align: center;
padding: 14px 20px;
text-decoration: none;
}
.navbar a:hover {
background-color: #ddd;
color: #333;
}
/* Estilos para la sección de portada */
#portada {
background: url('joel.jpg') no-repeat center center/cover;
height: 400px;
text-align: center;
color: #5ff33d;
display: flex;
flex-direction: column;
justify-content: center;
}
#portada h1 {
font-size: 3em;
margin-bottom: 0.5em;
}
#portada p {
font-size: 1.2em;
}
/* Estilos para el formulario de registro */
.form-container {
margin: 20px 0;
padding: 20px;
background: #fff;
border: 1px solid #ddd;
}
.form-container input[type=text],
.form-container input[type=email],
.form-container input[type=password] {
width: 100%;
padding: 10px;
margin: 5px 0 20px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
.form-container button {
background-color: #333;
color: #fff;
padding: 12px 20px;
border: none;
cursor: pointer;
width: 100%;
}
.form-container button:hover {
background-color: #ddd;
color: #333;
}
/* Estilos para el footer */
footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 10px 0;
position: absolute;
bottom: 0;
width: 100%;
}
/* Cambiar el color del enlace */
.mi-enlace {
color: blue; /* Color del texto del enlace */
text-decoration: none; /* Quita el subrayado por defecto */
font-weight: bold; /* Hace el texto más grueso */
border: 2px solid blue; /* Le añade un borde */
padding: 5px 10px; /* Espaciado dentro del enlace */
border-radius: 5px; /* Bordes redondeados */
background-color: #f0f8ff; /* Fondo del enlace */
}
/* Cambiar el estilo cuando el mouse pasa sobre el enlace */
.mi-enlace:hover {
background-color: blue; /* Cambia el fondo al pasar el mouse */
color: white; /* Cambia el color del texto al pasar el mouse */
text-decoration: underline; /* Subrayar el texto cuando se pasa el
mouse */
}