本文整理匯總了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"' : '') . ' />';