Show pireps pending

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

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>

Thanks ill try it

this didnt exactly work this is what i get

Try this

<?php
$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>

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

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>

It doesnt show anything for pireps (number) it just says you have pireps pending not even zero

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>
1 Like

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.

Thanks. I haven’t had a chance to upload PMV2.1 yet. I’ll do it first chance.

Cool Beans