<?php
	$arrayUM = array();
	$queryUM = mysqli_query($connect,"SELECT * FROM Unidad_Medida WHERE estado = 1 ");
	while($dataUM = mysqli_fetch_array($queryUM)){
		array_push($arrayUM, array($dataUM["id"], $dataUM["simbolo"]) );
	}

    function Mes_Text($mes, $array_mes ){
		$tx_mes = '';
		foreach ($array_mes as &$meses) {
			if( $mes == $meses[0] ){ $tx_mes = $meses[1]; }
		}
		return $tx_mes;
	}
	
	function Unit_Symbol($id_unit, $arrayUM){
		$symbol_unit = 'test';
		foreach ($arrayUM as &$unidad) {
			if( $id_unit == $unidad[0] ){ $symbol_unit = $unidad[1]; }
		}
		return $symbol_unit;
	}
	
	function Format_Number($number){
		$val = number_format($number,2,".",",");
		return $val;
	}
	
	function Unit_Id($text, $arrayUM){
		$symbol_id = 0;
		foreach ($arrayUM as &$unidad) {
			if( strtoupper($text) == strtoupper($unidad[1]) ){ $symbol_id = $unidad[0]; }
		}
		return $symbol_id;
	}
	
?>

