FltbookSystem issue

Ohh, thousand pardons, had not seen. Silly questions, did you insert the sql into your database? What version is your php and phpVMS? Are you using Fltbook version 2? Is the file right? Ex: php or tpl

Can you take a photo of what is showing up and put your file confirmbid.php here to see?

And another silly question, in that code that I spoke up to change you corrected an error that was missing a quote in <script type="text/javascript>?

I have installed the sql, I am using the php version. 

My code from the schedule_results is allmost default now cause of a clean install after trying everything.

I have removed one line that was causing errors with my template. 

Quote

<link rel=“stylesheet” href=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css” integrity=“sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u” crossorigin=“anonymous”>
 

 

Quote

<div class=“app-content content container-fluid”>
      <div class=“content-wrapper”>
        <div class=“content-header row”>
        </div>
        <section id=“basic-alerts”>
    <div class=“row”>
        <div class=“col-md-12”>
            <div class=“card”>
                <div class=“card-header”>
                    <h4 class=“card-title”>Avaiable flights</h4>
                    <a class=“heading-elements-toggle”><i class=“icon-ellipsis font-medium-3”></i></a>
                    <div class=“heading-elements”>
                        <ul class=“list-inline mb-0”>
                            <li><a data-action=“collapse”><i class=“icon-minus4”></i></a></li>
                            <li><a data-action=“reload”><i class=“icon-reload”></i></a></li>
                            <li><a data-action=“expand”><i class=“icon-expand2”></i></a></li>
                            <li><a data-action=“close”><i class=“icon-cross2”></i></a></li>
                        </ul>
                    </div>
                </div>
                <div class=“card-body collapse in”>
                    <div class=“card-block”>

<?php
$pilotid = Auth::$userinfo->pilotid;
$last_location     = FltbookData::getLocation($pilotid);
$last_name = OperationsData::getAirportInfo($last_location->arricao);
?>
<!-- Bootstrap - Latest compiled and minified CSS –>

<!-- Pagination => Enable it via the module settings –>
<?php if($settings[‘pagination_enabled’] == 1) { ?>
<style>
div.dataTables_paginate {
  float: right;
    margin-top: -25px;
}
div.dataTables_length {
    float: left;
    margin: 0;
}
div.dataTables_filter {
    float: right;
    margin: 0;
}
</style>
<script src=“https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js”></script>

<script type=“text/javascript” src=“<?php echo fileurl(‘lib/js/jquery.dataTables.js’);?>”></script>
<script type=“text/javascript” src=“<?php echo fileurl(‘lib/js/datatables.js’);?>”></script>
<script type=“text/javascript” src=“<?php echo fileurl(‘lib/js/dataTables.bootstrap.min.js’);?>”></script>
<script type=“text/javascript” charset=“utf-8”>
$(document).ready(function() {
  $(‘#schedules_table’).dataTable( {
  “lengthMenu”: [[10, 25, 50, -1], [10, 25, 50, “All”] ]
} )});
</script>
<?php } ?>
<!-- Latest compiled and minified JavaScript - Modified to clear modal on data-dismiss –>
<script type=“text/javascript” src=“<?php echo SITE_URL; ?>/lib/js/bootstrap.js”></script>
<br />

<table id=“schedules_table” class=“table” width=“100%”>
<?php
if(!$allroutes) {
    echo ‘<tr><td align=“center”>No flights found!</td></tr>’;
} else {
?>
<thead>
    <tr id=“tablehead”>
        <th>Airline</th>
        <th>Flight Number</th>
        <th>Origin</th>
        <th>Destination</th>
        <th>Aircraft</th>
        <th>Options</th>
        <?php if($settings[‘show_details_button’] == 1) { ?>
        <th style=“display: none;”>Details</th>
        <?php } ?>
    </tr>
</thead>
<tbody>
<?php
foreach($allroutes as $route) {
    if($settings[‘disabled_ac_sched_show’] == 0) {
        # Disable ‘fake’ aircraft to get hide a lot of schedules at once
        $aircraft = FltbookData::getAircraftByID($route->aircraftid);
        if($aircraft->enabled != 1) {
            continue;
        }
    }

    if(Config::Get(‘RESTRICT_AIRCRAFT_RANKS’) == 1 && Auth::LoggedIn()) {
        if($route->aircraftlevel > Auth::$userinfo->ranklevel) {
            continue;
        }
    }
?>
<tr style=“height: 12px; font-size: 14px; font-weight: normal;”>
    <td width=“16.5%” valign=“middle”><img src=“<?php echo SITE_URL; ?>/lib/images/airlinelogos/<?php echo $route->code;?>.png” alt=“<?php echo $route->code;?>”></td>
    <td width=“16.5%” align=“center” valign=“middle”><?php echo $route->code . $route->flightnum?></td>
    <td width=“16.5%” align=“center” valign=“middle”><?php echo $route->depicao ;?></td>
    <td width=“16.5%” align=“center” valign=“middle”><?php echo $route->arricao ;?></td>
    <td width=“16.5%” valign=“middle”><?php echo $route->aircraft ;?>
        <div class=“vertical-align-text pull-right” style=“padding-left: 6px;”>
        <div class=“font-small pull-right”><?php echo $route->flighttime; ?>h</div>
        <div class=“font-small”><?php echo round($route->distance, 0, PHP_ROUND_HALF_UP); ?>nm</div>
    </div>
  </td>
  <td width=“16.5%” align=“center” valign=“middle”>
     <?php if($settings[‘show_details_button’] == 1) { ?>
     <input type=“button” value=“Details” class=“btn btn-warning” onclick=“$(‘#details_<?php echo $route->flightnum;?>’).toggle()”>
     <?php } ?>
     <?php
     $aircraft = OperationsData::getAircraftInfo($route->aircraftid);
     $acbidded = FltbookData::getBidByAircraft($aircraft->id);
     $check    = SchedulesData::getBidWithRoute(Auth::$userinfo->pilotid, $route->code, $route->flightnum);

    if(Config::Get(‘DISABLE_SCHED_ON_BID’) == true && $route->bidid != 0) {
         echo ‘<div class=“btn btn-danger btn-sm disabled”>Booked</div>’;
     } elseif($check) {
         echo ‘<div class=“btn btn-danger btn-sm disabled”>Booked</div>’;
     } else {
         echo ‘<a data-toggle=“modal” href="’.SITE_URL.‘/action.php/Fltbook/confirm?id=’.$route->id.‘&airline=’.$route->code.‘&aicao=’.$route->aircrafticao.‘" data-target=“#confirm” class=“btn btn-success btn-md”>Book</a>’;
     }
     ?>
  </td>
<?php if($settings[‘show_details_button’] == 1) { ?>
<td colspan=“6” id=“details_<?php echo $route->flightnum; ?>” style=“display: none;” width=“100%”>
    <table class=“table table-striped”>
        <tr>
            <th align=“center” bgcolor=“black” colspan=“6”><font color=“white”>Flight Briefing</font></th>
        </tr>
        <tr>
            <td>Departure:</td>
            <td colspan=“2”><strong>
                <?php
                $name = OperationsData::getAirportInfo($route->depicao);
                echo “{$name->name}”;
                ?></strong>
            </td>
            <td>Arrival:</td>
            <td colspan=“2”><strong>
                <?php
                $name = OperationsData::getAirportInfo($route->arricao);
                echo “{$name->name}”;
                ?></strong>
            </td>
        </tr>
        <tr>
            <td>Aircraft</td>
            <td colspan=“2”><strong>
                <?php
                $plane = OperationsData::getAircraftByName($route->aircraft);
                echo $plane->fullname;
                ?></strong>
            </td>
            <td>Distance:</td>
            <td colspan=“2”><strong><?php echo $route->distance.Config::Get(‘UNITS’); ?></strong></td>
        </tr>
        <tr>
            <td>Dep Time:</td>
            <td colspan=“2”><strong><font color=“red”><?php echo $route->deptime?> UTC</font></strong></td>
            <td>Arr Time:</td>
            <td colspan=“2”><strong><font color=“red”><?php echo $route->arrtime?> UTC</font></strong></td>
        </tr>
        <tr>
            <td>Altitude:</td>
            <td colspan=“2”><strong><?php echo $route->flightlevel; ?> ft</strong></td>
            <td>Duration:</td>
            <td colspan=“2”>
                <font color=“red”>
                <strong>
                <?php
                $dist = $route->distance;
                $speed = 440;
                $app = $speed / 60;
                $flttime = round($dist / $app,0) + 20;
                $hours = intval($flttime / 60);
                $minutes = (($flttime / 60) - $hours) * 60;

                if($hours > “9” AND $minutes > “9”) {
                    echo $hours.‘:’.$minutes ;
                } else {
                    echo ‘0’.$hours.‘:0’.$minutes ;
                }
                ?> Hrs
                </strong>
            </font>
            </td>
        </tr>
        <tr>
            <td>Days:</td>
            <td colspan=“2”><strong><?php echo Util::GetDaysLong($route->daysofweek); ?></strong></td>
            <td>Price:</td>
            <td colspan=“2”><strong>$<?php echo $route->price ;?>.00</strong></td>
        </tr>
        <tr>
            <td>Flight Type:</td>
            <td colspan=“2”><strong>
            <?php
            if($route->flighttype == “P”) {
                echo ‘Passenger’;
            } elseif($route->flighttype == “C”) {
                echo ‘Cargo’;
            } elseif($route->flighttype == “H”) {
                echo ‘Charter’;
            } else {
                echo ‘Passenger’;
            }
            ?>
            </strong></td>
            <td>Times Flown</td>
            <td colspan=“2”><strong><?php echo $route->timesflown ;?></strong></td>
        </tr>
         
    </table>
</td>
<?php } ?>
</tr>
<div class=“modal fade” id=“confirm”>
  <div class=“modal-dialog”>
    <div class=“modal-content”>
      <div class=“modal-body”>
      </div>
    </div>
  </div>
</div>
<?php
/* END OF ONE TABLE ROW */
}
}
?>
</tbody>
</table>
</div>
<hr>
<center><a href=“<?php echo url(‘/Fltbook’) ;?>”><input type=“submit” class=“btn btn-primary” name=“submit” value=“Back to Flight Booking” ></a></center></div>
<br />

 

Have you changed anything in the confirmbid.php file?

negative sir,

Posted below is my confirm bid

 

Quote

<style>
.sharp {
    border-radius: 0;
    margin-left: 3px;
    margin-right: 3px;
}
</style>
<div class=“container-fluid”>
    <div class=“modal-header”>
      <button type=“button” class=“close” data-dismiss=“modal”>×</button>
      <h4 class=“modal-title”>Confirm Booking</h4>
    </div>
    <div class=“modal-body”>
      <h3>Select Aircraft Registration</h3>
    <form action=“<?php echo url(‘/Fltbook/addbid’); ?>” method=“post”>
        <select class=“form-control” name=“aircraftid” id=“aircraftid”>
            <option value=“” selected disabled>Select Your Aircraft</option>
            <?php
            $allaircraft = FltbookData::getAllAircraftFltbook($airline, $aicao);
            foreach($allaircraft as $aircraft) {
                # If Aircraft is disabled, remove it from the list
                if($settings[‘disabled_ac_allow_book’] == 1) {
                    if($aircraft->enabled != 1) {
                        continue;
                    }
                }
                # If Aircraft is has been booked, remove it from the list
                if($settings[‘show_ac_if_booked’] == 0) {
                    $acbidded = FltbookData::getBidByAircraft($aircraft->id);
                    if($acbidded) { continue; }
                }

                $icaoairline = “{$aircraft->icao}{$airline}”;
                if($aircraft->registration == $icaoairline) {
                    echo ‘’;
                } else {
                    echo ‘<option value="’.$aircraft->id.‘" ‘.$sel.’>’.$aircraft->registration.’ - ‘.$aircraft->icao.’ - ‘.$aircraft->name.’</option>';
                }
            }
            ?>
        </select>
          <hr />
          <input type=“hidden” name=“routeid” value=“<?php echo $routeid; ?>” />
          <input type=“submit” name=“submit” class=“btn btn-success” value=“Book” />
          <button type=“button” class=“btn btn-default” data-dismiss=“modal”>Cancel</button>
    </form>
  </div>
</div>
 

 

12 hours ago, ncd200 said:

Ok another problem.

Also I have now the problem that the popup for aircraft selection dissappears directly.

I have tried to use the options given above but I can’t figure it out.

I know it is a js problem.

Any ideas?

Rick

So it opens, but it closes immediately before you see anything (small white flash)?

Are you using phpVMS 5.5.x & fltbook version 2? Also, are you using bootstrap in your skin?

If so, try replacing this line

https://github.com/web541/phpVMS-FltbookSystem-v2/blob/master/core/templates/fltbook/search_results.php#L38

with this

\<script type="text/javascript\> // Clear Modal On Hide // =================== // no cache data loaded to modal popup (by default it's cached) $('body').on('hidden.bs.modal', '.modal', function (event) { $(this).removeData('bs.modal'); }); \</script\>

Only that one. Sometimes there are conflicts if you are already using bootstrap in your site.

If i do that my available flights are zero, when i restore it to the default my flights appear.

I know allmost for sure it is a bootstrap or js error.

I ise the phpvms 5.5 and v2 of the booking system.

Anything in your browser console?

I must take a look tomorrow. But maybe I can fix it. I just found out there are also modals integrated in my template. So if I change the code from the modal. Maybe that works. Don’t know but it is worth the try.

 

I want this flight booking working cause it is the best I know of.

Ok, I have tried to modify it, but i cant get it to work.

Someone that can help me?

Do you have a website url?

http://crew.silverwingsva.com

 

On 13/11/2017 at 5:30 PM, ncd200 said:

http://crew.silverwingsva.com

 

In search_results.php, try removing

\<link rel="stylesheet" href="http://crew.silverwingsva.com/lib/skins/crewcenter/app-assets/css/bootstrap.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"\>

And in layout.php, try replacing this

\<script src="http://crew.silverwingsva.com/lib/skins/crewcenter/app-assets/js/core/libraries/bootstrap.min.js" type="text/javascript"\>\</script\>

With this

\<script type="text/javascript" src="\<?php echo SITE\_URL; ?\>/lib/js/bootstrap.js"\>\</script\>

and see what happens. From what I can see, it’s a bootstrap conflict issue.

18 minutes ago, web541 said:

In search_results.php, try removing

<link rel=“stylesheet” href=“http://crew.silverwingsva.com/lib/skins/crewcenter/app-assets/css/bootstrap.css” integrity=“sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u” crossorigin=“anonymous”>

And in layout.php, try replacing this

<script src=“http://crew.silverwingsva.com/lib/skins/crewcenter/app-assets/js/core/libraries/bootstrap.min.js” type=“text/javascript”></script>

With this

<script type=“text/javascript” src=“<?php echo SITE_URL; ?>/lib/js/bootstrap.js”></script>

and see what happens. From what I can see, it’s a bootstrap conflict issue.

Thanks for the reply, I have tried it but my results stay completely empty.

ah ok I see the issue, you’re using bootstrap version 1.4.0a and my module uses 1.3.7 (I think) so you would have to convert the templating over.

First, change the links above back to what they were (only the js one, leave the css one out).

Once the HTML shows back up, report back here.

I have several problems installing FltbookSystem 2 Master.
1.- When I create the tables with fltbook.sql I have an error:

Error

consulta SQL:

MySQL ha dicho:

#1060 - Nombre de columna duplicado 'airline'

The tables are created equally.

I create the airplanes:
A350MDN
A350-01
A350-02

I think several more but for the example is like this

When I book a route, it lets me choose between the A350-01, A350-02
I reserve the A350-01, but the plane is blocked for the other pilots.
It is no longer available to anyone, even though the A350-02 is free.

 

 

Erase the planes, the routes, the company.
Create everything from the beginning several times and always the same with the same result.
I think everything comes from the error first when creating the table, but I do not know how to solve it.
Can you help me?
Thank you
phpvms 5.5.x

 

 

 

4 hours ago, polirom said:

I have several problems installing FltbookSystem 2 Master.
1.- When I create the tables with fltbook.sql I have an error:

Error

consulta SQL:

MySQL ha dicho:

#1060 - Nombre de columna duplicado 'airline'

The tables are created equally.

I create the airplanes:
A350MDN
A350-01
A350-02

I think several more but for the example is like this

When I book a route, it lets me choose between the A350-01, A350-02
I reserve the A350-01, but the plane is blocked for the other pilots.
It is no longer available to anyone, even though the A350-02 is free.

 

 

Erase the planes, the routes, the company.
Create everything from the beginning several times and always the same with the same result.
I think everything comes from the error first when creating the table, but I do not know how to solve it.
Can you help me?
Thank you
phpvms 5.5.x

 

 

 

The SQL error is because you already have a column name called ‘airline’ in your ‘phpvms_aircraft’ table. This could be from another custom module, or from you importing the SQL file more than once. Can you go to phpmyadmin => structure of the the ‘phpvms_aircraft’ table and screenshot it. Also take one of your aircraft table (only the first row will be fine).

Also, in your core/local.config.php file, what is this set to?

DISABLE\_SCHED\_ON\_BID

 

9 minutes ago, web541 said:

The SQL error is because you already have a column name called ‘airline’ in your ‘phpvms_aircraft’ table. This could be from another custom module, or from you importing the SQL file more than once. Can you go to phpmyadmin => structure of the the ‘phpvms_aircraft’ table and screenshot it. Also take one of your aircraft table (only the first row will be fine).

Also, in your core/local.config.php file, what is this set to?

DISABLE_SCHED_ON_BID

 

I have it like that

 

On 4/26/2018 at 8:23 AM, polirom said:

I have it like that

 

If you go to the admin panel and to the settings for this module, what is this set to? If you change it, does it work?

Allow aircraft to be booked if someone else has booked a schedule with that aircraft

 

It is in “YES”
I install it several times and it always happens the same. Does not accept the change of the administration panel

8 hours ago, polirom said:

It is in “YES”
I install it several times and it always happens the same. Does not accept the change of the administration panel

This is quite odd, if you change the value to ‘No’, does it update (it could be that the settings table isn’t read properly) and does it allow the aircraft to be booked by multiple people? I just tested the module on a fresh install and it worked first time for me.

In the event that it still doesn’t work, you can go into core/templates/fltbook/confirm_bid.php and delete lines 27-31 which should force it to unlock if something is wrong.