本文整理汇总了PHP中HTML_Page2::addScriptDeclaration方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Page2::addScriptDeclaration方法的具体用法?PHP HTML_Page2::addScriptDeclaration怎么用?PHP HTML_Page2::addScriptDeclaration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_Page2
的用法示例。
在下文中一共展示了HTML_Page2::addScriptDeclaration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hideMsgDiv
function hideMsgDiv() {
new Effect.Fade("floating_message");
}
-->
</script><div id="notify"><div id="floating_message">' . urldecode($_GET["msg"]) . '</div></div>';
}
$page->setTitle("{$pro_addr}");
$page->addStyleSheet('css/styles.css');
$page->addScript('js/global.js');
$page->addScript('js/scriptaculous/prototype.js');
$page->addScript('js/scriptaculous/scriptaculous.js');
$page->addScript('js/CalendarPopup.js');
if ($dea_type == 'Sales' && ($dea_status == 'Under Offer' || $dea_status == 'Exchanged' || $dea_status == 'Completed')) {
$page->addScriptDeclaration('
document.write(getCalendarStyles());
var popcaldea_exchdate = new CalendarPopup("popCalDivdea_exchdate");
var popcaldea_compdate = new CalendarPopup("popCalDivdea_compdate");
');
}
if ($dea_type == 'Lettings') {
$page->addScriptDeclaration('
document.write(getCalendarStyles());
var popcaldea_available = new CalendarPopup("popCalDivdea_available");
');
}
$page->addScriptDeclaration($additional_js);
$page->setBodyAttributes(array('onLoad' => $onLoad));
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="content">');
//$page->addBodyContent($navbar);
$page->addBodyContent($navbar);
示例2: hideMsgDiv
setTimeout("hideMsgDiv()",1500);
}
function hideMsgDiv() {
new Effect.Fade("floating_message");
}
-->
</script><div id="notify"><div id="floating_message">' . urldecode($_GET["msg"]) . '</div></div>';
}
$navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $searchLink), 'search' => array('title' => 'Contact Search', 'label' => 'Client Search', 'link' => 'client_search.php'));
$navbar = navbar2($navbar_array);
$page->setTitle("Contact > {$con_fname} {$con_sname}");
$page->addStyleSheet(getDefaultCss());
$page->addScript('js/global.js');
$page->addScript('js/scriptaculous/prototype.js');
$page->addScript('js/scriptaculous/scriptaculous.js');
$page->addScriptDeclaration($additional_js);
$page->setBodyAttributes(array('onLoad' => $onLoad));
//,'onKeyPress'=>'keyPressShowDiv(event.keyCode)'
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="content">');
$page->addBodyContent($navbar);
$page->addBodyContent($form->renderForm());
$page->addBodyContent('</div>');
$page->addBodyContent('<div id="hint" style="background-color:#FFFFFF"></div><script type="text/javascript">
new Ajax.Autocompleter("con_company","hint","ajax_contact.php");
</script>');
if ($msg) {
$page->addBodyContent($msg);
}
$page->display();
/*
示例3: array
$form->addLegend('Address');
if (!$pro_pcid) {
$form->ajaxPostcode("by_freetext", "pro");
} else {
$form->addData($formData2, $_POST);
$form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit'))));
}
$form->addHtml("</fieldset>\n");
$form->addHtml("</div>\n");
// start a new page
$page = new HTML_Page2($page_defaults);
$page->setTitle("Directory > Edit");
$page->addStyleSheet(GLOBAL_URL . 'css/styles.css');
$page->addScript(GLOBAL_URL . 'js/global.js');
$page->addScript(GLOBAL_URL . 'js/scriptaculous/prototype.js');
$page->addScriptDeclaration($source['js']);
$page->setBodyAttributes(array('onLoad' => $source['onload']));
$page->addBodyContent('<div id="content">');
$page->addBodyContent($menu);
$page->addBodyContent('<p><a href="image.php?dir_id=' . $dir_id . '">Images</a></p>');
$page->addBodyContent($form->renderForm());
$page->addBodyContent('</div>');
$page->display();
exit;
} else {
// if the form has been submitted
$result = new Validate();
$results = $result->process($formData1, $_POST);
$db_data = $results['Results'];
$result2 = new Validate();
$results2 = $result2->process($formData2, $_POST);
示例4:
function _renderForm(&$page)
{
$pageName = $page->getAttribute('name');
$tabPreview = array_slice($page->controller->_tabs, -2, 1);
$tab = ' ';
$p = new HTML_Page2(array('lineend' => PHP_EOL, 'tab' => $tab, 'doctype' => 'XHTML 1.0 Strict', 'language' => 'en', 'cache' => 'false'));
$p->disableXmlProlog();
$p->setTitle('PEAR::HTML_Progress2 - Generator');
$p->setMetaData('author', 'Laurent Laville');
$styles = '
body {
background-color: #7B7B88;
font-family: Verdana, Arial, helvetica;
font-size: 10pt;
}
h1 {
color: #FFC;
text-align: center;
}
.maintable {
width: 100%;
border-width: 0;
border-style: thin dashed;
border-color: #D0D0D0;
background-color: #EEE;
cellspacing: 2;
cellspadding: 3;
}
th {
text-align: center;
color: #FFC;
background-color: #AAA;
white-space: nowrap;
}
input {
font-family: Verdana, Arial, helvetica;
}
input.flat {
border-style: solid;
border-width: 2px 2px 0 2px;
border-color: #996;
}
';
// on preview tab, add progress bar javascript and stylesheet
if ($pageName == $tabPreview[0][0]) {
$pb = $page->controller->createProgressBar();
$pb->setTab($tab);
$p->addStyleDeclaration($styles . $pb->getStyle());
$p->addScriptDeclaration($pb->getScript());
$pbElement =& $page->getElement('progressBar');
$pbElement->setText($pb->toHtml() . '<br /><br />');
} else {
$p->addStyleDeclaration($styles);
}
$formTemplate = "\n<form{attributes}>" . "\n<table style=\"font-size: 8pt;\" class=\"maintable\">" . "\n{content}" . "\n</table>" . "\n</form>";
$headerTemplate = "\n<tr>" . "\n\t<th colspan=\"2\">" . "\n\t\t{header}" . "\n\t</th>" . "\n</tr>";
$elementTemplate = "\n\t<tr>" . "\n\t\t<td align=\"right\" valign=\"top\" width=\"30%\">" . "<!-- BEGIN required --><span style=\"color: #ff0000\">*</span><!-- END required -->" . "<b>{label}</b></td>" . "\n\t\t<td valign=\"top\" align=\"left\">" . "<!-- BEGIN error --><span style=\"color: #ff0000\">{error}</span><br /><!-- END error -->" . "\t{element}</td>" . "\n\t</tr>";
$groupTemplate = "<table><tr>{content}</tr></table>";
$groupElementTemplate = "<td>{element}<br />" . "<span style=\"font-size:10px;\">" . "<span class=\"label\">{label}</span>" . "</span></td>";
$renderer =& $page->defaultRenderer();
$renderer->setFormTemplate($formTemplate);
$renderer->setHeaderTemplate($headerTemplate);
$renderer->setElementTemplate($elementTemplate);
$renderer->setGroupTemplate($groupTemplate, 'name');
$renderer->setGroupElementTemplate($groupElementTemplate, 'name');
$page->accept($renderer);
$p->addBodyContent($renderer->toHtml());
$p->display();
}
示例5: array
if (!$_GET["pro_pro_id"]) {
$form->ajaxPostcode("by_freetext", "pro");
} else {
$form->addData($formData, $_GET);
$form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit'))));
}
$form->addHtml($form->addDiv($form->makeField("button", "", "", "Skip if Address Unknown", array('onClick' => 'document.location.href = \'?' . $_SERVER['QUERY_STRING'] . '&stage=viewing_address&skip=skip\'', 'class' => 'submit'))));
$form->addHtml("</fieldset>\n");
$form->addHtml("</div>\n");
$navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => urldecode($searchLink)), 'search' => array('title' => 'Property Search', 'label' => 'Property Search', 'link' => 'property_search.php'));
$navbar = navbar2($navbar_array);
$page->setTitle("Arrange Viewing");
$page->addStyleSheet('css/styles.css');
$page->addScript('js/global.js');
$page->addScript('js/scriptaculous/prototype.js');
$page->addScriptDeclaration($additional_js);
$page->setBodyAttributes(array('onLoad' => $onLoad));
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="content">');
$page->addBodyContent($navbar);
$page->addBodyContent($form->renderForm());
$page->addBodyContent('</div>');
$page->display();
exit;
} else {
// validate second form, but this is only required is posctcode lookup isnt used
if (!$_GET["pro_pro_id"]) {
$result = new Validate();
$results = $result->process($formData1, $_GET);
$db_data2 = $results['Results'];
if (is_array($results['Results'])) {
示例6: array
$form->addField("hidden", "cli_id", "", $cli_id);
$form->addField("hidden", "pro_id", "", $pro_id);
$form->addField("hidden", "dea_id", "", $dea_id);
$form->addHtml("<fieldset>\n");
$form->addLegend('Property Particulars');
$form->addData($formDataArea, $_GET);
$form->addData($formData, $_GET);
$form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit'))));
$form->addHtml("</fieldset>\n");
$navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $searchLink), 'search' => array('title' => 'Property Search', 'label' => 'Property Search', 'link' => 'property_search.php'));
$navbar = navbar2($navbar_array);
$page->setTitle("New Instruction");
$page->addStyleSheet('css/styles.css');
$page->addScript('js/global.js');
$page->addScript('js/scriptaculous/prototype.js');
$page->addScriptDeclaration($ptype['js']);
$page->setBodyAttributes(array('onLoad' => $ptype['onload']));
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="content">');
$page->addBodyContent($navbar);
$page->addBodyContent($render);
$page->addBodyContent($form->renderForm());
$page->addBodyContent('</div>');
$page->display();
} else {
// if form is submitted
// validate (dea)
$result = new Validate();
$results = $result->process($formData, $_GET);
$db_data = $results['Results'];
// build return link
示例7: array
$form->addHtml("<fieldset>\n");
$form->addHtml('<div class="block-header">Property Particulars</div>');
$form->addData($formDataArea, $_GET);
$form->addData($formData, $_GET);
$form->addSeperator();
$form->addData($formData1, $_GET);
$form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit'))));
$form->addHtml("</fieldset>\n");
$navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $searchLink), 'search' => array('title' => 'Property Search', 'label' => 'Property Search', 'link' => 'property_search.php'));
$navbar = navbar2($navbar_array);
$page->setTitle("New Property");
$page->addStyleSheet(getDefaultCss());
$page->addScript('js/global.js');
$page->addScript('js/scriptaculous/prototype.js');
$page->addScript('js/CalendarPopup.js');
$page->addScriptDeclaration($ptype['js']);
$page->addScriptDeclaration('
document.write(getCalendarStyles());
var popcaldea_date = new CalendarPopup("popCalDivdea_date");
');
if ($dea_type == 'Lettings') {
$page->addScriptDeclaration('
var popcaldea_available = new CalendarPopup("popCalDivdea_available");
');
}
$page->setBodyAttributes(array('onLoad' => $ptype['onload']));
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="content">');
$page->addBodyContent($navbar);
$page->addBodyContent($render);
$page->addBodyContent($form->renderForm());
示例8: Sales
<td>' . preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row["pro_addr"]) . '</td>
<td class="nowrap">' . $row["use_name"] . '</td>
<td><a href="appointment_edit.php?app_id=' . $row["app_id"] . '&searchLink=' . $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'] . '"><img src="/images/sys/admin/icons/edit-icon.png" width="16" height="16" border="0" alt="View Appointment" /></a></td>
<td><a href="/admin4/appointment/feedback/id/id=' . $row["d2a_id"] . '"><img src="/images/sys/admin/icons/comment_add.gif" width="16" height="16" border="0" alt="Leave Feedback" /></a></td>
</tr>
';
$countLettings++;
}
}
$feedback = '
<h1>Missing Feedback Sales (' . $countSales . ')</h1>
<table border="0" cellpadding="5" cellspacing="0">
' . $feedback . '</table>';
$feedback2 = '
<h1>Missing Feedback Lettings (' . $countLettings . ')</h1>
<table border="0" cellpadding="5" cellspacing="0">
' . $feedback2 . '</table>';
}
$page = new HTML_Page2($page_defaults);
$page->setTitle("Leave Feedback");
$page->addStyleSheet(getDefaultCss());
$page->addScriptDeclaration($js);
$page->addScript('js/global.js');
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="home"><table width="100%" cellpadding="10"><tr valign="top"><td width="50%">');
$page->addBodyContent($feedback);
$page->addBodyContent('</td><td width="50%">');
$page->addBodyContent($feedback2);
$page->addBodyContent('</td></tr></table>');
$page->addBodyContent('</div>');
$page->display();
示例9: strtotime
$page->addScript('js/global.js');
$page->addScript('js/scriptaculous/prototype.js');
$page->addScript('js/scriptaculous/scriptaculous.js');
$page->addScript('js/CalendarPopup.js');
// this disables dates before today to prevent appointments being made in the past
$yesterday = strtotime($date_mysql) - 60 * 60 * 24;
$y = date('Y', $yesterday);
$m = date('m', $yesterday);
$m = $m - 1;
// js date function sees months as minus 1
$d = date('d', $yesterday);
$yesterday = "{$y},{$m},{$d}";
$page->addScriptDeclaration('
document.write(getCalendarStyles());
var now = new Date();
now.setFullYear(' . $yesterday . ');
var popcalapp_date = new CalendarPopup("popCalDivapp_date");
popcalapp_date.showYearNavigation();
//popcalapp_date.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
');
$test = '<div style="height:1680px;">
<div id="app4560" class="calEntryDiv" style="position: absolute; height: 54px; left: 42px; top:120px; width:107px; border: 1px solid #FFB574; border-left: 10px solid #FFB574; z-index:1; overflow: hidden;" onClick="javascript:parent.window.location.href=\'https://new.wooster-1.titaninternet.co.uk/v3.0/live/admin/appointment_edit.php?app_id=4560&searchLink=calendar.php?y%3D2007%26m%3D9%26d%3D17%26branch%3D1%26\'" onMouseOver="return overlib(\'2 Halsmere Road SE5<br /><br />Chase vendor for time to do new pix\',CAPTION,\'Note 09:00 to 09:30<br />(30 minutes)\');" onMouseOut="nd();" onMouseDown="nd();">
<strong>Note</strong> 09:00<br />2 Halsmere Road SE5
</div>
<div id="app4647" class="calEntryDiv" style="position: absolute; height: 54px; left: 42px; top:360px; width:107px; border: 1px solid #CDCD9B; border-left: 10px solid #CDCD9B; z-index:1; overflow: hidden;" onClick="javascript:parent.window.location.href=\'https://new.wooster-1.titaninternet.co.uk/v3.0/live/admin/appointment_edit.php?app_id=4647&searchLink=calendar.php?y%3D2007%26m%3D9%26d%3D17%26branch%3D1%26\'" onMouseOver="return overlib(\'Client:<br />Raymond Kalunga - 07711 832 369<br /><br />Property:<br />135 Chadwick Road SE15 <br /><br />Negotiator:<br />Emma Ovenell\',CAPTION,\'Viewing 11:00 to 11:30<br />(30 minutes)\');" onMouseOut="nd();" onMouseDown="nd();">
<strong>Viewing</strong> 11:00<br />Raymond Kalunga
</div>
</div>';
$page->setBodyAttributes(array('onLoad' => $onLoad));
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="content">');
$page->addBodyContent($navbar);
示例10: getSelectionId
$navbar = navbar2($navbar_array);
$page->setTitle("Client > {$cli_fname} {$cli_sname}");
$page->addStyleSheet(getDefaultCss());
// $page->addStyleSheet('/css/gray/default.css');
$page->addStyleSheet('/css/public/jquery-ui-1.9.2.custom.min.css');
// $page->addScript('js/scriptaculous/prototype.js');
// $page->addScript('js/scriptaculous/scriptaculous.js');
$page->addScript('/js/jquery.latest.js');
$page->addScript('/js/jquery-ui.min.js');
$page->addScript('js/global.js');
$page->addScript('js/thickbox.js');
$page->addScript('/js/functions.js');
$page->addScript('/js/Popup.js');
$page->addScript('/js/AddressTools.js');
// $page->addScriptDeclaration('jQuery.noConflict();');
$page->addScriptDeclaration($additional_js);
$page->addScriptDeclaration($source['js']);
$page->setBodyAttributes(array('onLoad' => $onLoad));
//,'onKeyPress'=>'keyPressShowDiv(event.keyCode)'
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="content">');
$page->addBodyContent($navbar);
$page->addBodyContent($form->renderForm());
$page->addBodyContent('</div>');
$page->addBodyContent('<div id="hint"></div><script type="text/javascript">
//new Ajax.Autocompleter("cli_solicitor","hint","ajax_solicitor.php",{afterUpdateElement : getSelectionId});
function getSelectionId(text, li) {
document.getElementById(\'cli_solicitor_id\').value = li.id;
}
</script>');
ob_start();
示例11:
/**
* Outputs the form.
*
* @param object &$page the page being processed
*
* @return void
* @access public
* @since version 2.0.0RC1 (2005-06-23)
*/
function _renderForm(&$page)
{
$tab = ' ';
$p = new HTML_Page2(array('lineend' => PHP_EOL, 'tab' => $tab, 'doctype' => 'XHTML 1.0 Strict', 'language' => 'en', 'cache' => 'false'));
$p->disableXmlProlog();
$p->setTitle('PEAR::HTML_Progress2 - Generator');
$p->setMetaData('author', 'Laurent Laville');
$formTemplate = "\n<form{attributes}>" . "\n<table class=\"maintable\">" . "\n<caption>HTML_Progress2 Generator</caption>" . "\n{content}" . "\n</table>" . "\n</form>";
$headerTemplate = "\n<tr>" . "\n\t<th colspan=\"2\">" . "\n\t\t{header}" . "\n\t</th>" . "\n</tr>";
$elementTemplate = "\n<tr valign=\"top\">" . "\n\t<td class=\"qfLabel\"> " . "<!-- BEGIN required -->" . "<span class=\"required\">*</span>" . "<!-- END required -->" . "{label}</td>" . "\n\t<td class=\"qfElement\">" . "\n{element}" . "<!-- BEGIN label_2 --> " . "<span class=\"qfLabel2\">{label_2}</span>" . "<!-- END label_2 -->" . "\n\t</td>" . "\n</tr>";
$groupTemplate = "\n\t\t<table class=\"group\">" . "\n\t\t<tr>" . "\n\t\t\t{content}" . "\n\t\t</tr>" . "\n\t\t</table>";
$groupElementTemplate = "<td>{element}" . "<!-- BEGIN label --><br/>" . "<span class=\"qfLabel\">{label}</span>" . "<!-- END label -->" . "</td>";
$renderer =& $page->defaultRenderer();
$renderer->setFormTemplate($formTemplate);
$renderer->setHeaderTemplate($headerTemplate);
$renderer->setElementTemplate($elementTemplate);
$renderer->setGroupTemplate($groupTemplate, 'name');
$renderer->setGroupElementTemplate($groupElementTemplate, 'name');
$styles = $this->getStyleSheet();
$js = '';
// on preview tab, add progress bar javascript and stylesheet
if ($page->getAttribute('id') == 'Preview') {
$pb = $page->controller->createProgressBar();
$pb->setTab($tab);
$styles .= $pb->getStyle();
$js = $pb->getScript();
$p->addStyleDeclaration($styles);
$p->addScriptDeclaration($js);
$pbElement =& $page->getElement('progressBar');
$pbElement->setText($pb->toHtml() . '<br /><br />');
} else {
$p->addStyleDeclaration($styles);
}
$page->accept($renderer);
$p->addBodyContent($renderer->toHtml());
$p->display();
}
示例12: array
$form->addHtml("</fieldset>\n");
if (!$_GET["viewForm"]) {
$viewForm = 1;
}
$additional_js = '
if (!previousID) {
var previousID = "form' . $viewForm . '";
}
';
$navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => urldecode($_GET["searchLink"])), 'search' => array('title' => 'Search Calendar', 'label' => 'Search Calendar', 'link' => 'appointment_search.php'));
$navbar = navbar2($navbar_array);
$page->setTitle("Search Calendar");
$page->addStyleSheet(getDefaultCss());
$page->addScript('js/global.js');
$page->addScript('js/CalendarPopup.js');
$page->addScriptDeclaration($additional_js);
$page->setBodyAttributes(array('onLoad' => $onLoad));
$page->addScriptDeclaration('document.write(getCalendarStyles());var popcaldate_from = new CalendarPopup("popCalDivdate_from");popcaldate_from.showYearNavigation();var popcaldate_to = new CalendarPopup("popCalDivdate_to");popcaldate_to.showYearNavigation(); ');
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="content">');
$page->addBodyContent($navbar);
$page->addBodyContent($form->renderForm());
$page->addBodyContent('</div>');
$page->display();
exit;
} else {
// if form is submitted
// construct sql
if ($_GET["type"]) {
$q[] = "app_type = '" . $_GET["type"] . "' AND ";
$return["type"] = $_GET["type"];
示例13: urlencode
$form->addField("hidden", "searchLink", "", urlencode($searchLink));
$form->addHtml("<fieldset>\n");
$form->addHtml('<div class="block-header">' . $app_type . '</div>');
$form->addData($formData1, $_GET);
$form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'))));
$form->addHtml($deal_table);
$form->addHtml($form->addDiv($form->makeField("button", $formName, "", "Add Properties", array('class' => 'submit', 'onClick' => 'javascript:document.location.href=\'viewing_add.php?stage=viewing_address&cli_id=' . $cli_id . '&app_id=' . $app_id . '\';'))));
$form->addHtml("</fieldset>\n");
$form->addHtml('</div>');
$page->setTitle("Appointment");
$page->addStyleSheet(getDefaultCss());
$page->addScript('js/global.js');
$page->addScript('js/scriptaculous/prototype.js');
$page->addScript('js/scriptaculous/scriptaculous.js');
$page->addScript('js/CalendarPopup.js');
$page->addScriptDeclaration('document.write(getCalendarStyles());var popcal = new CalendarPopup("popCalDiv");popcal.showYearNavigation(); ');
$page->addBodyContent('<div id="content">');
$page->addBodyContent($form->renderForm());
$page->addBodyContent('</div>');
$page->display();
exit;
break;
/////////////////////////////////////////////////////////////////////////////
// Valuation:
// (valuations are created on valuation_add.php page)
// multiple clients are permitted
// single user only (this is becuase a: we need to give the appointment a colour, and b: so we can track user's activity)
// single deal only (multiple valuations means multiple appointments)
// valuer name and company, from contacts (or directory?)
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
示例14: hideMsgDiv
setTimeout("hideMsgDiv()",1500);
}
function hideMsgDiv() {
new Effect.Fade("floating_message");
}
-->
</script><div id="notify"><div id="floating_message">' . urldecode($_GET["msg"]) . '</div></div>';
}
$page->setTitle("Production > {$pro_addr}");
$page->addStyleSheet(getDefaultCss());
$page->addScript('js/global.js');
$page->addScript('js/scriptaculous/prototype.js');
$page->addScript('js/scriptaculous/scriptaculous.js');
$page->addScript('/js/Popup.js');
$page->addScript('/js/jquery-1.4.3.min.js');
$page->addScriptDeclaration($additional_js);
$page->addScriptDeclaration($ptype['js']);
#$page->setBodyAttributes(array('onLoad'=>$ptype['onload']));
$page->setBodyAttributes(array('onLoad' => $onLoad));
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="content">');
$page->addBodyContent($navbar);
$page->addBodyContent($form->renderForm());
if ($msg) {
$page->addBodyContent($msg);
}
$page->addBodyContent('<a href="postcode_tools_property.php?pro_id=' . $pro_id . '&dea_id=' . $dea_id . '">' . $pro_id . '</a>');
$page->addBodyContent('</div>');
$page->display();
exit;
} elseif ($_POST["action"] == "update") {
示例15: IN
<?php
require_once "inx/global.inc.php";
// choose a colour for a user. must not allow the same colour to be chosen for more than one user.
$sql = "SELECT\ncol_colour\nFROM\ncolour\nWHERE col_colour NOT IN ( SELECT use_colour FROM user )\nORDER BY col_id";
$q = $db->query($sql);
if (DB::isError($q)) {
die("db error: " . $q->getMessage());
}
$numRows = $q->numRows();
while ($row = $q->fetchRow()) {
$render .= '
<span style="width:60px; height:60px; margin:2px 2px 2px 2px; background-color: #' . $row["col_colour"] . '; border: 1px solid #666666;"><a href="javascript:pick(\'' . $row["col_colour"] . '\');"><img src="/images/sys/admin/blank.gif" width="60" height="60" border="0"></a></span>
';
}
// start a new page
$page = new HTML_Page2($page_defaults);
$page->setTitle("Colour Picker");
$page->addStyleSheet(getDefaultCss());
$page->addScript('js/global.js');
$page->addScriptDeclaration('function pick(color) {
if (window.opener && !window.opener.closed)
window.opener.document.forms[0].use_colour.value = color;
window.opener.document.forms[0].use_colour.style.background = color;
window.opener.document.forms[0].use_colour.style.color = color;
window.close();
}');
$page->addBodyContent($render);
$page->display();
exit;