include_once "../Librerias/ProductoDao.php";
include_once "../Librerias/Producto.php";
include_once "../Librerias/Variables.php";
$conn = new Datasource($dbhost, $dbName, $dbUser, $dbPassword);
$idartesano = $_POST["ID"];
$descripcion = $_POST["descripcion"];
$enlace = $_POST["enlace"];
$nroenvio = $_POST["nroenvio"];
$empresa = $_POST["empresa"];
$producto = new Producto();
$pdao = new ProductoDao();
$producto->setIdartesano($idartesano);
$producto->setAceptado(0);
$producto->setNotificado(0);
$producto->setDescripcion($descripcion);
$producto->setLink($enlace);
$producto->setEmpresa($empresa);
$producto->setNroenvio($nroenvio);
$producto->setStock(0);
$producto->setVentas(0);
$producto->setFormatofoto(0);
$producto->setPrecio(0);
$producto->setMostrar($_POST["mostrar"]);
if ($pdao->create($conn, $producto)) {
    ?>
			<meta http-equiv="REFRESH" CONTENT="0,url=../Interfaces/principal.php">
			<script type="text/javascript">
				alert("Producto registrado exitosamente");
			</script>
		<?php 
} else {
示例#2
0
 /**
  * Clone will return identical deep copy of this valueObject.
  * Note, that this method is different than the clone() which
  * is defined in java.lang.Object. Here, the retuned cloned object
  * will also have all its attributes cloned.
  */
 function cloneObject()
 {
     $cloned = new Producto();
     $cloned->setIdproducto($this->idproducto);
     $cloned->setNombproducto($this->nombproducto);
     $cloned->setDescripcion($this->descripcion);
     $cloned->setLink($this->link);
     $cloned->setIdartesano($this->idartesano);
     $cloned->setAceptado($this->aceptado);
     $cloned->setEmpresa($this->empresa);
     $cloned->setNroenvio($this->nroenvio);
     $cloned->setNotificado($this->notificado);
     $cloned->setStock($this->stock);
     $cloned->setVentas($this->ventas);
     $cloned->setFormatofoto($this->formatofoto);
     $cloned->setPrecio($this->precio);
     $cloned->setMostrar($this->mostrar);
     return $cloned;
 }