本文整理汇总了PHP中ExtraFields::showInputField方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtraFields::showInputField方法的具体用法?PHP ExtraFields::showInputField怎么用?PHP ExtraFields::showInputField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExtraFields
的用法示例。
在下文中一共展示了ExtraFields::showInputField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GETPOST
print '<tr><td>' . $langs->trans("Login") . ' <FONT COLOR="red">*</FONT></td><td><input type="text" name="login" size="20" value="' . dol_escape_htmltag(GETPOST('login')) . '"></td></tr>' . "\n";
print '<tr><td>' . $langs->trans("Password") . ' <FONT COLOR="red">*</FONT></td><td><input type="password" name="pass1" size="20" value="' . GETPOST("pass1") . '"></td></tr>' . "\n";
print '<tr><td>' . $langs->trans("PasswordAgain") . ' <FONT COLOR="red">*</FONT></td><td><input type="password" name="pass2" size="20" value="' . GETPOST("pass2") . '"></td></tr>' . "\n";
}
// Birthday
print '<tr id="trbirth" class="trbirth"><td>' . $langs->trans("DateToBirth") . '</td><td>';
print $form->select_date($birthday, 'birth', 0, 0, 1, "newmember");
print '</td></tr>' . "\n";
// Photo
print '<tr><td>' . $langs->trans("URLPhoto") . '</td><td><input type="text" name="photo" size="40" value="' . dol_escape_htmltag(GETPOST('photo')) . '"></td></tr>' . "\n";
// Public
print '<tr><td>' . $langs->trans("Public") . '</td><td><input type="checkbox" name="public" value="1" checked></td></tr>' . "\n";
// Extrafields
foreach ($extrafields->attribute_label as $key => $value) {
print "<tr><td>" . $value . "</td><td>";
print $extrafields->showInputField($key, GETPOST('options_' . $key));
print "</td></tr>\n";
}
// Comments
print '<tr>';
print '<td valign="top">' . $langs->trans("Comments") . '</td>';
print '<td valign="top"><textarea name="comment" wrap="soft" cols="60" rows="' . ROWS_4 . '">' . dol_escape_htmltag(GETPOST('comment')) . '</textarea></td>';
print '</tr>' . "\n";
// Add specific fields used by Dolibarr foundation for example
if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
$arraybudget = array('50' => '<= 100 000', '100' => '<= 200 000', '200' => '<= 500 000', '300' => '<= 1 500 000', '600' => '<= 3 000 000', '1000' => '<= 5 000 000', '2000' => '5 000 000+');
print '<tr id="trbudget" class="trcompany"><td>' . $langs->trans("TurnoverOrBudget") . ' <FONT COLOR="red">*</FONT></td><td>';
print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1);
print ' € or $';
print '<script type="text/javascript">
jQuery(document).ready(function () {
示例2: foreach
print '<td>'.$langs->trans("AllocateCommercial").'</td>';
print '<td colspan="3">';
$form->select_users($object->commercial_id,'commercial_id',1);
print '</td></tr>';
}
// Other attributes
$parameters=array('colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
print '<tr><td>'.$label.'</td><td colspan="3">';
print $extrafields->showInputField($key,$value);
print '</td></tr>'."\n";
}
}
// Ajout du logo
print '<tr>';
print '<td>'.$langs->trans("Logo").'</td>';
print '<td colspan="3">';
print '<input class="flat" type="file" name="photo" id="photoinput" />';
print '</td>';
print '</tr>';
print '</table>'."\n";
print '<br><center>';
示例3: array
$arraystcomm = array();
foreach ($prospectstatic->cacheprospectstatus as $key => $val) {
$arraystcomm[$val['id']] = $val['label'];
}
print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2);
print '</td>';
print '<td class="liste_titre" align="center">';
print ' ';
print '</td>';
// Extrafields
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) {
foreach ($extrafields->attribute_list as $key => $val) {
if ($val) {
$crit = $search_array_options['search_options_' . $key];
print '<td class="liste_titre">';
print $extrafields->showInputField($key, $crit, '', '', 'search_', 4);
print '</td>';
}
}
}
// Hook fields
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSearch', $parameters);
// Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Status
print '<td class="liste_titre" align="right">';
print $form->selectarray('search_status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), $search_status);
print '</td>';
// Print the search button
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';