<?php

namespace App\Models;

class Rels extends Abs{
	
	/**
	* @return retorna todos as Cliente
	*/
	public function getAllRels()
	{
		return $this->executaSelect("fcdp_cliente","*","","","");
	}
	/**
	* Regatar número total de usuários
	* @return um valor numérico
	*/
	public function getTotCliente()
	{
			$response = $this->executaSelect("fcdp_cliente","COUNT(*) as cont","","","");
			
			$condicao = array(
				array("status_id", 6),
			);
			$response2 = $this->executaSelect("fcdp_orcamento","COUNT(*) as cont",$condicao,"","");
			$response3 = $this->executaSelect("fcdp_orcamento","COUNT(*) as cont","","","");
			$response4 = $this->executaSelect("fcdp_comentarios","COUNT(*) as cont","","","");
			
			$response5 = $this->executaSelect("fcdp_orcamento","titulo,data_evento,quant_unidade","","","ORDER BY `fcdp_orcamento`.`id` DESC LIMIT 5");
			$response6 = $this->executaSelect("fcdp_comentarios","*","","","ORDER BY `fcdp_orcamento`.`id` DESC LIMIT 5");

			 
			
			$cli = $response[0]["cont"];
			$pro = $response2[0]["cont"];
			$orc = $response3[0]["cont"];
			$com = $response4[0]["cont"];

						$array = [
							"cli" => $cli,
							"pro" => $pro,
							"orc" => $orc,
							"com" => $com,
							"feed" => $response5,
							"nots" => $response6,
						];
						
			return $array;
	}

}