Jump to content

Loop Logged In Pilots Reports Only


StartVM

Recommended Posts

Hi,

you can fix it like this:

//Script order
<?php MainController::Run('PIREPS', 'RecentFrontPage'); ?>


//Content of frontpage_recent.tpl
<?php
$pir_sel = "SELECT * FROM pireps WHERE pilotid = 'Auth::$userinfo->pilotid' ORDER BY id DESC LIMIT 5";
$pir_go = mysql_query($pir_sql);
while($report = mysql_fetch_object) {
 <li><a href="<?php echo url('/pireps/viewreport/'.$report->pirepid);?>">#<?php echo $report->pirepid
 . ' - ' . $report->code.$report->flightnum?> <span class="icon-align-left"></span><strong> Flying from <?php echo $report->depICAO . ' to ' . $report->arrICAO?></strong></a></li>
}
?>

I know that doesn't work with modules, but I think it's the easyst method.

Link to comment
Share on other sites

It doesn't work syntax error. Unexpected "<" on line 5

So check line 5 and work it out ;)

Here, I did it for you:

//Script order
<?php MainController::Run('PIREPS', 'RecentFrontPage'); ?>


//Content of frontpage_recent.tpl
<?php
$pir_sel = "SELECT * FROM pireps WHERE pilotid = 'Auth::$userinfo->pilotid' ORDER BY id DESC LIMIT 5";
$pir_go = mysql_query($pir_sql);
while($report = mysql_fetch_object) { ?>
        <li><a href="<?php echo url('/pireps/viewreport/'.$report->pirepid);?>">#<?php echo $report->pirepid
        . ' - ' . $report->code.$report->flightnum?> <span class="icon-align-left"></span><strong> Flying from <?php echo $report->depICAO . ' to ' . $report->arrICAO?></strong></a></li>
<?php
}
?>

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...