Jump to content

Leave Of Absence v0.9


Sava

Recommended Posts

We probably have the same version if you got the new one. I was on skype with Sava when he released this and I grabbed it. I do have that comment as well in mine I just failed to post it. sorry about that. I was just sure about the 1 extra day thing on there.

I appreciate the reply Pro. Thanks man. I'll go fix that right quick before I forget.

Link to comment
Share on other sites

Hey guys, without looking at the code, I think I entered to account for the difference in time.
A huge part of the module is still legacy code from when I was still learning. I'll get the update done soon. (And send it for you to review Ray :P)

Link to comment
Share on other sites

  • 11 months later...

I don;t know if it is a problem on my end but sava's loa repo is not opening. I am getting these errors on client side:

Deprecated: Non-static method LoAData::CheckPilotID() should not be called statically, assuming $this from incompatible context in /storage/ssd3/285/3946285/public_html/core/modules/LoA/LoA.php on line 66

Deprecated: Non-static method LoAData::AddLoa() should not be called statically, assuming $this from incompatible context in /storage/ssd3/285/3946285/public_html/core/modules/LoA/LoA.php on line 76

And these on the admin side:

Deprecated: Non-static method LoAData::GetAllRequests() should not be called statically, assuming $this from incompatible context in /storage/ssd3/285/3946285/public_html/admin/modules/LoA/LoA.php on line 35

Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /storage/ssd3/285/3946285/public_html/admin/modules/LoA/LoA.php on line 83

Warning: fclose() expects parameter 1 to be resource, boolean given in /storage/ssd3/285/3946285/public_html/admin/modules/LoA/LoA.php on line 84

 

Link to comment
Share on other sites

  • 3 months later...
On 22/7/2013 at 11:51 AM, OA01 said:

I found the solution myself. :)

Open //core/common/LoAData.class and locate the following:

 


public function GetAllRequests ()
{
 $table = TABLE_PREFIX;
 $sql   = "SELECT loa.pilotid,
   loa.start,
   loa.end,
   loa.reason,
   phpvms_pilots.pilotid,
   phpvms_pilots.firstname,
   phpvms_pilots.lastname
   FROM loa
   JOIN phpvms_pilots ON loa.pilotid = phpvms_pilots.pilotid";
 $ret = DB::get_results($sql);
 return $ret;
 

 

And replace it with this:

 


public function GetAllRequests ()
{
 $table = ".TABLE_PREFIX.";
 $sql   = "SELECT loa.pilotid,
   loa.start,
   loa.end,
   loa.reason,
   pilots.pilotid,
   pilots.firstname,
   pilots.lastname
   FROM loa
   JOIN pilots ON loa.pilotid = pilots.pilotid";
 $ret = DB::get_results($sql);
 return $ret;
Good afternoon. I tried to edit the file but it does not work. No data in the DB and in the admin panel (no error is shown) How to solve? thank you

 

Now the admin function works OK. :D

 

Link to comment
Share on other sites

  • 3 months later...

Good Morning Lades & Gents,

I would really like to use this module as im running Classic VMS 5.5 (PHP version) but sadly none of the download links work :( could anyone provide me with a download link?

Looks like a fantastic addition to my site.

Kind Regards Harry.

Link to comment
Share on other sites

6 hours ago, harryh146 said:

Good Morning Lades & Gents,

I would really like to use this module as im running Classic VMS 5.5 (PHP version) but sadly none of the download links work :( could anyone provide me with a download link?

Looks like a fantastic addition to my site.

Kind Regards Harry.

I packaged mine for you. You will need to change the classes to match your css.

 

Download Here!

Link to comment
Share on other sites

On 7/1/2018 at 5:34 PM, flyalaska said:

I packaged mine for you. You will need to change the classes to match your css.

Hi FlyAlaska thank you very much for uploading that for me ! No worries re-doing my css sheet at the moment anyway, Thanks again ! Kind Regards Harry

Link to comment
Share on other sites

1 hour ago, harryh146 said:

Hi FlyAlaska thank you very much for uploading that for me ! No worries re-doing my css sheet at the moment anyway, Thanks again ! Kind Regards Harry 

The loa.sql file is missing, which you can download from here: https://github.com/carriercomm/phpvms_loa

Use the loa.sql file to create the table necessary for the module to work. You can do this by using phpmyadmin.

Link to comment
Share on other sites

On 7/3/2018 at 6:19 PM, gio1961 said:

The loa.sql file is missing, which you can download from here: https://github.com/carriercomm/phpvms_loa

Use the loa.sql file to create the table necessary for the module to work. You can do this by using phpmyadmin.

Thank you that table has now been added to my DB, however im having a few issues & none of the above answers or fix's look like any of the code i have, ill attach pictures so you can see.

I hope you can help me.

Kind Regards Harry 

2018_07_04_18_21_40_Leave_of_Absence_Req 2018_07_04_18_21_55_php_VMS_Admin_Panel_

Link to comment
Share on other sites

  • 1 year later...

Anyone have a way i can fix this system? i cant seem to get it to work properly i get these errors

Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/deltavi1/public_html/core/common/LoAData.class.php on line 60

Warning: mysql_query(): Access denied for user 'deltavi1'@'localhost' (using password: NO) in /home/deltavi1/public_html/core/common/LoAData.class.php on line 60

Warning: mysql_query(): A link to the server could not be established in /home/deltavi1/public_html/core/common/LoAData.class.php on line 60

Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/deltavi1/public_html/core/common/LoAData.class.php on line 61

Warning: mysql_affected_rows(): Access denied for user 'deltavi1'@'localhost' (using password: NO) in /home/deltavi1/public_html/core/common/LoAData.class.php on line 61

Warning: mysql_affected_rows(): A link to the server could not be established in /home/deltavi1/public_html/core/common/LoAData.class.php on line 61

Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/deltavi1/public_html/admin/modules/LoA/LoA.php on line 64

Warning: mysql_affected_rows(): Access denied for user 'deltavi1'@'localhost' (using password: NO) in /home/deltavi1/public_html/admin/modules/LoA/LoA.php on line 64

Warning: mysql_affected_rows(): A link to the server could not be established in /home/deltavi1/public_html/admin/modules/LoA/LoA.php on line 64

Link to comment
Share on other sites

  • 1 month later...
On 1/16/2020 at 3:59 AM, SmarticleCo said:

Anyone have a way i can fix this system? i cant seem to get it to work properly i get these errors

Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/deltavi1/public_html/core/common/LoAData.class.php on line 60

Warning: mysql_query(): Access denied for user 'deltavi1'@'localhost' (using password: NO) in /home/deltavi1/public_html/core/common/LoAData.class.php on line 60

Warning: mysql_query(): A link to the server could not be established in /home/deltavi1/public_html/core/common/LoAData.class.php on line 60

Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/deltavi1/public_html/core/common/LoAData.class.php on line 61

Warning: mysql_affected_rows(): Access denied for user 'deltavi1'@'localhost' (using password: NO) in /home/deltavi1/public_html/core/common/LoAData.class.php on line 61

Warning: mysql_affected_rows(): A link to the server could not be established in /home/deltavi1/public_html/core/common/LoAData.class.php on line 61

Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/deltavi1/public_html/admin/modules/LoA/LoA.php on line 64

Warning: mysql_affected_rows(): Access denied for user 'deltavi1'@'localhost' (using password: NO) in /home/deltavi1/public_html/admin/modules/LoA/LoA.php on line 64

Warning: mysql_affected_rows(): A link to the server could not be established in /home/deltavi1/public_html/admin/modules/LoA/LoA.php on line 64

bump

Link to comment
Share on other sites

  • 3 months later...
  • Administrators
1 hour ago, William said:

Yes, thanks, but that's not much help. Already have that and was looking for something that's a bit more up to date.

 

That should be version 1.0 - and is probably the most current version.

What is it that you feel needs to be more current? This version is easily converted from tpl to php template files. It's working well in phpVMS 5.5.2 and phpVMS 5.5.2.72 without error.

Link to comment
Share on other sites

Hey ProAvia, thanks for the response. 

 

Yes, a cleaned up version of V1 is what we have on the site now and I resolved most of the errors, but I still have a couple of function errors I wanted to get rid off. 

 

For instance when I try to delete a submitted LOA, it throws an error saying mysqli_query expecting a value and not finding it and as a consequence does not delete the request from the DB or the Admin panel.

I'm on my phone now, but I can be more clear in the errors I mentioned when I get to the computer.

 

Thanks   

Edited by William
Link to comment
Share on other sites

  • Administrators
5 hours ago, William said:

Hey ProAvia, thanks for the response. 

 

Yes, a cleaned up version of V1 is what we have on the site now and I resolved most of the errors, but I still have a couple of function errors I wanted to get rid off. 

 

For instance when I try to delete a submitted LOA, it throws an error saying mysqli_query expecting a value and not finding it and as a consequence does not delete the request from the DB or the Admin panel.

I'm on my phone now, but I can be more clear in the errors I mentioned when I get to the computer.

 

Thanks   

 

Yes, listing the error would help figure out what may need to be changed.

 

Be sure to list

  • phpVMS version
  • PHP version
  • MySQL/MariaDB version
  • Exact errors you are seeing
Link to comment
Share on other sites


Hello,


I am also looking for a more updated version of this module, but it is the only one here in the forum, I installed it and it gives some kind of error (LoA requests do not appear in the administrative panel either) and I wrote to the author of the module and He never gave an answer.
 

Thank you

Link to comment
Share on other sites

  • Administrators
2 hours ago, VIELMA16 said:


Hello,


I am also looking for a more updated version of this module, but it is the only one here in the forum, I installed it and it gives some kind of error (LoA requests do not appear in the administrative panel either) and I wrote to the author of the module and He never gave an answer.
 

Thank you

 

The link listed a few posts above IS the most updated version. You will need to covert to from tpl to php.

 

After you convert it - if you still get an error, try Googling the error. Or post the error here and maybe someone will help you out.

Link to comment
Share on other sites

2 minutes ago, ProAvia said:

 

El enlace enumeró algunas publicaciones anteriores ES la versión más actualizada. Deberá pasar de tpl a php.

 

Después de convertirlo, si aún recibe un error, intente buscar el error en Google. O publique el error aquí y tal vez alguien lo ayude.

 

Deprecated: Non-static method LoAData::CheckPilotID() should not be called statically in /home/level/public_html/phpvms/core/modules/LoA/LoA.php on line 66

Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home/level/public_html/phpvms/core/common/LoAData.class.php:22 Stack trace: #0 /home/level/public_html/phpvms/core/modules/LoA/LoA.php(66): LoAData::CheckPilotID('1') #1 /home/level/public_html/phpvms/core/classes/MainController.class.php(218): LoA->submit() #2 /home/level/public_html/phpvms/index.php(70): MainController::RunAllActions() #3 {main} thrown in /home/level/public_html/phpvms/core/common/LoAData.class.php on line 22

Link to comment
Share on other sites

  • Administrators
1 hour ago, VIELMA16 said:

 

Deprecated: Non-static method LoAData::CheckPilotID() should not be called statically in /home/level/public_html/phpvms/core/modules/LoA/LoA.php on line 66

Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home/level/public_html/phpvms/core/common/LoAData.class.php:22 Stack trace: #0 /home/level/public_html/phpvms/core/modules/LoA/LoA.php(66): LoAData::CheckPilotID('1') #1 /home/level/public_html/phpvms/core/classes/MainController.class.php(218): LoA->submit() #2 /home/level/public_html/phpvms/index.php(70): MainController::RunAllActions() #3 {main} thrown in /home/level/public_html/phpvms/core/common/LoAData.class.php on line 22

 

What is line 66 in /core/modules/Loa/LoA.php?

 

What is line 22 in /core/common/LoAData.class.php?

phpVMS version?

PHP version?

MySQL/MariaDB version?

 

Link to comment
Share on other sites

  • 3 weeks later...

Hey ProAvia,

Here are me and William's errors in admin:

Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php on line 63
Warning: mysql_affected_rows(): Access denied for user ''@'localhost' (using password: NO) in /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php on line 63
Warning: mysql_affected_rows(): A link to the server could not be established in /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php on line 63

 

And here is that file with line 63 noted:

 

Thanks
 

class LoA extends CodonModule {

    public $title = "Leave of Absence Admin";
    
    public function HTMLHead()
        {
           $this->set('sidebar', 'loa/loa_admin_sidebar.php');
        }

    public function NavBar ()
        {
            echo '<li><a href="'.SITE_URL.'/admin/index.php/LoA">LoA Admin</a></li>';
        }

    public function index ()

    {
        $version = '1.0';
        $leaves = LoAData::GetAllRequests(array());
        $this->set('all_leaves', $leaves);
        $this->render('loa/loa_admin_index.php');
        $this->check($version);
     }



     public function viewLOA()
     {  
        $id = $this->get->id;        
        $getinfo = LoAData::GetInfoByID($id);
        $this->set('info', $getinfo);
        $this->render('loa/loa_admin_view_request.php');

     }

     public function confirmDeleteLOA()
     {
       $id = $this->get->id;        
        $getinfo = LoAData::GetInfoById($id);
        $this->set('info', $getinfo);
        $this->render('loa/loa_admin_confirm_delete_request.php');
     }
     public function deleteLOA()
     {
        $id = $this->get->id;
        $getinfo = LoAData::DeleteLoA($id);
 Line 63->       if (mysql_affected_rows() == -1)
       
        {
            $this->set('message', 'The LoA Reqest hasn\'t been deleted from the database for some reason. This isn\'t suppose to happen. Check the phpVMS forums for support.');
            $this->render('loa/loa_admin_delete_request.php');
        }
        else
        {
            
            $this->set('message', 'The LoA Reqest has been successfuly deleted from the database.');
            $this->render('loa/loa_admin_delete_request.php');
        }


     }
     protected function check ($version)
     {
        $version_to_check = $version;
        $url = 'http://www.savamarkovic.com/loa.csv';
        $fp = @fopen ($url, 'r') or $message = "The updater checking service is currently offline"; //If the server is unreachable
        $read = fgetcsv ($fp); 
        fclose ($fp); // Closes the connection
        if ($read[0] > $version_to_check && $read[2] == "1") { $critical = TRUE; } // If its 1, set ciritcal to true
        if ($read[0] > $version_to_check) { $update = TRUE; } // Anything other than 1 set update to true
        if ($read[0] == $version_to_check) {
            echo '<p id="success">Your version of this module is up to date. Wohooooo! ;))</p>';
        }else if ($critical) {
                echo '<h4>CRITICAL UPDATE FOUND!</h4>';
                echo '<p id="error">There is a critical update available! Here is the information associated with the update. <br/><b>Version:
                 '.$read[0].' - '. $read[1].' <br /></b>Please send an email to ceo@airserbiavirtual.com to receive the updated version.</p>';
        }else if ($update){
                echo '<h4>NON CRITICAL UPDATE FOUND!</h4>';
                echo '<p id="error" style="background:#fffca7;border-color:orange">There is NON critical update available! Here is the information associated with the update. <br/><b>Version:
                 '.$read[0].' - '. $read[1].' <br /></b>Please send an email to ceo@airserbiavirtual.com to receive the updated version.</p>';
      }

   
}
}

 

Link to comment
Share on other sites

Whoops, sorry!

 

phpvms 5.5.2
mysql 5.7.30-cll-lve
php 5.6

The exact errors are in my post above:

  • Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php on line 63
  • Warning: mysql_affected_rows(): Access denied for user ''@'localhost' (using password: NO) in /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php on line 63
  • Warning: mysql_affected_rows(): A link to the server could not be established in /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php on line 63

The code for /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php is also in my post, with Line 63 noted out. 

Link to comment
Share on other sites

As a matter of fact with the changes I made, the module works as it should. The only thing we cannot do is delete the LOA requests from within Admin.

 

That's when the error is thrown (at line 63) so we have to delete them directly in the DB. I didn't get around to fix that yet.

Edited by William
Link to comment
Share on other sites

  • Administrators
9 hours ago, djtiger76 said:

Whoops, sorry!

 

phpvms 5.5.2
mysql 5.7.30-cll-lve
php 5.6

The exact errors are in my post above:

  • Deprecated: mysql_affected_rows(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php on line 63
  • Warning: mysql_affected_rows(): Access denied for user ''@'localhost' (using password: NO) in /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php on line 63
  • Warning: mysql_affected_rows(): A link to the server could not be established in /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php on line 63

The code for /home/tstamer/public_html/crew/admin/modules/LoA/LoA.php is also in my post, with Line 63 noted out. 

 

What version of the module do you have? Where did you get it from?

 

In local.config around line 23, post the complete DBASE_TYPE line

 

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