<?php
/**
  @licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
  @portion code Copyright (c) 2002 osCommerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.1.0
  @date  19/12/10, 19:49
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
*/
/**
*/
function tep_get_zone_name($country_id, $zone_id, $default_zone) {
  $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country_id . "' and zone_id = '" . (int)$zone_id . "'");
  if (tep_db_num_rows($zone_query)) {
    $zone = tep_db_fetch_array($zone_query);
    return $zone['zone_name'];
  }
  else return $default_zone;
}

/**
  @param
    @a object $cInfo
    @a string $champ nom du champs
    @a string $function
    @a int $maxlength
    @a bool $requis
    @a bool $view_function force l'usage de la function pour affichage
*/
function tep_result_up_field($cInfo,$champ,$function='',$maxlength='32',$requis=false,$view_function=false) {
    $value= (!empty($function))
      ? (function_exists($function)
	? $function($cInfo->$champ)
	: customers::$function($cInfo->$champ) )
      : $cInfo->$champ;
    return ((customers::$processed)
	    ? $value.tep_draw_hidden_field($champ,$cInfo->$champ)
	    : ((empty($function) || !$view_function)
		? tep_draw_input_field($champ,'', $value, 'maxlength="'.$maxlength.'"', $requis)
		: (function_exists($function)
		    ? $function($cInfo->$champ)
		    : customers::$function($cInfo->$champ) )
	    ));
  }

?>