PHP - ayuda con web

 
Vista:

ayuda con web

Publicado por christian (1 intervención) el 09/10/2008 05:18:10
hola, necesito hacer una bd de usuarios registrados y q pueda administrar, al registrarse me lleva a una lista de productos, donde solo ingresa la cantidad que quiere por producto, que al submit me genere una lista de totales, y que se envia al mail.
o si hay alguna manera con joomla u otro de hacer esto.
gracias por su colaboracion.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:ayuda con web

Publicado por Pineapple (183 intervenciones) el 09/10/2008 21:07:54
Mmm pues amigo... hay muchos programitas pero especificamente para lo que quieres lo dudo, porque no lo haces tu, o bajas un drupal o algo asi...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ayuda con web

Publicado por roman (6 intervenciones) el 09/10/2008 22:18:19
hola amigo me llamo román quiero pedir un favor y me ayuden en hacer una facturacion de productos o podrian darme una idea y un codigo de ejemplo tengo en php me podeis ayudar adjunto mi codigo y la base datos muchas gracias

Como podras ver una vez que lo ejecutes mi pregunta es como hacer para poder ingresar varios pedidos en esta factura y que hallae su respectiva subtotal igv y total de varios productos por ejemplo 5 productos y no solamente uno como veis y como geenerar una serie de los numeros de factura

Muchas gracias

Facturar.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
<style type="text/css">
<!--
.Estilo1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
}
.Estilo4 {font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; }
.Estilo7 {
font-size: 24px;
font-family: Impact;
color: #FF0000;
}
.Estilo8 {color: #0000FF}
-->
</style>
</head>

<body>
<?php
$COD=$_GET["ID"];//Captura codigo del pedido
$serie=$_GET["id"];
$link = mysql_connect("localhost", "root", "telesup"); //Creando la conexión
mysql_select_db("comsa", $link); //Seleccionando la BD
$result = mysql_query("SELECT CODPED,APELLIDOS,NOMBRES,DIRECCION,TELEFONO,DNI,RUC,IDPRODUCTO,DESCRIPCION,CANTIDAD,PRECIO FROM PEDIDOS P INNER JOIN CLIENTES C ON P.IDCLIENTE=C.IDCLIENTE INNER JOIN PRODUCTOS PR ON P.CODPROD=PR.IDPRODUCTO WHERE CODPED='".$COD."'", $link); //Ejecutando la consulta
$row = mysql_fetch_row($result)//Generando esquema de datos
//

?>
<form id="form1" name="form1" method="post" action="">
<table width="80%" border="0" align="center">
<tr>
<td width="15%" rowspan="3"><div align="center"><img src="Imagenes/logo.png" width="111" height="80" /></div></td>
<td width="50%" class="Estilo7">Computers & <span class="Estilo8">Systems</span></td>
<td width="14%"> </td>
<td width="17%" bgcolor="#FFFFCC"><span class="Estilo1">RUC. 12345678901 </span></td>
</tr>
<tr>
<td><div align="left" class="Estilo4"><strong>Av. Arequipa 2545 Lince </strong></div>
<div align="left" class="Estilo4"></div></td>
<td> </td>
<td bgcolor="#FFFFCC"><label></label>
<div align="center"><strong>FACTURA</strong></div></td>
</tr>
<tr>
<td><div align="left" class="Estilo4"><strong>Telfs. Fax. (511) 425-9658 (511) 458-8963 </strong></div>
<div align="left" class="Estilo4"></div></td>
<td> </td>
<td bgcolor="#FFFFCC"><input name="txtserie" type="text" id="txtserie" size="5" />
<label>
<input name="txtnfact" type="text" id="txtnfact" size="10" />
</label></td>
</tr>
<tr>
<td>IdPedido</td>
<td><label>
<input name="txtidped" type="text" id="txtidped" value="<?php echo $row[0] ?>" size="10" />
</label></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Nombre</td>
<td><label>
<input name="txtnomcli" type="text" id="txtnomcli" value="<?php echo $row[1]." ".$row[2] ?> " size="50" />
</label></td>
<td>Fecha</td>
<td><label>
<input name="txtff" type="text" id="txtff" value="<?php echo date('d/m/y') ?>" size="20" />
</label></td>
</tr>
<tr>
<td>Dirección</td>
<td><label>
<input name="txtdircli" type="text" id="txtdircli" value="<?php echo $row[3] ?>" size="50" />
</label></td>
<td>RUC</td>
<td><input name="txtruccli" type="text" id="txtruccli" value="<?php echo $row[6] ?>" size="20" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">Telefono</td>
<td bgcolor="#FFFFFF"><input name="txtdircli2" type="text" id="txtdircli2" value="<?php echo $row[4] ?>" size="50" /></td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td bgcolor="#FFFFCC"><div align="center"><strong>Cantidad</strong></div></td>
<td bgcolor="#FFFFCC"><div align="center"><strong>Descripción</strong></div></td>
<td bgcolor="#FFFFCC"><div align="center"><strong>Precio Unit. </strong></div></td>
<td bgcolor="#FFFFCC"><div align="center"><strong>Val.Venta</strong></div></td>
</tr>
<tr>
<td align="right"><?php echo $row[9] ?></td>
<td><div align="center"><?php echo $row[8] ?></div></td>
<td align="right"><?php echo $row[10] ?></td>
<td align="right"><?php echo $row[9] * $row[10] ?></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><strong>SubTotal</strong></td>
<td bgcolor="#FFFFCC" align="right"><?php echo $row[9] * $row[10] ?></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><strong>IGV.19%</strong></td>
<td bgcolor="#FFFFCC" align="right"><?php echo $row[9] * $row[10] *0.19?></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><strong>Total a Pagar </strong></td>
<td bgcolor="#FFFFCC" align="right"><?php echo $row[9] * $row[10] *1.19?></td>
</tr>
</table>
</form>
</body>
</html>


Pedidos.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>

<body>
<div align="center">
<?php
$link = mysql_connect("localhost", "root", "telesup"); //Creando la conexión
mysql_select_db("comsa", $link); //Seleccionando la BD
$result = mysql_query("select * from pedidos", $link); //Ejecutando la consulta
echo "<table border = '0'><tr bgcolor=#336699><th>IdPedido<th>Fecha Pedido<th>Fecha Envío<th>Cod.Producto<th>Cantidad<th>Precio</tr>"; //Imprimiendo la cabecera de la tabla de productos
$linea=1;
while ($row = mysql_fetch_row($result)){ //Generando esquema de datos
if ($linea%2==0){
echo "<tr bgcolor=#99ccff><td><a href=facturar.php?ID=".$row[0].">".$row[0]."</a><td>".$row[1]."<td>".$row[2]."<td>".$row[3]."<td>".$row[4]."<td>".$row[5]."</tr>"; //Imprimiendo los datos
}else{
echo "<tr><td><a href=facturar.php?ID=".$row[0].">".$row[0]."</a><td>".$row[1]."<td>".$row[2]."<td>".$row[3]."<td>".$row[4]."<td>".$row[5]."</tr>"; //Imprimiendo los datos
}
$linea++;
}
echo "</table>";
?>
</div>
</body>
</html>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ayuda con web

Publicado por roman (6 intervenciones) el 09/10/2008 22:19:11
esta es la bd
Base de datos: `comsa`
--

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `carrito`
--

CREATE TABLE `carrito` (
`cCod` char(5) NOT NULL,
`cCant` int(11) NOT NULL,
`cPre` decimal(10,2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Volcar la base de datos para la tabla `carrito`
--

INSERT INTO `carrito` VALUES ('00007', 1, 240.00);
INSERT INTO `carrito` VALUES ('00009', 1, 123.00);
INSERT INTO `carrito` VALUES ('00002', 1, 240.00);

-- --------------------------------------------------------

--
--
CREATE TABLE `clientes` (
`idcliente` char(5) NOT NULL,
`apellidos` varchar(20) NOT NULL,
`nombres` varchar(20) NOT NULL,
`direccion` varchar(40) NOT NULL,
`telefono` varchar(15) NOT NULL,
`dni` char(8) NOT NULL,
`ruc` char(11) NOT NULL,
PRIMARY KEY (`idcliente`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Volcar la base de datos para la tabla `clientes`
--

INSERT INTO `clientes` VALUES ('00002', 'Caceres Robles', 'Luis', 'Av. Arequipa 294', '452-8965', '25541870', '20406080104');
INSERT INTO `clientes` VALUES ('00001', 'Lopez Tafur', 'Carmen', 'Av. Brasil 1056', '424-1015', '20541870', '10203040506');
INSERT INTO `clientes` VALUES ('00003', 'Fuentes Vega', 'Carlos', 'Av. Benavides 1244', '447-6587', '40541870', '10406080104');

-- --------------------------------------------------------

--
----
-- Estructura de tabla para la tabla `pedidos`
--

CREATE TABLE `pedidos` (
`codped` char(5) NOT NULL,
`fecped` date NOT NULL,
`fecenv` date NOT NULL,
`codprod` varchar(5) NOT NULL,
`cantidad` int(11) NOT NULL,
`precio` double(10,2) NOT NULL,
`Estado` char(1) NOT NULL,
`IdCliente` char(5) NOT NULL,
PRIMARY KEY (`codped`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Volcar la base de datos para la tabla `pedidos`
--

INSERT INTO `pedidos` VALUES ('00002', '2008-10-05', '2008-10-05', '00002', 1, 150.00, '', '00001');
INSERT INTO `pedidos` VALUES ('00001', '2008-10-05', '2008-10-05', '00001', 2, 200.00, '', '00002');
INSERT INTO `pedidos` VALUES ('00003', '2008-10-05', '2008-10-05', '00001', 1, 150.00, '', '00001');
INSERT INTO `pedidos` VALUES ('00004', '2008-10-05', '2008-10-05', '00002', 1, 150.00, '', '00003');
INSERT INTO `pedidos` VALUES ('00005', '2008-10-05', '2008-10-05', '00003', 1, 150.00, '', '00002');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `productos`
--

CREATE TABLE `productos` (
`IdProducto` char(5) NOT NULL,
`Descripcion` varchar(50) NOT NULL,
`IdCategoria` char(3) NOT NULL,
`PrecioUnit` decimal(10,2) NOT NULL,
`Stock` int(8) NOT NULL,
`Imagen` varchar(50) NOT NULL,
`Descontinuado` char(1) NOT NULL,
PRIMARY KEY (`IdProducto`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Volcar la base de datos para la tabla `productos`
--

INSERT INTO `productos` VALUES ('00001', 'Monitor LCD SyncMaster540N 17', 'K01', 240.00, 4000, 'imagenes/p0001.jpg', '0');
INSERT INTO `productos` VALUES ('00002', 'Impresora HP Laser 6000DPI', 'K02', 240.00, 60, 'imagenes/p0002.jpg', '0');
INSERT INTO `productos` VALUES ('00003', 'Impresora Digital Samsung', 'K01', 150.00, 100, 'imagenes/p0003', '');
INSERT INTO `productos` VALUES ('00004', 'Impresora Epson Stylus C5000', 'K02', 250.00, 60, 'imagenes/p0004', '');
INSERT INTO `productos` VALUES ('00005', 'Memoria USB 4GB Kingston', 'K01', 85.00, 200, 'imagenes/p0005', '0');
INSERT INTO `productos` VALUES ('00006', 'Memoria DDR 512MB', 'K04', 32.00, 40, 'imagenes/p0006', '');
INSERT INTO `productos` VALUES ('00007', 'Scanner HP 6000 DPI', 'K03', 240.00, 30, 'imagenes/p0007', '');
INSERT INTO `productos` VALUES ('00008', 'impresora laser xxx', 'k01', 254.00, 25, 'imagenes/P0006.jpg', '0');
INSERT INTO `productos` VALUES ('00009', 'impresora lasex 2500', 'K01', 123.00, 350, 'imagenes/P0009.jpg', '0');

-- --------------------------------------------------------
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar