"; $halfimage = "\"$letrero\""; $full = "\"$letrero\""; if ($score == 5) { for ($i=0; $i < 5; $i++) $regreso .= $full; } else { for ($i=0; $i < intval($score); $i++) $regreso .= "$image"; if ($score-intval($score) >= .5) $regreso .= "$halfimage"; } // else return $regreso; } function ver_resto($restoid) { global $user_prefix, $db, $module_name, $admin, $user, $cookie, $currentlang; $resultado = $db->sql_query("select * from ".$user_prefix."_restaurantes WHERE restoid=$restoid"); $restolistado = $db->sql_fetchrow($restolistado); // Verifica si el usuario es administrador o es el propietario del hotel para poder editarlo if(is_admin($admin)) { $editar = "[ "._EDIT." ] \n"; } else {$editar = "";} // Obtiene el Nombre de Usuario cookiedecode( $user ); $username = $cookie[1]; if( is_user( $user ) and $username==$restolistado[userresto]) { $editar = "[ "._EDIT." ] \n"; } else {$editar = "";} include("header.php"); $telefono = _TELEFONO.": ".$restolistado[telefono]; $Services = " "._SERVICES." "; $espedescri="No se ha definido especialidad para este Restaurante"; $descri = "desc_".$currentlang; $descripcion = $restolistado[$descri]; // Obtiene datos de la especialidad $sqlview="select * from ".$user_prefix."_restaurantesespecial"; $resulview = $db->sql_query($sqlview); $descri="resp_desc_".$currentlang; foreach ($resulview as $views){ if ($restolistado[especialidad] == $views[respid]) $espedescri=_ESPECIALIDAD.": ".$views[$descri]; } // while $views // Obtiene los Datos de los Servicios $servicios = "
"; if ( substr($restolistado[servicio],0,1) == 1) $servicios .= ""._DESAYUNO.""; else $servicios .= ""._DESAYUNO.""; if ( substr($restolistado[servicio],1,1) == 1) $servicios .= " "._COMIDA.""; else $servicios .= " "._COMIDA.""; if ( substr($restolistado[servicio],2,1) == 1) $servicios .= " "._CENA.""; else $servicios .= " "._CENA.""; $servicios .= "
"; // Obtiene las Tarjetas de Crédito for ($i=1; $i<=4; $i ++) if ( substr($restolistado[tarjetas], $i-1, 1) == 1) $tarjetas .= " "; $calificar ="" ."\""._CALIFICARRESTO."\""._CALIFICARRESTO.""; // Obtiene las calificaciones registradas $resultcalifs=$db->sql_query("select AVG(vroverall), AVG(vrfood), AVG(vrservice), AVG(vrambiance), AVG(vrclean), AVG(vrmoney), AVG(vrwinelist), AVG(vrkid) from ".$user_prefix."_restovotos where restoid='$restolistado[restoid]'"); list($overall, $food, $service, $ambiance, $clean, $money, $winelist, $kid) = $db->sql_fetchrow($resultcalifs); $calificaciones = "
"._OVERALL.""; $calificaciones .= despliega_estrellas($overall); $calificaciones .= "
"._FOOD.""; $calificaciones .= despliega_estrellas($food); $calificaciones .= "
"._SERVICE.""; $calificaciones .= despliega_estrellas($service); $calificaciones .= "
"._AMBIANCE.""; $calificaciones .= despliega_estrellas($ambiance); $calificaciones .= "
"._CLEANLINESS.""; $calificaciones .= despliega_estrellas($clean); $calificaciones .= "
"._VALUEFORMONEY.""; $calificaciones .= despliega_estrellas($money); $calificaciones .= "
"._WINELIST.""; $calificaciones .= despliega_estrellas($winelist); $calificaciones .= "
"._KIDFRIEND.""; $calificaciones .= despliega_estrellas($kid); $calificaciones .= "
"; // Obtiene Comentarios de los Usuarios $sqlvotos="select * from ".$user_prefix."_restovotos where restoid='$restolistado[restoid]' order by vrfecha desc"; $resvotos= $db->sql_query($sqlvotos); $comentarios = ""; if ($resvotos) { $comentarios .=""._OPINIONESGENTE.""; //$comentarios .=" $restolistado[restoid]"; foreach ($resvotos as $listavotos){ $comentarios .= ""; } // while } // if $resvotos $comentarios .= "
"._ENVIADOPOR." $listavotos[userrvoto] on $listavotos[vrfecha]"; if(is_admin($admin)) $comentarios .= " "; $comentarios .= "
$listavotos[vrcoment]
"; $tmpl_file = "modules/restaurantes/restaurantel-template.html"; $thefile = implode("", file($tmpl_file)); $thefile = addslashes($thefile); $thefile = "\$r_file=\"".$thefile."\";"; eval($thefile); print $r_file; include("footer.php"); } // funcion ver_resto switch ($do) { case 'ver_resto': ver_resto($restoid); break; case 'borrarcomentario': $sql = "DELETE from $prefix"._restovotos." where rvotoid=$rvotoid"; mysql_query($sql); ver_resto($restoid); break; } ?>