smokey68 Posted November 11, 2015 Report Share Posted November 11, 2015 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 Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted November 11, 2015 Moderators Report Share Posted November 11, 2015 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> Quote Link to comment Share on other sites More sharing options...
smokey68 Posted November 11, 2015 Author Report Share Posted November 11, 2015 Thanks ill try it Quote Link to comment Share on other sites More sharing options...
smokey68 Posted November 11, 2015 Author Report Share Posted November 11, 2015 this didnt exactly work this is what i get Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 11, 2015 Report Share Posted November 11, 2015 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> Quote Link to comment Share on other sites More sharing options...
smokey68 Posted November 12, 2015 Author Report Share Posted November 12, 2015 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 Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted November 12, 2015 Moderators Report Share Posted November 12, 2015 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> Quote Link to comment Share on other sites More sharing options...
smokey68 Posted November 12, 2015 Author Report Share Posted November 12, 2015 It doesnt show anything for pireps (number) it just says you have pireps pending not even zero Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted November 12, 2015 Moderators Report Share Posted November 12, 2015 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 Quote Link to comment Share on other sites More sharing options...
smokey68 Posted November 12, 2015 Author Report Share Posted November 12, 2015 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. Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted November 12, 2015 Moderators Report Share Posted November 12, 2015 Thanks. I haven't had a chance to upload PMV2.1 yet. I'll do it first chance. Quote Link to comment Share on other sites More sharing options...
smokey68 Posted November 12, 2015 Author Report Share Posted November 12, 2015 Cool Beans Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.