/** Recursively prints selects to present hierarchy */ function printSelect($class, $hierarchy, $selectedId, $nameForSelected) { if (isset($hierarchy) && is_array($hierarchy) && count($hierarchy) > 0) { $item = array_shift($hierarchy); // Remove head from the hierarchy $item_children = call_user_func(array($class, "getChildren"), $item["id"]); // Get children if (isset($hierarchy[0])) { // There is a "next one" $currentSelectionId = $hierarchy[0]["id"]; // Select item $overrideName = $currentSelectionId == $selectedId && !empty($nameForSelected); } if (count($item_children)) { ?> <select name="<?php echo $overrideName ? $nameForSelected : $item['name']; ?> " class="hierarchy_item" style="width:120px"> <option value="<?php echo $item["id"]; ?> " <?php echo isset($currentSelectionId) ? "" : "selected"; ?> > </option> <?php foreach ($item_children as $key => $value) { ?> <option value="<?php echo $key; ?> " <?php echo $currentSelectionId == $key ? "selected" : ""; ?> ><?php echo $value; ?> </option> <?php } ?> </select> <?php printSelect($class, $hierarchy, $selectedId, $nameForSelected); } } }
<td><?php echo $loc->getText("biblioFieldsCollection"); ?> :</td> <td><?php printSelect("collectionCd", "collection_dm", $postVars); ?> </td> </tr> <tr> <td><?php echo $loc->getText("biblioFieldsMaterialTyp"); ?> :</td> <td><?php printSelect("materialCd", "material_type_dm", $postVars); ?> </td> </tr> <tr> <td><?php echo $loc->getText("biblioFieldsOpacFlg"); ?> :</td> <td> <SELECT name=opac id=opac> <option value=Y SELECTED><?php echo $loc->getText("AnswerYes"); ?> </option> <option value=N><?php
function renderEditVService($vsid) { $vsinfo = spotEntity('ipv4vs', $vsid); printOpFormIntro('updIPv4VS'); echo '<table border=0 align=center>'; echo "<tr><th class=tdright>VIP:</th><td class=tdleft><input type=text name=vip value='{$vsinfo['vip']}'></td></tr>\n"; echo "<tr><th class=tdright>Port:</th><td class=tdleft><input type=text name=vport value='{$vsinfo['vport']}'></td></tr>\n"; echo "<tr><th class=tdright>Proto:</th><td class=tdleft>"; global $vs_proto; printSelect($vs_proto, array('name' => 'proto'), $vsinfo['proto']); echo "</td></tr>\n"; echo "<tr><th class=tdright>Name:</th><td class=tdleft><input type=text name=name value='{$vsinfo['name']}'></td></tr>\n"; echo "<tr><th class=tdright>Tags:</th><td class=tdleft>"; printTagsPicker(); echo "</td></tr>\n"; echo "<tr><th class=tdright>VS config:</th><td class=tdleft><textarea name=vsconfig rows=20 cols=80>{$vsinfo['vsconfig']}</textarea></td></tr>\n"; echo "<tr><th class=tdright>RS config:</th><td class=tdleft><textarea name=rsconfig rows=20 cols=80>{$vsinfo['rsconfig']}</textarea></td></tr>\n"; echo "<tr><th class=submit colspan=2>"; printImageHREF('SAVE', 'Save changes', TRUE); echo "</td></tr>\n"; echo "</table></form>\n"; // delete link echo '<p class="centered">'; if ($vsinfo['refcnt'] > 0) { echo getOpLink(NULL, 'Delete virtual service', 'nodestroy', "Could not delete: there are {$vsinfo['refcnt']} LB links"); } else { echo getOpLink(array('op' => 'del', 'id' => $vsinfo['id']), 'Delete virtual service', 'destroy'); } }
print createInfoField(userData::ADDRESS_TAG, util::UTF8toISO8859($userData->getAddress()) . ", " . $userData->getCity() . ", " . $userData->getZipCode()); print createInfoField(userData::PHONE_TAG, $userData->getPhone()); print ' </div> <div class="registerField" style="float: right;margin-top:8 "> <input class="searchButton" style="font-size: 16" size="15" value="Modifier" type="submit" /> </div> </fieldset>'; print '</form>'; // DEMANDE ////////////////////////// print '<form method="post" action="" name="demande" enctype="multipart/form-data"> <input type="hidden" name="submissionTarget" value="demande"/>'; print '<fieldset > <legend> <h3>Demande de stationnement</h3> </legend> <div style="display:block" >'; printn('<label>Type de paiement :</label>' . printSelect(demande::PAYMENT_METHOD_FORM_FIELD, $demande->getPaymentMethod(), $demande->getPaymentErrorMessage()) . '<br/></br>'); createCheckBoxField(demande::CARPOOLING_FORM_FIELD, $demande->isCarpooling(), "Je prevois faire du covoiturage (si oui, indiquer le nom, prénom et matricule des personnes \n\t\t\t\t\t\tavec qui vous prevoyez covoiturer dans les notes concernant votre demande"); createCheckBoxField(demande::CARPOOLING_OTHERS_FORM_FIELD, $demande->isCarpoolingOthers(), 'Je serais interesse à trouver des personnes pour faire du covoiturage'); printn('<label class="formFieldFileLabel">Note concernant votre demande (optionnel) :</label><textarea name="' . demande::DETAILS_FORM_FIELD . '" style="max-width:65%" cols="40" rows="7">' . $demande->getDetails() . '</textarea><br/>'); print createDemandFileField('Preuve de permis de conduire', '(nom de fichier alphanumérique [a-z][0-9] sans espace)', '', 'file', demande::DRIVING_LICENSE_FORM_FIELD, '', demande::DRIVING_LICENSE_FORM_FIELD, $demande->getLicenseErrorMessage(), $demande->getLicense()); print createDemandFileField('Preuve de résidence', '(nom de fichier alphanumérique [a-z][0-9] sans espace)', '', 'file', demande::PROOF_OF_RESIDENCE_FORM_FIELD, '', demande::PROOF_OF_RESIDENCE_FORM_FIELD, $demande->getResidenceErrorMessage(), $demande->getResidenceProof()); print ' </div> </fieldset>'; // VOITURES ////////////////////////// createCarForm($demande->getFirstCar(), '1'); createCarForm($demande->getSecondCar(), '2 - optionnel'); print ' <div class="registerField" style="float: right;margin-top:8;margin-bottom:15 "> <input class="searchButton" style="font-size: 16" size="15" value="' . ($demande->hasExistingDemandInDB() ? "Enregistrer" : "Soumettre") . '" type="submit"' . (util::isWebsiteOpen() ? "" : "disabled") . '/> </div>'; print '</form>';
</div> </li> <li class="clearfix bb_d pb10 pt10"> <div class="fl fb w80">影像报告单</div> <div class="oh zoom fs pl30 write_report_detail"> <?php printSelect($attachment, 'yingxiang'); ?> <?php printSelect($attachment, 'other'); ?> </div> </li> <li class="clearfix bb_d pb10 pt10"> <div class="fl fb w80">其他报告单</div> <div class="oh zoom fs pl30 write_report_detail"> <?php printSelect($attachment, 'zhenduan'); ?> <?php printSelect($attachment, 'waiguan'); ?> </div> </li> </ul> </div> </div> </div> </div> <?php }
<tr> <th colspan="2" valign="top" nowrap="yes" align="left"> <?php echo $loc->getText("mbrAccountLabel"); ?> </td> </tr> <tr> <td nowrap="true" class="primary"> <?php echo $loc->getText("mbrAccountTransTyp"); ?> </td> <td valign="top" class="primary"> <?php printSelect("transactionTypeCd", "transaction_type_dm", $postVars); ?> </td> </tr> <tr> <td nowrap="true" class="primary" valign="top"> <?php echo $loc->getText("mbrAccountDesc"); ?> </td> <td valign="top" class="primary"> <?php printInputText("description", 40, 128, $postVars, $pageErrors); ?> </td> </tr>
function renderNewTripletForm($realm1, $realm2) { function get_realm_data($realm) { $name = NULL; $list = array(); $options = array(); switch ($realm) { case 'object': $name = 'Load balancer'; $list = getNarrowObjectList('IPV4LB_LISTSRC'); $options = array('name' => 'object_id'); break; case 'ipvs': $name = 'Virtual service'; $list = formatEntityList(listCells('ipvs')); $options = array('name' => 'vs_id'); break; case 'ipv4rspool': $name = 'RS pool'; $list = formatEntityList(listCells('ipv4rspool')); $options = array('name' => 'rspool_id'); break; default: throw new InvalidArgException('realm', $realm); } return array('name' => $name, 'list' => $list, 'options' => $options); } $realm1_data = get_realm_data($realm1); $realm2_data = get_realm_data($realm2); startPortlet('Add new VS group'); if (count($realm1_data['list']) && count($realm2_data['list'])) { printOpFormIntro('addLink'); } echo "<table cellspacing=0 cellpadding=5 align=center>"; echo "<tr valign=top><th class=tdright>{$realm1_data['name']}</th><td class=tdleft>"; printSelect($realm1_data['list'], $realm1_data['options']); echo '</td><td class=tdcenter valign=middle rowspan=2>'; if (count($realm1_data['list']) && count($realm2_data['list'])) { printImageHREF('ADD', 'Configure LB', TRUE); } else { $names = array(); if (!count($realm1_data['list'])) { $names[] = 'a ' . $realm1_data['name']; } if (!count($realm2_data['list'])) { $names[] = 'a ' . $realm2_data['name']; } $message = 'Please create ' . implode(' and ', $names) . '.'; showNotice($message); printImageHREF('DENIED', $message, FALSE); } echo "<tr valign=top><th class=tdright>{$realm2_data['name']}</th><td class=tdleft>"; printSelect($realm2_data['list'], $realm2_data['options']); echo "</td></tr>\n"; echo "</table></form>\n"; finishPortlet(); }
<div class="oh zoom fs pl30 write_report_detail"> <?php printSelect($attachment, 'huayandan', $patient->id); ?> </div> </li> <li class="clearfix bbd_e9 pb10 pt10"> <div class="fl fb w80">影像报告单</div> <div class="oh zoom fs pl30 write_report_detail"> <?php printSelect($attachment, 'yingxiang', $patient->id); ?> <?php printSelect($attachment, 'other', $patient->id); ?> </div> </li> <li class="clearfix bbd_e9 pb10 pt10"> <div class="fl fb w80">其他报告单</div> <div class="oh zoom fs pl30 write_report_detail"> <?php printSelect($attachment, 'zhenduan', $patient->id); ?> <?php printSelect($attachment, 'waiguan', $patient->id); ?> </div> </li> </ul> </div> </div> </div> </div> <?php } ?> <script> function showPopupBingli4Space(type_id, patientId) {//{{{ fancyBoxOpenWindow('/bingli/showbl/'+type_id+'.htm?patientId='+patientId+'&bingli4space=1'); }//}}}
function handlePopupPortLink() { assertPermission('depot', 'default'); assertUIntArg('port'); assertUIntArg('remote_port'); assertStringArg('cable', TRUE); $port_info = getPortInfo($_REQUEST['port']); $remote_port_info = getPortInfo($_REQUEST['remote_port']); $POIFC = getPortOIFCompat(); if (isset($_REQUEST['port_type']) and isset($_REQUEST['remote_port_type'])) { $type_local = $_REQUEST['port_type']; $type_remote = $_REQUEST['remote_port_type']; } else { $type_local = $port_info['oif_id']; $type_remote = $remote_port_info['oif_id']; } $matches = FALSE; $js_table = ''; foreach ($POIFC as $pair) { if ($pair['type1'] == $type_local && $pair['type2'] == $type_remote) { $matches = TRUE; break; } else { $js_table .= "POIFC['{$pair['type1']}-{$pair['type2']}'] = 1;\n"; } } if ($matches) { if ($port_info['oif_id'] != $type_local) { commitUpdatePortOIF($port_info['id'], $type_local); } if ($remote_port_info['oif_id'] != $type_remote) { commitUpdatePortOIF($remote_port_info['id'], $type_remote); } linkPorts($port_info['id'], $remote_port_info['id'], $_REQUEST['cable']); // patch cable? if (array_key_exists('heap_id', $_REQUEST)) { // Leave the compatibility constraints check up to the foreign keys. if (0 != ($heap_id = genericAssertion('heap_id', 'uint0'))) { $heaps = getPatchCableHeapSummary(); if (commitModifyPatchCableAmount($heap_id, -1)) { showSuccess('consumed a patch cable from ' . formatPatchCableHeapAsPlainText($heaps[$heap_id])); } else { showError('failed to consume a patch cable'); } } } showOneLiner(8, array(formatPortLink($port_info['object_id'], NULL, $port_info['id'], $port_info['name']), formatPort($remote_port_info))); addJS(<<<END window.opener.location.reload(true); window.close(); END , TRUE); backupLogMessages(); } else { // JS code to display port compatibility hint addJS(<<<END POIFC = {}; {$js_table} \$(document).ready(function () { \t\$('select.porttype').change(onPortTypeChange);\t \tonPortTypeChange(); }); function onPortTypeChange() { \tvar key = \$('*[name=port_type]')[0].value + '-' + \$('*[name=remote_port_type]')[0].value; \tif (POIFC[key] == 1) \t{ \t\t\$('#hint-not-compat').hide(); \t\t\$('#hint-compat').show(); \t} \telse \t{ \t\t\$('#hint-compat').hide(); \t\t\$('#hint-not-compat').show(); \t} } END , TRUE); addCSS(<<<END .compat-hint { \tdisplay: none; \tfont-size: 125%; } .compat-hint#hint-compat { \tcolor: green; } .compat-hint#hint-not-compat { \tcolor: #804040; } END , TRUE); // render port type editor form echo '<form method=GET>'; echo '<input type=hidden name="module" value="popup">'; echo '<input type=hidden name="helper" value="portlist">'; echo '<input type=hidden name="port" value="' . $port_info['id'] . '">'; echo '<input type=hidden name="remote_port" value="' . $remote_port_info['id'] . '">'; echo '<input type=hidden name="cable" value="' . htmlspecialchars($_REQUEST['cable'], ENT_QUOTES) . '">'; echo '<p>The ports you have selected are not compatible. Please select a compatible transceiver pair.'; echo '<p>'; echo formatPort($port_info) . ' '; if ($port_info['iif_id'] == 1) { echo formatPortIIFOIF($port_info); echo '<input type=hidden name="port_type" value="' . $port_info['oif_id'] . '">'; } else { echo '<label>' . $port_info['iif_name'] . ' '; printSelect(getExistingPortTypeOptions($port_info), array('class' => 'porttype', 'name' => 'port_type'), $type_local); echo '</label>'; } echo ' — '; if ($remote_port_info['iif_id'] == 1) { echo formatPortIIFOIF($remote_port_info); echo '<input type=hidden name="remote_port_type" value="' . $remote_port_info['oif_id'] . '">'; } else { echo '<label>' . $remote_port_info['iif_name'] . ' '; printSelect(getExistingPortTypeOptions($remote_port_info), array('class' => 'porttype', 'name' => 'remote_port_type'), $type_remote); echo '</label>'; } echo ' ' . formatPort($remote_port_info); echo '<p class="compat-hint" id="hint-not-compat">✕ Not compatible port types</p>'; echo '<p class="compat-hint" id="hint-compat">✔ Compatible port types</p>'; echo '<p><input type=submit name="do_link" value="Link">'; } }
function printNewItemTR() { global $vtoptions; printOpFormIntro('add'); echo '<tr><td>'; printImageHREF('create', 'add VLAN', TRUE, 110); echo '</td><td>'; echo '<input type=text name=vlan_id size=4 tabindex=101>'; echo '</td><td>'; printSelect($vtoptions, array('name' => 'vlan_type', 'tabindex' => 102), 'ondemand'); echo '</td><td>'; echo '<input type=text size=48 name=vlan_descr tabindex=103>'; echo '</td><td>'; printImageHREF('create', 'add VLAN', TRUE, 110); echo '</td></tr></form>'; }
echo ">" . H($dm->getDescription()) . "</option>\n"; } echo "</select>\n"; ?> </td> </tr> <tr> <td nowrap="true" class="primary form-required"> <sup>*</sup> <?php echo $loc->getText("biblioFieldsCollection"); ?> : </td> <td valign="top" class="primary"> <?php printSelect("collectionCd", "collection_dm", $postVars); ?> </td> </tr> <tr> <td nowrap="true" class="primary form-required" valign="top"> <sup>*</sup> <?php echo $loc->getText("biblioFieldsCallNmbr"); ?> : </td> <td valign="top" class="primary"> <?php printInputText("callNmbr1", 20, 20, $postVars, $pageErrors); ?> <br>
function renderNetworkEditAttrs() { global $pageno, $netobject_type_id; $network = spotEntity($pageno === 'ipv4net' ? 'ipv4net' : 'ipv6net', getBypassValue()); $values = getAttrValuesForNetwork($network); echo '<p>'; startPortlet("Attributes"); printOpFormIntro('updateAttrs'); // optional attributes echo '<table border=0 cellspacing=0 cellpadding=3 align=center>'; $suggest_records = array(); if (count($values) > 0) { $i = 0; foreach ($values as $record) { if (!permitted(NULL, NULL, NULL, array(array('tag' => '$attr_' . $record['id']), array('tag' => '$any_op')))) { continue; } echo "<input type=hidden name={$i}_attr_id value={$record['id']}>"; echo '<tr><td>'; if (strlen($record['value'])) { echo "<a href='" . makeHrefProcess(array('op' => 'clearSticker', 'id' => $network['id'], 'attr_id' => $record['id'])) . "'>"; printImageHREF('clear', 'Clear value'); echo '</a>'; } else { echo ' '; } echo '</td>'; echo "<th class=sticker>{$record['name']}:</th><td class=tdleft>"; switch ($record['type']) { case 'uint': case 'float': case 'string': echo "<input type=text name={$i}_value value='{$record['value']}'>"; break; case 'dict': $opts = array('0' => '(none)') + readChapter($record['chapter_id'], 'o'); printSelect($opts, array('name' => "{$i}_value"), $record['key']); break; case 'date': $date_value = $record['value'] ? date(getConfigVar('DATETIME_FORMAT'), $record['value']) : ''; echo "<input type=text name={$i}_value value='{$date_value}'>"; break; } $i++; echo '<input type=hidden name=num_attrs value=' . $i . ">\n"; } } echo '</table>'; printImageHREF('SAVE', 'Save changes', TRUE); echo '</form>'; finishPortlet(); }
<?php printSelect($attachment, 'yingxiang', $ref->patient->id); ?> <?php printSelect($attachment, 'other', $ref->patient->id); ?> </div> </li> <li class="clearfix bb_d pb10 pt10"> <div class="fl fb w80">其他报告单</div> <div class="oh zoom fs pl30 write_report_detail"> <?php printSelect($attachment, 'zhenduan', $ref->patient->id); ?> <?php printSelect($attachment, 'waiguan', $ref->patient->id); ?> </div> </li> </ul> </div> </div> </div> </div> <?php } ?> <script> function showPopupBingli4Space(type_id, patientId) {//{{{ fancyBoxOpenWindow('/bingli/showbl/'+type_id+'.htm?patientId='+patientId+'&bingli4space=1');
$selected = ''; } $options_str .= "<option " . $selected . " value=" . $key . ">" . $text . "</option>"; } echo "<select name=" . $name . ">" . $options_str . "</select>"; } ?> </pre> <form method="post"> <label for="first-name">Имя: </label> <input value="<?php echo $_POST['first-name']; ?> " name="first-name" id="first-name"> <br> <label>Домашние животные: </label> <?php printSelect($_POST, 'animals', array('Dog' => 'Собака', 'Cat' => 'Кошка')); ?> <br> <label>Автомобиль: </label> <?php makeSelect($_POST, 'cars', array('BMW' => 'БМВ', 'Mersedes' => 'Мерседес')); ?> <br> <input type="submit" value="Send"> </form> </body> </html>
function printNewItemTR() { printOpFormIntro('add'); echo '<tr><td>'; printImageHREF('create', 'Create attribute', TRUE); echo "</td><td><input type=text name=attr_name></td><td>"; global $attrtypes; printSelect($attrtypes, array('name' => 'attr_type')); echo '</td><td>'; printImageHREF('create', 'Create attribute', TRUE); echo '</td></tr></form>'; }
<td class="label"><?php echo $loc->getText("advsMaterialType"); ?> :</td> <td><?php echo form_biblio_material_types($loc); ?> </td> </tr> <tr> <td class="label"><?php echo $loc->getText("advsCollectionType"); ?> :</td> <td><?php printSelect("collectionCd", "collection_dm", $_POST, FALSE, FALSE); ?> </td> </tr> <tr> <td colspan="2" height="20"> </td> </tr> <tr> <td> </td> <td> <input type="hidden" name="searchType" value="advanced"> <input type="hidden" name="sortBy" value="default"> <input type="hidden" name="tab" value="<?php echo H($tab); ?> ">