<?php

require_once "conexion.php";

class ModeloProductos{

	/*=============================================
	MOSTRAR RECETAS
	=============================================*/

	static public function mdlMostrarRecetas($tabla,$consulta,$noReceta,$orden){

			$stmt = Conexion::conectar()->prepare("SELECT * FROM $tabla WHERE 1=1 
				AND tra_rmex_tra_cm_correlativo = :$consulta 
				AND tra_rmex_tra_no_receta = :$noReceta 
				AND tra_rmex_estado != 'E' 
			ORDER BY tra_rmex_tra_no_receta DESC");
				//$stmt -> bindParam(":".$consulta, $consulta, PDO::PARAM_STR);
				$stmt -> bindParam(":".$consulta, $consulta, PDO::PARAM_INT);
				//$stmt -> bindParam(":".$tipoFicha, $tipoFicha, PDO::PARAM_INT);
				$stmt -> bindParam(":".$noReceta, $noReceta, PDO::PARAM_INT);
			$stmt -> execute();
			//AND tra_rm_tipo_ficha = :$tipoFicha 
			return $stmt -> fetchAll();
			//AND tra_rm_tra_no_receta = :$noReceta 

		$stmt -> close();

		$stmt = null;

	}

	/*=============================================
	MOSTRAR PACIENTES
	=============================================*/

	static public function mdlMostrarPaciente($tabla,$paciente){
		$stmt = Conexion::conectar()->prepare("SELECT * FROM $tabla WHERE 1=1 AND cli_correlativo = :$paciente");
			$stmt -> bindParam(":".$paciente, $paciente, PDO::PARAM_INT);
		$stmt -> execute();
		return $stmt -> fetchAll();
		$stmt -> close();
		$stmt = null;
	}

}