當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TBase::conectaDB方法代碼示例

本文整理匯總了PHP中TBase::conectaDB方法的典型用法代碼示例。如果您正苦於以下問題:PHP TBase::conectaDB方法的具體用法?PHP TBase::conectaDB怎麽用?PHP TBase::conectaDB使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TBase的用法示例。


在下文中一共展示了TBase::conectaDB方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: eliminar

 public function eliminar()
 {
     if ($this->getId() == '') {
         return false;
     }
     $db = TBase::conectaDB();
     return $db->Execute("delete from departamento where idDepartamento = " . $this->getId()) ? true : false;
 }
開發者ID:hugooluisss,項目名稱:pdv,代碼行數:8,代碼來源:TDepartamento.class.php

示例2: guardar

 public function guardar()
 {
     if (!parent::guardar()) {
         return false;
     }
     $db = TBase::conectaDB();
     $rs = $db->Execute("select idItem from servicio where idItem = " . $this->getId());
     if ($rs->EOF) {
         $rs = $db->Execute("INSERT INTO servicio (idItem, precio, impInc, imp) VALUES (" . $this->getId() . ", 0, 'S', 0)");
     }
     $rs = $db->Execute("UPDATE servicio\n\t\t\tSET\n\t\t\t\tprecio = " . $this->getPrecio() . ",\n\t\t\t\timpInc = '" . $this->impInc . "',\n\t\t\t\timp = " . $this->getImpuesto() . "\n\t\t\tWHERE idItem = " . $this->getId());
     return $rs ? true : false;
 }
開發者ID:hugooluisss,項目名稱:pdv,代碼行數:13,代碼來源:TServicio.class.php

示例3: setId

 public function setId($id = '')
 {
     if ($id == '') {
         return false;
     }
     parent::setId($id);
     $db = TBase::conectaDB();
     $rs = $db->Execute("select * from venta where idOrden = " . $this->getId());
     foreach ($rs->fields as $key => $val) {
         switch ($key) {
             case 'idCliente':
                 $this->setCliente($val);
                 break;
             default:
                 $this->{$key} = $val;
         }
     }
 }
開發者ID:hugooluisss,項目名稱:pdv,代碼行數:18,代碼來源:TVenta.class.php

示例4: setId

 /**
  * Carga los datos del objeto
  *
  * @autor Hugo
  * @access public
  * @param int $id identificador del objeto
  * @return boolean True si se realizó sin problemas
  */
 public function setId($id = '')
 {
     if ($id == '') {
         return false;
     }
     $db = TBase::conectaDB("sigei");
     $rs = $db->Execute("select idEstudiante, matricula, plantel, nombrem, app, apm from estudiante where idEstudiante = " . $id);
     foreach ($rs->fields as $field => $val) {
         switch ($field) {
             case 'idPlantel':
                 $this->plantel = new TPlantel($val);
                 break;
             default:
                 $this->{$field} = $val;
         }
     }
     return true;
 }
開發者ID:hugooluisss,項目名稱:DGI,代碼行數:26,代碼來源:TEstudiante.class.php

示例5: generar

 public function generar($id)
 {
     $this->AddPage();
     //$this->Image('repositorio/img/ordendetrabajo.jpg', 0, 0);
     $pedido = $this->pedido;
     $this->Cell(0, 5, "C. " . $pedido->cliente->getNombre(), 0, 1);
     $this->Ln(10);
     $this->Write(5, utf8_decode("Estimado cliente, por medio del presente, le hago entrega del detalle de su pedido. Cualquier duda favor de contactarnos, con gusto se las resolveremos"));
     $this->SetFillColor(0, 150, 0);
     $this->Ln(20);
     $this->SetFont('Sans', 'B', 8);
     $this->Cell(80, 8, "Nombre", 0, 0, 'C', 1);
     $this->Cell(40, 8, "Marca", 0, 0, 'C', 1);
     $this->Cell(45, 8, "Talla", 0, 0, 'C', 1);
     $this->Cell(30, 8, "Cantidad", 0, 1, 'C', 1);
     $this->SetFont('Sans', '', 6);
     $cantidad = 0;
     $db = TBase::conectaDB();
     $rs = $db->Execute("select * from movped join talla using(idTalla) join ropa using(idItem) where idPedido = " . $this->pedido->getId());
     while (!$rs->EOF) {
         $mov = $rs->fields;
         $this->Cell(80, 8, $mov['descripcion'], "B", 0, 'L');
         $this->Cell(40, 8, $mov["marca"], "B", 0, 'L');
         $this->Cell(45, 8, $mov["nombre"], "B", 0, 'L');
         $this->Cell(30, 8, $mov["cantidad"], "B", 1, 'R');
         $cantidad += $mov["cantidad"];
         $rs->moveNext();
     }
     if ($unidades > 0) {
         $this->SetFont('Sans', '', 10);
         $this->Cell(165, 12, "Unidades", 0, 0, 'R');
         $this->SetFont('Sans', 'B', 11);
         $this->Cell(30, 12, "\$ " . sprintf("%d", $unidades), "B", 1, 'R');
     }
     $this->SetFont('Sans', 'B', 6);
     $this->Cell(165, 8, "Total a pagar", 0, 0, 'R');
     $this->Cell(30, 8, (string) $pedido->getPrecio(), "B", 1, 'R');
     $this->Cell(165, 8, "Seña", 0, 0, 'R');
     $this->Cell(30, 8, $pedido->getAnticipo(), "B", 1, 'R');
     $this->Cell(165, 8, "Resta", 0, 0, 'R');
     $this->Cell(30, 8, (string) sprintf("%0.2f", $pedido->getPrecio() - $pedido->getAnticipo()), "B", 1, 'R');
 }
開發者ID:hugooluisss,項目名稱:cotizador,代碼行數:42,代碼來源:pedido+copy.php

示例6: setId

 /**
  * Carga los datos del objeto
  *
  * @autor Hugo
  * @access public
  * @param int $id identificador del objeto
  * @return boolean True si se realizó sin problemas
  */
 public function setId($id = '')
 {
     if ($id == '') {
         return false;
     }
     $db = TBase::conectaDB("sip");
     $rs = $db->Execute("select * from plantel where id_plantel = '" . $id . "'");
     foreach ($rs->fields as $field => $val) {
         switch ($field) {
             case 'id_plantel':
                 $this->idPlantel = $val;
                 break;
             case 'nombre':
                 $this->nombre_pl = $val;
                 break;
             case 'clave_pl':
                 $this->clave = $val;
                 break;
         }
     }
     return true;
 }
開發者ID:hugooluisss,項目名稱:DGI,代碼行數:30,代碼來源:TPlantel.class.php

示例7: delSupervisado

 /**
  * Eliminar a doctor a supervisor
  *
  * @autor Hugo
  * @access public
  * @param $id Identificador del usuario doctor
  * @return boolean True si se realizó sin problemas
  */
 public function delSupervisado($id = '')
 {
     if ($id == '') {
         return false;
     }
     if ($this->getId() == '' or $this->getIdTipo() != 2) {
         return false;
     }
     $db = TBase::conectaDB();
     $rs = $db->Execute("delete from encargados where idSupervisor = " . $this->getId() . " and idUsuario = " . $id);
     return $rs ? true : false;
 }
開發者ID:hugooluisss,項目名稱:registroDoctores,代碼行數:20,代碼來源:TUsuario.class.php

示例8: eliminar

 public function eliminar()
 {
     if ($this->getId() == '') {
         return false;
     }
     $db = TBase::conectaDB();
     $rs = $db->Execute("update item set estado = 'E' where idItem = " . $this->getId());
     return $rs ? true : false;
 }
開發者ID:hugooluisss,項目名稱:pdv,代碼行數:9,代碼來源:TItem.class.php

示例9: eliminar

 /**
  * Elimina el objeto de la base de datos
  *
  * @autor Hugo
  * @access public
  * @return boolean True si se realizó sin problemas
  */
 public function eliminar()
 {
     if ($this->getId() == '') {
         return false;
     }
     $db = TBase::conectaDB();
     $rs = $db->Execute("delete from limite where idLimite = " . $this->getId());
     return $rs ? true : false;
 }
開發者ID:hugooluisss,項目名稱:cotizador,代碼行數:16,代碼來源:TLimite.class.php

示例10: setTipo

 public function setTipo($id = '')
 {
     if ($id == '' or $this->getId() == '') {
         return false;
     }
     $db = TBase::conectaDB();
     $rs = $db->Execute("update usuario set idTipo = " . $id . " where num_personal = " . $this->getId() . "");
     return true;
 }
開發者ID:hugooluisss,項目名稱:DGI,代碼行數:9,代碼來源:TUsuario.class.php

示例11: addTecnica

 public function addTecnica($id, $tecnica, $color, $cantidad, $ubicacion, $size, $medidas, $precio)
 {
     if ($this->getId() == '') {
         return false;
     }
     $db = TBase::conectaDB();
     if ($id == '') {
         $rs = $db->Execute("insert into pedidotecnicaimpresion(idPedido, idImpresion, color) values (" . $this->getId() . ", " . $tecnica . ", '" . $color . "')");
         $id = $db->Insert_ID();
     }
     if ($id != '') {
         $rs = $db->Execute("update pedidotecnicaimpresion set \n\t\t\t\t\tidImpresion = " . $tecnica . ",\n\t\t\t\t\tcolor = " . $color . ",\n\t\t\t\t\tcantidad = " . $cantidad . ",\n\t\t\t\t\tubicacion = " . $ubicacion . ",\n\t\t\t\t\tsize = " . $size . ",\n\t\t\t\t\tmedidas = " . $medidas . ",\n\t\t\t\t\tprecio = " . $precio . "\n\t\t\t\twhere idImpresion = " . $id . "\n\t\t\t");
     }
     return $rs ? true : false;
 }
開發者ID:hugooluisss,項目名稱:cotizador,代碼行數:15,代碼來源:TPedido.class.php

示例12: setComentarios

 /**
  * Agregar comentarios
  *
  * @autor Hugo
  * @access public
  * @return boolean True si se realizó sin problemas
  */
 public function setComentarios()
 {
     if ($this->getId() == '') {
         return false;
     }
     $db = TBase::conectaDB();
     $rs = $db->Execute("select idReporte from comentario where idReporte = " . $this->getId());
     if ($rs->EOF) {
         $rs = $db->Execute("insert into comentario (idReporte, campo1, campo2, campo3) values (" . $this->getId() . ", '" . $this->getCampo1() . "', '" . $this->getCampo2() . "', '" . $this->getCampo3() . "')");
     } else {
         $rs = $db->Execute("update comentario set\n\t\t\t\t\tcampo1 = '" . $this->getCampo1() . "',\n\t\t\t\t\tcampo2 = '" . $this->getCampo2() . "',\n\t\t\t\t\tcampo3 = '" . $this->getCampo3() . "'\n\t\t\t\twhere idReporte = " . $this->getId());
     }
     return $rs ? true : false;
 }
開發者ID:hugooluisss,項目名稱:SAMAP,代碼行數:21,代碼來源:TReporte.php

示例13: generar

 public function generar($id)
 {
     $adicionalY = -20;
     $adicionalX = -5;
     $this->AddPage();
     if ($his->formatoFondo) {
         $this->Image('repositorio/img/orden.jpg', 0, 0, 190, 240);
     }
     $pedido = $this->pedido;
     $this->SetFont('Arial', 'B', 8);
     $this->SetXY(96 + $adicionalX, 32.5 + $adicionalY);
     $this->Cell(15, 4, "No. Orden: ", 0, 0, 'L');
     $this->SetFont('Arial', '', 8);
     $this->SetXY(110 + $adicionalX, 32.5 + $adicionalY);
     $this->Cell(25, 4, (string) $pedido->getId(), 0, 0, 'R');
     $this->SetXY(24 + $adicionalX, 46 + $adicionalY);
     $this->Cell(0, 5, $pedido->cliente->getNombre(), 0);
     $this->SetXY(24 + $adicionalX, 54.5 + $adicionalY);
     $this->Cell(0, 5, $pedido->cliente->getCelular(), 0);
     $this->SetXY(24 + $adicionalX, 63 + $adicionalY);
     $this->Cell(0, 5, $pedido->cliente->getEmail(), 0);
     #registro
     $this->SetXY(40 + $adicionalX, 30 + $adicionalY);
     $this->Cell(0, 5, $pedido->getRegistro(), 0);
     #entrega
     $entrega = explode("-", $pedido->getEntrega());
     $entregaAux = explode(" ", $entrega[2]);
     $entrega[2] = $entregaAux[0];
     $entrega = explode("-", $pedido->getEntregaCliente() == '' ? $pedido->getEntrega() : $pedido->getEntregaCliente());
     $entregaHora = explode(":", $entregaAux[1]);
     $this->SetXY(40 + $adicionalX, 37 + $adicionalY);
     $this->Cell(0, 5, $entrega[2] . '-' . $entrega[1] . '-' . $entrega[0], 0);
     $this->SetXY(65 + $adicionalX, 37 + $adicionalY);
     $this->Cell(0, 5, $entregaHora[0], 0);
     $this->SetXY(71 + $adicionalX, 37 + $adicionalY);
     $this->Cell(0, 5, $entregaHora[1], 0);
     #Impresiones
     $db = TBase::conectaDB();
     $rs = $db->Execute("select * from pedidoimpresion where idPedido = " . $pedido->getId() . " and idImpresion = 4");
     if (!$rs->EOF) {
         $this->SetXY(107.5 + $adicionalX, 44.5 + $adicionalY);
         $this->Cell(3.5, 2, "", 0, 0, 'L', 1);
     }
     $rs = $db->Execute("select * from pedidoimpresion where idPedido = " . $pedido->getId() . " and idImpresion = 5");
     if (!$rs->EOF) {
         $this->SetXY(107.5 + $adicionalX, 48 + $adicionalY);
         $this->Cell(3.5, 2, "", 0, 0, 'L', 1);
     }
     $rs = $db->Execute("select * from pedidoimpresion where idPedido = " . $pedido->getId() . " and idImpresion = 6");
     if (!$rs->EOF) {
         $this->SetXY(107.5 + $adicionalX, 51.6 + $adicionalY);
         $this->Cell(3.5, 2, "", 0, 0, 'L', 1);
     }
     $rs = $db->Execute("select * from pedidoimpresion where idPedido = " . $pedido->getId() . " and idImpresion = 7");
     if (!$rs->EOF) {
         $this->SetXY(107.5 + $adicionalX, 55.1 + $adicionalY);
         $this->Cell(3.5, 2, "", 0, 0, 'L', 1);
     }
     $rs = $db->Execute("select * from pedidoimpresion where idPedido = " . $pedido->getId() . " and idImpresion = 8");
     if (!$rs->EOF) {
         $this->SetXY(107.5 + $adicionalX, 58.7 + $adicionalY);
         $this->Cell(3.5, 2, "", 0, 0, 'L', 1);
     }
     #articulos
     $rs = $db->Execute("select * from pedidoentregables where idPedido = " . $pedido->getId() . " and idEntregable = 10");
     if (!$rs->EOF) {
         $this->SetXY(117 + $adicionalX, 44.5 + $adicionalY);
         $this->Cell(3.5, 2, "", 0, 0, 'L', 1);
     }
     $rs = $db->Execute("select * from pedidoentregables where idPedido = " . $pedido->getId() . " and idEntregable = 11");
     if (!$rs->EOF) {
         $this->SetXY(117 + $adicionalX, 48 + $adicionalY);
         $this->Cell(3.5, 2, "", 0, 0, 'L', 1);
     }
     $rs = $db->Execute("select * from pedidoentregables where idPedido = " . $pedido->getId() . " and idEntregable = 12");
     if (!$rs->EOF) {
         $this->SetXY(117 + $adicionalX, 51.6 + $adicionalY);
         $this->Cell(3.5, 2, "", 0, 0, 'L', 1);
     }
     $rs = $db->Execute("select * from pedidoentregables where idPedido = " . $pedido->getId() . " and idEntregable = 13");
     if (!$rs->EOF) {
         $this->SetXY(117 + $adicionalX, 55.1 + $adicionalY);
         $this->Cell(3.5, 2, "", 0, 0, 'L', 1);
     }
     $rs = $db->Execute("select * from pedidoentregables where idPedido = " . $pedido->getId() . " and idEntregable = 14");
     if (!$rs->EOF) {
         $this->SetXY(117 + $adicionalX, 58.7 + $adicionalY);
         $this->Cell(3.5, 2, "", 0, 0, 'L', 1);
     }
     $this->SetXY(82 + $adicionalX, 63 + $adicionalY);
     $this->Cell(100, 3, $pedido->getEntregables());
     #Remeras
     $rs = $db->Execute("select distinct idItem from movped a join talla b using(idTalla) join ropa c using(idItem) where idPedido = " . $pedido->getId() . " limit 2");
     $tallas = array(1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 16, 'S', 'M', 'L', 'XL', 'XXL');
     #$colores = array("rojo", "roja", "azul", "amarillo", "amarilla", "verde", "gris claro", "gris oscuro", "beige", "blanco", "negro", "blanca", "azul francia", "azul marino", "azul piedra", "celeste", "bordo", "naranja", "verde militar", "verde meletton", "verde manzana", "verde ingles", "uva", "fucsia", "violeta", "turquesa", "verde italia", "arena", "marron", "marròn");
     $y = 78 + $adicionalY;
     #$y = 83.7 + $adicionalY;
     while (!$rs->EOF) {
         $x = 16.5 + $adicionalX;
         $item = '';
//.........這裏部分代碼省略.........
開發者ID:hugooluisss,項目名稱:cotizador,代碼行數:101,代碼來源:pedido.php

示例14: generar

 public function generar()
 {
     /*Primero hay que checar si es supervisor o administrador*/
     global $sesion;
     $supervisor = new TUsuario($sesion['usuario']);
     $hoja =& $this->libro->addWorksheet('Reporte');
     $head =& $this->libro->addFormat(array('Size' => 8, 'bold' => 1, 'Color' => 'red'));
     $this->libro->setCustomColor(15, 192, 192, 192);
     $titulo =& $this->libro->addFormat(array('Size' => 8, 'bold' => 1, "Align" => "center", "border" => 1, "FgColor" => 15));
     $encabezado =& $this->libro->addFormat(array('Size' => 10, 'bold' => 1, "Align" => "center", "FgColor" => 15));
     $hoja->write(2, 1, utf8_decode("REPORTE DE CONSULTAS GENERAL"), $encabezado);
     $hoja->mergeCells(2, 1, 2, 9);
     $hoja->write(3, 1, utf8_decode("Generado el: " . date("Y-m-d")), $head);
     $hoja->mergeCells(3, 1, 3, 9);
     $titulo->setAlign("vcenter");
     $db = TBase::conectaDB();
     switch ($supervisor->getIdTipo()) {
         case 1:
             $rs = $db->Execute("select idConsultorio, idDoctor, idServicio, sum(cantidad) as cantidad from reporte a join consulta b using(idReporte) join consultorio d using(idConsultorio) join servicio e using(idServicio) join tipoServicio f using(idTipo) join clasificacion g using(idClasificacion) where extract(month from fecha) = " . $this->mes . " and extract(year from fecha) = " . $this->anio . " group by idConsultorio, idDoctor, idServicio");
             break;
         case 2:
             $rs = $db->Execute("select idConsultorio, idDoctor, idServicio, sum(cantidad) as cantidad from reporte a join consulta b using(idReporte) join consultorio d using(idConsultorio) join servicio e using(idServicio) join tipoServicio f using(idTipo) join clasificacion g using(idClasificacion) where extract(month from fecha) = " . $this->mes . " and extract(year from fecha) = " . $this->anio . " and idSupervisor = " . $supervisor->getId() . " group by idConsultorio, idDoctor, idServicio");
             break;
         default:
             return false;
     }
     $hoja->write(4, 1, utf8_decode("Estado"), $titulo);
     $hoja->mergeCells(4, 1, 5, 1);
     $hoja->write(4, 2, utf8_decode("Ciudad"), $titulo);
     $hoja->mergeCells(4, 2, 5, 2);
     $hoja->write(4, 3, utf8_decode("Consultorio"), $titulo);
     $hoja->mergeCells(4, 3, 4, 4);
     $hoja->write(5, 3, utf8_decode("Clave"), $titulo);
     $hoja->write(5, 4, utf8_decode("Nombre"), $titulo);
     $hoja->write(4, 5, utf8_decode("Doctor"), $titulo);
     $hoja->mergeCells(4, 5, 4, 6);
     $hoja->write(5, 5, utf8_decode("Nombre"), $titulo);
     $hoja->write(5, 6, utf8_decode("EMail"), $titulo);
     $hoja->write(4, 7, utf8_decode("Servicio"), $titulo);
     $hoja->mergeCells(4, 7, 4, 8);
     $hoja->write(5, 7, utf8_decode("Tipo"), $titulo);
     $hoja->write(5, 8, utf8_decode("Nombre"), $titulo);
     $hoja->write(4, 9, utf8_decode("Cantidad"), $titulo);
     $hoja->mergeCells(4, 9, 5, 9);
     $datos =& $this->libro->addFormat(array('Size' => 8, "border" => 1));
     $hoja->setColumn(4, 8, 30);
     $y = 6;
     while (!$rs->EOF) {
         $consultorio = new TConsultorio($rs->fields['idConsultorio']);
         $servicio = new TServicio($rs->fields['idServicio']);
         $doctor = new TDoctor($rs->fields['idDoctor']);
         $hoja->write($y, 1, utf8_decode($consultorio->getEstado()), $datos);
         $hoja->write($y, 2, utf8_decode($consultorio->getCiudad()), $datos);
         $hoja->write($y, 3, utf8_decode($consultorio->getClave()), $datos);
         $hoja->write($y, 4, utf8_decode($consultorio->getNombre()), $datos);
         $hoja->write($y, 5, utf8_decode($doctor->getNombre()), $datos);
         $hoja->write($y, 6, utf8_decode($doctor->getEmail()), $datos);
         $hoja->write($y, 7, utf8_decode($servicio->tipo->getDescripcion()), $datos);
         $hoja->write($y, 8, utf8_decode($servicio->getNombre()), $datos);
         $hoja->write($y, 9, utf8_decode($rs->fields["cantidad"]), $datos);
         $rs->moveNext();
         $y++;
     }
     return true;
 }
開發者ID:hugooluisss,項目名稱:registroDoctores,代碼行數:65,代碼來源:general.php

示例15: eliminar

 public function eliminar()
 {
     if ($this->getId() == '') {
         return false;
     }
     $db = TBase::conectaDB();
     return $db->Execute("update cliente set estado = 'E' where idCliente = " . $this->getId()) ? true : false;
 }
開發者ID:hugooluisss,項目名稱:pdv,代碼行數:8,代碼來源:TCliente.class.php


注:本文中的TBase::conectaDB方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。