Jump to content

soulreaver418

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

soulreaver418's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, got the color issue sorted out. Ended up changing this section here, $resultfield = odbc_result($result,$i); echo "<td class='$resultfield'>"; echo $resultfield; and then created a .css file with the .occupied and .vacant in it with the proper colors. Thanks for the assistance to get the gears slowly turning here. Now on to making the Future Booked column and populating it according to what is in the StatusName table.
  2. Ok, got rid of the syntax error, however all I get now is a red "occupied at the bottom of my table.... doh! Man I think I am getting close just need to know more. Thanks for the link to the tutorial on If statements, that helped me understand the answer to the color question a bit better.
  3. That makes more sense now with the color, however I am getting a syntax error when inserting. I am probably putting it in the wrong place, sorry to be so helpless but I am trying to self teach php. I find it very interesting I just don't fully understand the language and the order of it yet. Think I need to go to books a million and find an idiot's guide to php...
  4. Also, regarding the psuedo code you posted. I think I did not clarify what exactly I am wanting. in the table unit.Status it will show "Vacant" or "Occupied", I would like to color those words, then use the if to check the viewPendingLease.StatusName for either a pending status or not. If it has no data I would like it to return a No in Column Future Booked, which I would have to create. If it has a pending status I would like for it to print a Yes in Column Future Booked. Thanks for the quick reply, I feel that I am on the right track and with help can get this figured out or done a different way. Going to include small ss of table so you can see print out of the table unit. Thanks again!
  5. The table that holds the pending lease status is a view, to be exact it would be viewPendingLease.StatusName. That shows which properties have a pending lease status.
  6. Hi and thanks for taking the time to read through this first and foremost. I have a bit of code that I have managed to piece together with help from other sites and what it does is connect to our local ms sql server and retrieve a few tables from our database. The info is relating to property management and it basically displays the unit address, current date and its rental status. (Occupied or Vacant) This makes it easy for us to at a glance check the status of our rentals instead of having to log into our software and navigate through all that.. anyways, I have two issues I need help with. First problem, in my code, is it possible to write a conditional statement that would check for a certain status in a view and then if it is there, print a simple yes or no in a table with that appropriate property. For example, we have property 1000 name street and it is currently vacant, however the viewPendingLease shows us information regarding future bookings. I would like to be able to look through that view with the code, check property 1000 name street for any future pending leases, and if there is one, print out a "Yes" in a Future Booked column that I would create. If any of that makes sense, I can post the print out of the tables of the viewPendingLease if it makes it easier for anyone to see the data output to understand what I am meaning. The second issue, is it possible to change the color of the text according to a variable, say a word in a generated table with html or css? I would like to color the words vacant or occupied green and red respectively just to make it much easier to zero in on the vacant properties. Or even maybe just color every other row a background color just to help distinguish between the different properties. Here is my code that pulls up my current tables to show Property, Street and current rented status. <?php //connect to a DSN "*******" $conn = odbc_connect('*******','*****','************'); if ($conn) { //the SQL statement that will query the database $query = "Select unit.PropertyUnitID, unit.Street, unit.Status, from unit"; //perform the query $result=odbc_exec($conn, $query); echo "<table border=\"1\"><tr>"; //print field name $colName = odbc_num_fields($result); for ($j=1; $j<= $colName; $j++) { echo "<th>"; echo odbc_field_name ($result, $j ); echo "</th>"; } //fetch tha data from the database while(odbc_fetch_row($result)) { echo "<tr>"; for($i=1;$i<=odbc_num_fields($result);$i++) { echo "<td>"; echo odbc_result($result,$i); echo "</td>"; } echo "</tr>"; } echo "</td> </tr>"; echo "</table >"; //close the connection odbc_close ($conn); } else echo "odbc not connected"; ?> I currently have the viewPendingLease.Active (which shows if there is a future pending lease) taken out due to a repeating data issue I am also trying to figure out...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.