当前位置: 首页>>代码示例>>PHP>>正文


PHP includeDatepicker函数代码示例

本文整理汇总了PHP中includeDatepicker函数的典型用法代码示例。如果您正苦于以下问题:PHP includeDatepicker函数的具体用法?PHP includeDatepicker怎么用?PHP includeDatepicker使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了includeDatepicker函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

 public function display()
 {
     global $smarty;
     includeDatepicker(array('datepickerFrom', 'datepickerTo'));
     $smarty->display(_PS_THEME_DIR_ . 'admin/violettools.tpl');
     echo '<fieldset><legend><img src="../img/admin/tab-tools.gif" />' . $this->l('Shop Tools') . '</legend>';
     echo '<p>' . $this->l('Several tools are available to manage your shop.') . '</p>';
     echo '<br />';
     echo '<p>' . $this->l('Please choose a tool by selecting a Tools sub-tab above.') . '</p>';
     echo '</fieldset>';
 }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:11,代码来源:AdminTools.php

示例2: initList

 public function initList()
 {
     //$helper = new HelperList();
     //$helper->title = array($this->module_instance->displayName, $this->module_instance->l('Translation projects', 'translation_projects.view'));
     //return parent::initList($helper);
     $projects = $this->getData();
     $list_total = count($this->getData(false));
     $pagination = array(20, 50, 100, 300);
     $page = (int) Tools::getValue('submitFilterproject');
     if (!$page) {
         $page = 1;
     }
     $total_pages = ceil($list_total / Tools::getValue('pagination', 50));
     if (!$total_pages) {
         $total_pages = 1;
     }
     $selected_pagination = Tools::getValue('pagination', isset($this->context->cookie->{'project_pagination'}) ? $this->context->cookie->{'project_pagination'} : null);
     $this->context->smarty->assign(array('projects' => $projects, 'list_total' => $list_total, 'page' => $page, 'full_url' => TextMaster::CURRENT_INDEX . Tools::getValue('token') . '&configure=' . $this->module_instance->name . '&menu=' . Tools::getValue('menu') . '&token=' . Tools::getAdminTokenLite('AdminModules'), 'menu' => 'translation', 'selected_pagination' => $selected_pagination, 'pagination' => $pagination, 'total_pages' => $total_pages));
     $fields = array('id_project', 'name', 'language_from', 'language_to', 'status');
     foreach ($fields as $key => $values) {
         if ($this->context->cookie->__isset('projectFilter_' . $values)) {
             $this->context->smarty->assign('cookie_projectFilter_' . $values, $this->context->cookie->{'projectFilter_' . $values});
         }
     }
     $fields = array('date_add', 'date_upd');
     foreach ($fields as $key => $values) {
         if ($this->context->cookie->__isset('projectFilter_' . $values)) {
             if (version_compare(_PS_VERSION_, '1.5', '<')) {
                 $date = unserialize($this->context->cookie->{'projectFilter_' . $values});
             } else {
                 $date = Tools::unSerialize($this->context->cookie->{'projectFilter_' . $values});
             }
             if (!empty($date[0])) {
                 $this->context->smarty->assign('cookie_projectFilter_' . $values . '_0', pSQL($date[0]));
             }
             if (!empty($date[1])) {
                 $this->context->smarty->assign('cookie_projectFilter_' . $values . '_1', pSQL($date[1]));
             }
         }
     }
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         includeDatepicker(array('projectFilter_date_add_0', 'projectFilter_date_add_1', 'projectFilter_date_upd_0', 'projectFilter_date_upd_1'));
     } else {
         $this->context->controller->addJqueryUI('ui.datepicker');
     }
     return $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'textmaster/views/templates/admin/main_list.tpl');
 }
开发者ID:ventsiwad,项目名称:presta_addons,代码行数:47,代码来源:translation_projects.view.php

示例3: displayListHeader


//.........这里部分代码省略.........
			</script>
			<script type="text/javascript" src="../js/admin-dnd.js"></script>
			';
        }
        echo '<table' . (array_key_exists($this->identifier, $this->identifiersDnd) ? ' id="' . ((int) Tools::getValue($this->identifiersDnd[$this->identifier], 1) ? substr($this->identifier, 3, strlen($this->identifier)) : '') . '"' : '') . ' class="table' . ((array_key_exists($this->identifier, $this->identifiersDnd) and ($this->_orderBy != 'position ' and $this->_orderWay != 'DESC')) ? ' tableDnD' : '') . '" cellpadding="0" cellspacing="0">
			<thead>
				<tr class="nodrag nodrop">
					<th>';
        if ($this->delete) {
            echo '		<input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \'' . $this->table . 'Box[]\', this.checked)" />';
        }
        echo '		</th>';
        foreach ($this->fieldsDisplay as $key => $params) {
            echo '	<th ' . (isset($params['widthColumn']) ? 'style="width: ' . $params['widthColumn'] . 'px"' : '') . '>' . $params['title'];
            if (!isset($params['orderby']) or $params['orderby']) {
                // Cleaning links
                if (Tools::getValue($this->table . 'Orderby') && Tools::getValue($this->table . 'Orderway')) {
                    $currentIndex = preg_replace('/&' . $this->table . 'Orderby=([a-z _]*)&' . $this->table . 'Orderway=([a-z]*)/i', '', $currentIndex);
                }
                echo '	<br />
						<a href="' . $currentIndex . '&' . $this->identifier . '=' . $id_cat . '&' . $this->table . 'Orderby=' . urlencode($key) . '&' . $this->table . 'Orderway=desc&token=' . $token . '"><img border="0" src="../img/admin/down' . ((isset($this->_orderBy) and $key == $this->_orderBy and $this->_orderWay == 'DESC') ? '_d' : '') . '.gif" /></a>
						<a href="' . $currentIndex . '&' . $this->identifier . '=' . $id_cat . '&' . $this->table . 'Orderby=' . urlencode($key) . '&' . $this->table . 'Orderway=asc&token=' . $token . '"><img border="0" src="../img/admin/up' . ((isset($this->_orderBy) and $key == $this->_orderBy and $this->_orderWay == 'ASC') ? '_d' : '') . '.gif" /></a>';
            }
            echo '	</th>';
        }
        /* Check if object can be modified, deleted or detailed */
        if ($this->edit or $this->delete or $this->view and $this->view !== 'noActionColumn') {
            echo '	<th style="width: 52px">' . $this->l('Actions') . '</th>';
        }
        echo '	</tr>
				<tr class="nodrag nodrop" style="height: 35px;">
					<td class="center">';
        if ($this->delete) {
            echo '		--';
        }
        echo '		</td>';
        /* Javascript hack in order to catch ENTER keypress event */
        $keyPress = 'onkeypress="formSubmit(event, \'submitFilterButton_' . $this->table . '\');"';
        /* Filters (input, select, date or bool) */
        foreach ($this->fieldsDisplay as $key => $params) {
            $width = isset($params['width']) ? ' style="width: ' . (int) $params['width'] . 'px;"' : '';
            echo '<td' . (isset($params['align']) ? ' class="' . $params['align'] . '"' : '') . '>';
            if (!isset($params['type'])) {
                $params['type'] = 'text';
            }
            $value = Tools::getValue($this->table . 'Filter_' . (array_key_exists('filter_key', $params) ? $params['filter_key'] : $key));
            if (isset($params['search']) and !$params['search']) {
                echo '--</td>';
                continue;
            }
            switch ($params['type']) {
                case 'bool':
                    echo '
					<select name="' . $this->table . 'Filter_' . $key . '">
						<option value="">--</option>
						<option value="1"' . ($value == 1 ? ' selected="selected"' : '') . '>' . $this->l('Yes') . '</option>
						<option value="0"' . (($value == 0 and $value != '') ? ' selected="selected"' : '') . '>' . $this->l('No') . '</option>
					</select>';
                    break;
                case 'date':
                case 'datetime':
                    if (is_string($value)) {
                        $value = unserialize($value);
                    }
                    if (!Validate::isCleanHtml($value[0]) or !Validate::isCleanHtml($value[1])) {
                        $value = '';
                    }
                    $name = $this->table . 'Filter_' . (isset($params['filter_key']) ? $params['filter_key'] : $key);
                    $nameId = str_replace('!', '__', $name);
                    includeDatepicker(array($nameId . '_0', $nameId . '_1'));
                    echo $this->l('From') . ' <input type="text" id="' . $nameId . '_0" name="' . $name . '[0]" value="' . (isset($value[0]) ? $value[0] : '') . '"' . $width . ' ' . $keyPress . ' /><br />
					' . $this->l('To') . ' <input type="text" id="' . $nameId . '_1" name="' . $name . '[1]" value="' . (isset($value[1]) ? $value[1] : '') . '"' . $width . ' ' . $keyPress . ' />';
                    break;
                case 'select':
                    if (isset($params['filter_key'])) {
                        echo '<select onchange="$(\'#submitFilter' . $this->table . '\').focus();$(\'#submitFilter' . $this->table . '\').click();" name="' . $this->table . 'Filter_' . $params['filter_key'] . '" ' . (isset($params['width']) ? 'style="width: ' . $params['width'] . 'px"' : '') . '>
								<option value=""' . (($value == 0 and $value != '') ? ' selected="selected"' : '') . '>--</option>';
                        if (isset($params['select']) and is_array($params['select'])) {
                            foreach ($params['select'] as $optionValue => $optionDisplay) {
                                echo '<option value="' . $optionValue . '"' . ((isset($_POST[$this->table . 'Filter_' . $params['filter_key']]) and Tools::getValue($this->table . 'Filter_' . $params['filter_key']) == $optionValue and Tools::getValue($this->table . 'Filter_' . $params['filter_key']) != '') ? ' selected="selected"' : '') . '>' . $optionDisplay . '</option>';
                            }
                        }
                        echo '</select>';
                        break;
                    }
                case 'text':
                default:
                    if (!Validate::isCleanHtml($value)) {
                        $value = '';
                    }
                    echo '<input type="text" name="' . $this->table . 'Filter_' . (isset($params['filter_key']) ? $params['filter_key'] : $key) . '" value="' . htmlentities($value, ENT_COMPAT, 'UTF-8') . '"' . $width . ' ' . $keyPress . ' />';
            }
            echo '</td>';
        }
        if ($this->edit or $this->delete or $this->view and $this->view !== 'noActionColumn') {
            echo '<td class="center">--</td>';
        }
        echo '</tr>
			</thead>';
    }
开发者ID:vata,项目名称:jballegro,代码行数:101,代码来源:AdminTab.php

示例4: displayCalendarStatic

    public static function displayCalendarStatic($translations)
    {
        global $cookie;
        $employee = new Employee($cookie->id_employee);
        includeDatepicker(array('datepickerFrom', 'datepickerTo'));
        return '
		<fieldset style="width: 200px; font-size:13px;"><legend><img src="../img/admin/date.png" /> ' . $translations['Calendar'] . '</legend>
			<div>
				<form action="' . $_SERVER['REQUEST_URI'] . '" method="post">
					<input type="submit" name="submitDateDay" class="button" value="' . $translations['Day'] . '">
					<input type="submit" name="submitDateMonth" class="button" value="' . $translations['Month'] . '">
					<input type="submit" name="submitDateYear" class="button" value="' . $translations['Year'] . '"><br />
					<input type="submit" name="submitDateDayPrev" class="button" value="' . $translations['Day'] . '-1" style="margin-top:2px">
					<input type="submit" name="submitDateMonthPrev" class="button" value="' . $translations['Month'] . '-1" style="margin-top:2px">
					<input type="submit" name="submitDateYearPrev" class="button" value="' . $translations['Year'] . '-1" style="margin-top:2px">
					<p>' . (isset($translations['From']) ? $translations['From'] : 'From:') . ' <input type="text" name="datepickerFrom" id="datepickerFrom" value="' . Tools::getValue('datepickerFrom', $employee->stats_date_from) . '"></p>
					<p>' . (isset($translations['To']) ? $translations['To'] : 'To:') . ' <input type="text" name="datepickerTo" id="datepickerTo" value="' . Tools::getValue('datepickerTo', $employee->stats_date_to) . '"></p>
					<input type="submit" name="submitDatePicker" class="button" value="' . (isset($translations['Save']) ? $translations['Save'] : '   Save   ') . '" />
				</form>
			</div>
		</fieldset>';
    }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:22,代码来源:AdminStatsTab.php

示例5: getContent

 /**
  * module configuration page
  * @return page HTML code
  */
 public function getContent()
 {
     $this->displayFlashMessagesIfIsset();
     if (!$this->ps_14) {
         $this->context->controller->addJS(_DPDGROUP_JS_URI_ . 'backoffice.js');
         if (!$this->bootstrap || Tools::getValue('menu') && Tools::getValue('menu') != 'shipment_list') {
             $this->context->controller->addCSS(_DPDGROUP_CSS_URI_ . 'backoffice.css');
         }
     }
     $this->setGlobalVariablesForAjax();
     $this->context->smarty->assign('dpd_geopost_other_country', DpdGroupConfiguration::OTHER_COUNTRY);
     $this->html .= $this->context->smarty->fetch(_DPDGROUP_TPL_DIR_ . 'admin/global_variables.tpl');
     if ($this->bootstrap) {
         $this->html .= $this->getBootstrapMenu();
     }
     $this->displayModuleWarnings();
     switch (Tools::getValue('menu')) {
         case 'configuration':
             require_once _DPDGROUP_CONTROLLERS_DIR_ . 'Configuration.controller.php';
             DpdGroupConfigurationController::init();
             if (!$this->bootstrap) {
                 $this->context->smarty->assign('path', array($this->displayName, $this->l('Settings')));
                 $this->displayNavigation();
             }
             if (!$this->ps_14) {
                 $this->displayShopRestrictionWarning();
             }
             $configuration_controller = new DpdGroupConfigurationController();
             $this->html .= $configuration_controller->getSettingsPage();
             break;
         case 'csv':
             require_once _DPDGROUP_CONTROLLERS_DIR_ . 'Csv.controller.php';
             DpdGroupCSVController::init();
             if (!$this->bootstrap) {
                 $this->context->smarty->assign('path', array($this->displayName, $this->l('Price rules')));
                 $this->displayNavigation();
             }
             if (!$this->ps_14) {
                 if (Shop::getContext() != Shop::CONTEXT_SHOP) {
                     $this->displayAdminWarning($this->l('CSV management is disabled when all shops or group of shops are selected'));
                     break;
                 }
             }
             $csv_controller = new DpdGroupCSVController();
             $this->html .= $csv_controller->getCSVPage();
             break;
         case 'postcode':
             require_once _DPDGROUP_CONTROLLERS_DIR_ . 'Postcode.controller.php';
             DpdGroupPostcodeController::init();
             if (!$this->bootstrap) {
                 $this->context->smarty->assign('path', array($this->displayName, $this->l('Postcodes update')));
                 $this->displayNavigation();
             }
             if (!$this->ps_14) {
                 if (Shop::getContext() != Shop::CONTEXT_SHOP) {
                     $this->displayAdminWarning($this->l('Postcodes management is disabled when all shops or group of shops are selected'));
                     break;
                 }
             }
             $psotcode_controller = new DpdGroupPostcodeController();
             $this->html .= $psotcode_controller->getPostcodePage();
             break;
         case 'help':
             if (!$this->bootstrap) {
                 $this->context->smarty->assign('path', array($this->displayName, $this->l('Help')));
                 $this->displayNavigation();
             }
             if (Tools::isSubmit('print_pdf')) {
                 $filename = 'dpdgroup_eng.pdf';
                 ob_end_clean();
                 header('Content-type: application/pdf');
                 header('Content-Disposition: attachment; filename="' . $this->l('manual') . '.pdf"');
                 readfile(_PS_MODULE_DIR_ . $this->name . '/manual/' . $filename);
                 exit;
             }
             $this->context->smarty->assign('module_link', $this->module_url);
             $this->html .= $this->context->smarty->fetch(_DPDGROUP_TPL_DIR_ . 'admin/help.tpl');
             break;
         case 'shipment_list':
         default:
             if ($this->ps_14) {
                 includeDatepicker(null);
             } else {
                 $this->context->controller->addJqueryUI(array('ui.slider', 'ui.datepicker'));
                 $this->context->controller->addJS(array(_DPDGROUP_JS_URI_ . 'jquery.bpopup.min.js', _PS_JS_DIR_ . 'jquery/plugins/timepicker/jquery-ui-timepicker-addon.js'));
                 $this->context->controller->addCSS(_PS_JS_DIR_ . 'jquery/plugins/timepicker/jquery-ui-timepicker-addon.css');
                 // for datetimepicker
             }
             if (!$this->bootstrap) {
                 $this->context->smarty->assign('path', array($this->displayName, $this->l('Shipments')));
                 $this->displayNavigation();
             } else {
                 $this->context->controller->addCSS(_DPDGROUP_CSS_URI_ . 'backoffice_16.css');
             }
             require_once _DPDGROUP_CONTROLLERS_DIR_ . 'ShipmentsList.controller.php';
             if (!$this->ps_14 && Configuration::getGlobalValue('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops(0)) > 1 && Shop::getContext() != Shop::CONTEXT_SHOP) {
//.........这里部分代码省略.........
开发者ID:remixaz,项目名称:dpdgroup,代码行数:101,代码来源:dpdgroup.php

示例6: _displaySpecificPriceAdditionForm

    protected function _displaySpecificPriceAdditionForm($defaultCurrency, $shops, $currencies, $countries, $groups)
    {
        if (!($product = $this->loadObject())) {
            return;
        }
        $default_country = new Country((int) Configuration::get('PS_COUNTRY_DEFAULT'));
        echo '
		<a href="#" onclick="$(\'#add_specific_price\').slideToggle();return false;"><img src="../img/admin/add.gif" alt="" /> ' . $this->l('Add a new specific price') . '</a>

		<div id="add_specific_price" style="display: none;">
			<input type="hidden" name="sp_id_shop" value="0" />
			<label>' . $this->l('For:') . '</label>
			<div class="margin-form">
				<select name="sp_id_currency" id="spm_currency_0" onchange="changeCurrencySpecificPrice(0);">
					<option value="0">' . $this->l('All currencies') . '</option>';
        foreach ($currencies as $currency) {
            echo '<option value="' . (int) $currency['id_currency'] . '">' . Tools::htmlentitiesUTF8($currency['name']) . '</option>';
        }
        echo '
				</select>
				&gt;
				<select name="sp_id_country">
					<option value="0">' . $this->l('All countries') . '</option>';
        foreach ($countries as $country) {
            echo '<option value="' . (int) $country['id_country'] . '">' . Tools::htmlentitiesUTF8($country['name']) . '</option>';
        }
        echo '
				</select>
				&gt;
				<select name="sp_id_group">
					<option value="0">' . $this->l('All groups') . '</option>';
        foreach ($groups as $group) {
            echo '	<option value="' . (int) $group['id_group'] . '">' . Tools::htmlentitiesUTF8($group['name']) . '</option>';
        }
        echo '
				</select>
			</div>

			<label>' . $this->l('Available from:') . '</label>
			<div class="margin-form">
				<input type="text" name="sp_from" value="" style="text-align: center" id="sp_from" /><span style="font-weight:bold; color:#000000; font-size:12px"> ' . $this->l('to') . '</span>
				<input type="text" name="sp_to" value="" style="text-align: center" id="sp_to" />
			</div>

			<label>' . $this->l('Starting at') . '</label>
			<div class="margin-form">
				<input type="text" name="sp_from_quantity" value="1" size="3" /> <span style="font-weight:bold; color:#000000; font-size:12px">' . $this->l('unit') . '</span>
			</div>

			<label>' . $this->l('Product price');
        if ($default_country->display_tax_label) {
            echo ' ' . $this->l('(tax excl.):');
        }
        echo '</label>
			<div class="margin-form">
				<span id="spm_currency_sign_pre_0" style="font-weight:bold; color:#000000; font-size:12px">' . ($defaultCurrency->format == 1 ? ' ' . $defaultCurrency->sign : '') . '</span>
				<input type="text" name="sp_price" value="0" size="11" />
				<span id="spm_currency_sign_post_0" style="font-weight:bold; color:#000000; font-size:12px">' . ($defaultCurrency->format == 2 ? ' ' . $defaultCurrency->sign : '') . '</span>
				<span id="sp_current_ht_price" > (' . $this->l('Current:') . ' ' . Tools::displayPrice((double) $product->price, $defaultCurrency) . ')</span>
				<div class="hint clear" style="display:block;">
					' . $this->l('You can set this value at 0 in order to apply the default price') . '
				</div>
			</div>

			<label>' . $this->l('Apply a discount of:') . '</label>
			<div class="margin-form">
				<input type="text" name="sp_reduction" value="0.00" size="11" />
				<select name="sp_reduction_type">
					<option selected="selected">---</option>
					<option value="amount">' . $this->l('Amount') . '</option>
					<option value="percentage">' . $this->l('Percentage') . '</option>
				</select>
				' . $this->l('(if set to "amount", the tax is included)') . '
			</div>

			<div class="margin-form">
				<input type="submit" name="submitPriceAddition" value="' . $this->l('Add') . '" class="button" />
			</div>
		</div>
		<hr />';
        include_once 'functions.php';
        includeDatepicker(array('sp_from', 'sp_to'), true);
    }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:83,代码来源:AdminProducts.php

示例7: addDateTimePickerPlugins

 private function addDateTimePickerPlugins()
 {
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         return includeDatepicker(null);
     }
     $this->context->controller->addJqueryUI(array('ui.slider', 'ui.datepicker'));
     $this->context->controller->addJS(array(_DPDPOLAND_JS_URI_ . 'jquery.bpopup.min.js', _PS_JS_DIR_ . 'jquery/plugins/timepicker/jquery-ui-timepicker-addon.js'));
     if (version_compare(_PS_VERSION_, '1.6', '<')) {
         $this->addCSS(_PS_JS_DIR_ . 'jquery/plugins/timepicker/jquery-ui-timepicker-addon.css');
     }
     // for datetimepicker
 }
开发者ID:rokaszygmantas,项目名称:dpdpoland,代码行数:12,代码来源:dpdpoland.php

示例8: displayForm


//.........这里部分代码省略.........
										customers_length = 1;
									formDiscount.id_target.length = 1 + customers_length + groups_length;
									
									if (obj.groups.length == 0)
									{
										formDiscount.id_target.options[1].value = -1;
										formDiscount.id_target.options[1].text = \'' . $this->l('No match found') . '\';
										formDiscount.id_target.options[1].className = "groups_filtered";
									}
									else
									{
										for (i = 0; i < obj.groups.length && i < 50; i++)
										{
											formDiscount.id_target.options[i+1].value = obj.groups[i]["value"];
											formDiscount.id_target.options[i+1].text = obj.groups[i]["text"];
											formDiscount.id_target.options[i+1].className = "groups_filtered";
										}
										if (obj.groups.length >= 50)
										{
											formDiscount.id_target.options[50].text = "' . $this->l('Too many results...', __CLASS__, true, false) . '";
											formDiscount.id_target.options[50].value = "_";
											formDiscount.id_target.options[50].className = "groups_filtered";
										}
									}
									
									if (obj.customers.length == 0)
									{
										formDiscount.id_target.options[groups_length+1].value = -1;
										formDiscount.id_target.options[groups_length+1].text = \'' . $this->l('No match found') . '\';
										formDiscount.id_target.options[groups_length+1].className = "customers_filtered";
									}										
									else
									{
										for (i = 0; i < obj.customers.length && i < 50; i++)
										{
											formDiscount.id_target.options[groups_length+1+i].value = obj.customers[i]["value"];
											formDiscount.id_target.options[groups_length+1+i].text = obj.customers[i]["text"];
											formDiscount.id_target.options[groups_length+1+i].className = "customers_filtered";
										}
										if (obj.customers.length >= 50)
										{
											formDiscount.id_target.options[groups_length+i].text = "' . $this->l('Too many results...', __CLASS__, true, false) . '";
											formDiscount.id_target.options[groups_length+i].value = "_";
											formDiscount.id_target.options[groups_length+i].className = "customers_filtered";
										}
									}
									$(".groups_filtered").appendTo($("#id_target_group"));
									$(".customers_filtered").appendTo($("#id_target_customers"));
									if ($(\'#filter\').val())
									{
										if (formDiscount.id_target.options[1].value != -1)
											formDiscount.id_target.options.selectedIndex = 1;
										else
											formDiscount.id_target.options.selectedIndex = 2;
									}
									else if (filterValue)
										for (i = 0; i < (customers_length + groups_length); i++)
											if (formDiscount.id_target.options[i+1].value == filterValue)
												formDiscount.id_target.options.selectedIndex = i + 1;
								}
							);
						}
						fillCustomersAjax(); 
					</script>
				</div><br />';
        includeDatepicker(array('date_from', 'date_to'), true);
        echo '		
				<label>' . $this->l('From:') . ' </label>
				<div class="margin-form">
					<input type="text" size="20" id="date_from" name="date_from" value="' . ($this->getFieldValue($obj, 'date_from') ? htmlentities($this->getFieldValue($obj, 'date_from'), ENT_COMPAT, 'UTF-8') : date('Y-m-d H:i:s')) . '" /> <sup>*</sup>
					<p class="clear">' . $this->l('Date /time from which voucher is valid') . '<br />' . $this->l('Format: YYYY-MM-DD HH:MM:SS') . '</p>
				</div>
				<label>' . $this->l('To:') . ' </label>
				<div class="margin-form">
					<input type="text" size="20" id="date_to" name="date_to" value="' . ($this->getFieldValue($obj, 'date_to') ? htmlentities($this->getFieldValue($obj, 'date_to'), ENT_COMPAT, 'UTF-8') : date('Y') + 1 . date('-m-d H:i:s')) . '" /> <sup>*</sup>
					<p class="clear">' . $this->l('End date/time at which voucher is no longer valid') . '<br />' . $this->l('Format: YYYY-MM-DD HH:MM:SS') . '</p>
				</div>
				<label>' . $this->l('Display the voucher in the cart summary:') . ' </label>
				<div class="margin-form">
					<input type="radio" name="cart_display" id="cart_active_on" value="1" ' . ($this->getFieldValue($obj, 'cart_display') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="cart_display_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="cart_display" id="cart_active_off" value="0" ' . (!$this->getFieldValue($obj, 'cart_display') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="cart_display_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
				</div>
				<div class="clear" / >
				<label>' . $this->l('Status:') . ' </label>
				<div class="margin-form">
					<input type="radio" name="active" id="active_on" value="1" ' . ($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="active" id="active_off" value="0" ' . (!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					<p>' . $this->l('Enable or disable voucher') . '</p>
				</div>
				<div class="margin-form">
					<input type="submit" value="' . $this->l('   Save   ') . '" name="submitAdd' . $this->table . '" class="button" />
				</div>
				<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
			</fieldset>
		</form>';
    }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:101,代码来源:AdminDiscounts.php

示例9: displayForm


//.........这里部分代码省略.........
					<p style="clear: both;">' . $this->l('Total quantity available (mainly for vouchers open to everyone)') . '</p>
				</div>
				<label>' . $this->l('Qty per each user:') . ' </label>
				<div class="margin-form">
					<input type="text" size="15" name="quantity_per_user" value="' . intval($this->getFieldValue($obj, 'quantity_per_user')) . '" /> <sup>*</sup>
					<p style="clear: both;">' . $this->l('Number of times a single customer can use this voucher') . '</p>
				</div>
				<label>' . $this->l('Minimum amount') . '</label>
				<div class="margin-form">
					<input type="text" size="15" name="minimal" value="' . ($this->getFieldValue($obj, 'minimal') ? floatval($this->getFieldValue($obj, 'minimal')) : '0') . '" onkeyup="javascript:this.value = this.value.replace(/,/g, \'.\'); " /> <sup>*</sup>
					<p style="clear: both;">' . $this->l('Leave blank or 0 if not applicable') . '</p>
				</div>
				<div class="margin-form">
					<p>
						<input type="checkbox" name="cumulable"' . ($this->getFieldValue($obj, 'cumulable') == 1 ? ' checked="checked"' : '') . ' id="cumulable_on" value="1" />
						<label class="t" for="cumulable_on"> ' . $this->l('Cumulative with other vouchers') . '</label>
					</p>
				</div>
				<div class="margin-form">
					<p>
						<input type="checkbox" name="cumulable_reduction"' . ($this->getFieldValue($obj, 'cumulable_reduction') == 1 ? ' checked="checked"' : '') . ' id="cumulable_reduction_on" value="1" />
						<label class="t" for="cumulable_reduction_on"> ' . $this->l('Cumulative with price reductions') . '</label>
					</p>
				</div>
				<label>' . $this->l('To be used by:') . ' </label>
								<div class="margin-form">				
					<select name="id_customer" id="id_customer">
						<option value="0">-- ' . $this->l('All customers') . ' --</option>
					</select><br />' . $this->l('Filter:') . ' <input type="text" size="25" name="filter" id="filter" onkeyup="fillCustomersAjax();" class="space" value="" />
					<script type="text/javascript">
						var formDiscount = document.layers ? document.forms.discount : document.discount;	
						function fillCustomersAjax()
						{
							var filterValue = \'' . (($value = intval($this->getFieldValue($obj, 'id_customer'))) ? $value : '') . '\';
							if ($(\'#filter\').val())
								filterValue = $(\'#filter\').val();
							
							$.getJSON("' . dirname($currentIndex) . '/ajax.php",{ajaxDiscountCustomers:1,filter:filterValue},
								function(customers) {
									if (customers.length == 0)
									{
										formDiscount.id_customer.length = 2;
										formDiscount.id_customer.options[1].value = -1;
										formDiscount.id_customer.options[1].text = \'' . $this->l('No match found') . '\';
										formDiscount.id_customer.options.selectedIndex = 1;
									}										
									else
									{
										formDiscount.id_customer.length = customers.length + 1;
										for (i = 0; i < customers.length && i < 50; i++)
										{
											formDiscount.id_customer.options[i+1].value = customers[i]["value"];
											formDiscount.id_customer.options[i+1].text = customers[i]["text"];
										}
										if (customers.length >= 50)
										{
											formDiscount.id_customer.options[50].text = "' . $this->l('Too much results...', __CLASS__, true, false) . '";
											formDiscount.id_customer.options[50].value = "_";	
										}
										
										if ($(\'#filter\').val())
											formDiscount.id_customer.options.selectedIndex = 1;
										else if(filterValue)
											for (i = 0; i < customers.length; i++)
												if (formDiscount.id_customer.options[i+1].value == filterValue)
													formDiscount.id_customer.options.selectedIndex = i + 1;
									}
								}
							);
						}
						fillCustomersAjax(); 
					</script>
				</div><br />';
        includeDatepicker(array('date_from', 'date_to'), true);
        echo '		
				<label>' . $this->l('From:') . ' </label>
				<div class="margin-form">
					<input type="text" size="20" id="date_from" name="date_from" value="' . ($this->getFieldValue($obj, 'date_from') ? htmlentities($this->getFieldValue($obj, 'date_from'), ENT_COMPAT, 'UTF-8') : date('Y-m-d H:i:s')) . '" /> <sup>*</sup>
					<p style="clear: both;">' . $this->l('Start date/time from which voucher can be used') . '<br />' . $this->l('Format: YYYY-MM-DD HH:MM:SS') . '</p>
				</div>
				<label>' . $this->l('To:') . ' </label>
				<div class="margin-form">
					<input type="text" size="20" id="date_to" name="date_to" value="' . ($this->getFieldValue($obj, 'date_to') ? htmlentities($this->getFieldValue($obj, 'date_to'), ENT_COMPAT, 'UTF-8') : date('Y') + 1 . date('-m-d H:i:s')) . '" /> <sup>*</sup>
					<p style="clear: both;">' . $this->l('End date/time at which voucher is no longer valid') . '<br />' . $this->l('Format: YYYY-MM-DD HH:MM:SS') . '</p>
				</div>
				<label>' . $this->l('Status:') . ' </label>
				<div class="margin-form">
					<input type="radio" name="active" id="active_on" value="1" ' . ($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="active" id="active_off" value="0" ' . (!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					<p>' . $this->l('Enable or disable voucher') . '</p>
				</div>
				<div class="margin-form">
					<input type="submit" value="' . $this->l('   Save   ') . '" name="submitAdd' . $this->table . '" class="button" />
				</div>
				<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
			</fieldset>
		</form>';
    }
开发者ID:Bruno-2M,项目名称:prestashop,代码行数:101,代码来源:AdminDiscounts.php


注:本文中的includeDatepicker函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。