This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$temperatura = 25; | |
if ($temperatura < 0) { | |
echo "Está haciendo mucho frío, mejor quédate en casa."; | |
} | |
if ($temperatura >= 0 && $temperatura <= 10) { | |
echo "Hace frío, abrígate bien."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [Registros] | |
GO | |
/****** Object: Table [dbo].[usuarios] Script Date: 10/10/2023 11:11:34 p. m. ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('location: vista/vista_usuarios.html'); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once "../configuracion/Conexion.php"; | |
class modelo_usuarios { | |
private $conexion; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "../modelo/modelo_usuarios.php"; | |
$usuarios = new modelo_usuarios(); | |
switch ($_REQUEST['opcion']) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tabla; | |
$(document).ready(function(){ | |
tabla = $('#tabla').dataTable({ | |
"aProcessing" : true, | |
"aServerSide" : true, | |
dom:'Bfrtip', | |
"ajax":{ | |
url: '../controlador/controlador_usuarios.php?opcion=listarUsuarios', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once "global.php"; | |
$servidor = SERVIDOR; | |
$usuario = USUARIO; // reemplaza username con el usuario de la base de datos | |
$contraseña = CONTRASEÑA; // reemplaza password con la contraseña de la base de datos | |
$database = DATABASE; // reemplaza database_name con el nombre de la base de datos | |
$dsn = "sqlsrv:Server=$servidor;Database=$database"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define("SERVIDOR", "localhost"); | |
define("DATABASE", "Registros"); | |
define("USUARIO", "prueba"); | |
define("CONTRASEÑA", "passprueba"); | |
define("CODIFICACION", "utf-8"); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>CRUD PHP - SQL Server</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
<link href="https://cdn.datatables.net/v/dt/dt-1.13.5/datatables.min.css" rel="stylesheet"/> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO | |
[Registros].[dbo].[usuarios] ([Nombre], [Edad], [Correo], [Nacionalidad]) | |
VALUES | |
('Juan', 25, 'juan@example.com', 'Argentina'), | |
('María', 30, 'maria@example.com', 'México'), | |
('Pedro', 28, 'pedro@example.com', 'España'), | |
('Luisa', 22, 'luisa@example.com', 'Colombia'), | |
('Carlos', 26, 'carlos@example.com', 'Perú'), | |
('Ana', 27, 'ana@example.com', 'Chile'), | |
('Jorge', 32, 'jorge@example.com', 'Venezuela'), |
NewerOlder