public function index()
 {
     $arrResult = [];
     $bolQuery = false;
     $error = [];
     if (isset($_POST['txtDocument'])) {
         if (!empty($_POST['txtDocument'])) {
             $bolQuery = true;
             $objConection = new Conection();
             $sql = 'SELECT  usu_id
                         ,usu_nombres
                         ,usu_apellidos
                         ,usu_email
                 FROM usuario
                 WHERE usu_id =:usu_id';
             error_reporting(E_ERROR | E_WARNING | E_PARSE);
             $objConection->query($sql);
             $objConection->bind(':usu_id', $_POST['txtDocument']);
             $arrResult = (array) $objConection->single();
             if (isset($arrResult[0]) && (string) $arrResult[0] === '') {
                 $arrResult = [];
             }
         } else {
             $error[] = $this->config->errors[0];
         }
     }
     $this->render('example.php', ['data' => $arrResult, 'query' => $bolQuery, 'error' => $error]);
 }
示例#2
0
 function __construct()
 {
     require_once "../coreapp/Conection.php";
     $conection = new Conection();
     $this->conn = $conection->Conectar();
     return $this->conn;
 }
示例#3
0
 public static function getInstance()
 {
     if (!self::$_instance instanceof Conection) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
 /**
  * Funcion para usar el patron singleton
  *
  * @author  Sergio Alejandro Valencia López <*****@*****.**>
  * @version 1
  * @return object $inst Conection
  * @access public
  *
  */
 public static function Instance()
 {
     if (self::$inst === null) {
         self::$inst = new Conection();
     }
     return self::$inst;
 }
示例#5
0
function verificar($usuario, $clave)
{
    require '../coreapp/Conection.php';
    $conection = new Conection();
    $con = $conection->Conectar();
    $rpta;
    $sql = "SELECT cod_usu FROM usuarios WHERE log_usu='{$usuario}' AND psw_usu ='{$clave}' LIMIT 0,1;";
    $result = $con->query($sql);
    $numero = $result->num_rows;
    if ($numero > 0) {
        $rpta = TRUE;
    } else {
        $rpta = FALSE;
    }
    return $rpta;
}
示例#6
0
 /**
  * Construtor chama a construtor da classe \Conection
  */
 public function __construct()
 {
     try {
         if ($this->adapter === null) {
             $this->adapter = parent::__construct();
         }
     } catch (Exception $ex) {
         $this->adapter = null;
         echo $ex;
     }
 }
示例#7
0
 public function __construct($limit, $page, $url, $from, $where = null)
 {
     parent::__construct(DB_HOST, DB_USER, DB_PASS, DB_NAME);
     $this->mysqli = parent::setConectar();
     $this->_limit = $limit;
     $this->_page = $page;
     if ($page < 1) {
         $page = 1;
     }
     $this->_offset = ($page - 1) * $limit;
     $this->_url = $url;
     $this->_from = $from;
     $this->_where = $where;
     $this->getNrows();
 }
示例#8
0
 public function update()
 {
     $value = 250;
     $date = date('Y-m-d h:i:s');
     $intId = 141;
     $sql = "UPDATE meta\n                 SET met_fecCreacion=:date, met_valor=:value\n                 WHERE met_id=:id";
     $objConection = new Conection();
     $objConection->query($sql);
     $objConection->bind(':date', $date);
     $objConection->bind(':value', $value);
     $objConection->bind(':id', $intId);
     if ($objConection->execute() == 1) {
         return true;
     }
     return false;
 }
示例#9
0
<?php

session_start();
if (isset($_SESSION['log_usu']['autenticado']) && $_SESSION['log_usu']['autenticado']) {
    require "cabecera.php";
    require "menu.php";
    require_once "../inc/Conection.php";
    //Conexion con Base de Datos
    $conn = new Conection();
    $link = $conn->Conection();
    $otorgante = $_POST["txtOtorgante"];
    $sql = "SELECT indices.codIndice,CONCAT(Notario.nom_not,' ',Notario.mat_not,' ',Notario.pat_not) AS notario,indices.otorgante,indices.favorecido,indices.fecha,indices.subserie,indices.folio,indices.escritura,indices.bien \r\n\tFROM indices INNER JOIN Notario ON indices.codNotario=Notario.codNotario WHERE indices.otorgante LIKE '%{$otorgante}%'";
    $result = $link->query($sql);
    $total = $result->num_rows;
    ?>

<div class="container">

	<div class="row">
		<div class="col-md-12">

			<center><h3>Lista de Índices por Otorgantes</h3></center>
			<?php 
    echo "<h4>Número de Índices Encontrados: {$total} Índices</h4> ";
    ?>
			
			<table class="table table-striped table-bordered table-condensed" >
				<thead>
					<tr>
						<th>Número</th>
						<th>Nombre Notario</th>
示例#10
0
<?php

require_once 'conection.class.php';
if ($_POST) {
    $conexao = new Conection();
    $conexao->useBD('localhostBD');
    $conexao->useTable('listagem');
    $id = $_POST['id'];
    $conexao->removeId($id);
    header('location:/mongodb');
}
示例#11
0
 function __construct()
 {
     $con = new Conection();
     $this->conexion = $con->configuracion();
 }
示例#12
0
 function __construct()
 {
     require_once "../coreapp/conection.php";
     $this->con = new Conection();
     $this->con = Conection::Conexion();
 }
示例#13
0
<?php

require_once 'conection.class.php';
if ($_POST) {
    $conexao = new Conection();
    $conexao->useBD('localhostBD');
    $conexao->useTable('listagem');
    $nome = $_POST['nome'];
    $email = $_POST['email'];
    $conexao->insert(array('nome' => $nome, 'email' => $email));
    header('location:/mongodb');
}
示例#14
0
<?php

require_once "core/Conection.php";
$conection = new Conection();
$conn = $conection->Conectarse();
$idimagen = $_REQUEST['idimagen'];
$nombre = $_REQUEST['nombre'];
$ruta = $_REQUEST['ruta'];
$tipo = $_REQUEST['tipo'];
$taman = $_REQUEST['taman'];
$imagen = $_REQUEST['image3'];
$data = file_get_contents('imagenes/' . $imagen);
$image = pg_escape_bytea($data);
//pg_query($conn, "UPDATE imagen SET foto = '{$image}' WHERE id = 1");
pg_query($conn, "INSERT INTO imagen(nombre, rutaim, imagen, tipoim, tamima, idimag) VALUES ('{$nombre}', '{$ruta}', '{$image}', '{$tipo}', '{$taman}',{$idimagen});") or die(pg_errormessage());
pg_close($conn);
?>
<!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="UTF-8">
	<title>Imagenes</title>
</head>
<body>
	<form action="">
		idimagen:<input type="text" name="idimagen" placeholder="1"><br>
		nombre:<input type="text" name="nombre" placeholder="2"><br>
		Ruta<input type="text" name="ruta" placeholder="3"><br>
		Imagen<input type="file" name="image3" placeholder="4"><br>
		tipo<input type="text" name="tipo" placeholder="5"><br>
		Tamaño<input type="text" name="taman" placeholder="6"><br>
示例#15
0
<!DOCTYPE html>
<html>
<head>
	<title>Mongodb | Inicio</title>
	<meta charset="utf-8">
</head>
<body>

	<?php 
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
require_once 'conection.class.php';
$conexao = new Conection();
$conexao->useBD('localhostBD');
$conexao->useTable('listagem');
// $conexao->insert( Array('nome'=>'pedro','email'=>'*****@*****.**') );
$rows = $conexao->getAll();
function printer($arr)
{
    echo '<pre>' . print_r($arr, 1) . '</pre>';
}
?>

	<form action="send.php" method="post">
		<table>
			<tr>
				<td>Nome</td>
				<td><input type="text" name="nome"></td>
			</tr>
			<tr>
				<td>Email</td>
示例#16
0
文件: Querys.php 项目: peternerd/YOi
 public function __construct()
 {
     parent::__construct(DB_HOST, DB_USER, DB_PASS, DB_NAME);
     $this->mysqli = parent::setConectar();
 }
示例#17
0
<?php

require_once 'header.php';
require_once '../coreapp/Conection.php';
$conection = new Conection();
$mysqli = $conection->Conectar();
if (isset($_REQUEST['btnbuscar'])) {
    $nexo = "%";
    $nombre_bien = trim($_REQUEST['nombre_bien']);
    $separar = explode(" ", $nombre_bien);
    $union = implode($nexo, $separar);
    $sql = "SELECT cod_sct, cod_sub, fec_doc, nom_bie, proy_id FROM escrituras1 WHERE nom_bie Like '%{$union}%'";
    $res = $mysqli->query($sql);
    $data = $res->fetch_assoc();
    $numeroRegistros = $res->num_rows;
    echo "Numero de Registros: " . $numeroRegistros;
}
?>

<form id="busqueda" name="busqueda" method="post">
  <table>
  	<thead>
      <tr>
        <td>BUSCAR POR BIEN</td>
        <td><input name="nombre_bien" type="text" size="80" value="<?php 
echo @$nombre_bien;
?>
" required placeholder="Nombre del bien"/></td>
        <td><input name="btnbuscar" type="submit" value="Buscar" class="btn btn-info"/></td>
        <td></td>
      </tr>
示例#18
0
<?php

class Conection
{
    public function Conectar()
    {
        require_once "config.php";
        $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
        $mysqli->set_charset("utf8");
        if ($mysqli->connect_errno) {
            echo "Error al contenctar a MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
            exit;
        }
        echo $mysqli->host_info . " Test eb Conection.php";
        return $mysqli;
    }
}
$conn = new Conection();
$conn->Conectar();
示例#19
0
 /**
  * Constructor de la clase
  *
  * @author  Sergio Alejandro Valencia López <*****@*****.**>
  * @version 1.0
  * @copyright 2014
  * @return \Business
  * @access public
  */
 public function __construct()
 {
     $this->_conection = Conection::Instance();
 }
示例#20
0
文件: update.php 项目: dillman91/tv
<?php

require_once "../coreapp/Conection.php";
$conn = new Conection();
$mysqli = $conn->Conectar();
$activo = 0;
$id = 1;
$sql = "UPDATE campos SET activo = '{$activo}' WHERE campos.id = {$id} LIMIT 1;";
$mysqli->query($sql) or die($mysqli->error());
示例#21
0
 function __construct()
 {
     require_once "../inc/Conection.php";
     $conection = new Conection();
     $this->con = $conection->Conection();
 }
示例#22
0
                      <input type="text" name="carpeta" class="form-control" id="inputText" placeholder="Carpeta">
                    </div>
                  </div>

                  <div class="form-group">
                    <div class="col-lg-10 col-lg-offset-2">
                      <button type="reset" class="btn btn-default">Cancel</button>
                      <button type="submit" name="btnGuardar" class="btn btn-primary">Submit</button>
                    </div>
                  </div>
                </fieldset>
              </form>
            </div>
          </div>
	</div>
</body>
</html>

<?php 
require "../coreapp/conection.php";
$conection = new Conection();
$mysqli = $conection->Conexion();
if (isset($_POST['btnGuardar'])) {
    $archivo = $_FILES['archivo']['tmp_name'];
    $destino = $_SERVER['DOCUMENT_ROOT'] . "/digiarch/img/" . $_FILES['archivo']['name'];
    move_uploaded_file($archivo, $destino);
    //echo $mysqli->host_info. " aqui en addtruta";
    $sql = "INSERT INTO imagenes (idimagen,ruta,directorio,idproy) VALUES (null,'{$destino}','carpeta',19)";
    $mysqli->query($sql);
    //Insertar en base de datos
}