Miggel Posted March 14, 2018 Report Posted March 14, 2018 Hello everybodyI would also like to integrate the days into the schedule search. That means, if a pilot selects Monday in a box, then all flights from Monday are in the results. My code so far ... schedule_searchform.php <?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?> <section class="content-header"> <h1>Schedule Search</h1> </section> <!-- Main content --> <section class="content"> <div class="cssload-ball"></div> <!-- Main row --> <div class="row"> <!-- Left col --> <section class="col-md-8 connected"> <form id="form" action="<?php echo url('/schedules/view');?>" method="post"> <!-- Custom Tabs --> <div class="nav-tabs-custom"> <ul class="nav nav-tabs"> <li class="active"><a href="#tab_1" data-toggle="tab">Departure</a></li> <li><a href="#tab_2" data-toggle="tab">Arrival</a></li> <li><a href="#tab_3" data-toggle="tab">Aircraft</a></li> <li><a href="#tab_4" data-toggle="tab">Flight duaration</a></li> <li><a href="#tab_5" data-toggle="tab">Weekday</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="tab_1"> <p>Select your departure airport:</p> <div class="form-group"> <select id="depicao" name="depicao" class="form-control"> <option value="">Select All</option> <?php if (Auth::LoggedIn()) {?> <?php $reports = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, PIREP_ACCEPTED); if(is_object($reports)) {echo '<option value="'.$reports->arricao.'">From current location ('.$reports->arricao.')</option>';} elseif(!$reports) {echo '<option value="'.Auth::$userinfo->hub.'">From current location ('.Auth::$userinfo->hub.')</option>';}}?> <?php foreach ($airports as $airport) { echo '<option value="'.$airport->icao.'">'.$airport->icao.' - '.$airport->name.'</option>'; } if(!$depairports) $depairports = array(); foreach($depairports as $airport) { echo '<option value="'.$airport->icao.'">'.$airport->icao .' ('.$airport->name.')</option>'; } ?> </select> </div> <input type="submit" name="submit" value="Search" class="btn btn-flat btn-primary" /> </div> <!-- /.tab-pane --> <div class="tab-pane" id="tab_2"> <p>Select your arrival airport:</p> <div class="form-group"> <select id="arricao" name="arricao" class="form-control"> <option value="">Select All</option> <?php if(!$depairports) $depairports = array(); foreach($depairports as $airport) { echo '<option value="'.$airport->icao.'">'.$airport->icao .' ('.$airport->name.')</option>'; } ?> </select> </div> <input type="submit" name="submit" value="Search" class="btn btn-flat btn-primary" /> </div> <!-- /.tab-pane --> <div class="tab-pane" id="tab_3"> <p>Select aircraft:</p> <div class="form-group"> <select id="equipment" name="equipment" class="form-control"> <option value="">Select equipment</option> <?php if(!$equipment) $equipment = array(); foreach($equipment as $equip) { echo '<option value="'.$equip->name.'">'.$equip->name.'</option>'; } ?> </select> </div> <input type="submit" name="submit" value="Search" class="btn btn-flat btn-primary" /> </div> <!-- /.tab-pane --> <div class="tab-pane" id="tab_5"> <div class="form-group"> <label id="daysofweek" class="col-lg-3 control-label">Search By Day</label> <div class="col-lg-9"> <?php /*$days = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); */ $days = Config::Get('DAYS_LONG'); for($i=0; $i<=6; $i++) { # Add blank string to typecast from int to string, otherwise it won't search if(strpos($schedule->daysofweek, $i.'') === false) $checked = ''; else $checked = 'checked'; echo '<input type="checkbox" name="daysofweek" value="'.$i.'" '.$checked.'>'.$days[$i].' </br>'; } ?> </div> <input type="submit" name="submit" value="Search" class="btn btn-flat btn-primary" /> </div> <div class="tab-pane" id="tab_6"> <div class="form-group"> </div> </div> </div> <!-- /.tab-pane --> <div class="tab-pane" id="tab_4"> <p>Select Distance:</p> <div class="form-group"> <select id="type" name="type" class="form-control"> <option value="greater">Greater Than</option> <option value="less">Less Than</option> </select> </div> <div class="form-group"> <input type="text" name="distance" value="" class="form-control" /> </div> <input type="submit" name="submit" value="Search" class="btn btn-flat btn-primary" /> </div> <!-- /.tab-pane --> </div> <!-- /.tab-content --> </div> <!-- nav-tabs-custom --> <p> <input type="hidden" name="action" value="findflight" /> </section> <!-- /.Left col --> </div> <!-- /.row (main row) --> </section> <!-- /.content --> Quote
CFVA Posted March 17, 2018 Report Posted March 17, 2018 Are you asking if the code is right? Does it work? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.