Jump to content

Bid Date


freshJet

Recommended Posts

  • Moderators

There is a bid date in the Admin Center....so i thought it has to be saved somewhere?

(null)

I'm not sure what is the field name for the bid date, you can put this anywhere.

<?php echo date(DATE_FORMAT, $bid->dateadded);?>

check the bids time and see what is the field name for the date and then you can change the dateadded to something if it is not correct.

Link to comment
Share on other sites

  • Moderators

Thanks Kyle but that just displays them all as 31st December 1969 (311269)

Sorry, stupid me. I thought the bid date was in MySQL date format.

It's

<?php echo $bid->dateadded;?>

Link to comment
Share on other sites

I think my site is cursed. Nothing works. Here's my full code:


<?php
$bookings = SchedulesData::GetAllBids();
if (count($lastbids) > 0)
{ ?>
<table width="100%">
<tr>
<th align="left"><b>Flight</b></td>
<th align="left"><b>Pilot</b></td>
<th align="left"><b>From</b></td>
<th align="left"><b>To</b></td>
<th align="left"><b>Aircraft</b></td>
<th align="left"><b>Booked On</b></td>
</tr>
<?php
foreach($lastbids as $lastbid)
  {
  $pilot_info = PilotData::GetPilotData($lastbid->pilotid);  
?>
<tr>
<td align="left">FRX<?php echo $lastbid->flightnum; ?></td>
<td align="left"><?php echo $pilot_info->firstname.' '.$pilot_info->lastname; ?></td>
<td align="left"><?php echo $lastbid->depicao;?></td>
<td align="left"><?php echo $lastbid->arricao; ?></td>
<td align="left"><?php echo $lastbid->aircraft; ?></td>
<td align="left"><?php echo $bid->dateadded;?></td>
</tr>
 <?php
        }
	    } else { ?>
			 <p style="color:#cccccc; font-size:22px; text-align:center;">No bookings!</p>
	    <?php
	    }
 ?>
</table>

I tried $lastbid too...

Link to comment
Share on other sites

  • Moderators

you used $booking on the second line. I changed it to $lastbids.

try the new code. it should work.

<?php
$lastbids = SchedulesData::GetAllBids();
if (count($lastbids) > 0)
{ ?>
<table width="100%">
<tr>
<th align="left"><b>Flight</b></td>
<th align="left"><b>Pilot</b></td>
<th align="left"><b>From</b></td>
<th align="left"><b>To</b></td>
<th align="left"><b>Aircraft</b></td>
<th align="left"><b>Booked On</b></td>
</tr>
<?php
foreach($lastbids as $lastbid)
  {
  $pilot_info = PilotData::GetPilotData($lastbid->pilotid);  
?>
<tr>
<td align="left">FRX<?php echo $lastbid->flightnum; ?></td>
<td align="left"><?php echo $pilot_info->firstname.' '.$pilot_info->lastname; ?></td>
<td align="left"><?php echo $lastbid->depicao;?></td>
<td align="left"><?php echo $lastbid->arricao; ?></td>
<td align="left"><?php echo $lastbid->aircraft; ?></td>
<td align="left"><?php echo $lastbid->dateadded;?></td>
</tr>
 <?php
        }
	    } else { ?>
			 <p style="color:#cccccc; font-size:22px; text-align:center;">No bookings!</p>
	    <?php
	    }
 ?>
</table>

Link to comment
Share on other sites

if you have more than one Airline running on one phpvms install this code is more than usefull :)

<td align="left"><?php echo $lastbid->code; ?><?php echo $lastbid->flightnum; ?></td>

replaced your "FRX" Airline prefix with a code piece that takes the Airline code used in Schedule

is it possible to get the valid thru date of an bid example from 2012-05-23 - 2012-05-27

Link to comment
Share on other sites

got it work I have set my bid expires after 48 hours= 2 days

hope that help others ;)

			 <?php
$lastbids = SchedulesData::GetAllBids();
if (count($lastbids) > 0)
{ ?>
<table width="100%">
<tr>
<th align="left"><b>Flight</b></td>
<th align="left"><b>Pilot</b></td>
<th align="left"><b>From</b></td>
<th align="left"><b>To</b></td>
<th align="left"><b>Aircraft</b></td>
<th align="left"><b>Booked On</b></td>
<th align="left"><b>Bid Expires</b></td>
</tr>
<?php
foreach($lastbids as $lastbid)
	  {
  $pilot_info = PilotData::GetPilotData($lastbid->pilotid);
  $date = date($lastbid->dateadded);
$sNeuesDatum = date("Y-m-d", strtotime("$date + 2 day"));
?>
<tr>
<td align="left"><?php echo $lastbid->code; ?><?php echo $lastbid->flightnum; ?></td>
<td align="left"><?php echo $pilot_info->firstname.' '.$pilot_info->lastname; ?></td>
<td align="left"><?php echo $lastbid->depicao;?></td>
<td align="left"><?php echo $lastbid->arricao; ?></td>
<td align="left"><?php echo $lastbid->aircraft; ?></td>
<td align="left"><?php echo $lastbid->dateadded;?></td>
<td align="left"><?php echo $sNeuesDatum;?></td>
</tr>
	 <?php
	 }
			    } else { ?>
							 <p style="color:#cccccc; font-size:22px; text-align:center;">No bookings!</p>
			    <?php
			    }
	 ?>
</table>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...