Jump to content

VIELMA16

Members
  • Posts

    46
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by VIELMA16

  1. Hello, that module is quite interesting. Will it be paid or free?
  2. Thank you Strider!
  3. I have a problem with a module too, I wrote privately and sent an email over two weeks ago and it is impossible. I understand that you may have responsibilities but you should also be efficient with your clients. Support is what is most valued and is very important. They should improve that!
  4. Thank you ProAvia!
  5. Download link broken. Where can i download this. Thank you!
  6. This did not happen previously. But I realized that effectively with new reports (July) this is solved.
  7. Hello Guys, I need to fix this error in the monthly statistics of the airline. The module works well but I have noticed that since there are no statistics in this month for some reason it throws the error: Warning: Creating default object from empty value in /home/level/public_html/phpvms/core/common/FinanceData.class. php on line 107. I have not modified anything and it only throws the error in the statistics of this month. In the statistics of the previous months it does not. (Statistics for June) I looked FinanceData.class.php and basically I don't know what to do to fix that. This is the code: <?php /** * phpVMS - Virtual Airline Administration Software * Copyright (c) 2008 Nabeel Shahzad * For more information, visit www.phpvms.net * Forums: http://www.phpvms.net/forum * Documentation: http://www.phpvms.net/docs * * phpVMS is licenced under the following license: * Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) * View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/ * * @author Nabeel Shahzad * @copyright Copyright (c) 2008, Nabeel Shahzad * @link http://www.phpvms.net * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ */ class FinanceData extends CodonData { public static $lasterror; public static function formatMoney($number) { $isneg = false; if ($number < 0) { $isneg = true; } # $ 50.00 - If positive # ($ -50.00) - If negative $number = Config::Get('MONEY_UNIT') . ' ' . number_format($number, 2, '.', ', '); if ($isneg == true) $number = '(' . $number . ')'; return $number; } /** * Get the fuel cost, given the airport and the amount of fuel * * @param int $$fuel_amount Amount of fuel used * @param string $apt_icao ICAO of the airport to calculate fuel price * @return int Total cost of the fuel * */ public static function getFuelPrice($fuel_amount, $apt_icao = '') { /* A few steps: Check the local cache, if it's not there, or older than three days, reach out to the API, if not there, then use the localized price */ if ($apt_icao != '') { $price = FuelData::GetFuelPrice($apt_icao); } else { $price = Config::Get('FUEL_DEFAULT_PRICE'); } $total = ($fuel_amount * $price); # Surcharge amount $total += ((Config::Get('FUEL_SURCHARGE') / 100) * $fuel_amount) * $price; return $total; } /** * This populates the expenses for a monthly-listing from * PIREPData::getIntervalDatabyMonth(array(), months). This goes * monthly. Pass in just one month returned by that array. * * This will add a index called 'expenses' which will contain * all of the expenses for that month * * @param mixed $month_info This is a description * @return mixed This is the return value description * */ public static function calculateFinances($month_info) { $pilot_pay = LedgerData::getTotalForMonth($month_info->timestamp); /* Where the bulk of our work is done for expenses */ $running_total = 0; $expenses = self::getExpensesForMonth($month_info->timestamp); foreach ($expenses as $ex) { $ex->type = strtolower($ex->type); if($ex->type == 'm') { $ex->total = $ex->cost; } elseif($ex->type == 'f') { /* per-flight expense */ $ex->total = $month_info->total * $ex->cost; } elseif($ex->type == 'p') { /* percent of gross per month */ $ex->total = $month_info->gross * ($ex->cost / 100); } elseif($ex->type == 'g') { /* perfect revenue, per flight */ $ex->total = $month_info->gross * ($ex->cost / 100); } $running_total += $ex->total; } $month_info->expenses = $expenses; $month_info->expenses_total = $running_total; $month_info->pilotpay = $pilot_pay; $month_info->revenue = $month_info->gross - $month_info->fuelprice - $month_info->pilotpay - $running_total; return $month_info; } /** * FinanceData::getExpensesForMonth() * * @param mixed $timestamp * @return */ public static function getExpensesForMonth($timestamp) { $time = date('Ym', $timestamp); # If it's the current month, just return the latest expenses if ($time == date('Ym')) { return self::getAllExpenses(); } $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'expenselog WHERE `dateadded`=' . $time; $ret = DB::get_results($sql); if(!$ret) { return array(); } return $ret; } /** * FinanceData::setExpensesforMonth() * * @param mixed $timestamp * @return */ public static function setExpensesforMonth($timestamp) { $all_expenses = self::getAllExpenses(); if(!$all_expenses || count($all_expenses) == 0) { return true; } # Remove expenses first self::removeExpensesforMonth($timestamp); $time = date('Ym', $timestamp); foreach ($all_expenses as $expense) { $sql = 'INSERT INTO ' . TABLE_PREFIX . "expenselog (`dateadded`, `name`, `type`, `cost`) VALUES ('{$time}', '{$expense->name}', '{$expense->type}', '{$expense->cost}');"; DB::query($sql); } } /** * Populates any expenses which are missing from the table * Goes month by month * */ public static function updateAllExpenses() { $times = StatsData::GetMonthsSinceStart(); foreach ($times as $timestamp) { $exp = self::getExpensesForMonth($timestamp); if (!$exp) { self::setExpensesforMonth($timestamp); } } } /** * Re-populates all expenses, deleteing all the old ones * * @return mixed This is the return value description * */ public static function populateAllExpenses() { $times = StatsData::GetMonthsSinceStart(); foreach ($times as $timestamp) { self::setExpensesforMonth($timestamp); } } /** * FinanceData::removeExpensesforMonth() * * @param mixed $timestamp * @return void */ public static function removeExpensesforMonth($timestamp) { $time = date('Ym', $timestamp); $sql = 'DELETE FROM ' . TABLE_PREFIX . 'expenselog WHERE `dateadded`=' . $time; DB::query($sql); } /** * Get a list of all the expenses */ public static function getAllExpenses() { $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'expenses'; $res = DB::get_results($sql); if(!$res) { return array(); } return $res; } /** * Get an expense details based on ID */ public static function getExpenseDetail($id) { $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'expenses WHERE `id`=' . $id; return DB::get_row($sql); } /** * Get an expense by the name (mainly to check for * duplicates) */ public static function getExpenseByName($name) { $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'expenses WHERE `name`=' . $name; return DB::get_row($sql); } /** * Get all of the expenses for a flight */ public static function getFlightExpenses() { $sql = "SELECT * FROM " . TABLE_PREFIX . "expenses WHERE `type`='F'"; return DB::get_results($sql); } /** * Get any percentage expenses per flight * */ public static function getFlightPercentExpenses() { $sql = "SELECT * FROM " . TABLE_PREFIX . "expenses WHERE `type`='G'"; return DB::get_results($sql); } /** * Add an expense */ public static function addExpense($name, $cost, $type) { if ($name == '' || $cost == '') { self::$lasterror = 'Name and cost must be entered'; return false; } $name = DB::escape($name); $cost = DB::escape($cost); $type = strtoupper($type); if ($type == '') $type = 'M'; // Default as monthly $sql = 'INSERT INTO ' . TABLE_PREFIX . "expenses (`name`, `cost`, `type`) VALUES('$name', '$cost', '$type')"; DB::query($sql); if (DB::errno() != 0) return false; return true; } /** * Edit a certain expense */ public static function editExpense($id, $name, $cost, $type) { if ($name == '' || $cost == '') { self::$lasterror = 'Name and cost must be entered'; return false; } $name = DB::escape($name); $cost = DB::escape($cost); $type = strtoupper($type); if ($type == '') $type = 'M'; // Default as monthly $sql = 'UPDATE ' . TABLE_PREFIX . "expenses SET `name`='$name', `cost`='$cost', `type`='$type' WHERE `id`=$id"; DB::query($sql); if (DB::errno() != 0) return false; return true; } /** * Delete an expense */ public static function removeExpense($id) { $sql = 'DELETE FROM ' . TABLE_PREFIX . 'expenses WHERE `id`=' . $id; DB::query($sql); } /** * Get the active load count based on the load factor * based on the flight type: P(assenger), C(argo), H(Charter) */ public static function getLoadCount($aircraft_id, $flighttype = 'P') { $flighttype = strtoupper($flighttype); # Calculate our load factor for this flight # Charter flights always will have a 100% capacity if ($flighttype == 'H') { $load = 100; } else { # Not a charter $loadfactor = intval(Config::Get('LOAD_FACTOR')); $load = rand($loadfactor - LOAD_VARIATION, $loadfactor + LOAD_VARIATION); # Don't allow a load of more than 95% if ($load > 95) $load = 95; elseif ($load <= 0) $load = 92; # Use ATA standard of 72% } /* * Get the maximum allowed based on the aircraft flown */ $aircraft = OperationsData::GetAircraftInfo($aircraft_id); if (!$aircraft) # Aircraft doesn't exist { if ($flighttype == 'C') # Check cargo if cargo flight $count = Config::Get('DEFAULT_MAX_CARGO_LOAD'); else $count = Config::Get('DEFAULT_MAX_PAX_LOAD'); } else { if ($flighttype == 'C') # Check cargo if cargo flight $count = $aircraft->maxcargo; else $count = $aircraft->maxpax; } $load = ($load / 100); $currload = ceil($count * $load); return $currload; } } Thank you so much.
  8. Strider, Do you can post an example of how the table should look by adding codeshare and codenum to the schedules? For me to try it, surely you would help many of us with that. As I said in the previous message it is the only thing I could not do. Or post some other images of the module for us to help us. Thank you.
  9. Hello Strider, in my airline I used the previous version and it is an excellent module. Today I have successfully downloaded and installed version 2 but unfortunately it is very difficult for me to do what is stated in section 3 of the instructions. I don't know much about that and I don't want to do something wrong although I did the respective backups. Is there an easier way to do that? Thank you so much. Julio
  10. Solved. Thank you so much ProAvia!
  11. This is the complete code of the file Pagination.class.php <?php class Pagination extends CodonData { /** * Current Page * * @var integer */ var $page; /** * Size of the records per page * * @var integer */ var $size; /** * Total records * * @var integer */ var $total_records; /** * Link used to build navigation * * @var string */ var $link; /** * Class Constructor * * @param integer $page * @param integer $size * @param integer $total_records */ function Pagination($page = null, $size = null, $total_records = null) { $this->page = $page; $this->size = $size; $this->total_records = $total_records; } /** * Set's the current page * * @param unknown_type $page */ function setPage($page) { $this->page = 0+$page; } /** * Set's the records per page * * @param integer $size */ function setSize($size) { $this->size = 0+$size; } /** * Set's total records * * @param integer $total */ function setTotalRecords($total) { $this->total_records = 0+$total; } /** * Sets the link url for navigation pages * * @param string $url */ function setLink($url) { $this->link = $url; } /** * Returns the LIMIT sql statement * * @return string */ function getLimitSql() { $sql = "LIMIT " . $this->getLimit(); return $sql; } /** * Get the LIMIT statment * * @return string */ function getLimit() { if ($this->total_records == 0) { $lastpage = 0; } else { $lastpage = ceil($this->total_records/$this->size); } $page = $this->page; if ($this->page < 1) { $page = 1; } else if ($this->page > $lastpage && $lastpage > 0) { $page = $lastpage; } else { $page = $this->page; } $sql = ($page - 1) * $this->size . "," . $this->size; return $sql; } /** * Creates page navigation links * * @return string */ function create_links() { $totalItems = $this->total_records; $perPage = $this->size; $currentPage = $this->page; $link = $this->link; $totalPages = floor($totalItems / $perPage); $totalPages += ($totalItems % $perPage != 0) ? 1 : 0; if ($totalPages < 1 || $totalPages == 1){ return null; } $output = null; //$output = '<span id="total_page">Page (' . $currentPage . '/' . $totalPages . ')</span>&nbsp;'; $loopStart = 1; $loopEnd = $totalPages; if ($totalPages > 5) { if ($currentPage <= 3) { $loopStart = 1; $loopEnd = 5; } else if ($currentPage >= $totalPages - 2) { $loopStart = $totalPages - 4; $loopEnd = $totalPages; } else { $loopStart = $currentPage - 2; $loopEnd = $currentPage + 2; } } if ($loopStart != 1){ $output .= sprintf('<li class="disabledpage"><a href="' . $link . '">&#171;</a></li>', '1'); } if ($currentPage > 1){ $output .= sprintf('<li class="nextpage"><a href="' . $link . '">Previous</a></li>', $currentPage - 1); } for ($i = $loopStart; $i <= $loopEnd; $i++) { if ($i == $currentPage){ $output .= '<li class="currentpage">' . $i . '</li> '; } else { $output .= sprintf('<li><a href="' . $link . '">', $i) . $i . '</a></li> '; } } if ($currentPage < $totalPages){ $output .= sprintf('<li class="nextpage"><a href="' . $link . '">Next</a></li>', $currentPage + 1); } if ($loopEnd != $totalPages){ $output .= sprintf('<li class="nextpage"><a href="' . $link . '">&#187;</a></li>', $totalPages); } return '<div class="pagination"><ul>' . $output . '</ul></div>'; } } ?> Thank you so much ProAvia!
  12. Thanks for your reply. I searched and read the information but I did not solve anything. I don't know what to do to fix it.
  13. Hello everyone! I installed this module in my airline, everything is correctly installed and configured but for some reason it throws the following at me: Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Pagination has a deprecated constructor in /home/level/public_html/phpvms/core/common/Pagination.class.php on line 3 I would like to know how I solve it. Thank you so much.
  14. 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
  15. 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
  16. Hi everyone! It’s a great pleasure to announce that Level Virtual airlines is currently seeking pilots to join the New Airline. The airline is recently created, the recruitment of new pilots and corporate staff members is open. If you want to be part of my team, contact me: ceo@levelvirtual.com or visit our website: https://www.levelvirtual.com -Schedules from real world airline, updated, added and removed in line with schedule changes. With integrated simbrief for easily generate the flight plan. -Custom tracking system that facilitates the report of the flights in real time. With realistic voices and sounds for every aircraft in the virtual airline's fleet. -Join our friendly community of staff and pilots crazy about real and simulated aviation where you can get awards, ranks, earn money and spend it in our online virtual store. Welcome on board! Best Regards.
  17. Hello, I need a promotional video for my airline and I am looking for someone with experience in that (Paid work.). Write me by private.
  18. Hi everyone! Is there any code with which I can display the airline logo automatically depending on the flight number? Somewhere I don't remember, I found this one but it doesn't work: <td align="center"><img src="https://(website)/lib/skins/ocean_blue/images/airlines/<%=flight.flightcode%>.png"></td> Thank you!
  19. Hi everyone! I recently created Hawaiian Virtual Airlines, the airline has a website that works and, at the administrative level, is fully configured. For me it is very big because I started and I am alone in this project, therefore, I sell the airline as it is. Who is interested in buying it acquires: -Web domain for one year (paid). Offered by 209studios.com - Gold web hosting (pay $ 6.95 per month) (I paid until March). Offered by 209studios.com More information write by private. The airline is ready to continue operating Website: https://www.hawaiianva.org Best Regards.
  20. Hi everyone! My name is Julio and I am the CEO of Level Virtual Airlines, the airline is recently created, the recruitment of new pilots and corporate staff members is open. If you want to be part of my team, contact me: ceo@levelvirtual.com or visit our website: https://www.levelvirtual.com You are welcome on board! Best Regards.
×
×
  • Create New...