public function append_array($array)
 {
     if (isset($this->items_added)) {
         throw new Exception('You cannot append an array to a HTMLTags_FillTable more than once!');
     } else {
         $groups_array = $this->split_array($array);
         #print_r($groups_array);
         for ($i = 0; $i < count($groups_array); $i++) {
             $row = new HTMLTags_TR();
             for ($j = 0; $j < count($groups_array[$i]); $j++) {
                 $td = new HTMLTags_TD();
                 if (is_a($groups_array[$i][$j], 'HTMLTags_Tag')) {
                     #echo "tag\n";
                     $td->append_tag_to_content($groups_array[$i][$j]);
                 } else {
                     #echo "non-tag\n";
                     $td->append_str_to_content($groups_array[$i][$j]);
                 }
                 $row->append_tag_to_content($td);
             }
             $this->append_tag_to_content($row);
         }
         $this->items_added = TRUE;
     }
 }
 private function get_drama_tr(Oedipus_Drama $drama)
 {
     $tr = new HTMLTags_TR();
     //$tr->set_attribute_str('id', 'drama');
     $link = new HTMLTags_A($drama->get_name());
     $link->set_href($this->get_drama_page_url_for_drama($drama));
     $name_td = $this->get_td_with_id($link->get_as_string(), 'name');
     $tr->append($name_td);
     $added_td = $this->get_td_with_id($drama->get_human_readable_added(), 'added');
     $tr->append($added_td);
     return $tr;
 }
 protected function get_data_trs()
 {
     $data_trs = array();
     $key_fields = $this->get_key_fields();
     $base_redirect_script_url = $this->get_base_redirect_script_url();
     foreach ($this->row_data as $row_datum) {
         echo 'print_r($row_datum):' . "\n";
         print_r($row_datum);
         $data_tr = new HTMLTags_TR();
         /*
          * Make TDs for the row datum elements.
          */
         foreach ($row_datum as $rde) {
             $td = new HTMLTags_TD($rde);
             $data_tr->append_tag_to_content($td);
         }
         /*
          * Make TDs for links to the redirect script to move the row up or down.
          */
         $current_data_row_brsu = clone $base_redirect_script_url;
         foreach ($key_fields as $key_field) {
             $current_data_row_brsu->set_get_variable($key_field, $row_datum[$key_field]);
         }
         foreach (explode(' ', 'up down') as $direction) {
             $td = new HTMLTags_TD();
             /*
              * Make the link text.
              */
             $link_text = 'Shift' . ucfirst($direction);
             $current_shirt_direction_rsu = clone $current_data_row_brsu;
             $current_shirt_direction_rsu->set_get_variable('direction', $direction);
             $shift_a = new HTMLTags_A($link_text);
             $shift_a->set_href($current_shirt_direction_rsu);
             $td->append_tag_to_content($shift_a);
             $data_tr->append_tag_to_content($td);
         }
         $data_trs[] = $data_tr;
     }
     return $data_trs;
 }
 public function get_admin_pages_html_table()
 {
     $pages_table = $this->get_element();
     $admin_pages_html_table = new HTMLTags_Table();
     $admin_pages_html_table->set_attribute_str('id', 'admin_pages_table');
     /*
      * The head
      */
     $thead = new HTMLTags_THead();
     $header_tr = new HTMLTags_TR();
     $header_tr->append_tag_to_content(new HTMLTags_TH('Name'));
     $header_tr->append_tag_to_content(new HTMLTags_TH('Author'));
     $header_tr->append_tag_to_content(new HTMLTags_TH('Title'));
     $actions_th = new HTMLTags_TH('Actions');
     $actions_th->set_attribute_str('colspan', 2);
     $header_tr->append_tag_to_content($actions_th);
     $thead->append_tag_to_content($header_tr);
     $admin_pages_html_table->append_tag_to_content($thead);
     /*
      * The body.
      */
     $tbody = new HTMLTags_TBody();
     $pages = $pages_table->get_pages_viewable_by_currently_logged_in_user();
     foreach ($pages as $page) {
         $page_renderer = $page->get_renderer();
         $tbody->append_tag_to_content($page_renderer->get_admin_page_html_table_tr());
     }
     $admin_pages_html_table->append_tag_to_content($tbody);
     return $admin_pages_html_table;
 }
 public function get_admin_page_html_table_tr()
 {
     $page_row = $this->get_element();
     $admin_pages_html_table_tr = new HTMLTags_TR();
     $name_td = new HTMLTags_TD();
     $name_td->append_str_to_content($page_row->get_name());
     $admin_pages_html_table_tr->append_tag_to_content($name_td);
     $author_td = new HTMLTags_TD();
     $author_td->append_str_to_content($page_row->get_author());
     $admin_pages_html_table_tr->append_tag_to_content($author_td);
     $title_td = new HTMLTags_TD();
     #$title_td->append_str_to_content($page_row->get_title());
     $title_td->append_tag_to_content($this->get_title_a());
     $admin_pages_html_table_tr->append_tag_to_content($title_td);
     /*
      * The actions
      */
     $confirmation_url_base = new HTMLTags_URL();
     $confirmation_url_base->set_file('/');
     $confirmation_url_base->set_get_variable('section', 'haddock');
     $confirmation_url_base->set_get_variable('module', 'admin');
     $confirmation_url_base->set_get_variable('page', 'admin-includer');
     $confirmation_url_base->set_get_variable('type', 'html');
     $confirmation_url_base->set_get_variable('admin-section', 'haddock');
     $confirmation_url_base->set_get_variable('admin-module', 'database');
     /*
      * Edit the page's details.
      */
     $edit_td = new HTMLTags_TD();
     $edit_url = clone $confirmation_url_base;
     $edit_url->set_get_variable('admin-page', 'edit-page');
     $edit_url->set_get_variable('page_id', $page_row->get_id());
     $edit_a = new HTMLTags_A('Edit');
     $edit_a->set_href($edit_url);
     $edit_td->append_tag_to_content($edit_a);
     $admin_pages_html_table_tr->append_tag_to_content($edit_td);
     /*
      * Delete the page.
      */
     $delete_td = new HTMLTags_TD();
     $delete_url = clone $confirmation_url_base;
     $delete_url->set_get_variable('admin-page', 'delete-page');
     $delete_url->set_get_variable('page_id', $page_row->get_id());
     $delete_a = new HTMLTags_A('Delete');
     $delete_a->set_href($delete_url);
     $delete_td->append_tag_to_content($delete_a);
     $admin_pages_html_table_tr->append_tag_to_content($delete_td);
     return $admin_pages_html_table_tr;
 }
 public function get_admin_photographs_html_table_tr_without_actions()
 {
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     $database = $row->get_database();
     /*
      * The data.
      */
     $name_field = $table->get_field('name');
     $name_td = $this->get_data_html_table_td($name_field);
     $html_row->append_tag_to_content($name_td);
     $added_field = $table->get_field('added');
     $added_td = $this->get_data_html_table_td($added_field);
     $html_row->append_tag_to_content($added_td);
     $thumbnail_image_td = $this->get_thumbnail_image_td();
     $html_row->append_tag_to_content($thumbnail_image_td);
     return $html_row;
 }
 public function get_admin_product_categories_html_table_tr($current_page_url)
 {
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     /*
      * The data.
      */
     $name_field = $table->get_field('name');
     $name_td = $this->get_data_html_table_td($name_field);
     $html_row->append_tag_to_content($name_td);
     $description_field = $table->get_field('description');
     $description_td = $this->get_data_html_table_td($description_field);
     $html_row->append_tag_to_content($description_td);
     $sort_order_field = $table->get_field('sort_order');
     $sort_order_td = $this->get_data_html_table_td($sort_order_field);
     $html_row->append_tag_to_content($sort_order_td);
     /*
      * The edit td.
      */
     $edit_td = new HTMLTags_TD();
     $edit_link = new HTMLTags_A('Edit');
     $edit_link->set_attribute_str('class', 'cool_button');
     $edit_link->set_attribute_str('id', 'edit_table_button');
     $edit_location = clone $current_page_url;
     $edit_location->set_get_variable('edit_id', $row->get_id());
     $edit_link->set_href($edit_location);
     $edit_td->append_tag_to_content($edit_link);
     $html_row->append_tag_to_content($edit_td);
     /*
      * The delete td.
      */
     $delete_td = new HTMLTags_TD();
     $delete_link = new HTMLTags_A('Delete');
     $delete_link->set_attribute_str('class', 'cool_button');
     $delete_link->set_attribute_str('id', 'delete_table_button');
     $delete_location = clone $current_page_url;
     $delete_location->set_get_variable('delete_id', $row->get_id());
     $delete_link->set_href($delete_location);
     $delete_td->append_tag_to_content($delete_link);
     $html_row->append_tag_to_content($delete_td);
     return $html_row;
 }
 public function get_admin_product_tags_html_table_tr($redirect_script_url)
 {
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     /*
      * The data.
      */
     $tag_field = $table->get_field('tag');
     $tag_td = $this->get_data_html_table_td($tag_field);
     $html_row->append_tag_to_content($tag_td);
     $principal_field = $table->get_field('principal');
     $principal_td = $this->get_data_html_table_td($principal_field);
     $html_row->append_tag_to_content($principal_td);
     $no_of_products_td = $this->get_no_of_products_td();
     $html_row->append_tag_to_content($no_of_products_td);
     /*
      * The toggle_principal_status td.
      */
     $product_tag = $this->get_element();
     if ($product_tag->is_principal()) {
         $toggle_principal_status_link = new HTMLTags_A('Make Normal');
     } else {
         $toggle_principal_status_link = new HTMLTags_A('Make Principal');
     }
     $toggle_principal_status_td = new HTMLTags_TD();
     $toggle_principal_status_link->set_attribute_str('class', 'cool_button');
     $toggle_principal_status_link->set_attribute_str('id', 'toggle_principal_status_table_button');
     $toggle_principal_status_location = clone $redirect_script_url;
     $toggle_principal_status_location->set_get_variable('toggle_principal_status');
     $toggle_principal_status_location->set_get_variable('product_tag_id', $row->get_id());
     $toggle_principal_status_link->set_href($toggle_principal_status_location);
     $toggle_principal_status_td->append_tag_to_content($toggle_principal_status_link);
     $html_row->append_tag_to_content($toggle_principal_status_td);
     return $html_row;
 }
 $heading_tr = new HTMLTags_TR();
 $heading_tr->append_tag_to_content(new HTMLTags_TH());
 foreach ($customer_regions as $customer_region) {
     $customer_region_currency = $customer_region->get_currency();
     $th_text = '';
     $th_text .= $customer_region->get_name();
     $th_text .= '&nbsp;(';
     $th_text .= $customer_region_currency->get_symbol();
     $th_text .= ')';
     $heading_tr->append_tag_to_content(new HTMLTags_TH($th_text));
 }
 $heading_tr->append_tag_to_content(new HTMLTags_TH('Action'));
 $supplier_table->append_tag_to_content($heading_tr);
 $product_categories = $product_categories_table->get_all_rows();
 foreach ($product_categories as $product_category) {
     $row_tr = new HTMLTags_TR();
     $row_th = new HTMLTags_TH($product_category->get_name());
     $row_tr->append_tag_to_content($row_th);
     foreach ($customer_regions as $customer_region) {
         /*
          * FIRST_PRICE
          */
         try {
             $conditions = array();
             $conditions['supplier_id'] = $supplier->get_id();
             $conditions['customer_region_id'] = $customer_region->get_id();
             $conditions['product_category_id'] = $product_category->get_id();
             $supplier_shipping_price = $supplier_shipping_prices_table->get_rows_where($conditions);
             if (count($supplier_shipping_price) > 0) {
                 $data_td = new HTMLTags_TD();
                 $data_td->append_str_to_content($supplier_shipping_price[0]->get_first_price() . '&nbsp;(' . $supplier_shipping_price[0]->get_additional_price() . ')');
 public function append_row_action_tds_to_tr(Database_Row $row, HTMLTags_TR $dtr)
 {
     $row_renderer = $row->get_renderer();
     $dn = $this->get_display_node();
     $ases = $dn->getElementsByTagName('actions');
     if ($ases->length == 1) {
         $ase = $ases->item(0);
         $aes = $ase->getElementsByTagName('action');
         for ($i = 0; $i < $aes->length; $i++) {
             $ae = $aes->item($i);
             if ($ae->getAttribute('name') == 'edit' || $ae->getAttribute('name') == 'delete') {
                 $td = new HTMLTags_TD();
                 if ($ae->getAttribute('name') == 'edit') {
                     if ($ae->hasAttribute('edit_link_text')) {
                         $link = new HTMLTags_A($this->getAttribute('edit_link_text'));
                     } else {
                         $link = new HTMLTags_A('Edit');
                     }
                 } elseif ($ae->getAttribute('name') == 'delete') {
                     if ($ae->hasAttribute('delete_link_text')) {
                         $link = new HTMLTags_A($this->getAttribute('delete_link_text'));
                     } else {
                         $link = new HTMLTags_A('Delete');
                     }
                 }
                 $link->set_attribute_str('class', 'cool_button');
                 $location = $this->get_html_location();
                 if ($ae->getAttribute('name') == 'edit') {
                     $location->set_get_variable('edit_id', $row->get_id());
                 } elseif ($ae->getAttribute('name') == 'delete') {
                     $location->set_get_variable('delete_id', $row->get_id());
                 }
                 $link->set_href($location);
                 $td->append_tag_to_content($link);
             } else {
                 if ($ae->hasAttribute('td_render_method_name')) {
                     $rmn = $ae->getAttribute('td_render_method_name');
                     $rrro = new ReflectionObject($row_renderer);
                     $rm = $rrro->getMethod($rmn);
                     $td = $rm->invoke($row_renderer);
                 } else {
                     throw new Exception('No action TD render method set!');
                 }
             }
             $dtr->append_tag_to_content($td);
         }
         return $dtr;
     }
     throw new Exception('Unable to append actions to data TR!');
 }
 public function get_admin_products_html_table_tr($current_page_url, $redirect_script_url)
 {
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     /*
      * The data.
      */
     $plu_code_field = $table->get_field('plu_code');
     $plu_code_td = $this->get_data_html_table_td($plu_code_field);
     $html_row->append_tag_to_content($plu_code_td);
     $style_id_field = $table->get_field('style_id');
     $style_id_td = $this->get_data_html_table_td($style_id_field);
     $html_row->append_tag_to_content($style_id_td);
     $added_field = $table->get_field('added');
     $added_td = $this->get_data_html_table_td($added_field);
     $html_row->append_tag_to_content($added_td);
     $name_field = $table->get_field('name');
     $name_td = $this->get_data_html_table_td($name_field);
     $html_row->append_tag_to_content($name_td);
     $image_td = $this->get_image_td();
     $html_row->append_tag_to_content($image_td);
     $brand_td = $this->get_brand_td();
     $html_row->append_tag_to_content($brand_td);
     $product_category_td = $this->get_product_category_td();
     $html_row->append_tag_to_content($product_category_td);
     //                $description_td = $this->get_description_td();
     //                $html_row->append_tag_to_content($description_td);
     $price_td = $this->get_price_td();
     $html_row->append_tag_to_content($price_td);
     #$supplier_td = $this->get_supplier_td();
     #$html_row->append_tag_to_content($supplier_td);
     //                $comments_td = $this->get_comments_td();
     //                $html_row->append_tag_to_content($comments_td);
     $tags_td = $this->get_tags_td();
     $html_row->append_tag_to_content($tags_td);
     //                $use_stock_level_field = $table->get_field('use_stock_level');
     //                $use_stock_level_td = $this->get_data_html_table_td($use_stock_level_field);
     //                $html_row->append_tag_to_content($use_stock_level_td);
     //                $stock_level_td = $this->get_stock_level_td();
     //                $html_row->append_tag_to_content($stock_level_td);
     //                $stock_buffer_level_td = $this->get_stock_buffer_level_td();
     //                $html_row->append_tag_to_content($stock_buffer_level_td);
     #$stock_td = $this->get_stock_td();
     #$html_row->append_tag_to_content($stock_td);
     #$sort_order_field = $table->get_field('sort_order');
     #$sort_order_td = $this->get_data_html_table_td($sort_order_field);
     #$html_row->append_tag_to_content($sort_order_td);
     //                /*
     //                 * The set_principal_tags td.
     //                 */
     //                $set_principal_tags_td = new HTMLTags_TD();
     //                $set_principal_tags_link = new HTMLTags_A('Set Principal Tags');
     //                $set_principal_tags_link->set_attribute_str('class', 'cool_button');
     //                $set_principal_tags_link->set_attribute_str('id', 'set_principal_tags_table_button');
     //                $set_principal_tags_location = clone $current_page_url;
     //                $set_principal_tags_location->set_get_variable('set_principal_tags');
     //                $set_principal_tags_location->set_get_variable('product_id', $row->get_id());
     //                $set_principal_tags_link->set_href($set_principal_tags_location);
     //                $set_principal_tags_td->append_tag_to_content($set_principal_tags_link);
     //                $html_row->append_tag_to_content($set_principal_tags_td);
     //                /*
     //                 * The edit_tags td.
     //                 */
     //                $edit_tags_td = new HTMLTags_TD();
     //                $edit_tags_link = new HTMLTags_A('Edit All Tags');
     //                $edit_tags_link->set_attribute_str('class', 'cool_button');
     //                $edit_tags_link->set_attribute_str('id', 'edit_tags_table_button');
     //                $edit_tags_location = clone $current_page_url;
     //                $edit_tags_location->set_get_variable('edit_tags');
     //                $edit_tags_location->set_get_variable('product_id', $row->get_id());
     //                $edit_tags_link->set_href($edit_tags_location);
     //                $edit_tags_td->append_tag_to_content($edit_tags_link);
     //                $html_row->append_tag_to_content($edit_tags_td);
     //                /*
     //                 * The set_price td.
     //                 */
     //                $set_price_td = new HTMLTags_TD();
     //                $set_price_link = new HTMLTags_A('Set Price');
     //                $set_price_link->set_attribute_str('class', 'cool_button');
     //                $set_price_link->set_attribute_str('id', 'set_price_table_button');
     //                $set_price_location = clone $current_page_url;
     //                $set_price_location->set_get_variable('set_price');
     //                $set_price_location->set_get_variable('product_id', $row->get_id());
     //                $set_price_link->set_href($set_price_location);
     //                $set_price_td->append_tag_to_content($set_price_link);
     //                $html_row->append_tag_to_content($set_price_td);
     /*
      * The toggle_status td
      */
     $status_td = new HTMLTags_TD();
     $status_td->append_str_to_content($row->get_status());
     //                $status_field = $table->get_field('status');
     //                $status_td = $this->get_data_html_table_td($status_field);
     //                $html_row->append_tag_to_content($status_td);
     if ($row->is_displayable()) {
         $status_td->append_tag_to_content(new HTMLTags_BR());
         $status_td->append_tag_to_content(new HTMLTags_BR());
         if ($row->get_status() == 'hide') {
             $toggle_status_link = new HTMLTags_A('Display');
         } elseif ($row->get_status() == 'display') {
             $toggle_status_link = new HTMLTags_A('Hide');
         }
         $toggle_status_link->set_attribute_str('class', 'cool_button');
         $toggle_status_link->set_attribute_str('id', 'toggle_status_table_button');
         $toggle_status_location = clone $redirect_script_url;
         $toggle_status_location->set_get_variable('toggle_status');
         $toggle_status_location->set_get_variable('product_id', $row->get_id());
         $toggle_status_link->set_href($toggle_status_location);
         $status_td->append_tag_to_content($toggle_status_link);
     }
     $html_row->append_tag_to_content($status_td);
     /*
      * The set_stock_level td.
      */
     $set_stock_level_td = new HTMLTags_TD();
     if ($row->uses_stock_level()) {
         #			$set_stock_level_link = new HTMLTags_A('Set Stock Level');
         $link_text = 'Stock Level (' . $row->get_trackit_stock_quanities_sum() . ')';
         $set_stock_level_link = new HTMLTags_A($link_text);
         #$set_stock_level_link->set_attribute_str('class', 'cool_button');
         #$set_stock_level_link->set_attribute_str('id', 'set_stock_level_table_button');
         $set_stock_level_location = clone $current_page_url;
         $set_stock_level_location->set_get_variable('stock_level');
         $set_stock_level_location->set_get_variable('product_id', $row->get_id());
         $set_stock_level_link->set_href($set_stock_level_location);
         $set_stock_level_td->append_tag_to_content($set_stock_level_link);
     }
     $html_row->append_tag_to_content($set_stock_level_td);
     /*
      * The edit td.
      */
     $edit_td = new HTMLTags_TD();
     $edit_link = new HTMLTags_A('Edit');
     $edit_link->set_attribute_str('class', 'cool_button');
     $edit_link->set_attribute_str('id', 'edit_table_button');
     $edit_location = clone $current_page_url;
     $edit_location->set_get_variable('edit_id', $row->get_id());
     $edit_link->set_href($edit_location);
     $edit_td->append_tag_to_content($edit_link);
     $html_row->append_tag_to_content($edit_td);
     /*
      * The delete td.
      */
     //                $delete_td = new HTMLTags_TD();
     //                $delete_link = new HTMLTags_A('Delete');
     //                $delete_link->set_attribute_str('class', 'cool_button');
     //                $delete_link->set_attribute_str('id', 'delete_table_button');
     //                $delete_location = clone $current_page_url;
     //                $delete_location->set_get_variable('delete_id', $row->get_id());
     //                $delete_link->set_href($delete_location);
     //                $delete_td->append_tag_to_content($delete_link);
     //                $html_row->append_tag_to_content($delete_td);
     return $html_row;
 }
 public function get_all_orders_table($current_page_url)
 {
     $supplier = $this->get_element();
     $database = $supplier->get_database();
     $orders_table = $database->get_table('hpi_shop_orders');
     $all_orders_table = new HTMLTags_Table();
     $all_orders_table->set_attribute_str('id', 'shopping-basket-table');
     $caption = new HTMLTags_Caption('Your Orders');
     $all_orders_table->append_tag_to_content($caption);
     $thead = new HTMLTags_THead();
     $thead_tr = new HTMLTags_TR();
     $added_th = new HTMLTags_TH('Date of Purchase');
     $id_th = new HTMLTags_TH('Order No.');
     $product_th = new HTMLTags_TH('Product');
     $customer_th = new HTMLTags_TH('Customer');
     $quantity_th = new HTMLTags_TH('Amount');
     $status_th = new HTMLTags_TH('Status');
     $set_status_th = new HTMLTags_TH('Set Status');
     $thead_tr->append_tag_to_content($added_th);
     $thead_tr->append_tag_to_content($id_th);
     $thead_tr->append_tag_to_content($product_th);
     $thead_tr->append_tag_to_content($customer_th);
     $thead_tr->append_tag_to_content($quantity_th);
     $thead_tr->append_tag_to_content($status_th);
     $thead_tr->append_tag_to_content($set_status_th);
     $thead->append_tag_to_content($thead_tr);
     $all_orders_table->append_tag_to_content($thead);
     //                $tfoot = new HTMLTags_TFoot();
     //                $tfoot_tr = new HTMLTags_TR();
     //                $sub_total_th= new HTMLTags_TH('Sub-Total');
     //                $blank_td= new HTMLTags_TD('');
     //                $sub_total_td = new HTMLTags_TD($sub_total_price->get_as_string());
     //
     //                $tfoot_tr->append_tag_to_content($sub_total_th);
     //                $tfoot_tr->append_tag_to_content($blank_td);
     //                $tfoot_tr->append_tag_to_content($blank_td);
     //                $tfoot_tr->append_tag_to_content($sub_total_td);
     //                $tfoot_tr->append_tag_to_content($blank_td);
     //
     //                $tfoot->append_tag_to_content($tfoot_tr);
     //                $all_orders_table->append_tag_to_content($tfoot);
     $tbody = new HTMLTags_TBody();
     try {
         $orders = $orders_table->get_orders_for_supplier($supplier, $order_by = 'added');
     } catch (Exception $e) {
         /*
          * Shouldn't something happen here?
          */
     }
     #print_r($orders);
     foreach ($orders as $order) {
         $order_renderer = $order->get_renderer();
         $order_tr = $order_renderer->get_public_order_supplier_tr($current_page_url);
         $tbody->append_tag_to_content($order_tr);
     }
     $all_orders_table->append_tag_to_content($tbody);
     return $all_orders_table;
 }
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_A.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/' . 'HTMLTags_URL.inc.php';
require_once PROJECT_ROOT . '/haddock/database/classes/' . 'Database_MySQLUserFactory.inc.php';
/*
 * Start the displayed content.
 */
$content_div = new HTMLTags_Div();
$content_div->set_attribute_str('id', 'content');
$mysql_user_factory = Database_MySQLUserFactory::get_instance();
$mysql_user = $mysql_user_factory->get_for_this_project();
$database = $mysql_user->get_database();
$server_logs_table = $database->get_table('hc_logging_server_logs');
$entrances = $server_logs_table->get_entrances();
$entrances_table = new HTMLTags_Table();
foreach ($entrances as $entrance) {
    $tr = new HTMLTags_TR();
    $td = new HTMLTags_TD();
    $tr->append_tag_to_content(new HTMLTags_TD($entrance['domain']));
    #$entrance_a = new HTMLTags_A($entrance['domain']);
    #
    #$entrance_a->set_href(new HTMLTags_URL($entrance['domain']));
    #
    #$entrance_a->set_attribute_str('target', '_blank');
    #
    #$td->append_tag_to_content($entrance_a);
    #
    #$tr->append_tag_to_content($td);
    $tr->append_tag_to_content(new HTMLTags_TD($entrance['count']));
    $entrances_table->append_tag_to_content($tr);
}
$content_div->append_tag_to_content($entrances_table);
 public function get_admin_product_brands_html_table_tr_without_actions()
 {
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     $database = $row->get_database();
     /*
      * The data.
      */
     $name_field = $table->get_field('name');
     $name_td = $this->get_data_html_table_td($name_field);
     $html_row->append_tag_to_content($name_td);
     $owner_field = $table->get_field('owner');
     $owner_td = $this->get_data_html_table_td($owner_field);
     $html_row->append_tag_to_content($owner_td);
     $description_field = $table->get_field('description');
     $description_td = $this->get_data_html_table_td($description_field);
     $html_row->append_tag_to_content($description_td);
     $url_field = $table->get_field('url');
     $url_td = $this->get_data_html_table_td($url_field);
     $html_row->append_tag_to_content($url_td);
     $thumbnail_image_td = $this->get_thumbnail_image_td();
     $html_row->append_tag_to_content($thumbnail_image_td);
     return $html_row;
 }
 public function get_all_data_html_table()
 {
     $all_data_html_table = new HTMLTags_Table();
     $row = $this->get_element();
     $table = $row->get_table();
     $fields = $table->get_fields();
     $heading_row = new HTMLTags_TR();
     foreach ($fields as $field) {
         $heading_row->append_tag_to_content(new HTMLTags_TH($field->get_name()));
     }
     $all_data_html_table->append_tag_to_content($heading_row);
     $data_row = new HTMLTags_TR();
     foreach ($fields as $field) {
         #$field_td = new HTMLTags_TD($row->get($field->get_name()));
         $field_td = $this->get_data_html_table_td($field);
         $data_row->append_tag_to_content($field_td);
     }
     $all_data_html_table->append_tag_to_content($data_row);
     return $all_data_html_table;
 }
 /**
  * Append action TDs to the row.
  *
  * The array of action hashes can be built up to contain
  * different actions.
  *
  * The default behaviour is to just show the name of the action.
  *
  * However, if a filter has been associated with the action,
  * then the content of the TD is run through that filter using
  * eval(...).
  */
 protected function append_actions_to_tr($row, HTMLTags_TR $tr)
 {
     $actions = $this->get_data_table_actions();
     foreach ($actions as $action) {
         $str = $action['name'];
         if (isset($action['filter'])) {
             #echo $action['filter'];
             #exit;
             $str = eval($action['filter']);
         }
         $td = new HTMLTags_TD($str);
         $tr->append_tag_to_content($td);
     }
     return $tr;
 }
 public function get_admin_people_html_table_tr_without_actions()
 {
     $person = $this->get_element();
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     $database = $row->get_database();
     /*
      * The data.
      */
     $added_field = $table->get_field('added');
     $added_td = $this->get_data_html_table_td($added_field);
     $html_row->append_tag_to_content($added_td);
     $name_field = $table->get_field('name');
     $name_td = $this->get_data_html_table_td($name_field);
     $html_row->append_tag_to_content($name_td);
     $email_field = $table->get_field('email');
     $email_td = $this->get_data_html_table_td($email_field);
     $html_row->append_tag_to_content($email_td);
     $status_field = $table->get_field('status');
     $status_td = $this->get_data_html_table_td($status_field);
     $html_row->append_tag_to_content($status_td);
     return $html_row;
 }
 public function get_checkout_shopping_basket_for_current_session_table()
 {
     $shopping_baskets_table = $this->get_element();
     $database = $shopping_baskets_table->get_database();
     $customer_regions_table = $database->get_table('hpi_shop_customer_regions');
     $customer_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']);
     $currency = $customer_region->get_currency();
     $shopping_baskets_table = $this->get_element();
     $checkout_shopping_basket_table = new HTMLTags_Table();
     $checkout_shopping_basket_table->set_attribute_str('id', 'shopping-basket-table');
     $caption = new HTMLTags_Caption('Your Shopping Basket');
     $checkout_shopping_basket_table->append_tag_to_content($caption);
     // THEAD
     $thead = new HTMLTags_THead();
     $thead_tr = new HTMLTags_TR();
     $name_th = new HTMLTags_TH('Name');
     $price_th = new HTMLTags_TH('Unit Price');
     $quantity_th = new HTMLTags_TH('Amount');
     $sub_total_th = new HTMLTags_TH('Sub-Total');
     $thead_tr->append_tag_to_content($name_th);
     $thead_tr->append_tag_to_content($price_th);
     $thead_tr->append_tag_to_content($quantity_th);
     $thead_tr->append_tag_to_content($sub_total_th);
     $thead->append_tag_to_content($thead_tr);
     $checkout_shopping_basket_table->append_tag_to_content($thead);
     // TFOOT
     $tfoot = new HTMLTags_TFoot();
     $blank_td = new HTMLTags_TD('');
     // TFOOT - sub-total-tr
     $tfoot_sub_total_tr = new HTMLTags_TR();
     $sub_total_price = new Shop_SumOfMoney($shopping_baskets_table->get_sub_total_for_current_session($customer_region), $currency);
     $sub_total_th = new HTMLTags_TH('Sub-Total');
     $sub_total_td = new HTMLTags_TD($sub_total_price->get_as_string());
     $tfoot_sub_total_tr->append_tag_to_content($blank_td);
     $tfoot_sub_total_tr->append_tag_to_content($blank_td);
     $tfoot_sub_total_tr->append_tag_to_content($sub_total_th);
     $tfoot_sub_total_tr->append_tag_to_content($sub_total_td);
     $tfoot->append_tag_to_content($tfoot_sub_total_tr);
     // TFOOT - shipping-tr
     $shipping_price = new Shop_SumOfMoney($shopping_baskets_table->get_shipping_total_for_current_session($customer_region->get_id()), $currency);
     $tfoot_shipping_tr = new HTMLTags_TR();
     $shipping_th = new HTMLTags_TH('Shipping');
     $shipping_td = new HTMLTags_TD($shipping_price->get_as_string());
     $tfoot_shipping_tr->append_tag_to_content($blank_td);
     $tfoot_shipping_tr->append_tag_to_content($blank_td);
     $tfoot_shipping_tr->append_tag_to_content($shipping_th);
     $tfoot_shipping_tr->append_tag_to_content($shipping_td);
     $tfoot->append_tag_to_content($tfoot_shipping_tr);
     // TFOOT - total-tr
     $total_price = new Shop_SumOfMoney($shopping_baskets_table->get_total_for_current_session($customer_region->get_id()), $currency);
     $tfoot_total_tr = new HTMLTags_TR();
     $total_th = new HTMLTags_TH('Total');
     $total_td = new HTMLTags_TD($total_price->get_as_string());
     $tfoot_total_tr->append_tag_to_content($blank_td);
     $tfoot_total_tr->append_tag_to_content($blank_td);
     $tfoot_total_tr->append_tag_to_content($total_th);
     $tfoot_total_tr->append_tag_to_content($total_td);
     $tfoot->append_tag_to_content($tfoot_total_tr);
     $checkout_shopping_basket_table->append_tag_to_content($tfoot);
     // TBODY
     $tbody = new HTMLTags_TBody();
     try {
         $shopping_baskets = $shopping_baskets_table->get_shopping_baskets_for_current_session();
     } catch (Exception $e) {
     }
     if (count($shopping_baskets) > 0) {
         foreach ($shopping_baskets as $shopping_basket) {
             $shopping_basket_renderer = $shopping_basket->get_renderer();
             $shopping_basket_tr = $shopping_basket_renderer->get_checkout_shopping_basket_tr();
             $tbody->append_tag_to_content($shopping_basket_tr);
         }
     }
     $checkout_shopping_basket_table->append_tag_to_content($tbody);
     return $checkout_shopping_basket_table;
 }
 protected function get_option_trs()
 {
     $option_trs = array();
     foreach ($this->actors as $actor) {
         if ($actor->has_options()) {
             // Actors Name TR
             $actors_name_tr = new HTMLTags_TR();
             $actors_name_em = new HTMLTags_Em($actor->get_name());
             $actors_name_th = new HTMLTags_TH();
             $actors_name_th->append_tag_to_content($actors_name_em);
             $actors_name_th->set_attribute_str('class', 'option');
             $actors_name_th->set_attribute_str('id', $actor->get_color());
             $actors_name_tr->append_tag_to_content($actors_name_th);
             for ($i = -1; $i < count($this->actors); $i++) {
                 $blank_td = new HTMLTags_TD();
                 $actors_name_tr->append_tag_to_content($blank_td);
             }
             $option_trs[] = $actors_name_tr;
             // Option TRs with positions
             $options = $actor->get_options();
             foreach ($options as $option) {
                 $tr = new HTMLTags_TR();
                 $option_th = new HTMLTags_TH($option->get_name());
                 $option_th->set_attribute_str('class', 'option');
                 $option_th->set_attribute_str('id', $actor->get_color());
                 $tr->append_tag_to_content($option_th);
                 foreach ($this->actors as $position_actor) {
                     $position = $option->get_position($position_actor->get_id());
                     $position_td = new HTMLTags_TD();
                     $position_td->append_tag_to_content($this->get_position_tile($position));
                     $tr->append_tag_to_content($position_td);
                 }
                 // Stated Intention TD
                 $stated_intention = $option->get_stated_intention();
                 $stated_intention_td = new HTMLTags_TD();
                 $stated_intention_td->append_tag_to_content($this->get_stated_intention_tile($stated_intention, $actor));
                 $tr->append_tag_to_content($stated_intention_td);
                 $option_trs[] = $tr;
             }
             // Blank TR
             $blank_tr = new HTMLTags_TR();
             $blank_th = new HTMLTags_TH();
             $blank_th->set_attribute_str('class', 'blank');
             $blank_tr->append_tag_to_content($blank_th);
             for ($i = -1; $i < count($this->actors); $i++) {
                 $blank_td = new HTMLTags_TD();
                 $blank_tr->append_tag_to_content($blank_td);
             }
             $option_trs[] = $blank_tr;
         }
     }
     return $option_trs;
 }
 public function get_checkout_shopping_basket_tr()
 {
     $shopping_basket = $this->get_element();
     $product = $shopping_basket->get_product();
     $database = $shopping_basket->get_database();
     $customer_regions_table = $database->get_table('hpi_shop_customer_regions');
     $customer_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']);
     $currency = $customer_region->get_currency();
     $product_currency_price = $product->get_product_currency_price($currency->get_id());
     $full_tr = new HTMLTags_TR();
     $name_and_image_td = $this->get_product_td();
     //                $name_td = new HTMLTags_TD($product->get_name());
     $product_price = new Shop_SumOfMoney($product_currency_price->get_price(), $currency);
     $sub_total_price = new Shop_SumOfMoney($shopping_basket->get_sub_total(), $currency);
     $price_td = new HTMLTags_TD($product_price->get_as_string());
     $quantity_td = new HTMLTags_TD($shopping_basket->get_quantity());
     $sub_total_td = new HTMLTags_TD($sub_total_price->get_as_string());
     $full_tr->append_tag_to_content($name_and_image_td);
     $full_tr->append_tag_to_content($price_td);
     $full_tr->append_tag_to_content($quantity_td);
     $full_tr->append_tag_to_content($sub_total_td);
     return $full_tr;
 }
 public function get_admin_product_currency_prices_html_table_tr()
 {
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     //        name notes');
     //            foreach ($field_names as $field_name) {
     //                $heading_row->append_sortable_field_name($field_name);
     //            }
     //
     //           $currency_header = new HTMLTags_TH('Currency');
     //            $heading_row->append_tag_to_content($currency_header);
     //           $address_header = new HTMLTags_TH('Address');
     //            $heading_row->append_tag_to_content($address_header);
     //           $email_address_header = new HTMLTags_TH('Email Address');
     //            $heading_row->append_tag_to_content($email_address_header);
     //           $telephone_header = new HTMLTags_TH('Telephone');
     //            $heading_row->append_tag_to_content($telephone_header);
     /*
      * The data.
      */
     $name_field = $table->get_field('name');
     $name_td = $this->get_data_html_table_td($name_field);
     $html_row->append_tag_to_content($name_td);
     $notes_field = $table->get_field('notes');
     $notes_td = $this->get_data_html_table_td($notes_field);
     $html_row->append_tag_to_content($notes_td);
     $currency_td = $this->get_currency_td();
     $html_row->append_tag_to_content($currency_td);
     $address_td = $this->get_address_td();
     $html_row->append_tag_to_content($address_td);
     $email_address_td = $this->get_email_address_td();
     $html_row->append_tag_to_content($email_address_td);
     $telephone_number_td = $this->get_telephone_number_td();
     $html_row->append_tag_to_content($telephone_number_td);
     /*
      * The edit td.
      */
     $edit_td = new HTMLTags_TD();
     $edit_link = new HTMLTags_A('Edit');
     $edit_link->set_attribute_str('class', 'cool_button');
     $edit_link->set_attribute_str('id', 'edit_table_button');
     $edit_location = new HTMLTags_URL();
     $edit_location->set_file('/admin/');
     $edit_location->set_get_variable('module', 'shop');
     $edit_location->set_get_variable('page', 'product_currency_prices');
     $edit_location->set_get_variable('edit_id', $row->get_id());
     $edit_link->set_href($edit_location);
     $edit_td->append_tag_to_content($edit_link);
     $html_row->append_tag_to_content($edit_td);
     /*
      * The delete td.
      */
     $delete_td = new HTMLTags_TD();
     $delete_link = new HTMLTags_A('Delete');
     $delete_link->set_attribute_str('class', 'cool_button');
     $delete_link->set_attribute_str('id', 'delete_table_button');
     $delete_location = new HTMLTags_URL();
     $delete_location->set_file('/admin/');
     $delete_location->set_get_variable('module', 'shop');
     $delete_location->set_get_variable('page', 'product_currency_prices');
     $delete_location->set_get_variable('delete_id', $row->get_id());
     $delete_link->set_href($delete_location);
     $delete_td->append_tag_to_content($delete_link);
     $html_row->append_tag_to_content($delete_td);
     return $html_row;
 }
 public function get_checkout_order_for_current_session_table()
 {
     $orders_table = $this->get_element();
     $database = $orders_table->get_database();
     $customer_regions_table = $database->get_table('hpi_shop_customer_regions');
     $orders_table = $this->get_element();
     $checkout_order_table = new HTMLTags_Table();
     $caption = new HTMLTags_Caption('Your Shopping Basket');
     $checkout_order_table->append_tag_to_content($caption);
     // THEAD
     $thead = new HTMLTags_THead();
     $thead_tr = new HTMLTags_TR();
     $name_th = new HTMLTags_TH('Name');
     $price_th = new HTMLTags_TH('Unit Price');
     $quantity_th = new HTMLTags_TH('Amount');
     $sub_total_th = new HTMLTags_TH('Sub-Total');
     $thead_tr->append_tag_to_content($name_th);
     $thead_tr->append_tag_to_content($price_th);
     $thead_tr->append_tag_to_content($quantity_th);
     $thead_tr->append_tag_to_content($sub_total_th);
     $thead->append_tag_to_content($thead_tr);
     $checkout_order_table->append_tag_to_content($thead);
     // TFOOT
     $tfoot = new HTMLTags_TFoot();
     $blank_td = new HTMLTags_TD('');
     // TFOOT - sub-total-tr
     $tfoot_sub_total_tr = new HTMLTags_TR();
     $sub_total_th = new HTMLTags_TH('Sub-Total');
     $sub_total_td = new HTMLTags_TD($orders_table->get_sub_total_for_current_session());
     $tfoot_sub_total_tr->append_tag_to_content($blank_td);
     $tfoot_sub_total_tr->append_tag_to_content($blank_td);
     $tfoot_sub_total_tr->append_tag_to_content($sub_total_th);
     $tfoot_sub_total_tr->append_tag_to_content($sub_total_td);
     $tfoot->append_tag_to_content($tfoot_sub_total_tr);
     // TFOOT - shipping-tr
     $tfoot_shipping_tr = new HTMLTags_TR();
     $shipping_th = new HTMLTags_TH('Shipping');
     $shipping_td = new HTMLTags_TD($orders_table->get_shipping_total_for_current_session());
     $tfoot_shipping_tr->append_tag_to_content($blank_td);
     $tfoot_shipping_tr->append_tag_to_content($blank_td);
     $tfoot_shipping_tr->append_tag_to_content($shipping_th);
     $tfoot_shipping_tr->append_tag_to_content($shipping_td);
     $tfoot->append_tag_to_content($tfoot_shipping_tr);
     // TFOOT - total-tr
     $tfoot_total_tr = new HTMLTags_TR();
     $total_th = new HTMLTags_TH('Total');
     $total_td = new HTMLTags_TD($orders_table->get_total_for_current_session($shipping_location));
     $tfoot_total_tr->append_tag_to_content($blank_td);
     $tfoot_total_tr->append_tag_to_content($blank_td);
     $tfoot_total_tr->append_tag_to_content($total_th);
     $tfoot_total_tr->append_tag_to_content($total_td);
     $tfoot->append_tag_to_content($tfoot_total_tr);
     $checkout_order_table->append_tag_to_content($tfoot);
     // TBODY
     $tbody = new HTMLTags_TBody();
     try {
         $orders = $orders_table->get_orders_for_current_session();
     } catch (Exception $e) {
     }
     if (count($orders) > 0) {
         foreach ($orders as $order) {
             $order_renderer = $order->get_renderer();
             $order_tr = $order_renderer->get_checkout_order_tr();
             $tbody->append_tag_to_content($order_tr);
         }
     }
     $checkout_order_table->append_tag_to_content($tbody);
     return $checkout_order_table;
 }
 public function __construct(HTMLTags_URL $url, Database_Table $table, $order_by, $direction, $offset, $limit, $limit_str, $rows_html_table_caption, $lpnd_class, $data_table_class, $fields, $actions)
 {
     parent::__construct();
     $table_renderer = $table->get_renderer();
     /*
      * ----------------------------------------
      * Check the inputs.
      * ----------------------------------------
      */
     /*
      * ----------------------------------------
      * Create the content.
      * ----------------------------------------
      */
     $limit_previous_next_div = new HTMLTags_Div();
     $limit_previous_next_div->set_attribute_str('class', $lpnd_class);
     /*
      * To allow the user to set the number of extras to show at a time.
      */
     $limit_action = clone $url;
     $limit_action->delete_all_get_variables();
     $limit_form = new Database_LimitForm($limit_action, $limit, $limit_str);
     $get_vars = $url->get_get_variables();
     foreach (array_keys($get_vars) as $key) {
         $limit_form->add_hidden_input($key, $get_vars[$key]);
     }
     $limit_form->add_hidden_input('order_by', $order_by);
     $limit_form->add_hidden_input('direction', $direction);
     $limit_form->add_hidden_input('offset', $offset);
     $limit_previous_next_div->append_tag_to_content($limit_form);
     $previous_next_url = clone $url;
     $previous_next_url->set_get_variable('order_by', $order_by);
     $previous_next_url->set_get_variable('direction', $direction);
     $row_count = $table->count_all_rows();
     $previous_next_ul = new Database_PreviousNextUL($previous_next_url, $offset, $limit, $row_count);
     $limit_previous_next_div->append_tag_to_content($previous_next_ul);
     $this->append_tag_to_content($limit_previous_next_div);
     # ------------------------------------------------------------------
     /*
      * The table.
      */
     $rows_html_table = new HTMLTags_Table();
     $rows_html_table->set_attribute_str('class', $data_table_class);
     /*
      * The caption.
      */
     $caption = new HTMLTags_Caption($rows_html_table_caption);
     $rows_html_table->append_tag_to_content($caption);
     /*
      * The Heading Row.
      */
     $sort_href = clone $url;
     $sort_href->set_get_variable('limit', $limit);
     $heading_row = new Database_SortableHeadingTR($sort_href, $direction);
     //if (isset($fields_str)) {
     //    $fields = array();
     //
     //    foreach (explode(' ', $fields_str) as $field_name) {
     //        $fields[] = $table->get_field($field_name);
     //    }
     //} else {
     //    $fields = $table->get_fields();
     //}
     foreach ($fields as $field) {
         if ($field['sortable']) {
             $heading_row->append_sortable_field_name($field['name']);
         } else {
             $heading_row->append_nonsortable_field_name($field['name']);
         }
     }
     foreach ($actions as $action) {
         $heading_row->append_tag_to_content($action['th']);
     }
     $rows_html_table->append_tag_to_content($heading_row);
     # ------------------------------------------------------------------
     /*
      * Display the contents of the table.
      */
     $rows = $table->get_all_rows($order_by, $direction, $offset, $limit);
     foreach ($rows as $row) {
         $row_renderer = $row->get_renderer();
         $data_tr = new HTMLTags_TR();
         foreach ($fields as $field) {
             $field_td = self::get_html_table_cell_for_field($field, $row_renderer);
             $data_tr->append_tag_to_content($field_td);
         }
         //foreach (
         //    $row_renderer->get_action_tds(
         //        $actions_str,
         //        $url
         //    )
         //    as
         //    $action_td
         //) {
         //    $data_tr->append_tag_to_content($action_td);
         //}
         foreach ($actions as $action) {
             $action_td = self::get_html_table_cell_for_field($action, $row_renderer);
             $data_tr->append_tag_to_content($action_td);
         }
         $rows_html_table->append_tag_to_content($data_tr);
     }
     # ------------------------------------------------------------------
     $this->append_tag_to_content($rows_html_table);
     $this->append_tag_to_content($limit_previous_next_div);
 }
    $u_t_tr->append_tag_to_content(new HTMLTags_TD($count_passed_tests));
    $count_test_functions = $u_t_p_c_f->count_test_functions();
    $total_tests += $count_test_functions;
    $u_t_tr->append_tag_to_content(new HTMLTags_TD($count_test_functions));
    $passes_all_tests = $u_t_p_c_f->passes_all_tests();
    if ($everything_passes && !$passes_all_tests) {
        $everything_passes = FALSE;
    }
    $result_td = new HTMLTags_TD($passes_all_tests ? 'Pass' : 'Fail');
    $result_td->set_attribute_str('class', $passes_all_tests ? 'pass' : 'fail');
    $u_t_tr->append_tag_to_content($result_td);
    $total_test_time = $u_t_p_c_f->get_total_test_time();
    $total_time_all_tests += $total_test_time;
    $u_t_tr->append_tag_to_content(new HTMLTags_TD(sprintf('%.5f', $total_test_time)));
    $unit_tests_html_table->append_tag_to_content($u_t_tr);
}
$summary_tr = new HTMLTags_TR();
$summary_tr->set_attribute_str('class', 'summary');
$summary_tr->append_tag_to_content(new HTMLTags_TD('Summary'));
$summary_tr->append_tag_to_content(new HTMLTags_TD($total_passes));
$summary_tr->append_tag_to_content(new HTMLTags_TD($total_tests));
$result_td = new HTMLTags_TD($everything_passes ? 'Pass' : 'Fail');
$result_td->set_attribute_str('class', $everything_passes ? 'pass' : 'fail');
$summary_tr->append_tag_to_content($result_td);
$summary_tr->append_tag_to_content(new HTMLTags_TD(sprintf('%.5f', $total_time_all_tests)));
$unit_tests_html_table->append_tag_to_content($summary_tr);
$content_div->append_tag_to_content($unit_tests_html_table);
/*
 * -----------------------------------------------------------------------------
 */
echo $content_div->get_as_string();
require_once PROJECT_ROOT . '/project-specific/classes/' . 'ServerAdminScripts_LocalControlCentre.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_Div.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_Heading.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_Table.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_TR.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_TH.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_TD.inc.php';
$control_centre = new ServerAdminScripts_LocalControlCentre();
$content_div = new HTMLTags_Div();
$content_div->set_attribute_str('id', 'content');
$content_div->append_tag_to_content(new HTMLTags_Heading(2, 'Current Tasks'));
$tasks_table = new HTMLTags_Table();
$tasks_tr = new HTMLTags_TR();
$tasks_tr->append_tag_to_content(new HTMLTags_TH('Task Event ID'));
$tasks_tr->append_tag_to_content(new HTMLTags_TH('Host'));
$tasks_tr->append_tag_to_content(new HTMLTags_TH('System'));
$tasks_tr->append_tag_to_content(new HTMLTags_TH('Task'));
$tasks_tr->append_tag_to_content(new HTMLTags_TH('Start'));
$tasks_table->append_tag_to_content($tasks_tr);
$current_task_events = $control_centre->get_current_task_events();
foreach ($current_task_events as $current_task_event) {
    $tasks_tr = new HTMLTags_TR();
    $tasks_tr->append_tag_to_content(new HTMLTags_TD($current_task_event->get('ps_task_events.id')));
    $tasks_tr->append_tag_to_content(new HTMLTags_TD($current_task_event->get('ps_hosts.name')));
    $tasks_tr->append_tag_to_content(new HTMLTags_TD($current_task_event->get('ps_systems.name')));
    $tasks_tr->append_tag_to_content(new HTMLTags_TD($current_task_event->get('ps_tasks.name')));
    $tasks_tr->append_tag_to_content(new HTMLTags_TD($current_task_event->get('ps_task_events.start')));
    $tasks_table->append_tag_to_content($tasks_tr);
}
$content_div->append_tag_to_content($tasks_table);
echo $content_div->get_as_string();
         * The table.
         */
        if ($result && mysql_num_rows($result) > 0) {
            $results_table = new HTMLTags_Table();
            $first = TRUE;
            while ($row = mysql_fetch_assoc($result)) {
                $fields = array_keys($row);
                if ($first) {
                    $first = FALSE;
                    $fields_header_tr = new HTMLTags_TR();
                    foreach ($fields as $field) {
                        $fields_header_tr->append_tag_to_content(new HTMLTags_TH($field));
                    }
                    $results_table->append_tag_to_content($fields_header_tr);
                }
                $fields_data_tr = new HTMLTags_TR();
                foreach ($fields as $field) {
                    $fields_data_tr->append_tag_to_content(new HTMLTags_TD(htmlentities($row[$field])));
                }
                $results_table->append_tag_to_content($fields_data_tr);
            }
            $content_div->append_tag_to_content($results_table);
        } else {
            $p = new HTMLTags_P('No rows found!');
            $content_div->append_tag_to_content($p);
        }
    } else {
        $p = new HTMLTags_P('Sorry, SELECT statements only!');
        $content_div->append_tag_to_content($p);
    }
}
$project_directory_finder = HaddockProjectOrganisation_ProjectDirectoryFinder::get_instance();
$project_directory = $project_directory_finder->get_project_directory_for_this_project();
$p_d_row = new HTMLTags_TR();
$p_d_row->append_tag_to_content(new HTMLTags_TD('Project Directory'));
$p_d_d_u = $project_directory->get_disk_usage();
$p_d_d_u /= pow(2, 10);
$p_d_row->append_tag_to_content(new HTMLTags_TD(sprintf("%.3f", $p_d_d_u)));
$d_u_table->append_tag_to_content($p_d_row);
/*
 * The disk usage of the database.
 */
$d_b_row = new HTMLTags_TR();
$d_b_row->append_tag_to_content(new HTMLTags_TD('Databases'));
$mysql_user = $project_directory->get_mysql_user();
$database = $mysql_user->get_database();
$d_b_d_u = $database->get_disk_usage();
$d_b_d_u /= pow(2, 10);
$d_b_row->append_tag_to_content(new HTMLTags_TD(sprintf("%.3f", $d_b_d_u)));
$d_u_table->append_tag_to_content($d_b_row);
/*
 * The total disk usage.
 */
$total_row = new HTMLTags_TR();
$total_row->append_tag_to_content(new HTMLTags_TD('Total'));
$total_row->append_tag_to_content(new HTMLTags_TD(sprintf("%.3f", $p_d_d_u + $d_b_d_u)));
$d_u_table->append_tag_to_content($total_row);
$content_div->append_tag_to_content($d_u_table);
/*
 * Display the content div.
 */
echo $content_div->get_as_string();
 public function __construct(HTMLTags_URL $href, $current_direction)
 {
     parent::__construct();
     $this->href = $href;
     $this->current_direction = $current_direction;
 }
 public function get_checkout_order_tr()
 {
     $order = $this->get_element();
     $product = $order->get_product();
     $database = $order->get_database();
     $customer_regions_table = $database->get_table('hpi_shop_customer_regions');
     $customer_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']);
     $currency = $customer_region->get_currency();
     $product_currency_price = $product->get_product_currency_price($currency->get_id());
     $full_tr = new HTMLTags_TR();
     $name_td = new HTMLTags_TD($product->get_name());
     $price_td = new HTMLTags_TD($product_currency_price->get_price());
     $quantity_td = new HTMLTags_TD($order->get_quantity());
     $sub_total_td = new HTMLTags_TD($order->get_sub_total());
     $full_tr->append_tag_to_content($name_td);
     $full_tr->append_tag_to_content($price_td);
     $full_tr->append_tag_to_content($quantity_td);
     $full_tr->append_tag_to_content($sub_total_td);
     return $full_tr;
 }
 public function get_admin_comments_html_table_tr_without_actions()
 {
     $comment = $this->get_element();
     $commenter = $comment->get_commenter();
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     $database = $row->get_database();
     /*
      * The data.
      */
     $added_field = $table->get_field('added');
     $added_td = $this->get_data_html_table_td($added_field);
     $html_row->append_tag_to_content($added_td);
     $modified_field = $table->get_field('modified');
     $modified_td = $this->get_data_html_table_td($modified_field);
     $html_row->append_tag_to_content($modified_td);
     $status_field = $table->get_field('status');
     $status_td = $this->get_data_html_table_td($status_field);
     $html_row->append_tag_to_content($status_td);
     $front_page_field = $table->get_field('front_page');
     $front_page_td = $this->get_data_html_table_td($front_page_field);
     $html_row->append_tag_to_content($front_page_td);
     $name_td = new HTMLTags_TD($commenter->get_name());
     $html_row->append_tag_to_content($name_td);
     $comment_field = $table->get_field('comment');
     $comment_td = $this->get_data_html_table_td($comment_field);
     $html_row->append_tag_to_content($comment_td);
     $product_td = $this->get_product_td();
     $html_row->append_tag_to_content($product_td);
     return $html_row;
 }