本文整理汇总了PHP中shopFunctionsF::renderStateList方法的典型用法代码示例。如果您正苦于以下问题:PHP shopFunctionsF::renderStateList方法的具体用法?PHP shopFunctionsF::renderStateList怎么用?PHP shopFunctionsF::renderStateList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shopFunctionsF
的用法示例。
在下文中一共展示了shopFunctionsF::renderStateList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserFieldsFilled
//.........这里部分代码省略.........
if(!empty($_return['fields'][$_fld->name]['value'])){
// Translate the value from ID to name
$_return['fields'][$_fld->name]['virtuemart_country_id'] = (int)$_return['fields'][$_fld->name]['value'];
$db = JFactory::getDBO ();
$q = 'SELECT * FROM `#__virtuemart_countries` WHERE virtuemart_country_id = "' . (int)$_return['fields'][$_fld->name]['value'] . '"';
$db->setQuery ($q);
$r = $db->loadAssoc();
if($r){
$_return['fields'][$_fld->name]['value'] = !empty($r['country_name'])? $r['country_name']:'' ;
$_return['fields'][$_fld->name]['country_2_code'] = !empty($r['country_2_code'])? $r['country_2_code']:'' ;
$_return['fields'][$_fld->name]['country_3_code'] = !empty($r['country_3_code'])? $r['country_3_code']:'' ;
} else {
vmError('Model Userfields, country with id '.$_return['fields'][$_fld->name]['value'].' not found');
}
} else {
$_return['fields'][$_fld->name]['value'] = '' ;
$_return['fields'][$_fld->name]['country_2_code'] = '' ;
$_return['fields'][$_fld->name]['country_3_code'] = '' ;
}
//$_return['fields'][$_fld->name]['value'] = vmText::_(shopFunctions::getCountryByID($_return['fields'][$_fld->name]['value']));
//$_return['fields'][$_fld->name]['state_2_code'] = vmText::_(shopFunctions::getCountryByID($_return['fields'][$_fld->name]['value']));
break;
case 'virtuemart_state_id':
if (!class_exists ('shopFunctionsF'))
require(VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php');
$attrib = array();
if ($_fld->size) {
$attrib = array('style'=>"width: ".$_fld->size."px");
}
$_return['fields'][$_fld->name]['formcode'] =
shopFunctionsF::renderStateList( $_return['fields'][$_fld->name]['value'],
$_prefix,
false,
$_fld->required,
$attrib
);
if(!empty($_return['fields'][$_fld->name]['value'])){
// Translate the value from ID to name
$_return['fields'][$_fld->name]['virtuemart_state_id'] = (int)$_return['fields'][$_fld->name]['value'];
$db = JFactory::getDBO ();
$q = 'SELECT * FROM `#__virtuemart_states` WHERE virtuemart_state_id = "' . (int)$_return['fields'][$_fld->name]['value'] . '"';
$db->setQuery ($q);
$r = $db->loadAssoc();
if($r){
$_return['fields'][$_fld->name]['value'] = !empty($r['state_name'])? $r['state_name']:'' ;
$_return['fields'][$_fld->name]['state_2_code'] = !empty($r['state_2_code'])? $r['state_2_code']:'' ;
$_return['fields'][$_fld->name]['state_3_code'] = !empty($r['state_3_code'])? $r['state_3_code']:'' ;
} else {
vmError('Model Userfields, state with id '.$_return['fields'][$_fld->name]['value'].' not found');
}
} else {
$_return['fields'][$_fld->name]['value'] = '' ;
$_return['fields'][$_fld->name]['state_2_code'] = '' ;
$_return['fields'][$_fld->name]['state_3_code'] = '' ;
}
//$_return['fields'][$_fld->name]['value'] = shopFunctions::getStateByID($_return['fields'][$_fld->name]['value']);
break;
//case 'agreed':
// $_return['fields'][$_fld->name]['formcode'] = '<input type="checkbox" id="'.$_prefix.'agreed_field" name="'.$_prefix.'agreed" value="1" '
// . ($_fld->required ? ' class="required"' : '') . ' />';