Example #1
0
<?php

// <editor-fold defaultstate="collapsed" desc="php">
require '../../includes/constants.php';
$producto = new producto();
$empresa = new empresa();
$usuario = new usuario();
$categoria = new categoria();
$usuario->confirmar_miembro();
$categorias = $categoria->listar();
$resultado = array("suceed" => false);
if (isset($_POST['submit'])) {
    $data = $_POST;
    unset($data['submit']);
    $resultado = $producto->insertar($data);
}
// </editor-fold>
?>
<!DOCTYPE html>
<html lang="es">
    <head>
        <meta charset="utf-8">
        <title><?php 
echo TITULO;
?>
</title>
        <meta name="description" content="">
        <meta name="author" content="">

        <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
        <!--[if lt IE 9]>
Example #2
0
<!DOCTYPE html>
<html lang="es" ng-app="app">
<?php 
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_SESSION['id_imprimere'])) {
    $error = '';
    if (isset($_POST['descripcion']) && isset($_POST['fabricante']) && isset($_POST['stock']) && isset($_POST['precio']) && isset($_POST['stock_minimo'])) {
        if (is_numeric($_POST['stock']) && is_numeric($_POST['precio']) && is_numeric($_POST['stock_minimo'])) {
            require_once '/../../php/clases/producto.class.php';
            $class_producto = new producto();
            if (!$class_producto->existe_producto($_POST['descripcion'], $_POST['fabricante'])) {
                $class_producto->insertar($_POST['descripcion'], $_POST['fabricante'], $_POST['stock'], $_POST['stock_minimo'], $_POST['precio']);
                header("Location: productos.php");
            } else {
                $error = 'existe';
            }
        }
    }
} else {
    session_destroy();
    header("Location: ../../index.php");
}
?>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<title>Agregar Producto</title>

	<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png">