Avatar of asaidi
asaidi
 asked on

ie8 print empty page

Hi
when i use firefox the page is printed to a pdf with data..but when i switch to ie8 to see the difference blank page is printed only the header..
i m using javascript window.print()..
JavaScriptWeb BrowsersPHP

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon
Ray Paseur

Please set up a simple test case that demonstrates the problem, and post the code here.  I will install it on my server and try it with various client browsers.
asaidi

ASKER
Hi
ok go to this site:
http://www.netwaterwatch.ie/
then login as pattreacy
password=password1
then click enter on the first screen
then on menu click 24 hour usage report
the next screen click run then all on the bottom you will see print
 
<?php
include('db.php');
$auto=$_GET['auto'];
?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1252' />
<title>CAMPION The Power Behind The Water</title>
<style type="text/css"  >
#fixed {
    position: absolute;
    top: 0;
    left: 0;
    width: 10em;
    height: 100%;
}
@media print {
input#btnPrint {
display: none;
}
}    
@media screen{
    .imgs1 {
       position:absolute;
       width:30%;
       height:15%;
       top:-6px;
       left:0;
      }
  } 
.table2 {
      position:relative;
        /*top:-50px;*/
 border:1px solid #000;
    
      font-family:arial,sans-serif;
      font-size:60%;
      height:100%;
      width:100%; 
}
body {
        height: 650px;
        width: 100%;
        /* to centre page on screen*/
        margin-left: auto;
        margin-right: auto;
    }

#tab{
       position:relative;
        top:-90px;  
        left: 580px;
	border=0;
	background-color:#FFF;
        font-size:70%;
        border:0px ;
}
#table4{
        border:3px solid #fff;
        position:relative;
        top:-5px;  
        
}
table {
	border:1px solid #000;
	border-collapse:collapse;
	font-size:70%;
}
#td1{
	 
        background-color:#9cf;
         
}	
#td11{
	 
        background-color:#fff;
}

#td3{
        position:relative;
        top:1450px;
        border:0  ;
	border-collapse:collapse;
	padding:5px; 
        background-color:#fff;
}

#td2{
	 background-color: rgb(255,255,0); /* Needed for IEs */

        -moz-box-shadow: 5px 5px 5px rgba(68,68,68,0.6);
        -webkit-box-shadow: 5px 5px 5px rgba(68,68,68,0.6);
        box-shadow: 5px 5px 5px rgba(68,68,68,0.6);
}	
th{
	border:1px solid #000;
	border-collapse:collapse;
	padding:5px;
      
}	
#fn,#dp,#ar{width:110px;}
#fr,#to{width:90px;}
caption{
	background:#ccc;
	font-size:100%;
	border:1px solid #000;
	border-bottom:none;
	padding:20px 0 0 0;
	text-align:left;
}

div.ex
{
top:-40px;
width:220px;
padding:10px;
border:5px solid gray;
margin:0px;
} 
</style>
<script language='JavaScript'>
DA = (document.all) ? 1 : 0
 
function HandleError()
{
alert('\nNothing was printed. \n\nIf you do want to print this page, then\nclick on the printer icon in the toolbar above.')
return true;
}
</script>
</head>
<script language='JavaScript'>
DA = (document.all) ? 1 : 0
function HandleError()
{
alert('\nNothing was printed. \n\nIf you do want to print this page, then\nclick on the printer icon in the toolbar above.')
return true;
}
</script>
</head>  
<body>
<?php
function all2($date,$date2,$report){
$auto=$_GET['auto'];
 $gr=0; 
$result1=mysql_query("SELECT DATE(tran_date) as datei,unit_serial,account_no,customer_no   
                     from count_transactions  
           WHERE DATE(tran_date) BETWEEN '$date' AND '$date2' AND account_no=$auto  
          GROUP BY  customer_no, unit_serial,DATE(tran_date) order by tran_date") ; 
          $num = mysql_num_rows($result1);
    while($row = mysql_fetch_array($result1)) { 
              $dateb =$row['datei'];
              $dateb1=date('d-m-Y',strtotime($dateb));             
              $acn=$row['account_no'];
              $netw=$row['unit_serial'];
              $client=$row['customer_no'];
            
              $tot1=0;
              $tot22=0;
              $tot33=0;
              $tot44=0;
              $general1=0;
              
?>
<table id ='table4'><tr>
<?php
$q1="SELECT unitName FROM net_watch_units WHERE serial_no=$netw";
                   $res1=mysql_query($q1);
                   $r1=mysql_fetch_array($res1);
                   $account=$r1['unitName']; 
$q2="SELECT account_name FROM account_details WHERE auto_id=$acn";
                   $res2=mysql_query($q2);
                   $r2=mysql_fetch_array($res2);
                   $name=$r2['account_name'];  
?>                  
<?php
$q3="SELECT customer_name FROM customer_details WHERE auto_id=$client";
                   $res3=mysql_query($q3);
                   $r3=mysql_fetch_array($res3);
                   $name1=$r3['customer_name'];  

$query="SELECT serial_no,pulser1_name,pulser2_name,pulser3_name,pulser4_name  
 from net_watch_units 
 where serial_no=$netw order by serial_no"; 
$result2=mysql_query($query);
$record2=mysql_fetch_array($result2);
$pulser1=$record2['pulser1_name'];  
$pulser2=$record2['pulser2_name'];
$pulser3=$record2['pulser3_name'];
$pulser4=$record2['pulser4_name'];
if(empty($pulser1) and empty($pulser2) and empty($pulser3) and empty($pulser4)){
   include('tableau.php');
   tab();
   exit; 
} 
 
?>    
<td rowspan="2" style="width:30%"><img src='campion.png' alt='The Power Behind The Water'/></td>
<td colspan="2" style=" width:20%;font-size:14px;">Unit Name : <b><br><?php echo $account;?></b></td> 
<td colspan="2" style=" width:20%;font-size:14px;">Account Name : <b><br><?php echo $name;?></b></td> </tr>
<tr><td style="font-size:12px;width:10%;">Customer Name : <b><br><?php echo $name1;?></b></td>
 <td style="font-size:12px;width:10%;">Report Date : <b><br><?php echo $dateb1;?></b></td> 
<?php
         if($report=='1'){
            $rep='Litres';
         }
         if($report=='2'){
            $rep='M3';
         }
         if($report=='3'){
            $rep='Gallons (Imp)';
         }
    
         ?>

<td style="width:10%;font-size:14px;">Report Units : <b><br><?php echo $rep;?></b></td><td colspan="3" style="font-size:14px;">Report Name : <b><br> 24 Hour Usage Report</b></td></b></td>
</tr>
</table>
<?php
 
$result=mysql_query( "SELECT a.hr,
        SUM(CASE WHEN b.pulse_channel = 1 and a.hr between 0 and 6 then unit_qty else 0 END) as morning1,
        SUM(CASE WHEN b.pulse_channel = 2 and a.hr between 0 and 6 then unit_qty else 0 END) as morning2,
        SUM(CASE WHEN b.pulse_channel = 3 and a.hr between 0 and 6 then unit_qty else 0 END) as morning3,
        SUM(CASE WHEN b.pulse_channel = 4 and a.hr between 0 and 6 then unit_qty else 0 END) as morning4,
        SUM(CASE WHEN b.pulse_channel = 1 and a.hr between 7 and 19 then unit_qty else 0 END) as daily1,
        SUM(CASE WHEN b.pulse_channel = 2 and a.hr between 7 and 19 then unit_qty else 0 END) as daily2,
        SUM(CASE WHEN b.pulse_channel = 3 and a.hr between 7 and 19 then unit_qty else 0 END) as daily3,
        SUM(CASE WHEN b.pulse_channel = 4 and a.hr between 7 and 19 then unit_qty else 0 END) as daily4,       
        SUM(CASE WHEN b.pulse_channel = 1 and a.hr between 20 and 23 then unit_qty else 0 END) as night1,
        SUM(CASE WHEN b.pulse_channel = 2 and a.hr between 20 and 23 then unit_qty else 0 END) as night2,
        SUM(CASE WHEN b.pulse_channel = 3 and a.hr between 20 and 23 then unit_qty else 0 END) as night3,
        SUM(CASE WHEN b.pulse_channel = 4 and a.hr between 20 and 23 then unit_qty else 0 END) as night4, 
        
      SUM(case when b.pulse_channel = 1 then b.unit_qty else 0 end) as name1,
      SUM(case when b.pulse_channel = 2 then b.unit_qty else 0 end) as name2,
      SUM(case when b.pulse_channel = 3 then b.unit_qty else 0 end) as name3,
      SUM(case when b.pulse_channel = 4 then b.unit_qty else 0 end) as name4,
      SUM(b.unit_qty) as Total
from (
	select 0  as hr 
	union select 1
	union select 2 
	union select 3
	union select 4 
	union select 5 
	union select 6
	union select 7
	union select 8
	union select 9
	union select 10
	union select 11
	union select 12
	union select 13
	union select 14
	union select 15
	union select 16
	union select 17
	union select 18
	union select 19
	union select 20
	union select 21
	union select 22
	union select 23) a 
left join count_transactions b on a.hr = Hour(b.tran_date)
WHERE DATE(b.tran_date) BETWEEN '$dateb' AND '$dateb' AND unit_serial=$netw  
GROUP BY  a.hr" ) or die("SELECT Error: ".mysql_error());

 
 ?>
<table class='table2'><summary="This table lists all the quantity by hour.">
  <thead>
<tr>
      <th id="fr" scope="col">Hour</th>   
      <th id="fn" scope="col"><?php echo $pulser1;?>                  </th>  
      <th id="fn" scope="col"><?php echo $pulser2;?>                  </th>  
      <th id="fn" scope="col"><?php echo $pulser3;?>                  </th>  
      <th id="fn" scope="col"><?php echo $pulser4;?>                  </th>  
      <th id="fr" scope="col">Total</th>  
    </tr>
  </thead>
<?php	

$i=0;
 
$nom1=array();
$matin=0;$matin2=0;$matin3=0;$matin4=0;
$soir=0;$soir1=0;$soir2=0;$soir3=0;
$nuit=0;$nuit1=0;$nuit2=0;$nuit3=0;
while ($get_info = mysql_fetch_array($result)){
   
          $auto_id=$get_info[auto_id]; 
          $tran=$get_info[tran];
          $date=$get_info[tran_date]; 
	  $hr=$get_info[hr];
          $total=$get_info[Total];	 
          $name1=$get_info[name1];
          $morning=$get_info[morning1];
          $morning1=$get_info[morning2];
          $morning2=$get_info[morning3];
          $morning3=$get_info[morning4];
          $daily=$get_info[daily1];
          $daily1=$get_info[daily2];
          $daily2=$get_info[daily3];
          $daily3=$get_info[daily4];
          $night=$get_info[night1];
          $night1=$get_info[night2];
          $night2=$get_info[night3];
          $night3=$get_info[night4]; 
          $name2=$get_info[name2];
          $name3=$get_info[name3];
          $name4=$get_info[name4];   
          $total=$get_info[Total]; 
           
           if($hr<=9){
            $hr='0'.$hr.':00';
          } 
          else{
           $hr=$hr.':00';
          }          
          
          if($report==2){
             $name1=$name1/1000;
             $name2=$name2/1000;
             $name3=$name3/1000;
             $name4=$name4/1000;
             $total=$total/1000; 
          }
          elseif($report==3){
              $name1=$name1*0.2199;
              $name2=$name2*0.2199;
              $name3=$name3*0.2199;
              $name4=$name4*0.2199;
              $total=$total*0.2199;   
          }
          else{
            $name1=$name1*1;
            $name2=$name2*1;
            $name3=$name3*1;
            $name4=$name4*1;
            $total=$total*1; 
          }
$namef1=str_pad(number_format($name1,2,'.',','),$imax, $pad,  STR_PAD_LEFT);
$namef2=str_pad(number_format($name2,2,'.',','),$imax, $pad,  STR_PAD_LEFT);
$namef3=str_pad(number_format($name3,2,'.',','),$imax, $pad,  STR_PAD_LEFT);
$namef4=str_pad(number_format($name4,2,'.',','),$imax, $pad,  STR_PAD_LEFT);
$totalf=str_pad(number_format($total,2,'.',','),$imax, $pad,  STR_PAD_LEFT); 
if(empty($pulser1)){
  $total=$total-$name;    
  $namef1='';
  $pulse1='vide';
 
}
if(empty($pulser2)){
   $total=$total-$name2;   
   $namef2='';
   $pulse2='vide'; 
    
}
if(empty($pulser3)){
  $total=$total-$name3;   
  $namef3='';
  $pulse3='vide';
}
if(empty($pulser4)){
  $total=$total-$name4;    
  $namef4='';
  $pulse4='vide';

}

$tot1=$tot1+$name1; 
$tot22=$tot22+$name2;
$tot33=$tot33+$name3;
$tot44=$tot44+$name4; 
$general1=$general1+$total;
$matin=$matin+$morning; 
$matin2=$matin2+$morning1; 
$matin3=$matin3+$morning2; 
$matin4=$matin4+$morning3;  
$soir=$soir+$daily; 
$soir1=$soir1+$daily1; 
$soir2=$soir2+$daily2; 
$soir3=$soir3+$daily3; 
$nuit=$nuit+$night; 
$nuit1=$nuit1+$night1; 
$nuit2=$nuit2+$night2; 
$nuit3=$nuit3+$night3;      
$somme1=str_pad(number_format($tot1),$imax,  $pad,  STR_PAD_LEFT); 
$somme2=str_pad(number_format($tot22),$imax, $pad,  STR_PAD_LEFT); 
$somme3=str_pad(number_format($tot33),$imax, $pad,  STR_PAD_LEFT); 
$somme4=str_pad(number_format($tot44),$imax, $pad,  STR_PAD_LEFT); 
$general=str_pad(number_format($general1),$imax, $pad,  STR_PAD_LEFT); 

 echo"<tr>"; 
       	echo"<td>$hr</td><td>$namef1</td><td>$namef2</td><td>$namef3</td><td>$namef4</td><td>$totalf</td></tr>";
 
}

  $av1=round($tot1/24,2); 
  $av2=round($tot22/24,2);
  $av3=round($tot33/24,2); 
  $av4=round($tot44/24,2);  
  $av1=str_pad(number_format($av1,2),$imax, $pad,  STR_PAD_LEFT);
  $av2=str_pad(number_format($av2,2),$imax, $pad,  STR_PAD_LEFT);
  $av3=str_pad(number_format($av3,2),$imax, $pad,  STR_PAD_LEFT);
  $av4=str_pad(number_format($av4,2),$imax, $pad,  STR_PAD_LEFT);
  $avg=round($general1/(24),2);
  $avg1=str_pad(number_format($avg,2),$imax, $pad,  STR_PAD_LEFT); 
  
 
if(empty($pulser1)){
   $somme1='';   
   
}
if(empty($pulser2)){
   $somme2='';   
   
}
if(empty($pulser3)){
   $somme3='';   
   
}
if(empty($pulser4)){
   $somme4='';   
   
}
?>

<tr>
<td id='td1'>Total </td>  
<td id='td1'><?php echo $somme1;?></td> 
<td id='td1'><?php echo $somme2;?></td>
<td id='td1'><?php echo $somme3;?></td>
<td id='td1'><?php echo $somme4;?></td>
<td id='td1'><?php echo $general;?></td></tr>
<?php
if(empty($pulser1)){
   $av1='';   
   
}
if(empty($pulser2)){
   $av2='';   
   
}
if(empty($pulser3)){
   $av3='';   
   
}
if(empty($pulser4)){
   $av4='';   
   
}
?>
<tr>
<td id='td1'>Hourly Average </td> 
<td id='td1'><?php echo $av1;?></td> 
<td id='td1'><?php echo $av2;?></td> 
<td id='td1'><?php echo $av3;?></td> 
<td id='td1'><?php echo $av4;?></td> 
<td id='td1'><?php echo $avg1;?></td> 
</tr> 
<tr>
<?php

if($report==2){
             $morning=$morning/1000;
             $morning1=$morning1/1000;
             $morning2=$morning2/1000;
             $morning3=$morning3/1000;
             $daily1=$daily1/1000;
             $daily2=$daily2/1000;
             $daily3=$daily3/1000;
             $daily4=$daily4/1000;
             $night1=$night1/1000;
             $night2=$night2/1000;
             $night3=$night3/1000;
             $night4=$night4/1000; 

         }
          elseif($report==3){
              $morning=$morning*0.2199;
              $morning1=$morning1*0.2199;
              $morning2=$morning2*0.2199;
              $morning3=$morning3*0.2199;
              $daily1=$daily1*0.2199 ;
             $daily2=$daily2*0.2199;
             $daily3=$daily3*0.2199;
             $daily4=$daily4*0.2199;
             $night1=$night1*0.2199;
             $night2=$night2*0.2199;
             $night3=$night3*0.2199;
             $night4=$night4*0.2199;   
         

         }
          else{
              $morning=$morning; 
              $morning1=$morning1 ;
              $morning2=$morning2  ;
              $morning3=$morning3 ; 
              $daily1=$daily1  ;
             $daily2=$daily2 ;
             $daily3=$daily3 ;
             $daily4=$daily4 ;
             $night1=$night1 ;
             $night2=$night2 ;
             $night3=$night3 ;
             $night4=$night4 ;    



        }



$avm1=round($matin/6,2);
$avm2=round($matin2/6,2);
$avm3=round($matin3/6,2);
$avm4=round($matin4/6,2);
$avd1=round($soir/14,2);
$avd2=round($soir1/14,2);
$avd3=round($soir2/14,2);
$avd4=round($soir3/14,2);
$avn1=round($nuit/4,2);
$avn2=round($nuit1/4,2);
$avn3=round($nuit2/4,2);
$avn4=round($nuit3/4,2);
$morningf=str_pad(number_format($matin),$imax,  $pad,  STR_PAD_LEFT);
$morning1f=str_pad(number_format($matin2),$imax,  $pad,  STR_PAD_LEFT);
$morning2f=str_pad(number_format($matin3),$imax,  $pad,  STR_PAD_LEFT);
$morning3f=str_pad(number_format($matin4),$imax,  $pad,  STR_PAD_LEFT);
$daily1f=str_pad(number_format($soir),$imax,  $pad,  STR_PAD_LEFT);
$daily2f=str_pad(number_format($soir1),$imax,  $pad,  STR_PAD_LEFT);
$daily3f=str_pad(number_format($soir2),$imax,  $pad,  STR_PAD_LEFT);
$daily4f=str_pad(number_format($soir3),$imax,  $pad,  STR_PAD_LEFT); 
$night1f=str_pad(number_format($nuit),$imax,  $pad,  STR_PAD_LEFT);
$night2f=str_pad(number_format($nuit1),$imax,  $pad,  STR_PAD_LEFT);
$night3f=str_pad(number_format($nuit2),$imax,  $pad,  STR_PAD_LEFT);
$night4f=str_pad(number_format($nuit3),$imax,  $pad,  STR_PAD_LEFT);
$avm1=str_pad(number_format($avm1,2),$imax, $pad,  STR_PAD_LEFT);
$avm2=str_pad(number_format($avm2,2),$imax, $pad,  STR_PAD_LEFT);
$avm3=str_pad(number_format($avm3,2),$imax, $pad,  STR_PAD_LEFT);
$avm4=str_pad(number_format($avm4,2),$imax, $pad,  STR_PAD_LEFT);
$avd1=str_pad(number_format($avd1,2),$imax, $pad,  STR_PAD_LEFT);
$avd2=str_pad(number_format($avd2,2),$imax, $pad,  STR_PAD_LEFT);
$avd3=str_pad(number_format($avd3,2),$imax, $pad,  STR_PAD_LEFT);
$avd4=str_pad(number_format($avd4,2),$imax, $pad,  STR_PAD_LEFT);
$avn1=str_pad(number_format($avn1,2),$imax, $pad,  STR_PAD_LEFT);
$avn2=str_pad(number_format($avn2,2),$imax, $pad,  STR_PAD_LEFT);
$avn3=str_pad(number_format($avn3,2),$imax, $pad,  STR_PAD_LEFT);
$avn4=str_pad(number_format($avn4,2),$imax, $pad,  STR_PAD_LEFT);

?>
<td id='td1'>Morning Usage</td>
<?php
 if($morningf==0){ 
 $morningf='';
 $lib1=' ';
 $par1=' ';
 $par11=' ';
  $avm1='';
}
else{
$lib1='avg';
 $par1='(';
 $par11=')';
 
} 
 
?>
<td id='td1'><?php echo $morningf.$par1.$avm1.$lib1.$par11;?></td> 
<?php
if($morning1f==0){
    $morning1f='';
    $lib2='';
    $avm2='';
    $par2='';
    $par22='';  
}
else{

$lib2='avg';
  $par2='(';
  $par22=')';
}
 
?>
<td id='td1'><?php echo $morning1f.$par2.$avm2.$lib2.$par22;?></td> 
<?php
if($morning2f==0){
    $morning2f='';
    $lib3='';
    $avm3='';
    $par3='';
    $par33='';
}
else{
$lib3='avg';
  $par3='(';
  $par33=')';
}
 
?>

<td id='td1'><?php echo $morning2f.$par3.$avm3.$lib3.$par33;?></td> 
<?php
if($morning3f==0){
    $morning3f='';
    $lib4='';
    $avm4='';
    $par4='';
    $par44='';
}
else{
$lib4='avg';
  $par4='(';
  $par44=')';
}
$p1=' 05';  
?>

<td id='td1'><?php echo $morning3f.$par4.$avm4.$lib4.$par44;?></td>  
<td id='td1'>00:00 ><?php echo ($p1).':'.'59';?></td> </tr> 
 <tr><td id='td1'>Day Usage</td>
<?php  
  if($daily1f==0){
     $libd1='';
    $avd1='';
    $pard1='';
    $pard11='';
    $daily1f='';
}
else{
  $libd1='avg';
  $pard1='(';
  $pard11=')';
}
 
?>          
<td id='td1'><?php echo $daily1f.$pard1.$avd1.$libd1.$pard11;?></td> 
<?php  
  if($daily2f==0){
     $libd1='';
    $avd2='';
    $pard1='';
    $pard11='';
    $daily2f='';
 }

else{
$libd1='avg';
  $pard1='(';
  $pard11=')';
}
 
?>           
 <td id='td1'><?php echo $daily2f.$pard1.$avd2.$libd1.$pard11;?></td> 
<?php  
  if($daily3f==0){
    $libd1='';
    $avd3='';
    $pard1='';
     $pard11='';
    $daily3f='';
}
else{
  $libd1='avg';
  $pard1='(';
  $pard11=')';
}
 
?>                        
<td id='td1'><?php echo $daily3f.$pard1.$avd3.' '.$libd1.$pard11;?></td> 
<?php  
  if($daily4f==0){
     $libd1='';
    $avd4='';
    $pard1='';
    $pard11='';
    $daily4f='';
}
else{

$libd1='avg';
  $pard1='(';
  $pard11=')';
}
$pd=19; 
?>          
 
<td id='td1'><?php echo $daily4f.$pard1.$avd4.$libd1.$pard11;?></td>  
<td id='td1'>06:00 ><?php echo ($pd).':'.'59';?></td>              
</tr>
<?php 
echo"<tr><td id='td1'>Night Usage</td>";
 
  if($night1f==0){
    $libn1='';
    $avn1='';
    $parn1='';
    $parn11='';
    $night1f='';
}
else{

  $libn1='avg';
  $parn1='(';
  $parn11=')';
}
 
?>                
<td id='td1'><?php echo $night1f.' '.$parn1.$avn1.' '.$libn1.$parn11;?></td> 
<?php
if($night2f==0){
    $libn1='';
    $avn2='';
    $parn1='';
    $parn11='';
    $night2f='';
}
else{

  $libn1='avg';
  $parn1='(';
  $parn11=')';
} 
?>                   
<td id='td1'><?php echo $night2f.$parn1.$avn2.$libn1.$parn11;?></td> 
<?php
if($night3f==0){
  $libn1='';
    $avn3='';
    $parn1='';
    $parn11='';
    $night3f='';

}
else{
  $libn1='avg';
  $parn1='(';
  $parn11=')';
}
?>           
<td id='td1'><?php echo $night3f.$parn1.$avn3.$libn1.$parn11;?></td>        
<?php
if($night4f==0){
  $libn1='';
    $avn4='';
    $parn1='';
    $parn11='';
    $night4f='';
}
else{
  $libn1='avg';
  $parn1='(';
  $parn11=')';
$d=23;
$pn='20';
}
?>                 
<td id='td1'><?php echo $night4f.$parn1.$avn4.$libn1.$parn11;?></td>    
<td id='td1'><?php echo '20'.':00'.' > ';?><?php echo '23'.':59';?></td></tr>
 
</table>
 
<?php

if($report==1){  
?>
<p><img src='lineb.php?dateb=<?php echo $dateb?>&dateb=<?php echo $dateb?>&netw=<?php echo $netw?>'/></p> 
<?php
}
?>
<?php
if($report==2){  
?>
<p><img src='metreb.php?dateb=<?php echo $dateb?>&dateb=<?php echo $dateb?>&netw=<?php echo $netw?>'/></p> 
<?php
}

if($report==3){  
?>
<p><img src='galb.php?dateb=<?php echo $dateb?>&dateb=<?php echo $dateb?>&netw=<?php echo $netw?>'/></p> 
<br>
<?php
}
//echo "<br><br><br>";  
}
 
?>

<?php
mysql_close();
?>
<?php
if($num>0){
?>
<input type="button" id="btnPrint" value="Print" onClick="window.print();">  
<input type="button" id="btnPrint"  onclick="window.location.href='export.php?date=<?php echo $date?>&date2=<?php echo $date2?>&netw=<?php echo $netw?>'" value='Export'>
<?php
}
else{
echo "<h2> No Data Found...</h2>"; 
echo "<br>";
?>
<input type="button"  onclick="history.go(-1);" value="Back">
<?php
}
}
?>
</body>
</html>    
thanks

Open in new window

Ray Paseur

I did not want to visit an untrusted connection - apparently the URL redirects to some unknown web site.  So I just copied this part of the file and installed it on my server here.
http://www.laprbass.com/RAY_temp_asaidi.html

It prints correctly in IE, FF and Chrome.
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1252' />
<title>CAMPION The Power Behind The Water</title>
<style type="text/css"  >
#fixed {
    position: absolute;
    top: 0;
    left: 0;
    width: 10em;
    height: 100%;
}
@media print {
input#btnPrint {
display: none;
}
}
@media screen{
    .imgs1 {
       position:absolute;
       width:30%;
       height:15%;
       top:-6px;
       left:0;
      }
  }
.table2 {
      position:relative;
        /*top:-50px;*/
 border:1px solid #000;

      font-family:arial,sans-serif;
      font-size:60%;
      height:100%;
      width:100%;
}
body {
        height: 650px;
        width: 100%;
        /* to centre page on screen*/
        margin-left: auto;
        margin-right: auto;
    }

#tab{
       position:relative;
        top:-90px;
        left: 580px;
	border=0;
	background-color:#FFF;
        font-size:70%;
        border:0px ;
}
#table4{
        border:3px solid #fff;
        position:relative;
        top:-5px;

}
table {
	border:1px solid #000;
	border-collapse:collapse;
	font-size:70%;
}
#td1{

        background-color:#9cf;

}
#td11{

        background-color:#fff;
}

#td3{
        position:relative;
        top:1450px;
        border:0  ;
	border-collapse:collapse;
	padding:5px;
        background-color:#fff;
}

#td2{
	 background-color: rgb(255,255,0); /* Needed for IEs */

        -moz-box-shadow: 5px 5px 5px rgba(68,68,68,0.6);
        -webkit-box-shadow: 5px 5px 5px rgba(68,68,68,0.6);
        box-shadow: 5px 5px 5px rgba(68,68,68,0.6);
}
th{
	border:1px solid #000;
	border-collapse:collapse;
	padding:5px;

}
#fn,#dp,#ar{width:110px;}
#fr,#to{width:90px;}
caption{
	background:#ccc;
	font-size:100%;
	border:1px solid #000;
	border-bottom:none;
	padding:20px 0 0 0;
	text-align:left;
}

div.ex
{
top:-40px;
width:220px;
padding:10px;
border:5px solid gray;
margin:0px;
}
</style>
<script language='JavaScript'>
DA = (document.all) ? 1 : 0

function HandleError()
{
alert('\nNothing was printed. \n\nIf you do want to print this page, then\nclick on the printer icon in the toolbar above.')
return true;
}
</script>
</head>
<script language='JavaScript'>
DA = (document.all) ? 1 : 0
function HandleError()
{
alert('\nNothing was printed. \n\nIf you do want to print this page, then\nclick on the printer icon in the toolbar above.')
return true;
}
</script>
</head>
<body>
<h1> Hello World</h1>
<input type="button" id="btnPrint" value="Print" onClick="window.print();">
<input type="button" id="btnPrint"  onclick="window.location.href='export.php" value='Export'>

<input type="button"  onclick="history.go(-1);" value="Back">

</body>
</html>

Open in new window

Your help has saved me hundreds of hours of internet surfing.
fblack61
asaidi

ASKER
Hi Ray
really it is trusted site only may be is hosted by our server
please find attached pdf the same code
pdf ie and pdf firefox
firefox.pdf
ie.pdf
ASKER CERTIFIED SOLUTION
Ray Paseur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
asaidi

ASKER
RAY
YOU ARE GENIOUS
THE PROBLEM WAS btnprint and in IE i must write it BTNPRINT
Ray Paseur

Ha!  Thanks for the points.  Glad you got it sorted out, ~Ray
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.