Jump to content

Ashj24uk

Members
  • Posts

    62
  • Joined

  • Last visited

Posts posted by Ashj24uk

  1. i just tried the new one and got

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `phpvms_autopirep` (`id`, `criteria_description`, `created_by`, `ena' at line 12

  2. when i try to add the sql i get this error 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM AUTO_INCREMENT=38' at line 9

    any ideas what could be wrong?

  3. Hi guys I have a problem with adding modules I follow the instructions to add the modules correct along with the sql but for some reason it comes up with an error saying the /public_html/en/core/templates/credits

    index.tpl doesnt exsist so when i look in filezilla it has that file as a php file so i change it to a tpl file and it works but in my admin centre where i can add edit and stuff for the module i just get this error credits/sidebar_credits.php and i can seem to fix it i have attached a screenshot aswell

    post-5961-0-01616100-1380461830_thumb.jpg

  4. The issue is explained in the posts above yours. I do not know when the data feeds will return.

    I know you do not know when the data feeds are back up i have check when i put this post up and they were back online but as i stated the vatsim data file is still not being created

  5. here you sava

    <?php

    /**

    * Leave of Absence (LoA) v.1.0 Module

    *

    * phpVMS Module for pilots to submit a LoA request that is stored in a database

    * and an option for staff to view all the LoA requests through the admin panel

    * This module is released under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

    * You are free to redistribute and alter this work as you wish but you must keep the original 'copyright' information on all the places it comes in the original work.

    * You are not allowed to delete the copyright information and/or gain any profit by adopting or using this module.

    *

    * @author Sava Markovic - savamarkovic.com

    * @copyright Copyright © 2013, Sava Markovic

    * @link http://www.savamarkovic.com

    * @license http://creativecommons.org/licenses/by-nc-sa/3.0/

    */

    class LoA extends CodonModule {

    public $title = "Leave of Absence Request";

    public function index ()

    {

    if (!Auth::LoggedIn())

    {

    $this->set('message', 'You are not logged in.');

    $this->render('core_error.tpl');

    }

    else

    {

    $this->render('loa/loa_index.tpl');

    }

    }

    public function submit()

    {

    date_default_timezone_set('UTC');

    $date_now = time();

    $date_ref = strtotime($this->post->day.'-'.$this->post->month.'-'.$this->post->year);

    $days = ($date_ref - $date_now)/(60*60*24);

    if ($days > 61 || $days < 0)

    {

    $this->set('error_lenght', 'The requested leave duration exceeds our policy.');

    $this->render('loa/loa_error.tpl');

    $this->render('loa/loa_index.tpl');

    }

    else

    {

    if ($this->post->reason == '') //check if the LoA reason field is empty or not, if empty ->

    {

    $this->set('error_reason', 'You haven\'t specified a reason for your leaeve of absence.');

    $this->render('loa/loa_error.tpl');

    $this->render('loa/loa_index.tpl');

    }

    else

    {

    $data = array('pilotid' => Auth::$userinfo->pilotid,

    'start' => $date_now,

    'end' => $date_ref,

    'reason' => $this->post->reason);

    $pilotid_check = LoAData::CheckPilotID($data['pilotid']);

    if ($pilotid_check > 0)

    {

    $this->set('error_id', 'There is already a LoA request with your Pilot ID.');

    $this->render('loa/loa_error.tpl');

    $this->render('loa/loa_index.tpl');

    }

    else

    {

    LoAData::AddLoA($data);

    $this->sendmail($data);

    $this->render('loa/loa_submitted.tpl');

    }

    }

    }

    }

    protected function sendmail($data)

    {

    //send mail to admin

    $email_admin = ADMIN_EMAIL;

    $subject_admin = SITE_NAME . ' LoA Request Submitted';

    $message_admin = "Dear admin, a user has sent a LoA Requst. Check the details below. To edit the LoA request, go to your admin panel. <br>

    Here are the details of your request: <br>

    Pilot ID: {$data['pilotid']} <br>

    Start Date: ".date( DATE_FORMAT, $data['start'])."<br />

    End Date: ".date(DATE_FORMAT,$data['end'])." <br />

    Reason: {$data['reason']}<br>

    Thank you for submitting the request.";

    Util::SendEmail($email_admin, $subject_admin, $message_admin);

    //send mail to pilot

    $subject = SITE_NAME . ' Leave of Absence Confirmation';

    $email = Auth::$userinfo->email;

    $message = "Your leave of absence request has been submitted and processed by our system. <br>

    Here are the details of your request: <br>

    Pilot ID: {$data['pilotid']} <br>

    Start Date: ".date( DATE_FORMAT, $data['start'])."<br />

    End Date: ".date(DATE_FORMAT,$data['end'])." <br />

    Reason: {$data['reason']}<br>

    Thank you for submitting the request.";

    Util::SendEmail($email, $subject, $message);

    }

    }

  6. Hi guy I have recently added the Leave of absence module now in this module in the pilot center it wont let you enter a start date so after a bit of tinkering i manged to

    get it to let me choose a start date for my leave of absence as a drop down box now the thing is in the admin center it still shows today date as the start of my leave of absence

    even tho in the pilot center i choose a different date now how do i get it to display the start date correctly in the admin center il post some screen shots too

    post-5961-0-65618600-1376905370_thumb.jpg

    post-5961-0-02366900-1376905380_thumb.jpg

×
×
  • Create New...