示例#1
0
<?php

include_once 'controle.php';
$conBairro = new Bairro();
if (!empty($_GET['idBairro'])) {
    $conBairro->carregarPorId($_GET['idBairro']);
}
?>

<?php 
include_once '../../model/head.php';
?>
    <body>
	<div class="panel panel-primary">
    	<div class="panel-heading">
    		Bairro
    	</div>
            
    	<div class="panel-body">
	    	<form action="processamento.php" method="get" name="formulario" class="form-horizontal">
                    <input type="hidden" name="idBairro" id="idBairro" value="<?php 
echo $conBairro->getIdBairro();
?>
" />
	    	
				<div class="form-group">
                	<label for="bairro" class="col-sm-2 control-label">Bairro: </label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="bairro" id="descricao" value="<?php 
echo $conBairro->getBairro();
?>
<?php

$titulo = 'Cadastro de Bairro';
/* 
 * @autor Ricardo Caldeira
 * 
 */
include_once 'controle.php';
include_once '../../model/head.php';
$conBairro = new Bairro();
if (!isset($_GET['action'])) {
    ?>
        <script>
            alert('Erro ao capturar evento, não foi possível identificar a ação');
            window.location.href = '../../view/bairro.php'
        </script>
       <?php 
} else {
    $action = $_GET['action'];
    if (isset($_POST['bairro'])) {
        $bairro = $_POST['bairro'];
    }
    if (!empty($_GET['idBairro'])) {
        $idBairro = $_GET['idBairro'];
    }
}
switch ($action) {
    case 'incluir':
        $conBairro->insert($bairro);
        ?>
 
示例#3
0
文件: add_item.php 项目: marcosyyz/dm
<?php

include '../../config.php';
include ROOT . 'model/Item.php';
include ROOT . 'model/Categoria.php';
include ROOT . 'model/Bairro.php';
include ROOT . 'model/SEO.php';
if (!isset($_SESSION['USUARIO_CDG'])) {
    header('Location: ' . ROOT_URL . '?s=a');
}
//carregar parametros do item
$item_cdg = isset($_GET['i']) ? $_GET['i'] : '-1';
$item_cdg = $item_cdg == '' ? -1 : $item_cdg;
$item_cdg = !is_numeric($item_cdg) ? -1 : $item_cdg;
$Cat = new Categoria();
$Bairro = new Bairro();
$Item = new Item($item_cdg);
$SEO = new SEO();
$bairros = $Bairro->lista_bairros();
$cats = $Cat->lista_cats();
require ROOT . 'view/item/add_item.php';
示例#4
0
 public function actionBuscarBairropetshop()
 {
     $parametros = Util::getParametrosJSON();
     $bairro = Bairro::model()->findByPk($parametros['id']);
     Util::setParametrosJSON($bairro);
 }
示例#5
0
<?php

$titulo = 'Cadastro de bairro';
include_once '../model/head.php';
include_once '../control/bairro/controle.php';
$bairro = new Bairro();
$bairros = $bairro->recuperaTodos();
?>
<html>
    <body>
        <h1 align='center'>Cadastro de bairros</h1>
        <div class="container col-md-4">
                <table class="table table-striped" border='5'>
                    <tr>
                        <td><h3>AÇÃO</h3></td>
                        <td><h3>ID</h3></td>
                        <td><h3>Bairro</h3></td>
                    </tr>
                    <?php 
foreach ($bairros as $dado) {
    ?>
                    <tr>
                        <td><a title="alterar" href="..\control\bairro\formulario.php?idBairro=<?php 
    echo $dado['idBairro'];
    ?>
"><span class="glyphicon glyphicon-pencil"></span></a>
                        <a title="excluir" href="..\control\bairro\processamento.php?action=delete&idBairro=<?php 
    echo $dado['idBairro'];
    ?>
"><span class="glyphicon glyphicon-trash"></span></a></td>
                        <td><?php 
示例#6
0
 /**
  * method Delete()
  * Delete a record
  */
 function Delete($param)
 {
     try {
         // get the parameter $key
         $key = $param['key'];
         // open a transaction with database 'permission'
         TTransaction::open('liger');
         // instantiates object SystemProgram
         $object = new Bairro($key);
         // deletes the object from the database
         $object->delete();
         // close the transaction
         TTransaction::close();
         // reload the listing
         $this->onReload($param);
         // shows the success message
         new TMessage('info', TAdiantiCoreTranslator::translate('Record deleted'));
     } catch (Exception $e) {
         // shows the exception error message
         new TMessage('error', '<b>Error</b> ' . $e->getMessage());
         // undo all pending operations
         TTransaction::rollback();
     }
 }