Пример #1
0
 public function emails()
 {
     $this->set('title', 'Pilot Manager');
     $email = $this->post->email;
     $send = $this->post->send;
     Template::Set('send', $send);
     if ($send == "warning") {
         $pilotinfo = PManagerData::getpilotbyemail($email);
         $pilot = $pilotinfo->pilotid;
         Template::Set('pilot', PManagerData::getpilotbyemail($email));
         Template::Set('subject', 'Account termination Warning!!');
         Template::Set('email', $email);
         $subject = "Account termination Warning!!";
         $message = Template::Get('/pm/email_warning.php', true);
         Template::Set('message', $message);
         Util::SendEmail($email, $subject, $message);
         PManagerData::warningsent($pilot, $message);
         $this->show('/pm/email_confirm.php');
     }
     if ($send == "welcome") {
         $pilotinfo = PManagerData::getpilotbyemail($email);
         $pilot = $pilotinfo->pilotid;
         Template::Set('pilot', PManagerData::getpilotbyemail($email));
         Template::Set('subject', 'Welcome!!');
         Template::Set('email', $email);
         $subject = "Welcome!!";
         $message = Template::Get('/pm/email_welcome.php', true);
         Template::Set('message', $message);
         Util::SendEmail($email, $subject, $message);
         PManagerData::welcomesent($pilot, $message);
         $this->show('/pm/email_confirm.php');
     }
     if ($send == "blank") {
         $this->set('title', 'Pilot Manager');
         $this->set('email', $email);
         $this->show('/pm/blank_email.php');
     }
 }