Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 It's because the PIREP has not been accepted, so it sends out the email once it gets null value. Let me work on it to see how we can do this and let you know. Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 Okay. Open admin/templates/pirep_list.tpl go down around line 60 and find "Current Status". Now there is an if statement that says "If($pirep->accepted == PIREP_ACCEPTED)" open a bracket like "{" and paste the following after that and close the bracket like "}" then try and send a PIREP. I swear if it doesn't work I'm gonna pull my hair. $pilotfirstname = Auth::$userinfo->firstname; $pilotlastname= Auth::$userinfo->lastname; $email = Auth::$userinfo->email; $code = $pirep->code; $flightnum = $pirep->flightnum; Template::Set('pilotinfo', Auth::$userinfo); Template::Set('flight', $pirep); $sub = 'Flight Report for: '.$code.''.$flightnum; $message = Template::Get('email_pirep_accep.tpl', true); Util::SendEmail($email, $sub, $message); echo 'Accepted'; Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 Parko mate hope you dont like your hair Parse error: syntax error, unexpected T_ELSEIF in /home/airlingu/public_html/admin/templates/pireps_list.tpl on line 77 Sorry Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 That error is actually good, that means that the elseif is unexpected somewhere. He He, so I get to keep my hair. Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 lol glad you like your hair lol Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 here, replace with this: <?php if($pirep->accepted == PIREP_ACCEPTED) { $pilotfirstname = Auth::$userinfo->firstname; $pilotlastname= Auth::$userinfo->lastname; $email = Auth::$userinfo->email; $code = $pirep->code; $flightnum = $pirep->flightnum; Template::Set('pilotinfo', Auth::$userinfo); Template::Set('flight', $pirep); $sub = 'Flight Report for: '.$code.''.$flightnum; $message = Template::Get('email_pirep_accep.tpl', true); Util::SendEmail($email, $sub, $message); echo 'Accepted'; } elseif($pirep->accepted == PIREP_REJECTED) { echo 'Rejected'; } elseif($pirep->accepted == PIREP_PENDING) { echo 'Approval Pending'; } ?> Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 Got rid of the error but no email sent arggggggggg Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 HAHAHA, you know why? Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 Change this: Util::SendEmail($email, $sub, $message); To this: echo Util::SendEmail($email, $sub, $message) ; Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 still no email mate. are you bald yet Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 Getting there, re load the page and you might get something. Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 Ok mate I am now getting an email for every pirep that has been filed. They are coming through slowly i am at 15 at the moment. Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 Okay, that's good news. Now, we can add a button right next to the "Accept" status to send the the email manually once it's accepted. Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 Something like this: <?php if($pirep->accepted == PIREP_ACCEPTED) { $pilotid = Auth::$userinfo->pilotid; $rep = PIREPData::getLastReports($pilotid, 1); $pilotfirstname = Auth::$userinfo->firstname; $pilotlastname= Auth::$userinfo->lastname; $email = Auth::$userinfo->email; $code = $rep->code; $flightnum = $rep->flightnum; Template::Set('pilotinfo', Auth::$userinfo); Template::Set('flight', $pirep); $sub = 'Flight Report for: '.$code.''.$flightnum; $message = Template::Get('email_pirep_accep.tpl', true); echo 'Accepted'; ?> <input type="button" onclick="<?php echo Util::SendEmail($email, $sub, $message);?>" value="Send Email"> <?php } elseif($pirep->accepted == PIREP_REJECTED) { echo 'Rejected'; } elseif($pirep->accepted == PIREP_PENDING) { echo 'Approval Pending'; } ?> Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 Parse error: syntax error, unexpected ':' in /home/airlingu/public_html/admin/templates/pireps_list.tpl on line 63 $rep = PIREPData:getLastReports($pilotid, 1); Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 change it to "::" Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 NIR0004 - Site Maintenence Flight: NIR1026 Dep/Arr: EGAA/EGBB Flight Time: 1.00 Submit Date: 10/03/12 Current Status: Fatal error: Call to undefined function getLastReports() in /home/airlingu/public_html/admin/templates/pireps_list.tpl on line 63 Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 Did you change this part to this?: $rep = PIREPData::getLastReports($pilotid, 1); Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 hold on my mistake i used ; My site is down now Fivdev has been like this for a couple of days now Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 I know, I'm working on someone's website and it's been like this lately. That website is also on fivedev. Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 Did it work? Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 still having problems acessing my site grrrrrrrrrrrr Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 ok just sent in a pirep and accepted and guess what mate no email arghhhhhhhhhhhh Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 Ignore the last post Parko. It must have been the fivedev problem interfereing. I have now recieved 40 emails for the same pirep Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 Okay. Do you see the email button? Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 Where mate Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 Okay. You see, I added a button to send an email once the pirep is accepted and that has to be done by the admin manually but I think it disappears when you hit the accept button. Now if you go to view recent pireps the button should be there right next to the status field. Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 I cant get view recent reports to open it just sits with the timer going and then goes back to the dashboard Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 Its opened now . Must still be the server problems. Yes I see the send email button Quote Link to comment Share on other sites More sharing options...
Virtualei Posted October 3, 2012 Author Report Share Posted October 3, 2012 I now have 347 emails Parko 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.