Krunoslav
Here you go ... I've included the code, line numbers and surrounding text for you to work with in each of the files. Text noted in
italics is what you will INSERT.
index.php:
Near line 517:
txt_out("<h3>".$normal_messages_ar["details_of_record"]."</h3>");
txt_out("<a class=\"onlyscreen\" target=\"_".$edit_target_window."\" href=\"".$dadabik_main_file."?table_name=".urlencode($table_name)."&function=printenv&where_field=".urlencode($where_field)."&where_value=".urlencode($where_value)."\">Print to Envelope</a><p>");
// execute the select query
$res_details = execute_db("$sql", $conn);
include/business_logic.php:
Near line 2567:
} // end function build_details_table
function build_printenv_table($fields_labels_ar, $res_details)
// goal: build an html table with details of a record
// input: $fields_labels_ar $res_details (the result of the query)
// ouptut: $details_table, the html table
{
global $conn, $quote, $alias_prefix;
// build the table
$printenv_table = "";
$printenv_table .= "<table><tr><td height=\"262\"> </td></tr>";
while ($details_row = fetch_row_db($res_details)){ // should be just one
$count_temp = count($fields_labels_ar);
for ($i=0; $i<$count_temp; $i++){
if ($fields_labels_ar[$i]["present_details_form_field"] == "1"){
$field_name_temp = $fields_labels_ar[$i]["name_field"];
$field_values_ar = array(); // reset the array containing values to display, otherwise for each loop if I don't call build_linked_field_values_ar I have the previous values
$primary_key_field_field = $fields_labels_ar[$i]["primary_key_field_field"];
if ($primary_key_field_field != ""){
$primary_key_field_field = $fields_labels_ar[$i]["primary_key_field_field"];
$primary_key_table_field = $fields_labels_ar[$i]["primary_key_table_field"];
$primary_key_db_field = $fields_labels_ar[$i]["primary_key_db_field"];
$linked_fields_field = $fields_labels_ar[$i]["linked_fields_field"];
$linked_fields_ar = explode($fields_labels_ar[$i]["separator_field"], $linked_fields_field);
$alias_suffix_field = $fields_labels_ar[$i]["alias_suffix_field"];
for ($j=0;$j<count($linked_fields_ar);$j++) {
$field_values_ar[$j] .= $details_row[$linked_fields_ar[$j].$alias_prefix.$alias_suffix_field];
} // end for
/*
$linked_field_values_ar = build_linked_field_values_ar($details_row[$field_name_temp], $primary_key_field_field, $primary_key_table_field, $primary_key_db_field, $linked_fields_ar);
*/
/*
if (substr($foreign_key_temp, 0, 4) == "SQL:"){
$sql = substr($foreign_key_temp, 4, strlen($foreign_key_temp)-4);
} // end if
else{
*/
//$field_values_ar = $linked_field_values_ar;
}
else{
$field_values_ar[0] = $details_row[$field_name_temp];
}
$count_temp_2 = count($field_values_ar);
$printenv_table .= "<tr><td width=\"772\"> </td><td class=\"td_value_details\">";
for ($j=0; $j<$count_temp_2; $j++) {
$field_to_display = get_field_correct_displaying($field_values_ar[$j], $fields_labels_ar[$i]["type_field"], $fields_labels_ar[$i]["content_field"], $fields_labels_ar[$i]["separator_field"], "printenv_table"); // get the correct display mode for the field
$printenv_table .= $field_to_display." "; // at the field value to the table
}
$printenv_table = substr($printenv_table, 0, -6); // delete the last
$printenv_table .= "</td></tr>";
} // end if
} // end for
} // end while
$printenv_table .= "</table>";
return $printenv_table;
} // end function build_printenv_table
function build_navigation_tool
include/footer.php **:
Near line 107:
<div align="left"
class="onlyscreen"><font size="1">Powered by:
DaDaBIK</font></div>
** NOTE: Anything else you see in the header/footer files that you do not want to print can have the
class="onlyscreen" added to it. The other option may be to create a new page that does not call the header or footer for DaDaBIK - just remember to include all necessary files in order for it to work.
The height and width measurements (shown in bold in the business_logic addition) are based on the default IE margins of 2cm calculated at 37.5 pixels per CM. You may need to play with these measurements or add a spacer graphic to ensure the measurements display correctly on the resulting page.
IMPORTANT!
It is IMPOSSIBLE to remove the header/footer lines that IE automatically prints on pages from a browser using CSS or scripting (so far). So, this is what I do when I do not want those items to print:
Create a text file to hold the settings you currently have in IE for your page setup. From IE, select File > Page Setup... from the menu and copy the values from the header and footer box into your text file. Save your text file and delete the header/footer values from the IE page setup. Now when you print, there will be nothing but the content of the page (in your case, the address) printed.
Hope this helps!
Debbie
(Latest version of DaDaBIK when this message was posted: 3.1 Beta)