Moderators Parkho Posted October 3, 2012 Moderators Report 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
Moderators Parkho Posted October 3, 2012 Moderators Report 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
Virtualei Posted October 3, 2012 Author Report 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
Moderators Parkho Posted October 3, 2012 Moderators Report 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
Virtualei Posted October 3, 2012 Author Report Posted October 3, 2012 lol glad you like your hair lol Quote
Moderators Parkho Posted October 3, 2012 Moderators Report 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
Virtualei Posted October 3, 2012 Author Report Posted October 3, 2012 Got rid of the error but no email sent arggggggggg Quote
Moderators Parkho Posted October 3, 2012 Moderators Report Posted October 3, 2012 HAHAHA, you know why? Quote
Moderators Parkho Posted October 3, 2012 Moderators Report Posted October 3, 2012 Change this: Util::SendEmail($email, $sub, $message); To this: echo Util::SendEmail($email, $sub, $message) ; Quote
Virtualei Posted October 3, 2012 Author Report Posted October 3, 2012 still no email mate. are you bald yet Quote
Moderators Parkho Posted October 3, 2012 Moderators Report Posted October 3, 2012 Getting there, re load the page and you might get something. Quote
Virtualei Posted October 3, 2012 Author Report 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
Moderators Parkho Posted October 3, 2012 Moderators Report 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
Moderators Parkho Posted October 3, 2012 Moderators Report 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
Virtualei Posted October 3, 2012 Author Report 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
Moderators Parkho Posted October 3, 2012 Moderators Report Posted October 3, 2012 change it to "::" Quote
Virtualei Posted October 3, 2012 Author Report 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
Moderators Parkho Posted October 3, 2012 Moderators Report Posted October 3, 2012 Did you change this part to this?: $rep = PIREPData::getLastReports($pilotid, 1); Quote
Virtualei Posted October 3, 2012 Author Report 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
Moderators Parkho Posted October 3, 2012 Moderators Report 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
Virtualei Posted October 3, 2012 Author Report Posted October 3, 2012 still having problems acessing my site grrrrrrrrrrrr Quote
Virtualei Posted October 3, 2012 Author Report Posted October 3, 2012 ok just sent in a pirep and accepted and guess what mate no email arghhhhhhhhhhhh Quote
Virtualei Posted October 3, 2012 Author Report 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
Moderators Parkho Posted October 3, 2012 Moderators Report Posted October 3, 2012 Okay. Do you see the email button? Quote
Moderators Parkho Posted October 3, 2012 Moderators Report 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
Virtualei Posted October 3, 2012 Author Report 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
Virtualei Posted October 3, 2012 Author Report Posted October 3, 2012 Its opened now . Must still be the server problems. Yes I see the send email button Quote
Virtualei Posted October 3, 2012 Author Report Posted October 3, 2012 I now have 347 emails Parko 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.