本文整理汇总了PHP中FormCompany::select_region方法的典型用法代码示例。如果您正苦于以下问题:PHP FormCompany::select_region方法的具体用法?PHP FormCompany::select_region怎么用?PHP FormCompany::select_region使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormCompany
的用法示例。
在下文中一共展示了FormCompany::select_region方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fieldList
/**
* Show fields in insert/edit mode
*
* @param array $fieldlist Array of fields
* @param Object $obj If we show a particular record, obj is filled with record fields
* @param string $tabname Name of SQL table
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
* @return void
*/
function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
{
global $conf, $langs, $db;
global $form;
global $region_id;
global $elementList, $sourceList, $localtax_typeList;
global $bc;
$formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);
foreach ($fieldlist as $field => $value) {
if ($fieldlist[$field] == 'country') {
if (in_array('region_id', $fieldlist)) {
print '<td>';
//print join(',',$fieldlist);
print '</td>';
continue;
}
// For state page, we do not show the country input (we link to region, not country)
print '<td>';
$fieldname = 'country';
print $form->select_country(!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : ''), $fieldname, '', 28, 'maxwidth300');
print '</td>';
} elseif ($fieldlist[$field] == 'country_id') {
if (!in_array('country', $fieldlist)) {
$country_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
print '<td>';
print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $country_id . '">';
print '</td>';
}
} elseif ($fieldlist[$field] == 'region') {
print '<td>';
$formcompany->select_region($region_id, 'region');
print '</td>';
} elseif ($fieldlist[$field] == 'region_id') {
$region_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
print '<td>';
print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $region_id . '">';
print '</td>';
} elseif ($fieldlist[$field] == 'lang') {
print '<td>';
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang');
print '</td>';
} elseif ($fieldlist[$field] == 'type_template') {
print '<td>';
print $form->selectarray('type_template', $elementList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
print '</td>';
} elseif ($fieldlist[$field] == 'element') {
print '<td>';
print $form->selectarray('element', $elementList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
print '</td>';
} elseif ($fieldlist[$field] == 'source') {
print '<td>';
print $form->selectarray('source', $sourceList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
print '</td>';
} elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX . "c_actioncomm") {
print '<td>';
print 'user<input type="hidden" name="type" value="user">';
print '</td>';
} elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible') {
print '<td>';
print $form->selectyesno($fieldlist[$field], !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', 1);
print '</td>';
} elseif (in_array($fieldlist[$field], array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) {
$align = "left";
if (in_array($fieldlist[$field], array('taux', 'localtax1', 'localtax2'))) {
$align = "right";
}
// Fields aligned on right
print '<td align="' . $align . '">';
print '<input type="text" class="flat" value="' . (isset($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="3" name="' . $fieldlist[$field] . '">';
print '</td>';
} elseif (in_array($fieldlist[$field], array('libelle_facture'))) {
print '<td><textarea cols="30" rows="' . ROWS_2 . '" class="flat" name="' . $fieldlist[$field] . '">' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '</textarea></td>';
} elseif (in_array($fieldlist[$field], array('content'))) {
if ($tabname == MAIN_DB_PREFIX . 'c_email_templates') {
print '<td colspan="4"></td></tr><tr class="pair nohover"><td colspan="5">';
// To create an artificial CR for the current tr we are on
} else {
print '<td>';
}
if ($context != 'hide') {
//print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'</textarea>';
$doleditor = new DolEditor($fieldlist[$field], !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', '', 140, 'dolibarr_mailings', 'In', 0, false, true, ROWS_5, '90%');
print $doleditor->Create(1);
} else {
print ' ';
}
print '</td>';
} elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
print '<td><input type="text" class="flat" value="' . price(!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="8" name="' . $fieldlist[$field] . '"></td>';
} elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist}[$field])) {
//.........这里部分代码省略.........
示例2: fieldList
/**
* Show field
*
* @param array $fieldlist Array of fields
* @param Object $obj If we show a particular record, obj is filled with record fields
* @param string $tabname Name of SQL table
* @return void
*/
function fieldList($fieldlist, $obj = '', $tabname = '')
{
global $conf, $langs, $db;
global $form;
global $region_id;
global $elementList, $sourceList;
$formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);
foreach ($fieldlist as $field => $value) {
if ($fieldlist[$field] == 'pays') {
if (in_array('region_id', $fieldlist)) {
print '<td> </td>';
continue;
}
// For region page, we do not show the country input
print '<td>';
print $form->select_country(!empty($obj->pays_code) ? $obj->pays_code : (!empty($obj->pays) ? $obj->pays : ''), 'pays');
print '</td>';
} elseif ($fieldlist[$field] == 'pays_id') {
$pays_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $pays_id . '">';
} elseif ($fieldlist[$field] == 'region') {
print '<td>';
$formcompany->select_region($region_id, 'region');
print '</td>';
} elseif ($fieldlist[$field] == 'region_id') {
$region_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $region_id . '">';
} elseif ($fieldlist[$field] == 'lang') {
print '<td>';
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang');
print '</td>';
} elseif ($fieldlist[$field] == 'priority') {
$priority = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
print '<td>';
print $form->selectarray("priority", $priority, $obj->{$fieldlist}[$field]);
print '</td>';
} elseif ($fieldlist[$field] == 'element') {
print '<td>';
print $form->selectarray('element', $elementList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
print '</td>';
} elseif ($fieldlist[$field] == 'source') {
print '<td>';
print $form->selectarray('source', $sourceList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
print '</td>';
} elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX . "c_actioncomm") {
print '<td>';
print 'user<input type="hidden" name="type" value="user">';
print '</td>';
} elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm') {
print '<td>';
print $form->selectyesno($fieldlist[$field], !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', 1);
print '</td>';
} elseif (in_array($fieldlist[$field], array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) {
print '<td><input type="text" class="flat" value="' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="3" name="' . $fieldlist[$field] . '"></td>';
} elseif ($fieldlist[$field] == 'libelle_facture') {
print '<td><textarea cols="30" rows="' . ROWS_2 . '" class="flat" name="' . $fieldlist[$field] . '">' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '</textarea></td>';
} elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
print '<td><input type="text" class="flat" value="' . price(!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="8" name="' . $fieldlist[$field] . '"></td>';
} elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist}[$field])) {
print '<td><input type="text" class="flat" value="' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="10" name="' . $fieldlist[$field] . '"></td>';
} elseif ($fieldlist[$field] == 'unit') {
print '<td>';
print $form->selectarray('unit', array('mm', 'cm', 'point', 'inch'), !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', 0, 0, 1);
print '</td>';
} else {
print '<td>';
print '<input type="text" ' . ($fieldlist[$field] == 'libelle' ? 'size="32" ' : '') . ' class="flat" value="' . (isset($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" name="' . $fieldlist[$field] . '">';
print '</td>';
}
}
}
示例3: fieldList
/**
* \brief Show field
* \param fieldlist Array of fields
* \param obj If we show a particular record, obj is filled with record fields
*/
function fieldList($fieldlist, $obj = '')
{
global $conf, $langs, $db;
global $region_id;
global $elementList, $sourceList;
$html = new Form($db);
$formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);
foreach ($fieldlist as $field => $value) {
if ($fieldlist[$field] == 'pays') {
if (in_array('region_id', $fieldlist)) {
print '<td> </td>';
continue;
}
// For region page, we do not show the country input
print '<td>';
print $html->select_country($obj->pays_code ? $obj->pays_code : $obj->pays, 'pays');
print '</td>';
} elseif ($fieldlist[$field] == 'pays_id') {
$pays_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $pays_id . '">';
} elseif ($fieldlist[$field] == 'region') {
print '<td>';
$formcompany->select_region($region_id, 'region');
print '</td>';
} elseif ($fieldlist[$field] == 'region_id') {
$region_id = $obj->{$fieldlist}[$field] ? $obj->{$fieldlist}[$field] : 0;
print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $region_id . '">';
} elseif ($fieldlist[$field] == 'lang') {
print '<td>';
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang');
print '</td>';
} elseif ($fieldlist[$field] == 'element') {
print '<td>';
print $html->selectarray('element', $elementList, $obj->{$fieldlist}[$field]);
print '</td>';
} elseif ($fieldlist[$field] == 'source') {
print '<td>';
print $html->selectarray('source', $sourceList, $obj->{$fieldlist}[$field]);
print '</td>';
} elseif ($fieldlist[$field] == 'type' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX . "c_actioncomm") {
print '<td>';
print 'user<input type="hidden" name="type" value="user">';
print '</td>';
} elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm') {
print '<td>';
print $html->selectyesno($fieldlist[$field], $obj->{$fieldlist}[$field], 1);
print '</td>';
} elseif ($fieldlist[$field] == 'nbjour' || $fieldlist[$field] == 'decalage' || $fieldlist[$field] == 'taux') {
print '<td><input type="text" class="flat" value="' . $obj->{$fieldlist}[$field] . '" size="3" name="' . $fieldlist[$field] . '"></td>';
} elseif ($fieldlist[$field] == 'libelle_facture') {
print '<td><textarea cols="30" rows="' . ROWS_2 . '" class="flat" name="' . $fieldlist[$field] . '">' . $obj->{$fieldlist}[$field] . '</textarea></td>';
} elseif ($fieldlist[$field] == 'price') {
print '<td><input type="text" class="flat" value="' . price($obj->{$fieldlist}[$field]) . '" size="8" name="' . $fieldlist[$field] . '"></td>';
} elseif ($fieldlist[$field] == 'code') {
print '<td><input type="text" class="flat" value="' . $obj->{$fieldlist}[$field] . '" size="10" name="' . $fieldlist[$field] . '"></td>';
} elseif ($fieldlist[$field] == 'unit') {
print '<td>';
print $html->selectarray('unit', array('mm', 'cm', 'point', 'inch'), $obj->{$fieldlist}[$field], 0, 0, 1);
print '</td>';
} else {
print '<td>';
print '<input type="text" ' . ($fieldlist[$field] == 'libelle' ? 'size="32" ' : '') . ' class="flat" value="' . $obj->{$fieldlist}[$field] . '" name="' . $fieldlist[$field] . '">';
print '</td>';
}
}
}
示例4: fieldList
/**
* Show field
*
* @param array $fieldlist Array of fields
* @param Object $obj If we show a particular record, obj is filled with record fields
* @param string $tabname Name of SQL table
* @return void
*/
function fieldList($fieldlist, $obj = '', $tabname = '')
{
global $conf, $langs, $db;
global $form;
global $region_id;
global $elementList, $sourceList, $localtax_typeList;
$formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);
foreach ($fieldlist as $field => $value) {
if ($fieldlist[$field] == 'country') {
if (in_array('region_id', $fieldlist)) {
print '<td> </td>';
continue;
}
// For region page, we do not show the country input
print '<td>';
print $form->select_country(!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : ''), 'country', '', 28);
print '</td>';
} elseif ($fieldlist[$field] == 'country_id') {
$country_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $country_id . '">';
} elseif ($fieldlist[$field] == 'region') {
print '<td>';
$formcompany->select_region($region_id, 'region');
print '</td>';
} elseif ($fieldlist[$field] == 'region_id') {
$region_id = !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : 0;
print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $region_id . '">';
} elseif ($fieldlist[$field] == 'lang') {
print '<td>';
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang');
print '</td>';
} elseif ($fieldlist[$field] == 'element') {
print '<td>';
print $form->selectarray('element', $elementList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
print '</td>';
} elseif ($fieldlist[$field] == 'source') {
print '<td>';
print $form->selectarray('source', $sourceList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
print '</td>';
} elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX . "c_actioncomm") {
print '<td>';
print 'user<input type="hidden" name="type" value="user">';
print '</td>';
} elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible') {
print '<td>';
print $form->selectyesno($fieldlist[$field], !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', 1);
print '</td>';
} elseif (in_array($fieldlist[$field], array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) {
$align = "left";
if (in_array($fieldlist[$field], array('taux', 'localtax1', 'localtax2'))) {
$align = "right";
}
// Fields aligned on right
print '<td align="' . $align . '">';
print '<input type="text" class="flat" value="' . (isset($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="3" name="' . $fieldlist[$field] . '">';
print '</td>';
} elseif ($fieldlist[$field] == 'libelle_facture') {
print '<td><textarea cols="30" rows="' . ROWS_2 . '" class="flat" name="' . $fieldlist[$field] . '">' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '</textarea></td>';
} elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
print '<td><input type="text" class="flat" value="' . price(!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="8" name="' . $fieldlist[$field] . '"></td>';
} elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist}[$field])) {
print '<td><input type="text" class="flat" value="' . (!empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" size="10" name="' . $fieldlist[$field] . '"></td>';
} elseif ($fieldlist[$field] == 'unit') {
print '<td>';
$units = array('mm' => $langs->trans('SizeUnitmm'), 'cm' => $langs->trans('SizeUnitcm'), 'point' => $langs->trans('SizeUnitpoint'), 'inch' => $langs->trans('SizeUnitinch'));
print $form->selectarray('unit', $units, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '', 0, 0, 0);
print '</td>';
} elseif ($fieldlist[$field] == 'localtax1_type' || $fieldlist[$field] == 'localtax2_type') {
print '<td align="center">';
print $form->selectarray($fieldlist[$field], $localtax_typeList, !empty($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '');
print '</td>';
} else {
print '<td>';
$size = '';
if ($fieldlist[$field] == 'libelle') {
$size = 'size="32" ';
}
if ($fieldlist[$field] == 'tracking') {
$size = 'size="92" ';
}
if ($fieldlist[$field] == 'accountancy_code') {
$size = 'size="10" ';
}
if ($fieldlist[$field] == 'accountancy_code_sell') {
$size = 'size="10" ';
}
if ($fieldlist[$field] == 'accountancy_code_buy') {
$size = 'size="10" ';
}
print '<input type="text" ' . $size . ' class="flat" value="' . (isset($obj->{$fieldlist}[$field]) ? $obj->{$fieldlist}[$field] : '') . '" name="' . $fieldlist[$field] . '">';
print '</td>';
//.........这里部分代码省略.........