function osc_cfg_set_credit_cards_checkbox_field($default, $key = null) { $OSCOM_PDO = Registry::get('PDO'); $name = empty($key) ? 'configuration_value' : 'configuration[' . $key . '][]'; $cc_array = array(); $Qcc = $OSCOM_PDO->prepare('select id, credit_card_name from :table_credit_cards where credit_card_status = :credit_card_status order by sort_order, credit_card_name'); $Qcc->bindInt(':credit_card_status', 1); $Qcc->execute(); while ($Qcc->fetch()) { $cc_array[] = array('id' => $Qcc->valueInt('id'), 'text' => $Qcc->value('credit_card_name')); } return HTML::checkboxField($name, $cc_array, explode(',', $default), null, '<br />'); }
<li><?php echo HTML::label(OSCOM::getDef('field_customer_telephone_number'), 'telephone', null, ACCOUNT_TELEPHONE > 0) . HTML::inputField('telephone', isset($osC_oiAddress) && $osC_oiAddress->exists('telephone') ? $osC_oiAddress->get('telephone') : null); ?> </li> <?php } if (ACCOUNT_FAX > -1) { ?> <li><?php echo HTML::label(OSCOM::getDef('field_customer_fax_number'), 'fax', null, ACCOUNT_FAX > 0) . HTML::inputField('fax', isset($osC_oiAddress) && $osC_oiAddress->exists('fax') ? $osC_oiAddress->get('fax') : null); ?> </li> <?php } if ($OSCOM_Customer->hasDefaultAddress() && (isset($_GET['Edit']) && $OSCOM_Customer->getDefaultAddressID() != $_GET['Edit'] || isset($_GET['Create']))) { ?> <li><?php echo HTML::checkboxField('primary', array(array('id' => 'on', 'text' => OSCOM::getDef('set_as_primary'))), false); ?> </li> <?php } ?> </ol>
</div> </div> <?php if (DISPLAY_PRIVACY_CONDITIONS == '1') { ?> <div class="moduleBox"> <h6><?php echo OSCOM::getDef('create_account_terms_heading'); ?> </h6> <div class="content"> <?php echo sprintf(OSCOM::getDef('create_account_terms_description'), OSCOM::getLink(null, 'Info', 'Privacy', 'AUTO')) . '<br /><br /><ol><li>' . HTML::checkboxField('privacy_conditions', array(array('id' => 1, 'text' => OSCOM::getDef('create_account_terms_confirm')))) . '</li></ol>'; ?> </div> </div> <?php } ?> <div class="submitFormButtons"> <span style="float: right;"><?php echo HTML::button(array('icon' => 'triangle-1-e', 'title' => OSCOM::getDef('button_continue'))); ?> </span> </div>
?> " method="post" onsubmit="return check_form();"> <?php if (DISPLAY_CONDITIONS_ON_CHECKOUT == '1') { ?> <div class="moduleBox"> <h6><?php echo OSCOM::getDef('order_conditions_title'); ?> </h6> <div class="content"> <?php echo sprintf(OSCOM::getDef('order_conditions_description'), OSCOM::getLink(null, 'Info', 'Conditions', 'AUTO')) . '<br /><br />' . HTML::checkboxField('conditions', array(array('id' => 1, 'text' => OSCOM::getDef('order_conditions_acknowledge'))), false); ?> </div> </div> <?php } ?> <div class="moduleBox"> <h6><?php echo OSCOM::getDef('billing_address_title'); ?> </h6> <div class="content">
<?php if ($new_customer) { echo '<h3>' . HTML::icon('new.png') . ' ' . OSCOM::getDef('action_heading_new_customer') . '</h3>'; } else { echo '<h3>' . HTML::icon('edit.png') . ' ' . $OSCOM_ObjectInfo->getProtected('customers_name') . '</h3>'; } ?> <fieldset> <?php if (ACCOUNT_NEWSLETTER == '1') { ?> <p><label for="newsletter"><?php echo OSCOM::getDef('field_newsletter_subscription'); ?> </label><?php echo HTML::checkboxField('newsletter', null, $new_customer ? null : $OSCOM_ObjectInfo->get('customers_newsletter') == '1'); ?> </p> <?php } ?> </fieldset> </div> </div>
<p><label for="pattern"><?php echo OSCOM::getDef('field_pattern'); ?> </label><?php echo HTML::inputField('pattern', $OSCOM_ObjectInfo->get('pattern')); ?> </p> <p><label for="sort_order"><?php echo OSCOM::getDef('field_sort_order'); ?> </label><?php echo HTML::inputField('sort_order', $OSCOM_ObjectInfo->get('sort_order')); ?> </p> <p><label for="credit_card_status"><?php echo OSCOM::getDef('field_status'); ?> </label><?php echo HTML::checkboxField('credit_card_status', '1', $OSCOM_ObjectInfo->get('credit_card_status')); ?> </p> </fieldset> <p><?php echo HTML::button(array('priority' => 'primary', 'icon' => 'check', 'title' => OSCOM::getDef('button_save'))) . ' ' . HTML::button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?> </p> </form> </div>
public function testCheckboxField() { $list_array = array(array('id' => 'one', 'text' => 'First'), array('id' => 'two', 'text' => 'Second'), array('id' => 'three', 'text' => 'Third')); $this->assertEquals('<input type="checkbox" name="selection" id="selection_1" value="one" /><label for="selection1" class="fieldLabel"> First</label> <input type="checkbox" name="selection" id="selection_2" value="two" checked="checked" /><label for="selection2" class="fieldLabel"> Second</label> <input type="checkbox" name="selection" id="selection_3" value="three" /><label for="selection3" class="fieldLabel"> Third</label>', HTML::checkboxField('selection', $list_array, 'two')); }
echo OSCOM::getDef('field_fax_number'); ?> </label><?php echo HTML::inputField('ab_fax'); ?> </p> <?php } ?> <p><label for="ab_default"><?php echo OSCOM::getDef('field_set_as_primary'); ?> </label><?php echo HTML::checkboxField('ab_default'); ?> </p> </fieldset> <p id="abSubmitButtonsNew"><?php echo HTML::button(array('type' => 'button', 'params' => 'onclick="processAddress();"', 'priority' => 'primary', 'icon' => 'plus', 'title' => OSCOM::getDef('button_add'))) . ' ' . HTML::button(array('type' => 'button', 'params' => 'onclick="cancelAddressForm();"', 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?> </p> <p id="abSubmitButtonsEdit"><?php echo HTML::button(array('type' => 'button', 'params' => 'data-abButtonType="henrysBucket"', 'priority' => 'primary', 'icon' => 'arrowrefresh-1-n', 'title' => OSCOM::getDef('button_update'))) . ' ' . HTML::button(array('type' => 'button', 'params' => 'onclick="cancelAddressForm();"', 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?> </p> </div> </div>
<h4><?php echo OSCOM::getDef('subsection_price'); ?></h4> <fieldset> <p><label for="variants_price_tax_class"><?php echo OSCOM::getDef('field_tax_class'); ?></label><?php echo HTML::selectMenu('variants_price_tax_class', $OSCOM_Application->getTaxClassesList(), null, 'onchange="updateGross(\'variants_price\');"'); ?></p> <p><label for="variants_price"><?php echo OSCOM::getDef('field_price_net'); ?></label><?php echo HTML::inputField('variants_price', null, 'onkeyup="updateGross(\'variants_price\')"'); ?></p> <p><label for="variants_price_gross"><?php echo OSCOM::getDef('field_price_gross'); ?></label><?php echo HTML::inputField('variants_price_gross', null, 'onkeyup="updateNet(\'variants_price\')"'); ?></p> </fieldset> <h4><?php echo OSCOM::getDef('subsection_data'); ?></h4> <fieldset> <p id="vstatus"><label for="variants_status"><?php echo OSCOM::getDef('field_status'); ?></label><?php echo HTML::radioField('variants_status', array(array('id' => '1', 'text' => OSCOM::getDef('status_enabled')), array('id' => '0', 'text' => OSCOM::getDef('status_disabled')))); ?></p> <p><label for="variants_model"><?php echo OSCOM::getDef('field_model'); ?></label><?php echo HTML::inputField('variants_model', null); ?></p> <p><label for="variants_quantity"><?php echo OSCOM::getDef('field_quantity'); ?></label><?php echo HTML::inputField('variants_quantity', null); ?></p> <p><label for="variants_weight"><?php echo OSCOM::getDef('field_weight'); ?></label><?php echo HTML::inputField('variants_weight', null, 'size="6"'). HTML::selectMenu('variants_weight_class', $OSCOM_Application->getWeightClassesList(), SHIPPING_WEIGHT_UNIT); ?></p> <p><label for="variants_default"><?php echo OSCOM::getDef('field_default'); ?></label><?php echo HTML::checkboxField('variants_default'); ?></p> </fieldset> <script> $(function() { $('#vstatus').buttonset(); }); </script> </td> </tr> </table> <p id="variantSubmitButtonsNew"><?php echo HTML::button(array('type' => 'button', 'params' => 'onclick="processVariantForm();"', 'priority' => 'primary', 'icon' => 'plus', 'title' => OSCOM::getDef('button_add'))) . ' ' . HTML::button(array('type' => 'button', 'params' => 'onclick="closeVariantForm();"', 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?></p> <p id="variantSubmitButtonsEdit"><?php echo HTML::button(array('type' => 'button', 'params' => 'data-vButtonType="henrysBucket"', 'priority' => 'primary', 'icon' => 'arrowrefresh-1-n', 'title' => OSCOM::getDef('button_update'))) . ' ' . HTML::button(array('type' => 'button', 'params' => 'onclick="closeVariantForm();"', 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?></p> </div>
$Qcategories = $OSCOM_PDO->prepare('select categories_id from :table_products_to_categories where products_id = :products_id'); $Qcategories->bindInt(':products_id', $OSCOM_ObjectInfo->getInt('products_id')); $Qcategories->execute(); while ( $Qcategories->fetch() ) { $product_categories_array[] = $Qcategories->valueInt('categories_id'); } } $assignedCategoryTree = new CategoryTree(); $assignedCategoryTree->setBreadcrumbUsage(false); $assignedCategoryTree->setSpacerString(' ', 5); foreach ($assignedCategoryTree->getArray() as $value) { echo ' <tr>' . "\n" . ' <td width="50" align="center">' . HTML::checkboxField('categories[]', $value['id'], in_array($value['id'], $product_categories_array), 'id="categories_' . $value['id'] . '"') . '</td>' . "\n" . ' <td><a href="#" onclick="document.product.categories_' . $value['id'] . '.checked=!document.product.categories_' . $value['id'] . '.checked;">' . $value['title'] . '</a></td>' . "\n" . ' </tr>' . "\n"; } ?> </tbody> </table> <script> $('#productCategoriesDataTable tbody tr:odd').addClass('alt'); $('#productCategoriesDataTable tbody tr').each(function(i) { $(this).hover( function() { $(this).addClass('mouseOver'); }, function() { $(this).removeClass('mouseOver'); }); }); </script>
<ol> <li> <?php echo HTML::label(OSCOM::getDef('field_search_categories'), 'category'); $OSCOM_CategoryTree->setSpacerString(' ', 2); $categories_array = array(array('id' => '', 'text' => OSCOM::getDef('filter_all_categories'))); foreach ($OSCOM_CategoryTree->buildBranchArray(0) as $category) { $categories_array[] = array('id' => $category['id'], 'text' => $category['title']); } echo HTML::selectMenu('category', $categories_array); ?> </li> <li><?php echo HTML::checkboxField('recursive', array(array('id' => '1', 'text' => OSCOM::getDef('field_search_recursive'))), true); ?> </li> <li> <?php echo HTML::label(OSCOM::getDef('field_search_manufacturers'), 'manufacturer'); $manufacturers_array = array(array('id' => '', 'text' => OSCOM::getDef('filter_all_manufacturers'))); $Qmanufacturers = $OSCOM_PDO->query('select manufacturers_id, manufacturers_name from :table_manufacturers order by manufacturers_name'); $Qmanufacturers->execute(); while ($Qmanufacturers->fetch()) { $manufacturers_array[] = array('id' => $Qmanufacturers->valueInt('manufacturers_id'), 'text' => $Qmanufacturers->value('manufacturers_name')); } echo HTML::selectMenu('manufacturer', $manufacturers_array); ?>
<form name="account_newsletter" action="<?php echo OSCOM::getLink(null, null, 'Newsletters&Process', 'SSL'); ?> " method="post"> <div class="moduleBox"> <h6><?php echo OSCOM::getDef('newsletter_subscriptions_heading'); ?> </h6> <div class="content"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="30"><?php echo HTML::checkboxField('newsletter_general', '1', $Qnewsletter->value('customers_newsletter')); ?> </td> <td><b><?php echo HTML::label(OSCOM::getDef('newsletter_general'), 'newsletter_general'); ?> </b></td> </tr> <tr> <td width="30"> </td> <td><?php echo OSCOM::getDef('newsletter_general_description'); ?> </td> </tr> </table>
<div style="padding-top: 30px;"> <p><?php echo OSCOM::getDef('order_processed_successfully'); ?> </p> <p> <?php if ($OSCOM_Customer->isLoggedOn()) { if ($Qglobal->valueInt('global_product_notifications') != 1) { echo OSCOM::getDef('add_selection_to_product_notifications') . '<br /><p class="productsNotifications">'; $products_displayed = array(); foreach ($products_array as $product) { if (!in_array($product['id'], $products_displayed)) { echo HTML::checkboxField('notify[]', $product['id']) . ' ' . $product['text'] . '<br />'; $products_displayed[] = $product['id']; } } } else { echo sprintf(OSCOM::getDef('view_order_history'), OSCOM::getLink(null, 'Account', null, 'SSL'), OSCOM::getLink(null, 'Account', 'Orders', 'SSL')) . '<br /><br />' . sprintf(OSCOM::getDef('contact_store_owner'), OSCOM::getLink(null, 'Info', 'Contact')); } } ?> </p> <h2 style="text-align: center;"><?php echo OSCOM::getDef('thanks_for_shopping_with_us'); ?> </h2>
<p><?php echo OSCOM::getDef('introduction_export_language'); ?> </p> <fieldset> <p>(<a href="javascript:selectAllFromPullDownMenu('groups');"><u><?php echo OSCOM::getDef('select_all'); ?> </u></a> | <a href="javascript:resetPullDownMenuSelection('groups');"><u><?php echo OSCOM::getDef('select_none'); ?> </u></a>)<br /><?php echo HTML::selectMenu('groups[]', $groups_array, array('account', 'checkout', 'general', 'index', 'info', 'order', 'products', 'search'), 'id="groups" size="10" multiple="multiple"'); ?> </p> <p><?php echo HTML::checkboxField('include_data', array(array('id' => '', 'text' => OSCOM::getDef('field_export_with_data'))), true); ?> </p> </fieldset> <p><?php echo HTML::button(array('priority' => 'primary', 'icon' => 'triangle-1-nw', 'title' => OSCOM::getDef('button_export'))) . ' ' . HTML::button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?> </p> </form> </div>
<td colspan="2"><?php echo OSCOM::getDef('newsletter_product_notifications_products_description'); ?> </td> </tr> <?php $Qproducts = $OSCOM_Customer->getProductNotifications(); $counter = 0; while ($Qproducts->next()) { $counter++; ?> <tr> <td width="30"><?php echo HTML::checkboxField('products[' . $counter . ']', $Qproducts->valueInt('products_id'), true); ?> </td> <td><b><?php echo HTML::label($Qproducts->value('products_name'), 'products[' . $counter . ']'); ?> </b></td> </tr> <?php } ?> </table> <?php
?> </td> </tr> <tr> <td class="inputField"><?php echo OSCOM::getDef('param_time_zone') . '<br />' . HTML::timeZoneSelectMenu('CFG_TIME_ZONE', ini_get('date.timezone') ?: null); ?> </td> <td class="inputDescription"><?php echo OSCOM::getDef('param_time_zone_description'); ?> </td> </tr> <tr> <td class="inputField"><?php echo HTML::checkboxField('DB_INSERT_SAMPLE_DATA', 'true', true) . ' ' . OSCOM::getDef('param_database_import_sample_data'); ?> </td> <td class="inputDescription"><?php echo OSCOM::getDef('param_database_import_sample_data_description'); ?> </td> </tr> </table> <p align="right"><?php echo HTML::button(array('priority' => 'primary', 'icon' => 'triangle-1-e', 'title' => OSCOM::getDef('button_continue'))) . ' ' . HTML::button(array('href' => OSCOM::getLink(null, OSCOM::getDefaultSiteApplication()), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?> </p> <?php
<p><label for="pattern"><?php echo OSCOM::getDef('field_pattern'); ?> </label><?php echo HTML::inputField('pattern'); ?> </p> <p><label for="sort_order"><?php echo OSCOM::getDef('field_sort_order'); ?> </label><?php echo HTML::inputField('sort_order'); ?> </p> <p><label for="credit_card_status"><?php echo OSCOM::getDef('field_status'); ?> </label><?php echo HTML::checkboxField('credit_card_status', '1'); ?> </p> </fieldset> <p><?php echo HTML::button(array('priority' => 'primary', 'icon' => 'check', 'title' => OSCOM::getDef('button_save'))) . ' ' . HTML::button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?> </p> </form> </div>
echo OSCOM::getDef('field_date_of_birth'); ?> </label><?php echo HTML::inputField('dob', $new_customer ? null : DateTime::fromUnixTimestamp(DateTime::getTimestamp($OSCOM_ObjectInfo->get('customers_dob')), 'Y-m-d')); ?> </p> <script>$('#dob').datepicker({dateFormat: 'yy-mm-dd', changeMonth: true, changeYear: true, yearRange: '-100:+0'});</script> <?php } ?> <p><label for="email_address"><?php echo OSCOM::getDef('field_email_address'); ?> </label><?php echo HTML::inputField('email_address', $new_customer ? null : $OSCOM_ObjectInfo->get('customers_email_address')); ?> </p> <p><label for="status"><?php echo OSCOM::getDef('field_status'); ?> </label><?php echo HTML::checkboxField('status', null, $new_customer ? true : $OSCOM_ObjectInfo->get('customers_status') == '1'); ?> </p> </fieldset> </div> </div>
?> </th> <th align="center" width="20"><?php echo HTML::checkboxField('batchFlag', null, null, 'onclick="flagCheckboxes(this);"'); ?> </th> </tr> </thead> <tfoot> <tr> <th align="right" colspan="4"><?php echo HTML::submitImage(HTML::iconRaw('trash.png'), OSCOM::getDef('icon_trash'), 'onclick="document.batch.action=\'' . OSCOM::getLink(null, null, 'BatchDelete') . '\';"'); ?> </th> <th align="center" width="20"><?php echo HTML::checkboxField('batchFlag', null, null, 'onclick="flagCheckboxes(this);"'); ?> </th> </tr> </tfoot> <tbody> </tbody> </table> </form> <div style="padding: 2px;"> <span id="dataTableLegend"><?php echo '<b>' . OSCOM::getDef('table_action_legend') . '</b> ' . HTML::icon('edit.png') . ' ' . OSCOM::getDef('icon_edit') . ' ' . HTML::icon('trash.png') . ' ' . OSCOM::getDef('icon_trash'); ?> </span>
<form name="batch" action="#" method="post"> <table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable" id="productsDataTable"> <thead> <tr> <th><?php echo OSCOM::getDef('table_heading_products'); ?></th> <th><?php echo OSCOM::getDef('table_heading_price'); ?></th> <th><?php echo OSCOM::getDef('table_heading_quantity'); ?></th> <th width="150"><?php echo OSCOM::getDef('table_heading_action'); ?></th> <th align="center" width="20"><?php echo HTML::checkboxField('batchFlag', null, null, 'onclick="flagCheckboxes(this);"'); ?></th> </tr> </thead> <tfoot> <tr> <th align="right" colspan="4"><?php echo HTML::submitImage(HTML::iconRaw('copy.png'), OSCOM::getDef('icon_copy'), 'onclick="document.batch.action=\'' . OSCOM::getLink(null, null, 'BatchCopy&cid=' . $OSCOM_Application->getCurrentCategoryID()) . '\';"') . ' <a href="#" onclick="$(\'#dialogBatchDeleteConfirm\').dialog(\'open\'); return false;">' . HTML::icon('trash.png') . '</a>'; ?></th> <th align="center" width="20"><?php echo HTML::checkboxField('batchFlag', null, null, 'onclick="flagCheckboxes(this);"'); ?></th> </tr> </tfoot> <tbody> </tbody> </table> </form> <div style="padding: 2px;"> <span id="dataTableLegend"><?php echo '<b>' . OSCOM::getDef('table_action_legend') . '</b> ' . HTML::icon('edit.png') . ' ' . OSCOM::getDef('icon_edit') . ' ' . HTML::icon('copy.png') . ' ' . OSCOM::getDef('icon_copy') . ' ' . HTML::icon('trash.png') . ' ' . OSCOM::getDef('icon_trash'); ?></span> <span id="batchPullDownMenu"></span> </div> <script> var moduleParamsCookieName = 'oscom_admin_' + pageModule;