Jump to content

Recommended Posts

Posted

i would like to have the number of pierps pending for each pilot on their profile

example John does profile says ; John Doe you currently have 1 pirep pending

another profile ; John Marks your currently have 3 pireps pending

  • Moderators
Posted

Try this:

$a = "SELECT count(pirepid) AS count FROM phpvms_pireps WHERE accepted = 0";
$ab = DB::get_row($a);
<p> You have <?php echo $ab->count ;?> pending pireps</p>

Posted

that works but not really what i wanted i wanted it to say how many flights there are per person so if i fly 2 flights and file them when i login it will show there are 2 pireps pending for me in which there may be 20 pending for the whole website but this example that you have given shows number of all pireps pending

  • Moderators
Posted

Try this:

<?php
$a = "SELECT count(pirepid) AS count FROM phpvms_pireps WHERE accepted = 0 AND pilotid = Auth::$userinfo->pilotid";
$ab = DB::get_row($a);
?>
<p> You have <?php echo $ab->count ;?> pending pireps</p>

  • Moderators
Posted

Try This:

<?php
$pilotid = Auth::$userinfo->pilotid;
$a = "SELECT count(pirepid) AS count FROM phpvms_pireps WHERE accepted = 0 AND pilotid = '$pilotid'";
$ab = DB::get_row($a);
?>
<p> You have <?php echo $ab->count ;?> pending pireps</p>

  • Haha 1
Posted

This seems to work you have been a great help and i like the addons you had on github as well but i saw that the pilot manager has not fully been upload yet it just had a readme in it.

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