473,671 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

newbie - highlight a table cell

cassbiz
202 New Member
The output I am receiving is not highlighting all of the contents just part.

in the below code @line 21 if a certain variable is met I want the cell highlighted. The problem is in the output it is highlighting but only on one cell and not covering the other cells that need to be highlighted. For example, the customer books a room for 3 days. The first day is not highlighting just the 2nd and 3rd. If they book a room for only one day then it does not highlight at all.

Expand|Select|Wrap|Line Numbers
  1.  
  2.         for  ($i = 1; $i <= $days; $i++)
  3.         {
  4.                 $year = date("Y",$tag + 86400 * $i - 86400);
  5.                 $month = date("n",$tag + 86400 * $i - 86400);
  6.                 $day = date("d",$tag + 86400 * $i - 86400);
  7.  
  8.         $belegt = belegt($zdaten[$ii][1],date("Y.m.d",$tag+ 86400 * $i - 86400));
  9.                 if ($belegt=="" )
  10.                  {
  11.                         if ($tag+ 86400 * ($i-1) < strtotime(date("Y-m-d 12:00:00"),time()))
  12.                         {
  13.                                 echo '<td align="center" bgcolor="white"> n/a';
  14.                         }else{
  15.                         //available for booking
  16.                                 echo '<td align="center">
  17.                                                 <a href="kalender.php?andatum=', $tag + 86400 * $i - 86400, '&zimmer=',$zdaten[$ii][1],'&year=',$year,'&month=',$month,'&day=',$day,'" id="l1">
  18.                                                         <font color="#008000">'.$t_myres['free'].'</font></a>';
  19.                         }
  20.       /* ###### CHANGE CELL COLOR IF CONFIRMATION NECESSARY  ###### */
  21.                 }elseif ($knr=$resdaten[1][9]=="")
  22.                         {
  23.                         //booked and still needs to be confirmed
  24.                         echo '<td align="center" bgcolor="yellow">';
  25.                         $resdaten = sucheresnr($belegt);
  26.                         $knr=$resdaten[1][1];
  27.                         $daten = suche('knr', $knr);
  28.                         $nname=$daten[1][3];
  29.                         echo '
  30.                         <a href="details.php?resnr=', $belegt, '&schreiben=readonly" id="l5">',
  31.                                         $nname,
  32.                         '</a>';
  33.                         }
  34.                  else{
  35.                         //booked and confirmed
  36.                         echo '<td align="center">';
  37.                         $resdaten = sucheresnr($belegt);
  38.                         $knr=$resdaten[1][1];
  39.                         $daten = suche('knr', $knr);
  40.                         $nname=$daten[1][3];
  41.                         echo '
  42.                         <a href="details.php?resnr=', $belegt, '&schreiben=readonly" id="l5">',
  43.                                         $nname,
  44.                         '</a>';
  45.                  }
  46.                  echo '</td>';
  47.         }
  48.         echo '<td align="right" style="white-space:nowrap">';
  49.         echo "<a href=\"javascript:zimmer_link('";
  50.         echo $zimmer;
  51.         echo "')\" id='l4'>$zimmer</a></td></tr>";
  52. }
  53. echo '<tr>';
  54. echo '<td width ="', 100/($days+2),'%">';
  55. echo '</td>';
  56.  
Nov 9 '06 #1
2 2166
ronverdonk
4,258 Recognized Expert Specialist
The only cause I can think of is that you miscalculate the start day by 'fiddling' with an index or having a start day as 0 reserveation days or alike problem. As far as I can see the code (except for the date calculations, I cannot follow that and that is why I suspect it) is fine from a html point.

Ronald :cool:
Nov 9 '06 #2
cassbiz
202 New Member
The only cause I can think of is that you miscalculate the start day by 'fiddling' with an index or having a start day as 0 reserveation days or alike problem. As far as I can see the code (except for the date calculations, I cannot follow that and that is why I suspect it) is fine from a html point.

Ronald :cool:
Thank you,

I didn't see an error in the code and from the many tutorials that I have read all appears correct except the output. I will try to narrow down the question when I find more of the error. I will research the start day to see if I can find it.
Nov 9 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5000
by: Gerg | last post by:
The datagrid has a tablestyle applied to it, and there are DataGridTextBoxColumn and each DataGridTextBoxColumn has an array of DataGridTextBox objects. Private Sub highlight(ByVal str As String) Dim myTextBoxcolumn As DataGridTextBoxColumn Dim myTextBox As DataGridTextBox 'loop through the cells of the datagrid, searching for the string
2
4926
by: J Krugman | last post by:
I have set up an HTML table with clickable cells (the cells contain only text). They work fine, but I would like to give the user some visual feedback to indicate that a cell has been clicked. I'd like this feedback to be the usual highlight on mouseDown, un-highlight on mouseUp, but I can't figure out how to do it. Help? Thanks in advance! jill --
11
4358
by: VK | last post by:
Hi, I'm playing around with tables (TOM vs. DOM etc.) I cannot figure out an effective highlight mechanics for the cells: 1) No problems with: <td ...onMouseOver/Out background change> some text inside </td> 2) <td ...onMouseOver/Out background change>
3
1906
by: mitch | last post by:
Suppose you have an HTML table with 2 rows 1 2 3 4 5 6 7 8 and you click the cell with the 2 and drag to the cell with the 7. You will see the items 2 3 4 5 6 7 highlighted. This is sort of like what you would see in a Word document. Suppose instead you wanted to see a rectangle highlighted: 2 3 6 7
2
1610
by: Geraldine Hobley | last post by:
Hello I have a datagrid, called MyDataGrid and I wish to put the focus on a particular cell in order that the user to highlight the fact that the user needs to enter a value in this cell, e.g. I put the message up "Please enter an order number" I then wish to highlight the column MyDataGrid(0,1), but I can't find out how to do this Many thanx in advance Geri
17
3378
by: toffee | last post by:
Hi all, I have a table with 12 cols and 10 rows. When a user clicks on a table cell; the page is refreshed and displays some data below the table dependant on whichever cell was selected. I would like to make it so that whichever cell was clicked; the background color is changed - so that when the user sees the data, (s)he can tell which cell it relates to. Does anyone know of a clever way to do this ?
1
1682
by: dsbsnag | last post by:
I am using Access 2003 on Windows XP I'm a school teacher and need help achieving the following: I have three spreadsheets with various information in them. But, they have a common cell named "Student ID". To be specific this is what my three spreadsheets consist of is this: Spreadsheet 1 Student ID
5
2710
by: Dave | last post by:
Is there a way to selectively highlight text in an OverLib popup? I'd like to be able to make some text stand out from the rest of the text that is displayed. I tried using a one-cell table with background set to yellow, but that caused the popup not to work at all (this might be a syntax problem - I haven't been able to find any syntax examples for putting a table inside an OverLib call) Thanks
1
2542
by: dixonjm | last post by:
Hi, I am adding a table dynamically using c# as below:- productCell = new TableCell(); KSSCheckBox checkBox = new KSSCheckBox(); checkBox.ID = string.Format("CheckBox|{0}|{1}", x, product.OwnProductUID); checkBox.Description = "Update"; checkBox.Checked = false; checkBox.Attributes.Add("onClick", "HighLightCell();");
0
8485
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6238
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5704
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4417
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.