smokey68 Posted November 11, 2015 Report 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
Moderators Parkho Posted November 11, 2015 Moderators Report 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
smokey68 Posted November 11, 2015 Author Report Posted November 11, 2015 this didnt exactly work this is what i get Quote
flyalaska Posted November 11, 2015 Report 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
smokey68 Posted November 12, 2015 Author Report 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
Moderators Parkho Posted November 12, 2015 Moderators Report 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
smokey68 Posted November 12, 2015 Author Report Posted November 12, 2015 It doesnt show anything for pireps (number) it just says you have pireps pending not even zero Quote
Moderators Parkho Posted November 12, 2015 Moderators Report 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
smokey68 Posted November 12, 2015 Author Report 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
Moderators Parkho Posted November 12, 2015 Moderators Report Posted November 12, 2015 Thanks. I haven't had a chance to upload PMV2.1 yet. I'll do it first chance. Quote
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.