public function get_input_lis()
 {
     $input_lis = array();
     $visible_fields = $this->get_visible_fields();
     $row_renderer = $this->row->get_renderer();
     foreach ($visible_fields as $visible_field) {
         $input_li = new HTMLTags_LI();
         $l_t_l_o_ws = Formatting_ListOfWords::get_list_of_words_for_string($visible_field->get_name(), '_');
         $label_text = $l_t_l_o_ws->get_words_as_capitalised_string();
         $input_label = new HTMLTags_Label($label_text);
         $input_label->set_attribute_str('for', $visible_field->get_name());
         #$input_label->set_attribute_str('id', $name);
         $input_li->append_tag_to_content($input_label);
         #$field_renderer = $visible_field->get_renderer();
         #
         #$input_tag = $field_renderer->get_form_input();
         #
         #echo '$visible_field->get_name(): ' . $visible_field->get_name() . "\n";
         #
         #$input_tag->set_value(
         #    $this->row->get($visible_field->get_name())
         #);
         $input_tag = $row_renderer->get_input_tag_for_field($visible_field);
         $input_li->append_tag_to_content($input_tag);
         $input_lis[] = $input_li;
     }
     return $input_lis;
 }
 public function get_input_lis()
 {
     $input_lis = array();
     $visible_fields = $this->get_visible_fields();
     foreach ($visible_fields as $visible_field) {
         if ($visible_field->get_name() != 'id') {
             $input_li = new HTMLTags_LI();
             $l_t_l_o_ws = Formatting_ListOfWords::get_list_of_words_for_string($visible_field->get_name(), '_');
             $label_text = $l_t_l_o_ws->get_words_as_capitalised_string();
             $input_label = new HTMLTags_Label($label_text);
             $input_label->set_attribute_str('for', $visible_field->get_name());
             #$input_label->set_attribute_str('id', $visible_field->get_name());
             $input_li->append_tag_to_content($input_label);
             $field_renderer = $visible_field->get_renderer();
             $input_tag = $field_renderer->get_form_input();
             #print_r($visible_field);
             if ($visible_field->has_default()) {
                 $input_tag->set_value($visible_field->get_default());
             }
             $input_li->append_tag_to_content($input_tag);
             $input_lis[] = $input_li;
         }
     }
     return $input_lis;
 }
 public function add_input_tag($name, HTMLTags_InputTag $input_tag, $label_text = null, $post_content = '')
 {
     #echo "In HTMLTags_SimpleOLForm::add_input_tag(...)\n";
     $input_li = new HTMLTags_LI();
     if (!isset($label_text)) {
         $l_t_l_o_ws = Formatting_ListOfWords::get_list_of_words_for_string($name, '_');
         $label_text = $l_t_l_o_ws->get_words_as_capitalised_string();
         #    echo "\$label_text: $label_text\n";
         #} else {
         #    echo "\$label_text: $label_text\n";
     }
     #echo "After if\n";
     $input_label = new HTMLTags_Label($label_text);
     $input_label->set_attribute_str('for', $name);
     #$input_label->set_attribute_str('id', $name);
     $input_li->append_tag_to_content($input_label);
     $input_li->append_tag_to_content($input_tag);
     if (strlen($post_content) > 0) {
         $input_li->append_str_to_content($post_content);
     }
     $input_msg_box = new HTMLTags_Span();
     $input_msg_box->set_attribute_str('id', $name . 'msg');
     $input_msg_box->set_attribute_str('class', 'rules');
     $input_li->append_tag_to_content($input_msg_box);
     if (count($this->input_lis) == 0) {
         $this->first_input_name = $name;
     }
     $this->input_lis[] = $input_li;
 }
 public function get_product_currency_price_editing_form($product_id, $redirect_script_url, $cancel_href)
 {
     $product_currency_prices_table = $this->get_element();
     $database = $product_currency_prices_table->get_database();
     $products_table = $database->get_table('hpi_shop_products');
     $currencies_table = $database->get_table('hpi_shop_currencies');
     $product = $products_table->get_row_by_id($product_id);
     $product_currency_price_editing_form = new HTMLTags_SimpleOLForm('product_currency_price_editing');
     $product_currency_price_editing_form->set_action($redirect_script_url);
     $legend_text = '';
     $legend_text .= 'Edit prices for ';
     $legend_text .= $product->get_name();
     $product_currency_price_editing_form->set_legend_text($legend_text);
     $currencies = $currencies_table->get_all_rows();
     foreach ($currencies as $currency) {
         /*
          * The price
          */
         $conditions = array();
         $conditions['product_id'] = $product_id;
         $conditions['currency_id'] = $currency->get_id();
         $product_currency_price = $product_currency_prices_table->get_rows_where($conditions);
         if (count($product_currency_price) > 0) {
             $current_price = $product_currency_price[0]->get_price();
         } else {
             $current_price = 0;
         }
         $input_li = new HTMLTags_LI();
         $input_label_text = '';
         $input_label_text .= 'Price in ';
         $input_label_text .= $currency->get_name();
         $input_label_text .= ' (';
         $input_label_text .= $currency->get_symbol();
         $input_label_text .= ')';
         $input_label_title = '';
         $input_label_title .= $currency->get_id();
         $input_label = new HTMLTags_Label($input_label_text);
         $input_label->set_attribute_str('for', $input_label_title);
         $input_li->append_tag_to_content($input_label);
         $input = new HTMLTags_Input();
         $input->set_attribute_str('type', 'text');
         $input->set_attribute_str('name', $input_label_title);
         $input->set_value($current_price);
         $input_li->append_tag_to_content($input);
         $product_currency_price_editing_form->add_input_li($input_li);
     }
     /*
      * The add button.
      */
     $product_currency_price_editing_form->set_submit_text('Edit');
     $product_currency_price_editing_form->set_cancel_location($cancel_href);
     return $product_currency_price_editing_form;
 }
 private function get_status_radio_button_li($name)
 {
     $input_tag = new HTMLTags_Input();
     $input_tag->set_attribute_str('type', 'radio');
     $input_tag->set_attribute_str('name', 'status');
     $input_tag->set_attribute_str('id', $name);
     $input_tag->set_attribute_str('value', $name);
     if ($this->drama->get_status() == $name) {
         $input_tag->set_attribute_str('checked', 'checked');
     }
     $input_li = new HTMLTags_LI();
     $input_li->append_tag_to_content($input_tag);
     $input_label = new HTMLTags_Label(ucfirst($name));
     $input_label->set_attribute_str('for', $name);
     $input_label->set_attribute_str('class', 'radio');
     $input_li->append_tag_to_content($input_label);
     return $input_li;
 }
  */
 if (count($field_renderer_files) > 0) {
     $field_renderers_heading = new HTMLTags_Heading(3, 'Field Renderers');
     $d_c_n_c_field_set->append_tag_to_content($field_renderers_heading);
     $table_names = array_keys($field_renderer_files);
     $field_renderers_list = new HTMLTags_OL();
     foreach ($table_names as $table_name) {
         $table_li = new HTMLTags_LI();
         $table_name_heading = new HTMLTags_Heading(4, $table_name);
         $table_li->append_tag_to_content($table_name_heading);
         $table_fields_list = new HTMLTags_OL();
         $field_names = array_keys($field_renderer_files[$table_name]);
         foreach ($field_names as $field_name) {
             $field_renderer_li = new HTMLTags_LI();
             $input_name = 'field-' . $table_name . '-' . $field_name . '-renderer';
             $field_renderer_select_label = new HTMLTags_Label($field_name);
             $field_renderer_select_label->set_attribute_str('for', $input_name);
             $field_renderer_li->append_tag_to_content($field_renderer_select_label);
             $field_renderer_select = new HTMLTags_Select();
             $field_renderer_select->set_attribute_str('id', $input_name);
             $field_renderer_select->set_attribute_str('name', $input_name);
             $current_field_renderer_class_file = null;
             if (isset($database_class_name_file)) {
                 if ($database_class_name_file->has_field_renderer_class_file($table_name, $field_name)) {
                     $current_field_renderer_class_file = $database_class_name_file->get_field_renderer_class_file($table_name, $field_name);
                 }
             }
             foreach ($field_renderer_files[$table_name][$field_name] as $field_renderer_class_file) {
                 $field_renderer_class_relative_filename = $field_renderer_class_file->get_name_relative_to_dir(PROJECT_ROOT);
                 $option = new HTMLTags_Option($field_renderer_class_file->get_php_class_name());
                 $option->set_attribute_str('value', $field_renderer_class_relative_filename);
$input_email->set_attribute_str('id', 'email');
$input_email->set_attribute_str('name', 'email');
$input_email->set_attribute_str('type', 'text');
//    if ($_SESSION['email']) {
//        echo $_SESSION['email'];
//    }
$input_email->set_attribute_str('value', isset($_SESSION['email']) ? $_SESSION['email'] : '');
//" size="17" />
#$input_email->set_attribute_str('size', 17);
//        <br>
$li_email->append_tag_to_content($input_email);
$ul_inputs->append_tag_to_content($li_email);
if (isset($_GET['email_incorrect'])) {
    $li_force_email = new HTMLTags_LI();
    //<label for="force_email">Force email:</label>
    $label_force_email = new HTMLTags_Label('Force email: ');
    $label_force_email->set_attribute_str('for', 'force_email');
    $li_force_email->append_tag_to_content($label_force_email);
    //<input
    //    id="force_email"
    //    name="force_email"
    //    type="checkbox"
    ///>
    $input_force_email = new HTMLTags_Input();
    $input_force_email->set_attribute_str('id', 'force_email');
    $input_force_email->set_attribute_str('name', 'force_email');
    $input_force_email->set_attribute_str('type', 'checkbox');
    $li_force_email->append_tag_to_content($input_force_email);
    //<br>
    $ul_inputs->append_tag_to_content($li_force_email);
}
 /**
  * Allows the customer to search for products by reducing the search
  * criteria using select drop-downs.
  *
  * Used in:
  * 	- The secondary navigation div.
  *
  * Changes:
  * 	- RFI 2007-12-13
  * 		Instead of going to separate pages for product categories and tags,
  * 		the customer is taken to the products page where the selection criteria
  * 		for products is constrained appropriately.
  */
 public function get_public_tag_selection_div()
 {
     $product_tag = $this->get_element();
     $tag = $product_tag->get_tag();
     $div = new HTMLTags_Div();
     $div->set_attribute_str('id', $tag);
     $div->set_attribute_str('class', 'tag-selection');
     $heading = new HTMLTags_Heading(3, ucfirst($tag));
     $tag_link_href = new HTMLTags_URL();
     $tag_link_file = '/?section=plug-ins&module=shop&page=products&type=html&tag=' . $tag;
     $tag_link_href->set_file($tag_link_file);
     $tag_link = new HTMLTags_A();
     $tag_link->set_href($tag_link_href);
     $tag_link->append_tag_to_content($heading);
     $div->append_tag_to_content($tag_link);
     /*
      * Brand Select Form
      */
     $brand_form = new MashShop_TagSelectionForm();
     $brand_form->set_attribute_str('id', 'brand');
     #$brand_form->add_hidden_input('section', 'plug-ins');
     #$brand_form->add_hidden_input('module', 'shop');
     #$brand_form->add_hidden_input('page', 'product-brand');
     #$brand_form->add_hidden_input('type', 'html');
     $brand_form = self::add_hidden_inputs_for_results_page_get_vars_to_tag_selection_form($brand_form);
     $brand_form->add_hidden_input('tag', $tag);
     $brand_action = new HTMLTags_URL();
     $brand_action->set_file('/');
     $brand_form->set_action($brand_action);
     $brand_form->set_attribute_str('name', 'brand');
     $brand_form->set_attribute_str('method', 'GET');
     $form_ul = new HTMLTags_UL();
     $brand_li = new HTMLTags_LI();
     $brand_label = new HTMLTags_Label('Brands:');
     $brand_label->set_attribute_str('for', 'product_brand_id');
     $brand_li->append_tag_to_content($brand_label);
     $brand_select_box = $this->get_brand_select();
     $brand_li->append_tag_to_content($brand_select_box);
     $form_ul->append_tag_to_content($brand_li);
     $submit_button = new HTMLTags_Input();
     $submit_button->set_attribute_str('type', 'submit');
     $submit_button->set_attribute_str('value', 'Go');
     $submit_button->set_attribute_str('class', 'submit');
     $submit_li = new HTMLTags_LI();
     $submit_li->append_tag_to_content($submit_button);
     $form_ul->append_tag_to_content($submit_li);
     $brand_form->append_tag_to_content($form_ul);
     $div->append_tag_to_content($brand_form);
     $clear_div = new HTMLTags_Div();
     $clear_div->set_attribute_str('style', 'clear:both;');
     $div->append_tag_to_content($clear_div);
     /*
      * category Select Form
      */
     $category_form = new MashShop_TagSelectionForm();
     $category_form->set_attribute_str('id', 'category');
     #$category_form->add_hidden_input('section', 'plug-ins');
     #$category_form->add_hidden_input('module', 'shop');
     #$category_form->add_hidden_input('page', 'product-category');
     #$category_form->add_hidden_input('type', 'html');
     $category_form = self::add_hidden_inputs_for_results_page_get_vars_to_tag_selection_form($category_form);
     $category_form->add_hidden_input('tag', $tag);
     $category_action = new HTMLTags_URL();
     $category_action->set_file('/');
     $category_form->set_action($category_action);
     $category_form->set_attribute_str('name', 'category');
     $category_form->set_attribute_str('method', 'GET');
     $form_ul = new HTMLTags_UL();
     $category_li = new HTMLTags_LI();
     $category_label = new HTMLTags_Label('Products:');
     $category_label->set_attribute_str('for', 'product_category_id');
     $category_li->append_tag_to_content($category_label);
     $category_select_box = $this->get_category_select();
     $category_li->append_tag_to_content($category_select_box);
     $form_ul->append_tag_to_content($category_li);
     $submit_button = new HTMLTags_Input();
     $submit_button->set_attribute_str('type', 'submit');
     $submit_button->set_attribute_str('value', 'Go');
     $submit_button->set_attribute_str('class', 'submit');
     $submit_li = new HTMLTags_LI();
     $submit_li->append_tag_to_content($submit_button);
     $form_ul->append_tag_to_content($submit_li);
     $category_form->append_tag_to_content($form_ul);
     $div->append_tag_to_content($category_form);
     $div->append_tag_to_content($clear_div);
     return $div;
 }
 public function get_embed_form()
 {
     $embed_form = new HTMLTags_Form();
     $embed_form->set_attribute_str('name', 'embedForm');
     $embed_form->set_attribute_str('id', 'embedForm');
     $embed_label = new HTMLTags_Label('Embed Code:');
     $embed_label->set_attribute_str('for', 'embed_code');
     $embed_form->append_tag_to_content($embed_label);
     $embed_input = new HTMLTags_Input();
     $embed_input->set_attribute_str('name', 'embed_code');
     $embed_input->set_attribute_str('class', 'embedField');
     $embed_input->set_attribute_str('value', $this->get_embed_code());
     $embed_input->set_attribute_str('onclick', 'javascript:document.embedForm.embed_code.focus();document.embedForm.embed_code.select();');
     $embed_input->set_attribute_str('readonly', 'true');
     $embed_input->set_attribute_str('type', 'text');
     $embed_form->append_tag_to_content($embed_input);
     return $embed_form;
 }
foreach (array_keys($get_vars) as $key) {
    $hidden_input = new HTMLTags_Input();
    $hidden_input->set_attribute_str('type', 'hidden');
    $hidden_input->set_attribute_str('name', $key);
    $hidden_input->set_attribute_str('value', $get_vars[$key]);
    $query_form->append_tag_to_content($hidden_input);
}
/*
 * A list to store the inputs.
 */
$form_ul = new HTMLTags_UL();
/*
 * The query input.
 */
$query_li = new HTMLTags_LI();
$query_label = new HTMLTags_Label('Query');
$query_label->set_attribute_str('for', 'query');
$query_li->append_tag_to_content($query_label);
$query_input = new HTMLTags_TextArea();
$query_input->set_attribute_str('id', 'query');
$query_input->set_attribute_str('name', 'query');
if (isset($_GET['query'])) {
    $query_input->append_str_to_content(stripcslashes($_GET['query']));
}
$query_input->set_attribute_str('cols', 72);
$query_input->set_attribute_str('rows', 15);
$query_li->append_tag_to_content($query_input);
$form_ul->add_li($query_li);
/*
 * The submit button.
 */
  * The order status selecting form.
  * -------------------------------------------------------------------------
  */
 $order_status_selecting_form = new HTMLTags_Form();
 $order_status_selecting_form->set_attribute_str('name', 'order_status_selecting');
 $order_status_selecting_form->set_attribute_str('method', 'GET');
 $order_status_selecting_form->set_attribute_str('class', 'table-select-form');
 $order_status_selecting_action = clone $current_page_url;
 //        $order_status_selecting_action->set_get_variable('status');
 $order_status_selecting_form->set_action(new HTMLTags_URL('/'));
 $inputs_ol = new HTMLTags_OL();
 /*
  * Select the status.
  */
 $status_li = new HTMLTags_LI();
 $status_label = new HTMLTags_Label('Order Status');
 $status_label->set_attribute_str('for', 'status');
 $status_li->append_tag_to_content($status_label);
 $status_select = new HTMLTags_Select();
 $status_select->set_attribute_str('id', 'status');
 $status_select->set_attribute_str('name', 'status');
 //        $possible_status = $status_table->get_all_rows('firm_name', 'ASC');
 $all_statuses_option = new HTMLTags_Option('all');
 $all_statuses_option->set_attribute_str('value', 'all');
 if (isset($_GET['status'])) {
     if ($_GET['status'] == 'all') {
         $all_statuses_option->set_attribute_str('selected');
     }
 }
 $status_select->add_option($all_statuses_option);
 $status_field = $orders_table->get_field('status');
 public static function render_body_form_add_email()
 {
     $form_email_adding = new HTMLTags_Form();
     /*
      * Form altered by RFI 2007-07-13
      */
     #$form_action = new HTMLTags_URL();
     #
     #$form_action->set_file('/');
     #
     #$form_action->set_get_variable('section', 'plug-ins');
     #$form_action->set_get_variable('module', 'mailing-list');
     #$form_action->set_get_variable('page', 'sign-up');
     #$form_action->set_get_variable('type', 'redirect-script');
     #$form_action->set_get_variable('add_person');
     #$form_action->set_get_variable('return_to', urlencode('/?section=project-specific&page=sign-up'));
     $form_action = MailingList_SignUpURLFactory::get_email_adding_redirect_script();
     #echo 'action="' . $form_action->get_as_string() . "\"\n";
     $form_email_adding->set_action($form_action);
     $form_email_adding->set_attribute_str('method', 'POST');
     //    method="POST"
     //>
     $ul_inputs = new HTMLTags_UL();
     $li_name = new HTMLTags_LI();
     //        <label for="name">Name:</label>
     $label_name = new HTMLTags_Label('Name: ');
     $label_name->set_attribute_str('for', 'name');
     $li_name->append_tag_to_content($label_name);
     //	<input class="name" name="name" type="text" id="name" value="
     $input_name = new HTMLTags_Input();
     $input_name->set_attribute_str('id', 'name');
     $input_name->set_attribute_str('name', 'name');
     $input_name->set_attribute_str('type', 'text');
     //    if ($_SESSION['name']) {
     //        echo $_SESSION['name'];
     //    }
     $input_name->set_attribute_str('value', isset($_SESSION['name']) ? $_SESSION['name'] : '');
     //" size="17" />
     #$input_name->set_attribute_str('size', 17);
     //        <br />
     $li_name->append_tag_to_content($input_name);
     $ul_inputs->add_li($li_name);
     //
     $li_email = new HTMLTags_LI();
     //	<label for="name">Email:</label>
     $label_email = new HTMLTags_Label('Email: ');
     $label_email->set_attribute_str('for', 'email');
     $li_email->append_tag_to_content($label_email);
     //	<input class="email" name="email" type="text" id="name" value="
     $input_email = new HTMLTags_Input();
     $input_email->set_attribute_str('id', 'email');
     $input_email->set_attribute_str('name', 'email');
     $input_email->set_attribute_str('type', 'text');
     //    if ($_SESSION['email']) {
     //        echo $_SESSION['email'];
     //    }
     $input_email->set_attribute_str('value', isset($_SESSION['email']) ? $_SESSION['email'] : '');
     //" size="17" />
     #$input_email->set_attribute_str('size', 17);
     //        <br>
     $li_email->append_tag_to_content($input_email);
     $ul_inputs->append_tag_to_content($li_email);
     if (isset($_GET['email_incorrect'])) {
         $li_force_email = new HTMLTags_LI();
         //<label for="force_email">Force email:</label>
         $label_force_email = new HTMLTags_Label('Force email: ');
         $label_force_email->set_attribute_str('for', 'force_email');
         $li_force_email->append_tag_to_content($label_force_email);
         //<input
         //    id="force_email"
         //    name="force_email"
         //    type="checkbox"
         ///>
         $input_force_email = new HTMLTags_Input();
         $input_force_email->set_attribute_str('id', 'force_email');
         $input_force_email->set_attribute_str('name', 'force_email');
         $input_force_email->set_attribute_str('type', 'checkbox');
         $li_force_email->append_tag_to_content($input_force_email);
         //<br>
         $ul_inputs->append_tag_to_content($li_force_email);
     }
     $form_email_adding->append_tag_to_content($ul_inputs);
     $li_submit = new HTMLTags_LI();
     #    <input class="submit" type="submit" name="Submit" value="Submit">
     $input_submit = new HTMLTags_Input();
     $input_submit->set_attribute_str('id', 'submit');
     $input_submit->set_attribute_str('name', 'submit');
     $input_submit->set_attribute_str('class', 'submit');
     $input_submit->set_attribute_str('type', 'submit');
     $input_submit->set_attribute_str('value', 'Submit');
     $li_submit->append_tag_to_content($input_submit);
     $ul_inputs->append_tag_to_content($li_submit);
     //</form>
     echo $form_email_adding->get_as_string();
 }
 public function get_supplier_shipping_price_editing_form($supplier_id, $product_category_id, $redirect_script_url, $cancel_href)
 {
     $supplier_shipping_prices_table = $this->get_element();
     $database = $supplier_shipping_prices_table->get_database();
     $customer_regions_table = $database->get_table('hpi_shop_customer_regions');
     $suppliers_table = $database->get_table('hpi_shop_suppliers');
     $supplier = $suppliers_table->get_row_by_id($supplier_id);
     $product_categories_table = $database->get_table('hpi_shop_product_categories');
     $product_category = $product_categories_table->get_row_by_id($product_category_id);
     $supplier_shipping_price_editing_form = new HTMLTags_SimpleOLForm('supplier_shipping_price_editing');
     $supplier_shipping_price_editing_form->set_action($redirect_script_url);
     $legend_text = '';
     $legend_text .= 'Edit&nbsp;';
     $legend_text .= $supplier->get_name();
     $legend_text .= "'s shipping prices for&nbsp;";
     $legend_text .= $product_category->get_name();
     $supplier_shipping_price_editing_form->set_legend_text($legend_text);
     $customer_regions = $customer_regions_table->get_all_rows();
     foreach ($customer_regions as $customer_region) {
         $price_id = $customer_region->get_id();
         $conditions = array();
         $conditions['customer_region_id'] = $customer_region->get_id();
         $conditions['product_category_id'] = $product_category_id;
         $conditions['supplier_id'] = $supplier_id;
         $supplier_shipping_prices = $supplier_shipping_prices_table->get_rows_where($conditions);
         if (count($supplier_shipping_prices) > 0) {
             $current_first_price = $supplier_shipping_prices[0]->get_first_price();
             $current_additional_price = $supplier_shipping_prices[0]->get_additional_price();
         } else {
             $current_first_price = 0;
             $current_additional_price = 0;
         }
         /*
          * The first_price
          */
         $input_li = new HTMLTags_LI();
         $currency = $customer_region->get_currency();
         $input_label_text = '';
         $input_label_text .= 'Price of first item to&nbsp;';
         $input_label_text .= $customer_region->get_name();
         $input_label_text .= '&nbsp;(';
         $input_label_text .= $currency->get_symbol();
         $input_label_text .= ')';
         $input_label_title = 'first_price_';
         $input_label_title .= $customer_region->get_id();
         $input_label = new HTMLTags_Label($input_label_text);
         $input_label->set_attribute_str('for', $input_label_title);
         $input_li->append_tag_to_content($input_label);
         $input = new HTMLTags_Input();
         $input->set_attribute_str('type', 'text');
         $input->set_attribute_str('name', $input_label_title);
         $input->set_value($current_first_price);
         $input_li->append_tag_to_content($input);
         $supplier_shipping_price_editing_form->add_input_li($input_li);
         /*
          * The additional_price
          */
         $input_li = new HTMLTags_LI();
         $currency = $customer_region->get_currency();
         $input_label_text = '';
         $input_label_text .= 'Price of each additional item to&nbsp;';
         $input_label_text .= $customer_region->get_name();
         $input_label_text .= '&nbsp;(';
         $input_label_text .= $currency->get_symbol();
         $input_label_text .= ')';
         $input_label_title = 'additional_price_';
         $input_label_title .= $customer_region->get_id();
         $input_label = new HTMLTags_Label($input_label_text);
         $input_label->set_attribute_str('for', $input_label_title);
         $input_li->append_tag_to_content($input_label);
         $input = new HTMLTags_Input();
         $input->set_attribute_str('type', 'text');
         $input->set_attribute_str('name', $input_label_title);
         $input->set_value($current_additional_price);
         $input_li->append_tag_to_content($input);
         $supplier_shipping_price_editing_form->add_input_li($input_li);
     }
     /*
      * The add button.
      */
     $supplier_shipping_price_editing_form->set_submit_text('Edit');
     $supplier_shipping_price_editing_form->set_cancel_location($cancel_href);
     return $supplier_shipping_price_editing_form;
 }
 private function get_enter_plu_code_form()
 {
     $enter_plu_code_form = new HTMLTags_Form();
     $enter_plu_code_form->set_attribute_str('name', 'enter_plu_code');
     $enter_plu_code_form->set_attribute_str('method', 'GET');
     $enter_plu_code_form->set_attribute_str('class', 'table-select-form');
     $enter_plu_code_form->set_action(new HTMLTags_URL('/'));
     $inputs_ol = new HTMLTags_OL();
     /*
      * Select whether you want all products or just those with status==display
      */
     $li = new HTMLTags_LI();
     $label = new HTMLTags_Label('PLU Code');
     $label->set_attribute_str('for', 'plu_code');
     $li->append_tag_to_content($label);
     $input = new HTMLTags_Input();
     $input->set_attribute_str('name', 'plu_code');
     $li->append($input);
     $inputs_ol->append($li);
     /*
      * The submit button.
      */
     $go_button_li = new HTMLTags_LI();
     $go_button = new HTMLTags_Input();
     $go_button->set_attribute_str('type', 'submit');
     $go_button->set_attribute_str('value', 'Go');
     $go_button->set_attribute_str('class', 'submit');
     $go_button_li->append_tag_to_content($go_button);
     $inputs_ol->add_li($go_button_li);
     $enter_plu_code_form->append($inputs_ol);
     /*
      * The hidden inputs.
      */
     $current_page_url = $this->get_current_page_url();
     $enter_plu_code_action = clone $current_page_url;
     $enter_plu_code_action_get_vars = $enter_plu_code_action->get_get_variables();
     foreach (array_keys($enter_plu_code_action_get_vars) as $key) {
         $form_hidden_input = new HTMLTags_Input();
         $form_hidden_input->set_attribute_str('type', 'hidden');
         $form_hidden_input->set_attribute_str('name', $key);
         $form_hidden_input->set_attribute_str('value', $enter_plu_code_action_get_vars[$key]);
         $enter_plu_code_form->append_tag_to_content($form_hidden_input);
     }
     return $enter_plu_code_form;
 }
  * The product category selecting form.
  * -------------------------------------------------------------------------
  */
 $product_category_selecting_form = new HTMLTags_Form();
 $product_category_selecting_form->set_attribute_str('name', 'product_category_selecting');
 $product_category_selecting_form->set_attribute_str('method', 'GET');
 $product_category_selecting_form->set_attribute_str('class', 'table-select-form');
 $product_category_selecting_action = clone $current_page_url;
 //        $product_category_selecting_action->set_get_variable('product_category_id');
 $product_category_selecting_form->set_action(new HTMLTags_URL('/'));
 $inputs_ol = new HTMLTags_OL();
 /*
  * Select the product_category_id.
  */
 $product_category_li = new HTMLTags_LI();
 $product_category_label = new HTMLTags_Label('Product Category');
 $product_category_label->set_attribute_str('for', 'product_category_id');
 $product_category_li->append_tag_to_content($product_category_label);
 if (isset($_GET['product_category_id'])) {
     $product_category_form_select = $table_renderer->get_product_category_form_select($_GET['product_category_id']);
 } else {
     $product_category_form_select = $table_renderer->get_product_category_form_select();
 }
 $all_product_categories_option = new HTMLTags_Option('all');
 $all_product_categories_option->set_attribute_str('value', 'all');
 if ($_GET['product_category_id'] == 'all' || !isset($_GET['product_category_id'])) {
     $all_product_categories_option->set_attribute_str('selected');
 }
 $product_category_form_select->add_option($all_product_categories_option);
 $product_category_li->append_tag_to_content($product_category_form_select);
 $inputs_ol->add_li($product_category_li);
 public function get_extra_photograph_form_checkbox_li()
 {
     $input_li = new HTMLTags_LI();
     $input_label = new HTMLTags_Label('Extra Photographs');
     $input_label->set_attribute_str('for', 'extra_photograph_id');
     $input_li->append_tag_to_content($input_label);
     $products_table = $this->get_element();
     $database = $products_table->get_database();
     $photographs_table = $database->get_table('hpi_shop_photographs');
     $photographs = $photographs_table->get_all_rows();
     foreach ($photographs as $photograph) {
         $photograph_renderer = $photograph->get_renderer();
         $input = new HTMLTags_Input();
         $input->set_attribute_str('type', 'checkbox');
         $input->set_attribute_str('name', 'extra_photograph_id_' . $photograph->get_id());
         $input->set_value($photograph->get_id());
         $input_li->append_tag_to_content($input);
         $input_li->append_tag_to_content($photograph_renderer->get_thumbnail_img());
     }
     $input_msg_box = new HTMLTags_Span();
     $input_msg_box->set_attribute_str('id', 'extra_photograph_id' . 'msg');
     $input_msg_box->set_attribute_str('class', 'rules');
     $input_li->append_tag_to_content($input_msg_box);
     return $input_li;
 }
 public function get_status_form_select_li()
 {
     $input_li = new HTMLTags_LI();
     $input_label = new HTMLTags_Label('Status');
     $input_label->set_attribute_str('for', 'status_id');
     $input_li->append_tag_to_content($input_label);
     $input_li->append_tag_to_content($this->get_status_form_select());
     $input_msg_box = new HTMLTags_Span();
     $input_msg_box->set_attribute_str('id', 'status_id' . 'msg');
     $input_msg_box->set_attribute_str('class', 'rules');
     $input_li->append_tag_to_content($input_msg_box);
     return $input_li;
 }
 public function get_supplier_form_checkbox_li($customer_region_id)
 {
     $input_li = new HTMLTags_LI();
     $input_label = new HTMLTags_Label('Suppliers');
     $input_label->set_attribute_str('for', 'supplier_id');
     $input_li->append_tag_to_content($input_label);
     $customer_region_supplier_links_table = $this->get_element();
     $database = $customer_region_supplier_links_table->get_database();
     $suppliers_table = $database->get_table('hpi_shop_suppliers');
     $suppliers = $suppliers_table->get_all_rows();
     foreach ($suppliers as $supplier) {
         $input = new HTMLTags_Input();
         $input->set_attribute_str('type', 'checkbox');
         $input->set_attribute_str('name', $supplier->get_id());
         $input->set_value($supplier->get_id());
         $conditions = array();
         $conditions['supplier_id'] = $supplier->get_id();
         $conditions['customer_region_id'] = $customer_region_id;
         $current_supplier = $customer_region_supplier_links_table->get_rows_where($conditions);
         if (count($current_supplier) > 0) {
             #print_r('saul');
             $input->set_attribute_str('checked', 'checked');
         }
         $input_li->append_tag_to_content($input);
         $input_li->append_str_to_content($supplier->get_name());
         //                        $input_li->append_tag_to_content(new HTMLTags_BR());
     }
     $input_msg_box = new HTMLTags_Span();
     $input_msg_box->set_attribute_str('id', 'supplier_id' . 'msg');
     $input_msg_box->set_attribute_str('class', 'rules');
     $input_li->append_tag_to_content($input_msg_box);
     return $input_li;
 }