Leave Of Absence v0.9

A few post up you can see

protected function check ($version)
	 {
	 $version_to_check = $version;
// make the cURL request
$curl = curl_init('http://www.savamarkovic.com/loa.csv');
curl_setopt($curl, CURLOPT_FAILonerror, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$read = curl_exec($curl);
	 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>';
	 }
}

Leave of Absence Admin

There are no LoA requests.

Warning : curl_setopt() expects parameter 2 to be long, string given in /home4/jroggjr/public_html/admin/modules/LoA/LoA.php on line 83

Here is line 83 curl_setopt($curl, CURLOPT_FAILonerror, true);

NON CRITICAL UPDATE FOUND!

There is NON critical update available! Here is the information associated with the update.

Version: < - !

Please send an email to ceo@airserbiavirtual.com to receive the updated version.

If I change the onerror to onerror the errors go away but I no longer get the update box either. The onerror should be all caps, but for some damn reason this thing won’t capitalize them.

Why not use the native cURL wrapper in phpVMS?

Instead of;

// make the cURL request
$curl = curl_init('http://www.savamarkovic.com/loa.csv');
curl_setopt($curl, CURLOPT_FAILonerror, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$read = curl_exec($curl);

try;

$url = 'http://www.savamarkovic.com/loa.csv';
$file = new CodonWebService();
$read = @$file->get($url);

The problem is not the curl call but the URL done 404

Click on http://www.savamarkovic.com/loa.csv

I have written to Sava for now no answer

Regards

There are no LoA requests.

Warning : fgetcsv() expects parameter 1 to be resource, boolean given in /membri/wwwcubanavirtual/phpvms/admin/modules/LoA/LoA.php on line 83

Warning : fclose(): supplied argument is not a valid stream resource in /membri/wwwcubanavirtual/phpvms/admin/modules/LoA/LoA.php on line 84

any help, thanks

There are no LoA requests.

Warning : fgetcsv() expects parameter 1 to be resource, boolean given in /membri/wwwcubanavirtual/phpvms/admin/modules/LoA/LoA.php on line 83

Warning : fclose(): supplied argument is not a valid stream resource in /membri/wwwcubanavirtual/phpvms/admin/modules/LoA/LoA.php on line 84

any help, thanks

Answer is right above your post. The page it is looking for is not there - 404 error

The problem is not the curl call but the URL done 404

Click on http://www.savamarkovic.com/loa.csv

Regards

Click on http://www.savamarkovic.com/loa.csv It’s ok now all is right now

*****

Why not use the native cURL wrapper in phpVMS?

Instead of;

// make the cURL request
$curl = curl_init(‘http://www.savamarkovic.com/loa.csv’);
curl_setopt($curl, CURLOPT_FAILonerror, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$read = curl_exec($curl);

try;

$url = ‘http://www.savamarkovic.com/loa.csv’;
$file = new CodonWebService();
$read = @$file->get($url);

I already post for that copy/paste this in your admin/modules/LoA/LoA.php

<?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 (c) 2012, 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 Admin";

public function HTMLHead()
 {
	 $this->set('sidebar', 'loa/loa_admin_sidebar.tpl');
 }
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.tpl');
 $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.tpl');
 }
 public function confirmDeleteLOA()
 {
 $id = $this->get->id;	
 $getinfo = LoAData::GetInfoById($id);
 $this->set('info', $getinfo);
 $this->render('loa/loa_admin_confirm_delete_request.tpl');
 }
 public function deleteLOA()
 {
 $id = $this->get->id;
 $getinfo = LoAData::DeleteLoA($id);

 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.tpl');
 }
 else
 {

	 $this->set('message', 'The LoA Reqest has been successfuly deleted from the database.');
	 $this->render('loa/loa_admin_delete_request.tpl');
 }

 }
protected function check ($version)
			 {
			 $version_to_check = $version;
// make the cURL request
$url = 'http://www.savamarkovic.com/loa.csv';
$file = new CodonWebService();
$read = @$file->get($url);
			 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>';
			 }
}
}

Ok resolve… best regards

I’M STILL WITH THIS ERROR , THANKS

post-9851-0-57552800-1429142020.jpg

Jut installed this with ver 5.5 running. on the Pilot Side emails being sent ok,2 issues. How can the pilot select a start date? and the following errors are shown, no data being sent to DB.

Strict Standards: Non-static method LoAData::CheckPilotID() should not be called statically, assuming $this from incompatible context in /var/www/vhosts/…com/core/modules/LoA/LoA.php on line 66

Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/vhosts//…com.com/core/common/LoAData.class.php on line 24

Warning: mysql_query(): Access denied for user ‘’@‘localhost’ (using password: NO) in /var/www/vhosts//…com.com/core/common/LoAData.class.php on line 24

Warning: mysql_query(): A link to the server could not be established in /var/www/vhosts//…com.com/core/common/LoAData.class.php on line 24

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /var/www/vhosts//…com.com/core/common/LoAData.class.php on line 25

Strict Standards: Non-static method LoAData::AddLoa() should not be called statically, assuming $this from incompatible context in /var/www/vhosts//…com.com/core/modules/LoA/LoA.php on line 76

Your leave of absence request has been submitted. You will recieve an email confirming your details. There is no further action required on your part.

On the ADmin page:

Strict Standards: Non-static method LoAData::GetAllRequests() should not be called statically, assuming $this from incompatible context in /var/www/vhosts/…com.com/admin/modules/LoA/LoA.php on line 35

Any fixes?

Thanks

Thank you!

I just installed this module, i got following issues :

Admin Panel :

Strict Standards : Non-static method LoAData::GetAllRequests() should not be called statically, assuming $this from incompatible context in /home/vaemirat/public_html/admin/modules/LoA/LoA.php on line 35

On the site, where it should show up :

Notice : The template file “/home/vaemirat/public_html/core/templates/loa/loa_index.php” doesn’t exist in /home/vaemirat/public_html/core/classes/TemplateSet.class.php on line 231

Can anyone please help me out ??

The connections are deprecated.

mysql_query(): is now mysqli_query()

But that gets a tad complicated.

You can rewrite it ass PDO.

Also everything to go with that connect is deprecated as well.

mysql_num_rows() is now mysqli_num_rows()

Same thing with the connection error. Etc etc. Basically this module needs help. The code it runs on was deprecated. “This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.” php Manual

I’m working on it but I suck at this stuff. I fixed this issue once on another module and not sure how I did it now.

Check this out too

mysqli_query is now used instead of mysql_query. You can also use PDO::query or MySQLi::query. You can see the documentation here

Hello everyone.

This module has been written a long time ago, and even then it was far from perfect. I believe there is a newer version I did a few months after the initial one and never uploaded it to GitHub. I’ll check and upload if so.

edit: never mind

I have been fiddling with this for a couple hours and no such love. I fixed this issue once before in another project I was working on like it was nothing. Now, it is nothing lol as I can not fix it. I am going to loose sleep over it now. I am REAL OCD like that.

I sounded a couple of alarms for help from people I know. Hopefully someone will chime in and help us all out.

Found the version. Here is it, haven’t checked it if it works, but if you’re willing to let me know.

http://www.savamarkovic.com/loa.zip

Needs a full update, so you’ll need to delete your old loa table.

Im on it bud. Got a very fresh install of phpvms ready to roll.

Cool. Thanks.

Let me know how it works.