Jump to content

Pirep accepted email[SOLVED]


Virtualei

Recommended Posts

  • Moderators

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. :huh:

$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';

Link to comment
Share on other sites

  • Moderators

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';
 }

?>

Link to comment
Share on other sites

  • Moderators

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';
}

?>

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...