case 'newClient':
        $view->client = new Cliente();
        $view->label = 'Nuevo RFI';
        $view->disableLayout = true;
        $view->contentTemplate = "templates/clientForm.php";
        // seteo el template que se va a mostrar
        break;
    case 'editClient':
        $editId = intval($_POST['id']);
        $view->label = 'Editar RFI';
        $view->client = new Cliente($editId);
        $view->disableLayout = true;
        $view->contentTemplate = "templates/clientForm.php";
        // seteo el template que se va a mostrar
        break;
    case 'deleteClient':
        $id = intval($_POST['id']);
        $client = new Cliente($id);
        $client->delete();
        die;
        // no quiero mostrar nada cuando borra , solo devuelve el control.
        break;
    default:
}
// si esta deshabilitado el layout solo imprime el template
if ($view->disableLayout == true) {
    include_once $view->contentTemplate;
} else {
    include_once 'templates/layout.php';
}
// el layout incluye el template adentro
Exemple #2
0
 public function eliminar($clienteId)
 {
     $this->load->model(array('Cliente'));
     $cliente = new Cliente($clienteId);
     echo json_encode(array("success" => $cliente->delete()));
 }
 function Delete($param)
 {
     // obtém o parâmetro $key
     $key = $param['key'];
     // inicia transação com o banco 'pg_livro'
     TTransaction::open('pg_livro');
     // instancia objeto Cliente
     $cliente = new Cliente($key);
     // deleta objeto do banco de dados
     $cliente->delete();
     // finaliza a transação
     TTransaction::close();
     // recarrega a datagrid
     $this->onReload();
     // exibe mensagem de sucesso
     new TMessage('info', "Registro excluído com sucesso");
 }
 /**
  * method Delete()
  * Delete a record
  */
 function Delete($param)
 {
     try {
         // get the parameter $key
         $key = $param['key'];
         // open a transaction with database 'samples'
         TTransaction::open('db_crmbf');
         // instantiates object Customer
         $customer = new Cliente($key);
         // deletes the object from the database
         $customer->delete();
         // close the transaction
         TTransaction::close();
         // reload the listing
         $this->onReload($param);
         // shows the success message
         new TMessage('info', "Registro Deletado");
     } catch (Exception $e) {
         // shows the exception error message
         new TMessage('error', '<b>Error</b> ' . $e->getMessage());
         // undo all pending operations
         TTransaction::rollback();
     }
 }
Exemple #5
0
	$rol = new Rol();

	if ($_GET['op']=='insert') {
		$cliente->setIdDoc($_POST['id_doc']);
		$cliente->setDoc($_POST['doc']);
		$cliente->setNom($_POST['nom']);
		$cliente->setApe($_POST['ape']);
		$cliente->setDir($_POST['dir']);
		$cliente->setIdCiu($_POST['id_ciu']);
		$cliente->setIdDep($_POST['id_dep']);
		$cliente->setTel($_POST['tel']);
		$cliente->insert();
	}

	if ($_GET['op']=='delete') {
		$cliente->delete($_GET['id']);
	}

	if ($_GET['op']=='ord') {
		$cliente->setOrder(" ORDER BY ".$_GET['by']);
		$_SESSION['orden'] = " ORDER BY ".$_GET['by'];
	}

	$show=$_SESSION['show'];
	$regs = $cliente->countRegs();
	if (!isset($_GET['index'])) {
		$_GET['index']=0;
	} else {
		$cliente->setOrder($_SESSION['orden']);
	}