miniu Posted March 10, 2010 Share Posted March 10, 2010 I know that when I want to print screen I have to make it like that <td align="right"><a href="#" onClick="javascript:window.print();">Print</a> </td> but how to print only a part of the window. For example not the top and left side but the content area? Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/ Share on other sites More sharing options...
Psycho Posted March 10, 2010 Share Posted March 10, 2010 Use the CSS @media property. You can them apply different styles to obects based upon the "media" that it is in. So, you can set a different "display" propert based upon whether the element is displayed in a browser or in the "print" media. So, for the elements you do not want printed give them a display value of "none" for the print media. There was a similar post which I replied to with example code: http://www.phpfreaks.com/forums/index.php/topic,289715.msg1372740.html#msg1372740 Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/#findComment-1024361 Share on other sites More sharing options...
miniu Posted March 10, 2010 Author Share Posted March 10, 2010 <style type="text/css" media="screen"> html, body { margin:0; padding:0; } div { border:1px solid #000; margin:10px; padding:3px; } </style> <style type="text/css" media="print"> html, body { margin:0; padding:0; } div { border:0; margin:10px 0; padding:0; } .noprint { display:none; } </style> and then <div class="noprint"></div> right??? Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/#findComment-1024417 Share on other sites More sharing options...
miniu Posted March 10, 2010 Author Share Posted March 10, 2010 Hmm ok I put the "noprint" but now there is nothing to print there. What have I done wrong? here is the code <?php include("connect.php"); include("admin.session.php"); $LeftLinkSection = 1; $pagetitle="Referees To Game"; if(isset($_GET['did'])) { $sql="delete from assigned_games where id=".$_GET['did']; $res=mysql_query($sql); echo mysql_error(); header('location:message.php?mid=27'); } if($_POST['sub11']==1) { //echo 'ts'; } if($_GET['league_id']!='') $league=$_GET['league_id']; ?> <HTML> <HEAD><title><?=Site_Title; ?></title> <SCRIPT language="javascript" src="body.js"></SCRIPT> <script> function show_divisions(val) { window.location.href='manage_referees_to_game.php?league_id=' + val; } function show_getgames() { if(document.getElementById('txtfromdate').value!='' && document.getElementById('txttodate').value=='') { alert('Please Select To Date'); document.getElementById('txttodate').focus(); return false; } if(document.getElementById('txttodate').value!='' && document.getElementById('txtfromdate').value=='') { alert('Please Select From Date'); document.getElementById('txtfromdate').focus(); return false; } if(document.getElementById('txttodate').value < document.getElementById('txtfromdate').value) { alert('To Date can not be less then From Date'); document.getElementById('txttodate').focus(); return false; } document.getElementById('sub11').value=1; document.frmgetgames.submit(); } function clearall() { document.getElementById('txtfromdate').value=''; document.getElementById('txttodate').value=''; document.getElementById('refsel').value=''; document.getElementById('drpdivisions').value=''; } function openWin(pageToLoad, winName, width, height, center,scrollbar){ if ((parseInt(navigator.appVersion) >= 4 ) && (center)){ xposition = (screen.width - width) / 2; yposition = (screen.height - height - 100) / 2; args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=no," + "scrollbars=" + scrollbar + "," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0," + "screenx=" + xposition + "," + "screeny=" + yposition + "," + "left=" + xposition + "," + "top=" + yposition; newWindow = window.open(pageToLoad,winName,args); window.focus; } } </script> <script src="calendar.js"></script> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <META content="MSHTML 6.00.2600.0" name=GENERATOR> <link rel="stylesheet" href="main.css" type="text/css"> <style type="text/css"> <!-- .style3 {color: #FFFFFF} --> </style> <style type="text/css" media="screen"> html, body { margin:0; padding:0; } div { border:0px solid #000; margin:0px; padding:0px; } </style> <style type="text/css" media="print"> html, body { margin:0; padding:0; } div { border:0; margin:0px 0; padding:0; } .noprint { display:none; } </style> </HEAD> <BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0"> <div class="noprint"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 class="th-a"> <TR><TD height=60 valign="top" colspan="2" bgColor="#ffffff"><? include("top.php") ?></td></TR> <tr> <td width="20%" valign="top" bgcolor="#1c6995"><? include("left.php"); ?></td> <td width="80%" valign="top" bgcolor="#FFFFFF" height="480"> <TABLE width="97%" border=0 cellPadding=0 cellSpacing=0 align="center"> <TR><TD width="100%" class="H1"> </TD></TR> <TR><TD align="center" width="100%" class="a-l"><?php echo $Message2 ; ?></TD></TR> <TR> <? if($msg!="") { ?> <TR><TD align="center" width="100%" class="a-l"><font color="red"><b>User Deleted Successfully</b></font></TD></TR> <TR> <? } ?> <TD width="100%" class="H1">Manage <?=$pagetitle?></TD> </TR> <TR><TD background="images/vdots.gif"><IMG height=1 src="images/spacer.gif" width=1 border=0></TD></TR> <tr> <TD> <FORM name="order" action="#" method="post"> <TABLE cellSpacing=0 cellPadding=1 border=0 > <tr><td colspan="25" height="20"><b>View By Main Referee Name</b></td></tr> <?=$prs_pageing->order();?> </TABLE> </form> <br><form name="frmgetgames" id="frmgetgames" method="post"> <table cellpadding="0" cellspacing="0" border="0"> <td width="100%" colspan="2" align="left"><select id="refsel" name="refsel"> <option value="" <? if($_POST['refsel']==' ') echo "selected='selected'"; ?>>--Select--</option> <option value="0" <? if($_POST['refsel']!='') { if($_POST['refsel']==0) echo "selected='selected'"; } ?>>Games with NO REFEREE Assigned</option> <option value="1" <? if($_POST['refsel']==1) echo "selected='selected'"; ?>>Games with NO Main Referee Assigned</option> <option value="2" <? if($_POST['refsel']==2) echo "selected='selected'"; ?>>Games with NO Assistant Referee 1 Assigned</option> <option value="3" <? if($_POST['refsel']==3) echo "selected='selected'"; ?>>Games with NO Assistant Referee 2 Assigned</option> </select> <select name="drpleague" id="drpleague" style="width:150px" onChange="show_divisions(this.value)"> <option value="">--Select--</option> <? $sql_league="select * from league"; $res_league=mysql_query($sql_league); while($row_league=mysql_fetch_object($res_league)) { ?> <option value="<?=$row_league->id?>" <? if($row_league->id==$league) echo "selected='selected'"; ?>><?=stripslashes($row_league->league_name)?></option> <? } ?> </select> <? if($league!='') { ?><select id="drpdivisions" name="drpdivisions"> <option value="">--Select Division--</option> <? $sql_division="select * from divisions where league_id=".$league." order by dname"; $res_division=mysql_query($sql_division); while($row_division=mysql_fetch_object($res_division)) { ?> <option value="<?=$row_division->id?>" <? if($_POST['drpdivisions']==$row_division->id) echo "selected='selected'"; ?>><?=stripslashes($row_division->dname);?></option> <? } ?> </select><? } ?> </td></tr> <tr> <td width="100%" colspan="2" align="center"> From Date: <input type="text" name="txtfromdate" readonly="true" id="txtfromdate" size="15" value="<?=stripslashes($_REQUEST['txtfromdate']);?>"> <a href="#" onClick="getCalendar(document.getElementById('txtfromdate'));"> Select Date</a> To Date: <input type="text" name="txttodate" readonly="true" id="txttodate" size="15" value="<?=stripslashes($_REQUEST['txttodate']);?>"> <a href="#" onClick="getCalendar(document.getElementById('txttodate'));"> Select Date</a> <input type="button" value="Get Games" onClick="show_getgames();"><input type="hidden" id="sub11" name="sub11" value="0"> <input type="button" value="Clear" onClick="clearall();"> </td> </tr> <tr><td colspan="2"> </td></tr> <tr> </table></form><br> </div> <? if($_GET["order"]) { $order=$_GET["order"]; $strQueryPerPage="select lea.league_name,ht.tname as htname,at.tname as atname,d.dname,g.gdate,g.gtime,ag.id,ag.gid,ag.main_ref_id,ag.ast_ref_id1,ag.ast_ref_id2,ag.main_ref_accept,ag.ast_ref1_accept,ag.ast_ref2_accept,r1.fname as r1fname,r1.lname as r1lname,r2.fname as r2fname,r2.lname as r2lname,r3.fname as r3fname,r3.lname as r3lname from assigned_games ag left outer join referees r1 on ag.main_ref_id=r1.id left outer join referees r2 on ag.ast_ref_id1=r2.id left outer join referees r3 on ag.ast_ref_id2=r3.id left outer join games g on ag.gid=g.gid left outer join divisions d on g.div_id=d.id left outer join league lea on g.league_id=lea.id left outer join teams ht on g.home_team_id=ht.id left outer join teams at on g.away_team_id=at.id where r1.fname like '$order%'"; } else $strQueryPerPage="select lea.league_name,ht.tname as htname,at.tname as atname,d.dname,g.gdate,g.gtime,ag.main_ref_id,ag.ast_ref_id1,ag.ast_ref_id2,ag.id,ag.gid,ag.main_ref_accept,ag.ast_ref1_accept,ag.ast_ref2_accept,r1.fname as r1fname,r1.lname as r1lname,r2.fname as r2fname,r2.lname as r2lname,r3.fname as r3fname,r3.lname as r3lname from assigned_games ag left outer join referees r1 on ag.main_ref_id=r1.id left outer join referees r2 on ag.ast_ref_id1=r2.id left outer join referees r3 on ag.ast_ref_id2=r3.id left outer join games g on ag.gid=g.gid left outer join divisions d on g.div_id=d.id left outer join league lea on g.league_id=lea.id left outer join teams ht on g.home_team_id=ht.id left outer join teams at on g.away_team_id=at.id where 1=1"; //echo $strQueryPerPage; if($_POST['sub11']==1) { if($_REQUEST['txtfromdate']!='') { $txtfromdate=$_REQUEST['txtfromdate']; $txtfromdate_arr=explode("-",$txtfromdate); $txtfromdate=$txtfromdate_arr[2].'-'.$txtfromdate_arr[0].'-'.$txtfromdate_arr[1]; $txttodate=$_REQUEST['txttodate']; $txttodate_arr=explode("-",$txttodate); $txttodate=$txttodate_arr[2].'-'.$txttodate_arr[0].'-'.$txttodate_arr[1]; $strQueryPerPage.=" and g.gdate >='".$txtfromdate."' and g.gdate<='".$txttodate."'"; } if($_POST['refsel']!='') { if($_POST['refsel']==0) { $strQueryPerPage.=" and ag.main_ref_id=0 and ag.ast_ref_id1=0 and ag.ast_ref_id2=0"; } if($_POST['refsel']==1) { $strQueryPerPage.=" and ag.main_ref_id=0"; } if($_POST['refsel']==2) { $strQueryPerPage.=" and ag.ast_ref_id1=0"; } if($_POST['refsel']==3) { $strQueryPerPage.=" and ag.ast_ref_id2=0"; } } if($_POST['drpdivisions']!='') { $strQueryPerPage.=" and d.id=".$_POST['drpdivisions']; $drp_division=$_POST['drpdivisions']; } if($_POST['drpleague']!='') { $strQueryPerPage.=" and lea.id=".$_POST['drpleague']; $league=$_POST['drpleague']; } } if(isset($_GET['sort'])) $strQueryPerPage.=" order by ".$_GET['sort']." ".$_GET['ordby']; else $strQueryPerPage.=" order by ag.id desc"; //echo $strQueryPerPage; $strResultPerPage=mysql_query($strQueryPerPage); $strTotalPerPage=mysql_affected_rows(); ?> <FORM name="form2" action="#" method="post"> <td align="right"><a href="#" onClick="javascript:window.print();"><b>PRINT</b></a> </td> <TABLE width="100%" height="89" border=1 cellSpacing=0 class=t-a> <!--DWLayoutTable--> <TBODY> <TR class="th-a"> <TD colspan="10"> <? $result=$prs_pageing->number_pageing($strQueryPerPage,15,7); ?> </TD> </TR> <TR class=th-a> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=lea.league_name&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">League Name</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=d.dname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Division</a></TD></div> <div><TD width="8%" align="left"><a href="manage_referees_to_game.php?sort=g.gdate&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Game Date</a></TD></div> <div><TD width="8%" align="left"><a href="manage_referees_to_game.php?sort=g.gtime&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Game Time</a></TD></div> <div><TD width="12%" align="left"><a href="manage_referees_to_game.php?sort=at.tname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Home Team</a></TD></div> <div><TD width="12%" align="left"><a href="manage_referees_to_game.php?sort=ht.tname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Away Team</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r1.fname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Referee</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r2.fname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Assistant Referee 1</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r3.fname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Assistant Referee 2</a></TD></div> <div><TD width="10%" align="center"><span class="style3">Option</span></TD></div> </TR> <?php $tr="#f4f4f4"; $clr=1; while($row = mysql_fetch_object($result)) { if($tr=="#FFFFFF") { $tr="#efefef"; $col="#000000"; } else { $tr="#FFFFFF"; $col="#000000"; } $tmpid = $row->id ; $tmpid = ""; $agid=$row->id; ?> <tr bgcolor="<? echo $tr; ?>"> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->league_name); ?></font></TD> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->dname); ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? $txtgdate=$row->gdate; $txtgdate_arr=explode("-",$txtgdate); $txtgdate=$txtgdate_arr[1].'-'.$txtgdate_arr[2].'-'.$txtgdate_arr[0]; ?> <? echo stripslashes($txtgdate); ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? $txtgtime=$row->gtime; $txtgtime_arr=explode("-",$txtgtime); $txtgtime=$txtgtime_arr[1].'-'.$txtgtime_arr[2].'-'.$txtgtime_arr[0]; ?> <? echo stripslashes($txtgtime); ?></font></TD> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->htname); ?></font></TD> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->atname); ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? echo stripslashes($row->r1fname).' '.stripslashes($row->r1lname); ?><br><? if($row->main_ref_accept=='P' && $row->main_ref_id!=0) echo "<font color='#FF9900'><b>Pending</b></font>"; ?><? if($row->main_ref_accept=='A') echo "<font color='#006633'><b>Accepted</b></font>"; ?><? if($row->main_ref_accept=='R') echo "<font color='#FF0000'><b>Rejected</b></font><a href='#' onclick=\"openWin('view_reason.php?mainref_id=$agid','test','550','500','true','yes');\">(View Reason)</a>"; ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? echo stripslashes($row->r2fname).' '.stripslashes($row->r2lname); ?></font><br><? if($row->r2fname!='') { if($row->ast_ref1_accept=='P' && $row->ast_ref_id1!=0) echo "<font color='#FF9900'><b>Pending</b></font>"; ?><? if($row->ast_ref1_accept=='A') echo "<font color='#006633'><b>Accepted</b></font>"; ?><? if($row->ast_ref1_accept=='R') echo "<font color='#FF0000'><b>Rejected</b></font><a href='#' onclick=\"openWin('view_reason.php?astref_id1=$agid','test','550','500','true','yes');\">(View Reason)</a>"; } ?></TD> <TD align="left"><font color="<?=$col?>"> <? echo stripslashes($row->r3fname).' '.stripslashes($row->r3lname); ?></font><br><? if($row->r3fname!='') { if($row->ast_ref2_accept=='P' && $row->ast_ref_id2!=0) echo "<font color='#FF9900'><b>Pending</b></font>"; ?><? if($row->ast_ref2_accept=='A') echo "<font color='#006633'><b>Accepted</b></font>"; ?><? if($row->ast_ref2_accept=='R') echo "<font color='#FF0000'><b>Rejected</b></font><a href='#' onclick=\"openWin('view_reason.php?astref_id2=$agid','test','550','500','true','yes');\">(View Reason)</a>"; } ?></TD> <TD align="center"><input name="button" type="button" class="bttn-s" onClick="location.href='edit_referee_to_game.php?id=<?php echo $row->id; ?>'" value="Edit Assignment"> <INPUT class="bttn-s" onClick="deleteconfirm('Are you sure you want to delete this Assigned Referee to Game? \n','manage_referees_to_game.php?did=<?php echo($row->id); ?>');" type="button" value="Delete Assignment"> </TD> </TR> <? $parentary = NULL ; } ?> <input type=hidden name="total" value="<? echo $strTotalNewRow; ?>"> <TR align=center> <TD colSpan=10> <? if(!$strTotalPerPage) { ?> <strong>No Referees To Game Detail Display</strong> <? } ?> </TD> </TR> </TABLE> </FORM> </TD> </TR> </TABLE> </td> </tr> </TABLE> </BODY></HTML> Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/#findComment-1024428 Share on other sites More sharing options...
Psycho Posted March 10, 2010 Share Posted March 10, 2010 Before I get to the problem, let me just say: You don't have to define the same element for screen and print if the style is the same for both (i.e. the html & body where you set the same properties for both). In this case I assume all styles are to be the same for screen & print except for the "noprint" style to be used on items that, well, shouldn't print. So, for the default styles don't declare a media value. I have never used different STYLE blocks for different media types. I have always used the @media property within a single STYLE block to define different media styles. I don't know which method is right or wrong, but a little testing showed me why you are experiencing this problem. And, it is an interesting difference. When using different STYLE blocks for different media types, if you declare a class in one media style block and not another, the browser is applying that class to all media types. So, in your code above you did not define the noprint class in the print media style block. I guess the browser then defaulted to the properties for that class in the print media style block. The method I typically used didn't have this behavior. Example: <html> <head> <style type="text/css"> /* media neutral styles go here */ @media print { .noprint { display: none; } } </style> </head> <body> <div>This will print</div> <div class="noprint">This will NOT print</div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/#findComment-1024441 Share on other sites More sharing options...
miniu Posted March 10, 2010 Author Share Posted March 10, 2010 Ok I've changed it like you said but I want to print only the table in that file and when I try to "noprint" other information it hide me everything. <style type="text/css"> /* media neutral styles go here */ @media print { .noprint { display: none; } } </style> </HEAD> <BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0"> <div class="noprint"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 class="th-a"> <TR><TD height=60 valign="top" colspan="2" bgColor="#ffffff"><? include("top.php") ?></td></TR> <tr> <td width="20%" valign="top" bgcolor="#1c6995"><? include("left.php"); ?></td> <td width="80%" valign="top" bgcolor="#FFFFFF" height="480"> <TABLE width="97%" border=0 cellPadding=0 cellSpacing=0 align="center"> <TR><TD width="100%" class="H1"> </TD></TR> <TR><TD align="center" width="100%" class="a-l"><?php echo $Message2 ; ?></TD></TR> <TR> <? if($msg!="") { ?> <TR><TD align="center" width="100%" class="a-l"><font color="red"><b>User Deleted Successfully</b></font></TD></TR> <TR> <? } ?> <TD width="100%" class="H1">Manage <?=$pagetitle?></TD> </TR> <TR><TD background="images/vdots.gif"><IMG height=1 src="images/spacer.gif" width=1 border=0></TD></TR> <tr> <TD> <FORM name="order" action="#" method="post"> <TABLE cellSpacing=0 cellPadding=1 border=0 > <tr><td colspan="25" height="20"><b>View By Main Referee Name</b></td></tr> <?=$prs_pageing->order();?> </TABLE> </form> <br><form name="frmgetgames" id="frmgetgames" method="post"> <table cellpadding="0" cellspacing="0" border="0"> <td width="100%" colspan="2" align="left"><select id="refsel" name="refsel"> <option value="" <? if($_POST['refsel']==' ') echo "selected='selected'"; ?>>--Select--</option> <option value="0" <? if($_POST['refsel']!='') { if($_POST['refsel']==0) echo "selected='selected'"; } ?>>Games with NO REFEREE Assigned</option> <option value="1" <? if($_POST['refsel']==1) echo "selected='selected'"; ?>>Games with NO Main Referee Assigned</option> <option value="2" <? if($_POST['refsel']==2) echo "selected='selected'"; ?>>Games with NO Assistant Referee 1 Assigned</option> <option value="3" <? if($_POST['refsel']==3) echo "selected='selected'"; ?>>Games with NO Assistant Referee 2 Assigned</option> </select> <select name="drpleague" id="drpleague" style="width:150px" onChange="show_divisions(this.value)"> <option value="">--Select--</option> <? $sql_league="select * from league"; $res_league=mysql_query($sql_league); while($row_league=mysql_fetch_object($res_league)) { ?> <option value="<?=$row_league->id?>" <? if($row_league->id==$league) echo "selected='selected'"; ?>><?=stripslashes($row_league->league_name)?></option> <? } ?> </select> <? if($league!='') { ?><select id="drpdivisions" name="drpdivisions"> <option value="">--Select Division--</option> <? $sql_division="select * from divisions where league_id=".$league." order by dname"; $res_division=mysql_query($sql_division); while($row_division=mysql_fetch_object($res_division)) { ?> <option value="<?=$row_division->id?>" <? if($_POST['drpdivisions']==$row_division->id) echo "selected='selected'"; ?>><?=stripslashes($row_division->dname);?></option> <? } ?> </select><? } ?> </td></tr> <tr> <td width="100%" colspan="2" align="center"> From Date: <input type="text" name="txtfromdate" readonly="true" id="txtfromdate" size="15" value="<?=stripslashes($_REQUEST['txtfromdate']);?>"> <a href="#" onClick="getCalendar(document.getElementById('txtfromdate'));"> Select Date</a> To Date: <input type="text" name="txttodate" readonly="true" id="txttodate" size="15" value="<?=stripslashes($_REQUEST['txttodate']);?>"> <a href="#" onClick="getCalendar(document.getElementById('txttodate'));"> Select Date</a> <input type="button" value="Get Games" onClick="show_getgames();"><input type="hidden" id="sub11" name="sub11" value="0"> <input type="button" value="Clear" onClick="clearall();"> </td> </tr> <tr><td colspan="2"> </td></tr> <tr> </table></form><br> </div> <? if($_GET["order"]) { $order=$_GET["order"]; $strQueryPerPage="select lea.league_name,ht.tname as htname,at.tname as atname,d.dname,g.gdate,g.gtime,ag.id,ag.gid,ag.main_ref_id,ag.ast_ref_id1,ag.ast_ref_id2,ag.main_ref_accept,ag.ast_ref1_accept,ag.ast_ref2_accept,r1.fname as r1fname,r1.lname as r1lname,r2.fname as r2fname,r2.lname as r2lname,r3.fname as r3fname,r3.lname as r3lname from assigned_games ag left outer join referees r1 on ag.main_ref_id=r1.id left outer join referees r2 on ag.ast_ref_id1=r2.id left outer join referees r3 on ag.ast_ref_id2=r3.id left outer join games g on ag.gid=g.gid left outer join divisions d on g.div_id=d.id left outer join league lea on g.league_id=lea.id left outer join teams ht on g.home_team_id=ht.id left outer join teams at on g.away_team_id=at.id where r1.fname like '$order%'"; } else $strQueryPerPage="select lea.league_name,ht.tname as htname,at.tname as atname,d.dname,g.gdate,g.gtime,ag.main_ref_id,ag.ast_ref_id1,ag.ast_ref_id2,ag.id,ag.gid,ag.main_ref_accept,ag.ast_ref1_accept,ag.ast_ref2_accept,r1.fname as r1fname,r1.lname as r1lname,r2.fname as r2fname,r2.lname as r2lname,r3.fname as r3fname,r3.lname as r3lname from assigned_games ag left outer join referees r1 on ag.main_ref_id=r1.id left outer join referees r2 on ag.ast_ref_id1=r2.id left outer join referees r3 on ag.ast_ref_id2=r3.id left outer join games g on ag.gid=g.gid left outer join divisions d on g.div_id=d.id left outer join league lea on g.league_id=lea.id left outer join teams ht on g.home_team_id=ht.id left outer join teams at on g.away_team_id=at.id where 1=1"; //echo $strQueryPerPage; if($_POST['sub11']==1) { if($_REQUEST['txtfromdate']!='') { $txtfromdate=$_REQUEST['txtfromdate']; $txtfromdate_arr=explode("-",$txtfromdate); $txtfromdate=$txtfromdate_arr[2].'-'.$txtfromdate_arr[0].'-'.$txtfromdate_arr[1]; $txttodate=$_REQUEST['txttodate']; $txttodate_arr=explode("-",$txttodate); $txttodate=$txttodate_arr[2].'-'.$txttodate_arr[0].'-'.$txttodate_arr[1]; $strQueryPerPage.=" and g.gdate >='".$txtfromdate."' and g.gdate<='".$txttodate."'"; } if($_POST['refsel']!='') { if($_POST['refsel']==0) { $strQueryPerPage.=" and ag.main_ref_id=0 and ag.ast_ref_id1=0 and ag.ast_ref_id2=0"; } if($_POST['refsel']==1) { $strQueryPerPage.=" and ag.main_ref_id=0"; } if($_POST['refsel']==2) { $strQueryPerPage.=" and ag.ast_ref_id1=0"; } if($_POST['refsel']==3) { $strQueryPerPage.=" and ag.ast_ref_id2=0"; } } if($_POST['drpdivisions']!='') { $strQueryPerPage.=" and d.id=".$_POST['drpdivisions']; $drp_division=$_POST['drpdivisions']; } if($_POST['drpleague']!='') { $strQueryPerPage.=" and lea.id=".$_POST['drpleague']; $league=$_POST['drpleague']; } } if(isset($_GET['sort'])) $strQueryPerPage.=" order by ".$_GET['sort']." ".$_GET['ordby']; else $strQueryPerPage.=" order by ag.id desc"; //echo $strQueryPerPage; $strResultPerPage=mysql_query($strQueryPerPage); $strTotalPerPage=mysql_affected_rows(); ?> <FORM name="form2" action="#" method="post"> <td align="right"><a href="#" onClick="javascript:window.print();"><b>PRINT</b></a> </td> <TABLE width="100%" height="89" border=1 cellSpacing=0 class=t-a> <!--DWLayoutTable--> <TBODY> <TR class="th-a"> <TD colspan="10"> <? $result=$prs_pageing->number_pageing($strQueryPerPage,15,7); ?> </TD> </TR> <TR class=th-a> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=lea.league_name&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">League Name</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=d.dname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Division</a></TD></div> <div><TD width="8%" align="left"><a href="manage_referees_to_game.php?sort=g.gdate&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Game Date</a></TD></div> <div><TD width="8%" align="left"><a href="manage_referees_to_game.php?sort=g.gtime&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Game Time</a></TD></div> <div><TD width="12%" align="left"><a href="manage_referees_to_game.php?sort=at.tname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Home Team</a></TD></div> <div><TD width="12%" align="left"><a href="manage_referees_to_game.php?sort=ht.tname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Away Team</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r1.fname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Referee</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r2.fname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Assistant Referee 1</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r3.fname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Assistant Referee 2</a></TD></div> <div><TD width="10%" align="center"><span class="style3">Option</span></TD></div> </TR> <?php $tr="#f4f4f4"; $clr=1; while($row = mysql_fetch_object($result)) { if($tr=="#FFFFFF") { $tr="#efefef"; $col="#000000"; } else { $tr="#FFFFFF"; $col="#000000"; } $tmpid = $row->id ; $tmpid = ""; $agid=$row->id; ?> <tr bgcolor="<? echo $tr; ?>"> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->league_name); ?></font></TD> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->dname); ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? $txtgdate=$row->gdate; $txtgdate_arr=explode("-",$txtgdate); $txtgdate=$txtgdate_arr[1].'-'.$txtgdate_arr[2].'-'.$txtgdate_arr[0]; ?> <? echo stripslashes($txtgdate); ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? $txtgtime=$row->gtime; $txtgtime_arr=explode("-",$txtgtime); $txtgtime=$txtgtime_arr[1].'-'.$txtgtime_arr[2].'-'.$txtgtime_arr[0]; ?> <? echo stripslashes($txtgtime); ?></font></TD> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->htname); ?></font></TD> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->atname); ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? echo stripslashes($row->r1fname).' '.stripslashes($row->r1lname); ?><br><? if($row->main_ref_accept=='P' && $row->main_ref_id!=0) echo "<font color='#FF9900'><b>Pending</b></font>"; ?><? if($row->main_ref_accept=='A') echo "<font color='#006633'><b>Accepted</b></font>"; ?><? if($row->main_ref_accept=='R') echo "<font color='#FF0000'><b>Rejected</b></font><a href='#' onclick=\"openWin('view_reason.php?mainref_id=$agid','test','550','500','true','yes');\">(View Reason)</a>"; ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? echo stripslashes($row->r2fname).' '.stripslashes($row->r2lname); ?></font><br><? if($row->r2fname!='') { if($row->ast_ref1_accept=='P' && $row->ast_ref_id1!=0) echo "<font color='#FF9900'><b>Pending</b></font>"; ?><? if($row->ast_ref1_accept=='A') echo "<font color='#006633'><b>Accepted</b></font>"; ?><? if($row->ast_ref1_accept=='R') echo "<font color='#FF0000'><b>Rejected</b></font><a href='#' onclick=\"openWin('view_reason.php?astref_id1=$agid','test','550','500','true','yes');\">(View Reason)</a>"; } ?></TD> <TD align="left"><font color="<?=$col?>"> <? echo stripslashes($row->r3fname).' '.stripslashes($row->r3lname); ?></font><br><? if($row->r3fname!='') { if($row->ast_ref2_accept=='P' && $row->ast_ref_id2!=0) echo "<font color='#FF9900'><b>Pending</b></font>"; ?><? if($row->ast_ref2_accept=='A') echo "<font color='#006633'><b>Accepted</b></font>"; ?><? if($row->ast_ref2_accept=='R') echo "<font color='#FF0000'><b>Rejected</b></font><a href='#' onclick=\"openWin('view_reason.php?astref_id2=$agid','test','550','500','true','yes');\">(View Reason)</a>"; } ?></TD> <TD align="center"><input name="button" type="button" class="bttn-s" onClick="location.href='edit_referee_to_game.php?id=<?php echo $row->id; ?>'" value="Edit Assignment"> <INPUT class="bttn-s" onClick="deleteconfirm('Are you sure you want to delete this Assigned Referee to Game? \n','manage_referees_to_game.php?did=<?php echo($row->id); ?>');" type="button" value="Delete Assignment"> </TD> </TR> <? $parentary = NULL ; } ?> <input type=hidden name="total" value="<? echo $strTotalNewRow; ?>"> <TR align=center> <TD colSpan=10> <? if(!$strTotalPerPage) { ?> <strong>No Referees To Game Detail Display</strong> <? } ?> </TD> </TR> </TABLE> </FORM> </TD> </TR> </TABLE> </td> </tr> </TABLE> Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/#findComment-1024458 Share on other sites More sharing options...
Psycho Posted March 11, 2010 Share Posted March 11, 2010 Your problem is an HTML/CSS one, not a PHP problem (moving to appropriate forum). It is difficult for me to understand what/where the problem is. Please post the HTML output of the script and I can help further. Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/#findComment-1024486 Share on other sites More sharing options...
miniu Posted March 11, 2010 Author Share Posted March 11, 2010 <?php include("connect.php"); include("admin.session.php"); $LeftLinkSection = 1; $pagetitle="Referees To Game"; if(isset($_GET['did'])) { $sql="delete from assigned_games where id=".$_GET['did']; $res=mysql_query($sql); echo mysql_error(); header('location:message.php?mid=27'); } if($_POST['sub11']==1) { //echo 'ts'; } if($_GET['league_id']!='') $league=$_GET['league_id']; ?> <HTML> <HEAD><title><?=Site_Title; ?></title> <SCRIPT language="javascript" src="body.js"></SCRIPT> <script> function show_divisions(val) { window.location.href='manage_referees_to_game.php?league_id=' + val; } function show_getgames() { if(document.getElementById('txtfromdate').value!='' && document.getElementById('txttodate').value=='') { alert('Please Select To Date'); document.getElementById('txttodate').focus(); return false; } if(document.getElementById('txttodate').value!='' && document.getElementById('txtfromdate').value=='') { alert('Please Select From Date'); document.getElementById('txtfromdate').focus(); return false; } if(document.getElementById('txttodate').value < document.getElementById('txtfromdate').value) { alert('To Date can not be less then From Date'); document.getElementById('txttodate').focus(); return false; } document.getElementById('sub11').value=1; document.frmgetgames.submit(); } function clearall() { document.getElementById('txtfromdate').value=''; document.getElementById('txttodate').value=''; document.getElementById('refsel').value=''; document.getElementById('drpdivisions').value=''; } function openWin(pageToLoad, winName, width, height, center,scrollbar){ if ((parseInt(navigator.appVersion) >= 4 ) && (center)){ xposition = (screen.width - width) / 2; yposition = (screen.height - height - 100) / 2; args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=no," + "scrollbars=" + scrollbar + "," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0," + "screenx=" + xposition + "," + "screeny=" + yposition + "," + "left=" + xposition + "," + "top=" + yposition; newWindow = window.open(pageToLoad,winName,args); window.focus; } } </script> <script src="calendar.js"></script> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <META content="MSHTML 6.00.2600.0" name=GENERATOR> <link rel="stylesheet" href="main.css" type="text/css"> <style type="text/css"> <!-- .style3 {color: #FFFFFF} --> </style> <style type="text/css"> /* media neutral styles go here */ @media print { .noprint { display: none; } } </style> </HEAD> <BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0"> <div class="noprint"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 class="th-a"> <TR><TD height=60 valign="top" colspan="2" bgColor="#ffffff"><? include("top.php") ?></td></TR> <tr> <td width="20%" valign="top" bgcolor="#1c6995"><? include("left.php"); ?></td> <td width="80%" valign="top" bgcolor="#FFFFFF" height="480"> <TABLE width="97%" border=0 cellPadding=0 cellSpacing=0 align="center"> <TR><TD width="100%" class="H1"> </TD></TR> <TR><TD align="center" width="100%" class="a-l"><?php echo $Message2 ; ?></TD></TR> <TR> <? if($msg!="") { ?> <TR><TD align="center" width="100%" class="a-l"><font color="red"><b>User Deleted Successfully</b></font></TD></TR> <TR> <? } ?> <TD width="100%" class="H1">Manage <?=$pagetitle?></TD> </TR> <TR><TD background="images/vdots.gif"><IMG height=1 src="images/spacer.gif" width=1 border=0></TD></TR> <tr> <TD> <FORM name="order" action="#" method="post"> <TABLE cellSpacing=0 cellPadding=1 border=0 > <tr><td colspan="25" height="20"><b>View By Main Referee Name</b></td></tr> <?=$prs_pageing->order();?> </TABLE> </form> <br><form name="frmgetgames" id="frmgetgames" method="post"> <table cellpadding="0" cellspacing="0" border="0"> <td width="100%" colspan="2" align="left"><select id="refsel" name="refsel"> <option value="" <? if($_POST['refsel']==' ') echo "selected='selected'"; ?>>--Select--</option> <option value="0" <? if($_POST['refsel']!='') { if($_POST['refsel']==0) echo "selected='selected'"; } ?>>Games with NO REFEREE Assigned</option> <option value="1" <? if($_POST['refsel']==1) echo "selected='selected'"; ?>>Games with NO Main Referee Assigned</option> <option value="2" <? if($_POST['refsel']==2) echo "selected='selected'"; ?>>Games with NO Assistant Referee 1 Assigned</option> <option value="3" <? if($_POST['refsel']==3) echo "selected='selected'"; ?>>Games with NO Assistant Referee 2 Assigned</option> </select> <select name="drpleague" id="drpleague" style="width:150px" onChange="show_divisions(this.value)"> <option value="">--Select--</option> <? $sql_league="select * from league"; $res_league=mysql_query($sql_league); while($row_league=mysql_fetch_object($res_league)) { ?> <option value="<?=$row_league->id?>" <? if($row_league->id==$league) echo "selected='selected'"; ?>><?=stripslashes($row_league->league_name)?></option> <? } ?> </select> <? if($league!='') { ?><select id="drpdivisions" name="drpdivisions"> <option value="">--Select Division--</option> <? $sql_division="select * from divisions where league_id=".$league." order by dname"; $res_division=mysql_query($sql_division); while($row_division=mysql_fetch_object($res_division)) { ?> <option value="<?=$row_division->id?>" <? if($_POST['drpdivisions']==$row_division->id) echo "selected='selected'"; ?>><?=stripslashes($row_division->dname);?></option> <? } ?> </select><? } ?> </td></tr> <tr> <td width="100%" colspan="2" align="center"> From Date: <input type="text" name="txtfromdate" readonly="true" id="txtfromdate" size="15" value="<?=stripslashes($_REQUEST['txtfromdate']);?>"> <a href="#" onClick="getCalendar(document.getElementById('txtfromdate'));"> Select Date</a> To Date: <input type="text" name="txttodate" readonly="true" id="txttodate" size="15" value="<?=stripslashes($_REQUEST['txttodate']);?>"> <a href="#" onClick="getCalendar(document.getElementById('txttodate'));"> Select Date</a> <input type="button" value="Get Games" onClick="show_getgames();"><input type="hidden" id="sub11" name="sub11" value="0"> <input type="button" value="Clear" onClick="clearall();"> </td> </tr> <tr><td colspan="2"> </td></tr> <tr> </table></form><br> </div> <? if($_GET["order"]) { $order=$_GET["order"]; $strQueryPerPage="select lea.league_name,ht.tname as htname,at.tname as atname,d.dname,g.gdate,g.gtime,ag.id,ag.gid,ag.main_ref_id,ag.ast_ref_id1,ag.ast_ref_id2,ag.main_ref_accept,ag.ast_ref1_accept,ag.ast_ref2_accept,r1.fname as r1fname,r1.lname as r1lname,r2.fname as r2fname,r2.lname as r2lname,r3.fname as r3fname,r3.lname as r3lname from assigned_games ag left outer join referees r1 on ag.main_ref_id=r1.id left outer join referees r2 on ag.ast_ref_id1=r2.id left outer join referees r3 on ag.ast_ref_id2=r3.id left outer join games g on ag.gid=g.gid left outer join divisions d on g.div_id=d.id left outer join league lea on g.league_id=lea.id left outer join teams ht on g.home_team_id=ht.id left outer join teams at on g.away_team_id=at.id where r1.fname like '$order%'"; } else $strQueryPerPage="select lea.league_name,ht.tname as htname,at.tname as atname,d.dname,g.gdate,g.gtime,ag.main_ref_id,ag.ast_ref_id1,ag.ast_ref_id2,ag.id,ag.gid,ag.main_ref_accept,ag.ast_ref1_accept,ag.ast_ref2_accept,r1.fname as r1fname,r1.lname as r1lname,r2.fname as r2fname,r2.lname as r2lname,r3.fname as r3fname,r3.lname as r3lname from assigned_games ag left outer join referees r1 on ag.main_ref_id=r1.id left outer join referees r2 on ag.ast_ref_id1=r2.id left outer join referees r3 on ag.ast_ref_id2=r3.id left outer join games g on ag.gid=g.gid left outer join divisions d on g.div_id=d.id left outer join league lea on g.league_id=lea.id left outer join teams ht on g.home_team_id=ht.id left outer join teams at on g.away_team_id=at.id where 1=1"; //echo $strQueryPerPage; if($_POST['sub11']==1) { if($_REQUEST['txtfromdate']!='') { $txtfromdate=$_REQUEST['txtfromdate']; $txtfromdate_arr=explode("-",$txtfromdate); $txtfromdate=$txtfromdate_arr[2].'-'.$txtfromdate_arr[0].'-'.$txtfromdate_arr[1]; $txttodate=$_REQUEST['txttodate']; $txttodate_arr=explode("-",$txttodate); $txttodate=$txttodate_arr[2].'-'.$txttodate_arr[0].'-'.$txttodate_arr[1]; $strQueryPerPage.=" and g.gdate >='".$txtfromdate."' and g.gdate<='".$txttodate."'"; } if($_POST['refsel']!='') { if($_POST['refsel']==0) { $strQueryPerPage.=" and ag.main_ref_id=0 and ag.ast_ref_id1=0 and ag.ast_ref_id2=0"; } if($_POST['refsel']==1) { $strQueryPerPage.=" and ag.main_ref_id=0"; } if($_POST['refsel']==2) { $strQueryPerPage.=" and ag.ast_ref_id1=0"; } if($_POST['refsel']==3) { $strQueryPerPage.=" and ag.ast_ref_id2=0"; } } if($_POST['drpdivisions']!='') { $strQueryPerPage.=" and d.id=".$_POST['drpdivisions']; $drp_division=$_POST['drpdivisions']; } if($_POST['drpleague']!='') { $strQueryPerPage.=" and lea.id=".$_POST['drpleague']; $league=$_POST['drpleague']; } } if(isset($_GET['sort'])) $strQueryPerPage.=" order by ".$_GET['sort']." ".$_GET['ordby']; else $strQueryPerPage.=" order by ag.id desc"; //echo $strQueryPerPage; $strResultPerPage=mysql_query($strQueryPerPage); $strTotalPerPage=mysql_affected_rows(); ?> <FORM name="form2" action="#" method="post"> <td align="right"><a href="#" onClick="javascript:window.print();"><b>PRINT</b></a> </td> <TABLE width="100%" height="89" border=1 cellSpacing=0 class=t-a> <!--DWLayoutTable--> <TBODY> <TR class="th-a"> <TD colspan="10"> <? $result=$prs_pageing->number_pageing($strQueryPerPage,15,7); ?> </TD> </TR> <TR class=th-a> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=lea.league_name&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">League Name</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=d.dname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Division</a></TD></div> <div><TD width="8%" align="left"><a href="manage_referees_to_game.php?sort=g.gdate&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Game Date</a></TD></div> <div><TD width="8%" align="left"><a href="manage_referees_to_game.php?sort=g.gtime&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Game Time</a></TD></div> <div><TD width="12%" align="left"><a href="manage_referees_to_game.php?sort=at.tname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Home Team</a></TD></div> <div><TD width="12%" align="left"><a href="manage_referees_to_game.php?sort=ht.tname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Away Team</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r1.fname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Referee</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r2.fname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Assistant Referee 1</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r3.fname&<? if($_GET['ordby']=='asc' || $_GET['ordby']=='' ) {?>ordby=desc<? } else {?>ordby=asc<? } ?>" class="link2">Assistant Referee 2</a></TD></div> <div><TD width="10%" align="center"><span class="style3">Option</span></TD></div> </TR> <?php $tr="#f4f4f4"; $clr=1; while($row = mysql_fetch_object($result)) { if($tr=="#FFFFFF") { $tr="#efefef"; $col="#000000"; } else { $tr="#FFFFFF"; $col="#000000"; } $tmpid = $row->id ; $tmpid = ""; $agid=$row->id; ?> <tr bgcolor="<? echo $tr; ?>"> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->league_name); ?></font></TD> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->dname); ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? $txtgdate=$row->gdate; $txtgdate_arr=explode("-",$txtgdate); $txtgdate=$txtgdate_arr[1].'-'.$txtgdate_arr[2].'-'.$txtgdate_arr[0]; ?> <? echo stripslashes($txtgdate); ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? $txtgtime=$row->gtime; $txtgtime_arr=explode("-",$txtgtime); $txtgtime=$txtgtime_arr[1].'-'.$txtgtime_arr[2].'-'.$txtgtime_arr[0]; ?> <? echo stripslashes($txtgtime); ?></font></TD> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->htname); ?></font></TD> <TD align="left"><font color="<?=$col?>"><? echo stripslashes($row->atname); ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? echo stripslashes($row->r1fname).' '.stripslashes($row->r1lname); ?><br><? if($row->main_ref_accept=='P' && $row->main_ref_id!=0) echo "<font color='#FF9900'><b>Pending</b></font>"; ?><? if($row->main_ref_accept=='A') echo "<font color='#006633'><b>Accepted</b></font>"; ?><? if($row->main_ref_accept=='R') echo "<font color='#FF0000'><b>Rejected</b></font><a href='#' onclick=\"openWin('view_reason.php?mainref_id=$agid','test','550','500','true','yes');\">(View Reason)</a>"; ?></font></TD> <TD align="left"><font color="<?=$col?>"> <? echo stripslashes($row->r2fname).' '.stripslashes($row->r2lname); ?></font><br><? if($row->r2fname!='') { if($row->ast_ref1_accept=='P' && $row->ast_ref_id1!=0) echo "<font color='#FF9900'><b>Pending</b></font>"; ?><? if($row->ast_ref1_accept=='A') echo "<font color='#006633'><b>Accepted</b></font>"; ?><? if($row->ast_ref1_accept=='R') echo "<font color='#FF0000'><b>Rejected</b></font><a href='#' onclick=\"openWin('view_reason.php?astref_id1=$agid','test','550','500','true','yes');\">(View Reason)</a>"; } ?></TD> <TD align="left"><font color="<?=$col?>"> <? echo stripslashes($row->r3fname).' '.stripslashes($row->r3lname); ?></font><br><? if($row->r3fname!='') { if($row->ast_ref2_accept=='P' && $row->ast_ref_id2!=0) echo "<font color='#FF9900'><b>Pending</b></font>"; ?><? if($row->ast_ref2_accept=='A') echo "<font color='#006633'><b>Accepted</b></font>"; ?><? if($row->ast_ref2_accept=='R') echo "<font color='#FF0000'><b>Rejected</b></font><a href='#' onclick=\"openWin('view_reason.php?astref_id2=$agid','test','550','500','true','yes');\">(View Reason)</a>"; } ?></TD> <TD align="center"><input name="button" type="button" class="bttn-s" onClick="location.href='edit_referee_to_game.php?id=<?php echo $row->id; ?>'" value="Edit Assignment"> <INPUT class="bttn-s" onClick="deleteconfirm('Are you sure you want to delete this Assigned Referee to Game? \n','manage_referees_to_game.php?did=<?php echo($row->id); ?>');" type="button" value="Delete Assignment"> </TD> </TR> <? $parentary = NULL ; } ?> <input type=hidden name="total" value="<? echo $strTotalNewRow; ?>"> <TR align=center> <TD colSpan=10> <? if(!$strTotalPerPage) { ?> <strong>No Referees To Game Detail Display</strong> <? } ?> </TD> </TR> </TABLE> </FORM> </TD> </TR> </TABLE> </td> </tr> </TABLE> </BODY></HTML> Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/#findComment-1024518 Share on other sites More sharing options...
Psycho Posted March 11, 2010 Share Posted March 11, 2010 That is not the HTML output - that is the PHP script. Run the script by pointing your browser at the page to load it from the web server. Then get the source of the rendered page. As I stated your problem is something to do with the HTML code and trying to figure out exactly what your HTML would look like while reading all the echo statemetns will be a pain in the a**. Although you state you only want the table to be in the printout, so why are you applying the noprint class to the div that contains the table? <div class="noprint"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 class="th-a"> Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/#findComment-1024611 Share on other sites More sharing options...
miniu Posted March 11, 2010 Author Share Posted March 11, 2010 <HTML> <HEAD><title>NJSA - Referee Assignment System</title> <SCRIPT language="javascript" src="body.js"></SCRIPT> <script> function show_divisions(val) { window.location.href='manage_referees_to_game.php?league_id=' + val; } function show_getgames() { if(document.getElementById('txtfromdate').value!='' && document.getElementById('txttodate').value=='') { alert('Please Select To Date'); document.getElementById('txttodate').focus(); return false; } if(document.getElementById('txttodate').value!='' && document.getElementById('txtfromdate').value=='') { alert('Please Select From Date'); document.getElementById('txtfromdate').focus(); return false; } if(document.getElementById('txttodate').value < document.getElementById('txtfromdate').value) { alert('To Date can not be less then From Date'); document.getElementById('txttodate').focus(); return false; } document.getElementById('sub11').value=1; document.frmgetgames.submit(); } function clearall() { document.getElementById('txtfromdate').value=''; document.getElementById('txttodate').value=''; document.getElementById('refsel').value=''; document.getElementById('drpdivisions').value=''; } function openWin(pageToLoad, winName, width, height, center,scrollbar){ if ((parseInt(navigator.appVersion) >= 4 ) && (center)){ xposition = (screen.width - width) / 2; yposition = (screen.height - height - 100) / 2; args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=no," + "scrollbars=" + scrollbar + "," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0," + "screenx=" + xposition + "," + "screeny=" + yposition + "," + "left=" + xposition + "," + "top=" + yposition; newWindow = window.open(pageToLoad,winName,args); window.focus; } } </script> <script src="calendar.js"></script> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <META content="MSHTML 6.00.2600.0" name=GENERATOR> <link rel="stylesheet" href="main.css" type="text/css"> <style type="text/css"> <!-- .style3 {color: #FFFFFF} --> </style> <style type="text/css"> /* media neutral styles go here */ @media print { .noprint { display: none; } } </style> </HEAD> <BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 class="th-a"> <div class="noprint"><TR><TD height=60 valign="top" colspan="2" bgColor="#ffffff"><table width="100%" cellpadding="0" cellspacing="0" border="0"> <TR> <TD height=65 colspan="4" bgColor='#154671'> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR> <Td width="39%"><font size="+2" color="#FFFFFF"><img src="images/banner_top.jpg" width="510" height="60"></font></Td> <TD width="20%" align="left"> <strong> <font color="#FFFFFF">Thursday, March 11, 2010</font></strong> </TD> <TD width="2%" align="left" noWrap valign="middle"><font color="#FFFFFF">|</font></TD> <TD width="15%" align="left"> <font color="#FFFFFF"><B> Welcome: bartek</B></font><B> </B></TD> <TD width="2%" align="left" noWrap valign="middle"><font color="#FFFFFF">|</font></TD> <TD width="9%" align="left" noWrap><A href="logout.php" target=_top><B><font color="#FFFFFF">Logout</font></B></A></TD> <TD width="3%" > </TD> </TR> </TABLE> </td> </TR> <tr height="25px" valign="middle"> <Td colspan="4" align="center" valign="middle" bgcolor="#1c6995"> <script language="javascript" type="text/javascript"> var NoOffFirstLineMenus=3; //Total No. Of Main Sections Specify Here Too var LowBgColor='#1c6995'; var LowSubBgColor='#1c6995'; var HighBgColor='#154671'; var HighSubBgColor='#154671'; var FontLowColor='#FFFFFF'; var FontSubLowColor='#FFFFFF'; var FontHighColor='White'; var FontSubHighColor='White'; var BorderColor='#FFFFFF'; var BorderSubColor='#f3ca60'; var BorderWidth=1; var BorderBtwnElmnts=1; var FontFamily="Verdana,Arial" var FontSize=9; var FontBold=1; var FontItalic=0; var MenuTextCentered='center'; var MenuCentered='center'; var MenuVerticalCentered='top'; var ChildOverlap=.0; var ChildVerticalOverlap=.0; var StartTop=66; var StartLeft=0; var VerCorrect=0; var HorCorrect=0; var LeftPaddng=3; var TopPaddng=3; var FirstLineHorizontal=1; var MenuFramesVertical=0; var DissapearDelay=75; var TakeOverBgColor=0; var FirstLineFrame='navig'; var SecLineFrame='navig'; var DocTargetFrame='navig'; var TargetLoc=''; var HideTop=0; var MenuWrap=0; var RightToLeft=0; var UnfoldsOnClick=0; var WebMasterCheck=0; var ShowArrow=0; var KeepHilite=1; var Arrws=['../images/tri.gif',3,10,'../images/tridown.gif',6,4,'../images/trileft.gif',5,10]; // Arrow source, width and height function BeforeStart(){return} function AfterBuild(){return} function BeforeFirstOpen(){return} function AfterCloseAll(){return} Menu1 = new Array("Home","deskboard.php","",0,20,120);Menu2 = new Array("Website","","",4,20,120); Menu2_1 = new Array('Referee Useage Report','referee_useage_report.php','',1,20,230); Menu2_1_1 = new Array('Referee Useage Report','referee_useage_report.php','',0,20,170); Menu2_2 = new Array('Manage Referee To Games','manage_referees_to_game.php','',2,20,230); Menu2_2_1 = new Array('Assign Referee To Game','assign_referee_to_game.php','',0,20,240); Menu2_2_2 = new Array('Manage Referee To Games','manage_referees_to_game.php','',0,20,240); Menu2_3 = new Array('Edit Profile','edit_profile_assigner.php','',1,20,230); Menu2_3_1 = new Array('Edit Profile','edit_profile_assigner.php','',0,20,170); Menu2_4 = new Array('Referees Address Book','referees_address_book.php','',1,20,230); Menu2_4_1 = new Array('Referees Address Book','referees_address_book.php','',0,20,170);Menu3 = new Array("User","","",1,15,120); Menu3_1 = new Array('Change Password','changepass.php','',0,20,150);</script><script type='text/javascript' src='menu_com.js'></script> <!-- <script language="JavaScript" src="js/main-navigation.js"></script> <script language="JavaScript" src="js/mm_menu.js"></script> <script language="JavaScript1.2">mmLoadMenus();</script> <script language="JavaScript1.2">mmLoadMenus();</script> --> </Td> </tr> <!-- <tr bgcolor="#A6CFB6" height="25px" valign="middle"> <Td width="30%" align="center" valign="middle" bgcolor="#2EA0E7"><a href="#" name="link2" class="tab-de_active-a" id="link1" onmouseover="MM_showMenu(window.mm_menu_0730154342_0,0,20,null,'link2')" onmouseout="MM_startTimeout();"><strong>Diamond Jewelry </strong></a> </Td> <Td width="24%" align="center" valign="middle" bgcolor="#2EA0E7"><span class="Tab-vit-bdr-lft-rt"><a href="#" name="link15" class="tab-de_active-a" id="link15" onmouseover="MM_showMenu(window.mm_menu_0730160301_0,0,20,null,'link15')" onmouseout="MM_startTimeout();"><strong>Gift Idea </strong></a></span></Td> <Td width="23%" align="center" valign="middle" bgcolor="#2EA0E7"><span class="Tab-vit-bdr-lft-rt"><a href="#" name="link7" class="tab-de_active-a" id="link7" onmouseover="MM_showMenu(window.mm_menu_0730162353_0,-30,20,null,'link7')" onmouseout="MM_startTimeout();"><strong>Shipment</strong></a></span></Td> <Td width="23%" align="center" valign="middle" bgcolor="#2EA0E7"><span class="Tab-vit-bdr-lft-rt"><a href="#" name="link8" class="tab-de_active-a" id="link8" onmouseover="MM_showMenu(window.mm_menu_0730162457_0,0,20,null,'link8')" onmouseout="MM_startTimeout();"><strong>Users</strong></a></span></Td> </tr> <tr bgcolor="#A6CFB6" height="25px" valign="middle"> <Td colspan="4" align="center" valign="middle" bgcolor="#2EA0E7"> </Td> </tr>--> </table> </td></TR></div> <tr> <div class="noprint"><td width="20%" valign="top" bgcolor="#1c6995"><table width="100%" cellpadding="3" cellspacing="2"> <tr > <Td align="center" bgcolor="#FFFFFF"><font color="#000000" size="+1" style="text-decoration:none;">Website</font></Td> </tr> <Tr><td align="left" bgcolor="#1c6995"> <a class="a-l" href="referee_useage_report.php">Referee Useage Report</a></td> </Tr> <Tr><td align="left" bgcolor="#FFFFFF"> <a href="referee_useage_report.php" class="tab3">Referee Useage Report</a></td> </Tr> <Tr><td align="left" bgcolor="#1c6995"> <a class="a-l" href="manage_referees_to_game.php">Manage Referee To Games</a></td> </Tr> <Tr><td align="left" bgcolor="#FFFFFF"> <a href="assign_referee_to_game.php" class="tab3">Assign Referee To Game</a></td> </Tr> <Tr><td align="left" bgcolor="#FFFFFF"> <a href="manage_referees_to_game.php" class="tab3">Manage Referee To Games</a></td> </Tr> <Tr><td align="left" bgcolor="#1c6995"> <a class="a-l" href="edit_profile_assigner.php">Edit Profile</a></td> </Tr> <Tr><td align="left" bgcolor="#FFFFFF"> <a href="edit_profile_assigner.php" class="tab3">Edit Profile</a></td> </Tr> <Tr><td align="left" bgcolor="#1c6995"> <a class="a-l" href="referees_address_book.php">Referees Address Book</a></td> </Tr> <Tr><td align="left" bgcolor="#FFFFFF"> <a href="referees_address_book.php" class="tab3">Referees Address Book</a></td> </Tr> </table> </td></div> <td width="80%" valign="top" bgcolor="#FFFFFF" height="480"> <div class="noprint"><TABLE width="97%" border=0 cellPadding=0 cellSpacing=0 align="center"> <TR><TD width="100%" class="H1"> </TD></TR> <TR><TD align="center" width="100%" class="a-l"></TD></TR> <TR> <TD width="100%" class="H1">Manage Referees To Game</TD> </TR> <TR><TD background="images/vdots.gif"><IMG height=1 src="images/spacer.gif" width=1 border=0></TD></TR> <tr> <TD> <FORM name="order" action="#" method="post"> <TABLE cellSpacing=0 cellPadding=1 border=0 > <tr><td colspan="25" height="20"><b>View By Main Referee Name</b></td></tr> <TR><TD><a class=la href='manage_referees_to_game.php' onMouseOver="smsg('View All Records');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">All</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=A' onMouseOver="smsg('View By A');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">A</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=B' onMouseOver="smsg('View By B');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">B</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=C' onMouseOver="smsg('View By C');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">C</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=D' onMouseOver="smsg('View By D');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">D</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=E' onMouseOver="smsg('View By E');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">E</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=F' onMouseOver="smsg('View By F');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">F</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=G' onMouseOver="smsg('View By G');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">G</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=H' onMouseOver="smsg('View By H');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">H</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=I' onMouseOver="smsg('View By I');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">I</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=J' onMouseOver="smsg('View By J');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">J</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=K' onMouseOver="smsg('View By K');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">K</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=L' onMouseOver="smsg('View By L');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">L</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=M' onMouseOver="smsg('View By M');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">M</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=N' onMouseOver="smsg('View By N');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">N</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=O' onMouseOver="smsg('View By O');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">O</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=P' onMouseOver="smsg('View By P');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">P</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=Q' onMouseOver="smsg('View By Q');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">Q</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=R' onMouseOver="smsg('View By R');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">R</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=S' onMouseOver="smsg('View By S');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">S</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=T' onMouseOver="smsg('View By T');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">T</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=U' onMouseOver="smsg('View By U');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">U</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=V' onMouseOver="smsg('View By V');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">V</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=W' onMouseOver="smsg('View By W');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">W</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=X' onMouseOver="smsg('View By X');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">X</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=Y' onMouseOver="smsg('View By Y');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">Y</a></TD><TD class=lg>|</TD><TD><a class=la href='?order=Z' onMouseOver="smsg('View By Z');return document.prs_return" onMouseOut="nosmsg('Done');return document.prs_return">Z</a></TD><TD class=lg>|</TD></TR> </TABLE></div> </form> <br><form name="frmgetgames" id="frmgetgames" method="post"> <div class="noprint"><table cellpadding="0" cellspacing="0" border="0"> <td width="100%" colspan="2" align="left"><select id="refsel" name="refsel"> <option value="" >--Select--</option> <option value="0" >Games with NO REFEREE Assigned</option> <option value="1" >Games with NO Main Referee Assigned</option> <option value="2" >Games with NO Assistant Referee 1 Assigned</option> <option value="3" >Games with NO Assistant Referee 2 Assigned</option> </select> <select name="drpleague" id="drpleague" style="width:150px" onChange="show_divisions(this.value)"> <option value="">--Select--</option> <option value="1" >GARDEN STATE SOCCER LEAGUE</option> <option value="13" >CHAMPIONS SOCCER LEAGUE</option> <option value="8" >COSMOPOLITAN SOCCER LEAGUE</option> <option value="6" >NORTH JERSEY SOCCER LEAGUE</option> <option value="5" >LUSO INTER. SOCCER ASSOC.</option> <option value="20" >NJ STATE CUPS</option> <option value="21" >USASA NATIONAL CUPS</option> <option value="12" >NJSA DEVELOPMENT PROGRAM</option> </select> </td></tr> <tr> <td width="100%" colspan="2" align="center"> From Date: <input type="text" name="txtfromdate" readonly="true" id="txtfromdate" size="15" value=""> <a href="#" onClick="getCalendar(document.getElementById('txtfromdate'));"> Select Date</a> To Date: <input type="text" name="txttodate" readonly="true" id="txttodate" size="15" value=""> <a href="#" onClick="getCalendar(document.getElementById('txttodate'));"> Select Date</a> <input type="button" value="Get Games" onClick="show_getgames();"><input type="hidden" id="sub11" name="sub11" value="0"> <input type="button" value="Clear" onClick="clearall();"> </td> </tr> <tr><td colspan="2"> </td></tr> <tr> </table></div></form><br> <FORM name="form2" action="#" method="post"> <td align="right"><a href="#" onClick="javascript:window.print();"><b>PRINT</b></a> </td> <div><TABLE width="100%" height="89" border=1 cellSpacing=0 class=t-a> <!--DWLayoutTable--> <TBODY> <TR class="th-a"> <TD colspan="10"> <table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0' class='alert_table'><tr><td width='15%' align='left' class='tab2'><strong> </strong> </td><td width='70%' align='center' class=tab2> <strong>Result 1 - 1 of 1 Records</strong><BR><strong>[1]</strong> </td><td width='15%' align='right' class='tab2'><strong> </strong> </td></tr></table> </TD> </TR> <TR class=th-a> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=lea.league_name&ordby=desc" class="link2">League Name</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=d.dname&ordby=desc" class="link2">Division</a></TD></div> <div><TD width="8%" align="left"><a href="manage_referees_to_game.php?sort=g.gdate&ordby=desc" class="link2">Game Date</a></TD></div> <div><TD width="8%" align="left"><a href="manage_referees_to_game.php?sort=g.gtime&ordby=desc" class="link2">Game Time</a></TD></div> <div><TD width="12%" align="left"><a href="manage_referees_to_game.php?sort=at.tname&ordby=desc" class="link2">Home Team</a></TD></div> <div><TD width="12%" align="left"><a href="manage_referees_to_game.php?sort=ht.tname&ordby=desc" class="link2">Away Team</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r1.fname&ordby=desc" class="link2">Referee</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r2.fname&ordby=desc" class="link2">Assistant Referee 1</a></TD></div> <div><TD width="10%" align="left"><a href="manage_referees_to_game.php?sort=r3.fname&ordby=desc" class="link2">Assistant Referee 2</a></TD></div> <div><TD width="10%" align="center"><span class="style3">Option</span></TD></div> </TR> <tr bgcolor="#FFFFFF"> <TD align="left"><font color="#000000">GARDEN STATE SOCCER LEAGUE</font></TD> <TD align="left"><font color="#000000">WOMEN A DIVISION</font></TD> <TD align="left"><font color="#000000"> 03-21-2010</font></TD> <TD align="left"><font color="#000000"> --11:00 AM</font></TD> <TD align="left"><font color="#000000">MEDFORD THUNDER</font></TD> <TD align="left"><font color="#000000">NJ LIONS FC WOMEN</font></TD> <TD align="left"><font color="#000000"> Bartek Cieslak<br><font color='#FF9900'><b>Pending</b></font></font></TD> <TD align="left"><font color="#000000"> Ashraf Kamel</font><br><font color='#006633'><b>Accepted</b></font></TD> <TD align="left"><font color="#000000"> </font><br></TD> <TD align="center"><input name="button" type="button" class="bttn-s" onClick="location.href='edit_referee_to_game.php?id=50'" value="Edit Assignment"> <INPUT class="bttn-s" onClick="deleteconfirm('Are you sure you want to delete this Assigned Referee to Game? \n','manage_referees_to_game.php?did=50');" type="button" value="Delete Assignment"> </TD> </TR> <input type=hidden name="total" value=""> <TR align=center> <TD colSpan=10> </TD> </TR> </TABLE></div> </FORM> </TD> </TR> </TABLE> </td> </tr> </TABLE> </BODY></HTML> Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/#findComment-1024740 Share on other sites More sharing options...
Psycho Posted March 11, 2010 Share Posted March 11, 2010 Your HTML is all messed up, so there is no telling how the browser will render it. Here are just a few problems I saw before I stopped looking: 1. You have DIV tag between an opening TABLE tag and an opening TR tag. You cannot put content inside anything other than a TD/TH tag within a table. 2. There is a TD with nothin in it except SCRIPT code. There are so many embedded tables and the code is not formatted to show logical structure so it is really difficult to follow. My guess is that there are some problems with the table structure and/or trying to apply the class to a div in-between table objects is causing the problem. Assign the noprint class on the "tables" you don't want printed. Well, ideally you would get rid of tables for the layout entirely (except the table of records) and use CSS for layout. Sorry, but I just don't have the time to dig through all of that mess. When I am creating a page such as that I will create an empty page: just a template of the sections: header, menu, content, footer, etc. Then before I actually start putting content into those sections, apply the styles and such. Following that appraoch it would be easy to apply the noprint class to a particular section. Then start adding the content. Quote Link to comment https://forums.phpfreaks.com/topic/194801-print-selected-area-not-window/#findComment-1024837 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.