Beispiel #1
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 Artesano();
     $cloned->setIdArtesano($this->idArtesano);
     $cloned->setTipoDoc($this->TipoDoc);
     $cloned->setNroDoc($this->NroDoc);
     $cloned->setPassword($this->password);
     $cloned->setDireccion($this->direccion);
     $cloned->setTelefono($this->telefono);
     $cloned->setTelefono2($this->telefono2);
     $cloned->setUsername($this->username);
     $cloned->setEstado($this->estado);
     $cloned->setNombre($this->nombre);
     $cloned->setCelular($this->celular);
     $cloned->setEmail($this->email);
     $cloned->setCertificacion($this->certificacion);
     $cloned->setNivelestudio($this->nivelestudio);
     $cloned->setAprendices($this->aprendices);
     $cloned->setCursos($this->cursos);
     $cloned->setFormatofoto($this->formatofoto);
     return $cloned;
 }
<?php

include_once "../Librerias/Datasource.php";
include_once "../Librerias/ArtesanoDao.php";
include_once "../Librerias/Artesano.php";
include_once "../Librerias/Variables.php";
$conn = new Datasource($dbhost, $dbName, $dbUser, $dbPassword);
$adao = new ArtesanoDao();
$artesanoborrado = new Artesano();
$artesanoborrado->setIdArtesano($_GET["idArtesano"]);
if ($adao->delete($conn, $artesanoborrado)) {
    $exito = 1;
} else {
    $exito = 0;
}
$lista = $adao->loadAll($conn);
$array1 = array();
for ($i = 0; $i < count($lista); $i++) {
    $artesano = $lista[$i];
    $array2 = array('idArtesano' => $artesano->getIdArtesano(), 'nombre' => utf8_encode($artesano->getNombre()), 'nroDoc' => $artesano->getNroDoc(), 'direccion' => utf8_encode($artesano->getDireccion()), 'telefono' => $artesano->getTelefono(), 'celular' => $artesano->getCelular(), 'email' => $artesano->getEmail());
    $array1[] = $array2;
}
$array3["exito"] = 1;
$array3["valores"] = $array1;
echo json_encode($array3);
include_once "../Librerias/Producto.php";
include_once "../Librerias/Variables.php";
$conn = new Datasource($dbhost, $dbName, $dbUser, $dbPassword);
$adao = new ArtesanoDao();
$pdao = new ProductoDao();
$artesano = new Artesano();
if (!isset($_SESSION["USER"])) {
    ?>
			<script type="text/javascript">
				alert("No tienes permiso para ver este contenido");
			</script>
			<META http-equiv="Refresh" content="0,url=index.php">
		<?php 
} else {
    if ($_SESSION["ROL"] == "Artesano") {
        $artesano->setIdArtesano($_SESSION["ID"]);
        $list = $adao->searchMatching($conn, $artesano);
        $artesano = $list[0];
        $artesano = $adao->encodificaraUTF($artesano);
        $busqueda = new Producto();
        $busqueda->setIdartesano($artesano->getIdartesano());
        $busqueda->setNotificado(0);
        $productos = $pdao->searchMatching($conn, $busqueda);
        $ver = false;
        $estado = false;
        ?>



<!DOCTYPE html>
<html>