コード例 #1
0
ファイル: PageService.php プロジェクト: Hank-wood/meizizhi
 public static function updatePraiseNum($pageid)
 {
     $mysql = new MySQL();
     $res = $mysql->execute("update page set praisenum=praisenum+1 where pageid=" . $pageid);
     $mysql->closeCon();
     return $res;
 }
コード例 #2
0
ファイル: SequenceHelper.php プロジェクト: Hank-wood/meizizhi
 public static function getSequence($seqType)
 {
     $replace_sql = "replace into sequence(seqname) VALUES('" . $seqType . "')";
     $mysql = new MySQL();
     $mysql->execute($replace_sql);
     $get_sql = "select seq from sequence where seqname='" . $seqType . "'";
     $res = $mysql->executeReturnFirstObj($get_sql);
     $seq = $res['seq'];
     $mysql->closeCon();
     return $seq;
 }
コード例 #3
0
ファイル: printer.php プロジェクト: atoledov/siglab
<link href="css/main.css" type="text/css" rel="stylesheet" media="screen" /> 
<?php 
require "../config/system.php";
require "../model/Util.php";
require "../model/MySql.php";
$Orden = explode("@", $_POST["Orden"]);
$TurnId = $Orden[0];
$OrdId = $Orden[1];
$tbl_name = $Orden[2];
$_db = new MySQL();
$_db->connect();
$ex = array();
$_sql = "SELECT CASE\r\n\t\t\t    WHEN TestPadrePadre!='' THEN TestPadrePadre\r\n\t\t\t    WHEN TestPadreDescripcion!='' THEN TestPadreDescripcion\r\n\t\t       END AS test\r\n\t\t FROM {$tbl_name} WHERE EstadoProcesa='V' GROUP BY test ORDER BY test ";
$_db->prepare($_sql);
$_result = $_db->execute();
while (@($data = $_db->fetch_array($_result))) {
    $ex[] = $data["test"];
}
$_db->free($_result);
$exams = array_unique($ex);
?>
<div style="margin: 20px">
    <div id="_image">
        <img src="../images/logo_msp.png?>" />&nbsp;<div style="float:right"><h3><?php 
echo CLIENT_NAME;
?>
</h3></div>		
    </div>
    	
    <div id="_header">
		<?php 
コード例 #4
0
ファイル: printer_pdf.php プロジェクト: atoledov/siglab
 function DetalleOrden($header, $TurnId, $OrdId, $tbl_name)
 {
     $_db = new MySQL();
     $_db->connect();
     /* Consulto los Examenes - Nuevo Esquema para generar el Menu */
     $ex = array();
     $_sql = "SELECT CASE\r\n\t\t\t\t\tWHEN TestPadrePadre!='' THEN TestPadrePadre\r\n\t\t\t\t\tWHEN TestPadreDescripcion!='' THEN TestPadreDescripcion\r\n\t\t\t\t\tEND AS test\r\n\t\t\t\t FROM {$tbl_name} WHERE EstadoProcesa='V' GROUP BY test ORDER BY test";
     $_db->prepare($_sql);
     //echo $_sql;
     $_result = $_db->execute();
     while (@($data = $_db->fetch_array($_result))) {
         $ex[] = $data["test"];
     }
     $_db->free($_result);
     //Verifico elementos repetidos en el array
     $exams = array_unique($ex);
     /* Barro Todos los Test Padres */
     $np = 0;
     foreach ($exams as $key => $value) {
         // Test Descripcion
         $this->Ln();
         $this->SetFont('Arial', 'B', 10);
         $this->Cell(10, 10, ucwords(strtolower(str_replace(":", " ", $value))), '', 0, 'L', false);
         $this->Ln();
         // Colores, ancho de linea y fuente en negrita
         $this->SetFillColor(101, 101, 101);
         $this->SetTextColor(255);
         $this->SetDrawColor(80, 80, 80);
         $this->SetLineWidth(0.3);
         $this->SetFont('Arial', '', 9);
         // Cabecera
         $w = array(60, 50, 25, 60);
         for ($i = 0; $i < count($header); $i++) {
             $this->Cell($w[$i], 6, $header[$i], 1, 0, 'C', true);
         }
         $this->Ln();
         // Consulto Resultados
         //$this->SetFont('Arial','',9);
         $fill = false;
         $test = trim(str_replace(":", " ", $value));
         $resultados = array();
         $_sql = "SELECT OrdId, OrdTurno, OrdFecha, CONCAT(PacNombre,' ',PacApellido) as Paciente, \r\n\t\t\t\t\t  CONCAT(MedNombre,' ',MedApellido)as Medico, TestDescripcion, Resultado, Unidad, \r\n\t\t\t\t\t  RanValInf, RanValSup, RanMultiple, TestPadre, TestPadreDescripcion, EmpId, EmpDescripcion,\r\n\t\t\t\t\t  TestNivel, TestPadrePadre, '' AS TestPadrePadrePadre, OrdDiagnostico\r\n\t\t\t\t\tFROM `{$tbl_name}` \r\n\t\t\t\t\tWHERE OrdTurno='{$TurnId}' AND OrdId='{$OrdId}' AND EstadoProcesa='V'  \r\n\t\t\t\t\t  AND (TestPadreDescripcion like '%{$test}%' Or TestPadrePadre like '%{$test}%') ";
         if ($test == 'BACTERIOLOGIA') {
             //$_sql .= " ORDER BY TestNivel, TestSubNivel, TestPadreDescripcion ";
             $_sql .= " ORDER BY TestPadre, TestNivel, TestSubNivel ";
         } else {
             if ($test == 'ORINA') {
                 $_sql .= " ORDER BY TestNivel ";
             } else {
                 $_sql .= " ORDER BY TestPadreDescripcion, TestNivel, TestSubNivel ";
             }
         }
         //echo $_sql;
         $_db->prepare($_sql);
         $_result = $_db->execute();
         while (@($data = $_db->fetch_array($_result))) {
             $resultados[] = $data;
         }
         $_db->free($_result);
         /* Muestra los Resultados */
         $i = 1;
         $j = 1;
         $limite = 26;
         foreach ($resultados as $k => $val) {
             $nivel = $val["TestNivel"];
             //Nivel del Examen
             if ($val["TestPadreDescripcion"] != $desc) {
                 $i = 1;
                 //Inicializo i
                 $j = 1;
                 //Inicializo j
             }
             /* Seteo el Formato drl Texto en las cabeceras de los Resultados */
             $this->SetFillColor(255, 255, 255);
             $this->SetTextColor(0);
             $this->SetFont('Arial', 'B', 9);
             if ($nivel > 1) {
                 switch ($nivel) {
                     case "2":
                         if ($i == 1) {
                             $this->Cell($w[0], 6, ucwords(strtolower(str_replace(":", " ", $val["TestPadreDescripcion"]))), '', 0, 'L', false);
                             $this->Ln();
                             //Salto de Linea
                         }
                         $i++;
                         break;
                     case "3":
                         if ($i == 1) {
                             if ($tpp != $val["TestPadrePadre"]) {
                                 $this->Cell($w[0], 6, ucwords(strtolower(str_replace(":", " ", $val["TestPadrePadre"]))), '', 0, 'L', false);
                                 $this->Ln();
                                 //Salto de Linea
                             }
                         }
                         if ($j == 1) {
                             $this->Cell($w[0], 6, ucwords(strtolower(str_replace(":", " ", $val["TestPadreDescripcion"]))), '', 0, 'L', false);
                             $this->Ln();
                             //Salto de Linea
                         }
                         $i++;
                         $j++;
                         break;
                 }
             }
             // Restauracion de colores y fuentes
             $this->SetFillColor(224, 235, 255);
             $this->SetTextColor(0);
             $this->SetFont('Arial', '', 9);
             /* Presenta los Resultados */
             $flag = false;
             $exa = "";
             $resul = "";
             $rango = "";
             # Verifica la Longitud del Examen
             if (strlen($val["TestDescripcion"]) >= $limite) {
                 if (strstr($val["TestDescripcion"], '<br>')) {
                     $exa = $val["TestDescripcion"];
                 } else {
                     $exa = FormatString($val["TestDescripcion"], $limite);
                     $flag = true;
                 }
             } else {
                 $exa = $val["TestDescripcion"];
             }
             # Verifica la Longitud del Resultado
             if (strlen($val["Resultado"]) >= $limite) {
                 if (strstr($val["Resultado"], '<br>')) {
                     $resul = $val["Resultado"];
                 } else {
                     $resul = FormatString($val["Resultado"], $limite);
                     $flag = true;
                 }
             } else {
                 $resul = $val["Resultado"];
             }
             # Verifica los rangos referenciales
             if (!empty($val["RanValInf"]) || !empty($val["RanValSup"])) {
                 $rango = $val["RanValInf"] . " - " . $val["RanValSup"];
             } else {
                 if (!empty($val["RanMultiple"])) {
                     $rango = str_replace("<br>", "\n", $val["RanMultiple"]);
                     $flag = true;
                 }
             }
             if (!$flag) {
                 $this->Cell($w[0], 6, $exa, 'LR', 0, 'L', $fill);
                 // Nombre del Examen
                 $this->Cell($w[1], 6, $resul, 'LR', 0, 'C', $fill);
                 // Resultado
                 $this->Cell($w[2], 6, $val["Unidad"], 'LR', 0, 'C', $fill);
                 // Unidad
                 $this->Cell($w[3], 6, $rango, 'LR', 0, 'C', $fill);
                 // Rango Minimo - Rango Maximo
             } else {
                 $this->SetFont('Arial', '', 9);
                 $this->SetWidths(array(60, 50, 25, 60));
                 if (strlen($rango) < $limite) {
                     $this->SetAligns(array('L', 'C', 'C', 'C'));
                 } else {
                     $this->SetAligns(array('L', 'C', 'C', 'L'));
                 }
                 $this->Row(array(utf8_decode(str_replace("<br/>", "\n", $exa)), utf8_decode(str_replace("<br/>", "\n", $resul)), utf8_decode($val["Unidad"]), $rango));
             }
             $this->Ln();
             $fill = !$fill;
             $desc = $val["TestPadreDescripcion"];
             // Guardo El Test Anterior - TestPadreDescripcion
             $tpp = $val["TestPadrePadre"];
             // TestPadrePadre
             $diagnostico = $val["OrdDiagnostico"];
             // Diagnostico
         }
         $this->Cell(array_sum($w), 0, '', 'T');
         $this->Ln();
         $this->Cell(200, 10, '* Sin valor legal, para ese efecto acerquese al Laboratorio Principal', 0, 0, 'C');
         $np++;
         if (count($exams) - $np != 0) {
             $this->AddPage();
         }
     }
     # Imprimo el Diagnostico
     if (!empty($diagnostico)) {
         $this->Ln(20);
         $this->SetFont('Arial', 'B', 10);
         $this->Cell(80, 6, "Observaciones y Comentarios a la Solicitud:", '', 'L', $fill);
         $this->SetFont('Arial', '', 10);
         $this->Cell(120, 6, $diagnostico, '', 'L', $fill);
     }
     $_db->close();
 }
コード例 #5
0
ファイル: mysql.example.php プロジェクト: Junred/DBclass
<?php

header("content-type:text/html;charset:utf-8");
require_once 'mysql.class.php';
$mysql = new MySQL('localhost', 'user', 'password', 'test');
echo '<pre>';
//获取表字段
//print_r($mysql->getFields('test'));
//增
echo $mysql->data(array('name' => 'test', 'password' => '123456'))->table('test')->add();
//删
echo $mysql->table('test')->where('id=1')->delete();
//改
echo $mysql->table('test')->data(array('name' => 'bbbbbbbbbbbb'))->where('id<3')->update();
//查
print_r($mysql->table('test')->where('id=4')->select());
print_r($mysql->table('test')->order('id desc')->select());
//
$mysql->query('select * from `test`');
$mysql->execute('update `test` set password = 123');
echo '</pre>';
echo '查询次数:' . $mysql->query_count . '<br>';
echo '查询时间:' . number_format(microtime(true) - $mysql->query_start_time, 10) . ' 秒<br>';
echo '错误信息:' . $mysql->error() . '<br>';
コード例 #6
0
ファイル: Orders.php プロジェクト: atoledov/siglab
 public function generateHeader()
 {
     $_db = new MySQL();
     $_db->connect();
     $_html = "";
     $_sql = "SELECT PacIdentificacion, PacApellido, PacNombre, PacFechaNac, GeneroDescripcion,\r\n                        OrdId, OrdTurno, DATE_FORMAT(OrdFecha, '%d-%m-%Y') AS OrdFecha, MedApellido, \r\n                        MedNombre, SalaHospDescripcion, LabAreaDescripcion, CamaDescripcion,\r\n                        CASE WHEN OrdFechaIngreso!='' AND OrdFechaIngreso!='0000-00-00 00:00:00' THEN \r\n                        DATE_FORMAT(OrdFechaIngreso, '%d-%m-%Y') ELSE '' END AS OrdFechaIngreso\r\n                 FROM {$this->_table}";
     $_db->prepare($_sql);
     $_result = $_db->execute();
     if ($_db->num_rows($_result) > 0) {
         @($data = $_db->fetch_array($_result));
         $this->setOrderId($data["OrdId"]);
         $this->setTurn($data["OrdTurno"]);
         $_html .= "<table width='100%'>";
         $_html .= "<thead>";
         $_html .= "<tr>";
         $_html .= "<td width='15%'>Paciente:</td>";
         $_html .= "<td width='25%'>" . ucwords(strtolower(utf8_encode($data["PacApellido"] . " " . $data["PacNombre"]))) . "</td>";
         $_html .= "<td width='10%'>Sala:</td>";
         $_html .= "<td width='15%'>{$data["SalaHospDescripcion"]}</td>";
         $_html .= "<td width='15%'>An&aacute;isis:</td>";
         $_html .= "<td width='20%'>{$data["OrdTurno"]}</td>";
         $_html .= "</tr>";
         $_html .= "<tr>";
         $_html .= "<td>Fecha Orden:</td>";
         $_html .= "<td>{$data["OrdFecha"]}</td>";
         $_html .= "<td>Cama:</td>";
         $_html .= "<td>{$data["CamaDescripcion"]}</td>";
         $_html .= "<td>CI:</td>";
         $_html .= "<td>{$data["PacIdentificacion"]}</td>";
         $_html .= "</tr>";
         $_html .= "<tr>";
         $_html .= "<td>Fecha Ingreso:</td>";
         $_html .= "<td>{$data["OrdFechaIngreso"]}</td>";
         $_html .= "<td>Area:</td>";
         $_html .= "<td>{$data["LabAreaDescripcion"]}</td>";
         $_html .= "<td>Edad:</td>";
         $_html .= "<td>" . Util::getAge($data["PacFechaNac"]) . " a&ntilde;os</td>";
         $_html .= "</tr>";
         $_html .= "<tr>";
         $_html .= "<td>Medico:</td>";
         $_html .= "<td>" . ucwords(strtolower(utf8_encode($data["MedApellido"] . " " . $data["MedNombre"]))) . "</td>";
         $_html .= "<td></td>";
         $_html .= "<td></td>";
         $_html .= "<td>Sexo:</td>";
         $_html .= "<td>" . ucwords(strtolower($data["GeneroDescripcion"])) . "</td>";
         $_html .= "</tr>";
         $_html .= "</thead>";
         $_html .= "</table>";
     }
     return $_html;
 }
コード例 #7
0
ファイル: ReviewService.php プロジェクト: Hank-wood/meizizhi
 public static function updateShowIndex($pageid, $showIndex)
 {
     $nt = time() * 1000;
     $sql = "update page set  showindex=" . $showIndex . ",udate=" . $nt . " where pageid=" . $pageid;
     $mysql = new MySQL();
     $mysql->execute($sql);
     $mysql->closeCon();
     return true;
 }