Greetings everyone,
From a time to here, I start to change the layout of my admin panel, everything is working perfectly, actually almost perfection, I have a problem in the pending pirep, when I click to accept the pirep it does not accept, does not happen anything.
My code of the pirep button:
\<?php if($error == false) { ?\> \<button class="pirepaction btn btn-success {button:{icons:{primary:'ui-icon-trash'}}}" href="\<?php echo adminaction('/pirepadmin/'.$load.'?pilotid='.$pirep-\>pilotid.'');?\>" action="approvepirep" id="\<?php echo $pirep-\>pirepid;?\>"\> Accept \</button\> \<?php } ?\>
My whole code:
Quote
<?php if(!defined(‘IN_PHPVMS’) && IN_PHPVMS !== true) { die(); } ?> <div class=“row”> <div class=“col-md-12”> <div class=“card”> <div class=“card-header” data-background-color=“purple”> <h4 class=“title”>Pilot Reports</h4> <p class=“category”>There are a total of <?php echo count($pireps);?> flight reports in this category. <a href=“<?php echo SITE_URL?>/admin/index.php/pirepadmin/approveall”>Click to approve all</a></p> </div> <div class=“card-content table-responsive”> <?php if($_GET[‘module’] == ‘pirepadmin’ && $_GET[‘page’] == ‘viewall’) { Template::Show(‘pireps_filter.tpl’); } if(isset($paginate)) { ?> <div style=“float: right;”> <a href=“?admin=<?php echo $admin?>&start=<?php echo $start?>”>Next Page</a> <br /> </div> <?php } ?> <?php if(!$pireps) { echo ‘<p>No reports have been found</p></div>’; return; } ?> <table class=“table”> <thead class=“text-primary”> <th>Pilot</th> <th>Flight</th> <th>Dep/Arr</th> <th>Flight Time</th> <th>Submit Date</th> <th>Current Status</th> <th>Details</th> <th>Options</th> </thead> <tbody> <?php foreach($pireps as $pirep) { if($pirep->accepted == PIREP_PENDING) $td_class = ‘pending’; else $td_class = ‘’; $error = false; ?> <tr class=“<?php echo $class?> pirep_list” id=“row<?php echo $pirep->pirepid;?>”> <td> <a href=“<?php echo SITE_URL?>/admin/index.php/pilotadmin/viewpilots?action=viewoptions&pilotid=<?php echo $pirep->pilotid;?>”><?php echo PilotData::GetPilotCode($pirep->pcode, $pirep->pilotid) . ’ - ’ .$pirep->firstname .’ ’ . $pirep->lastname;?></a> </td> <td><?php echo $pirep->code . $pirep->flightnum; ?></td> <td><?php echo $pirep->depicao; ?>/<?php echo $pirep->arricao; ?></td> <td><?php echo $pirep->flighttime; ?></td> <td><?php echo date(DATE_FORMAT, $pirep->submitdate); ?> </td> <td><?php if($pirep->accepted == PIREP_ACCEPTED) echo ‘Accepted’; elseif($pirep->accepted == PIREP_REJECTED) echo ‘Rejected’; elseif($pirep->accepted == PIREP_PENDING) echo ‘Approval Pending’; ?> <?php if($pirep->aircraft == ‘’) { $error = true; } ?> </td> <td> <a href=“#” onclick=“$(‘#details_dialog_<?php echo $pirep->pirepid;?>’).toggle()”>Details</a> <!-- Start Table - Details –> <table class=“table” id=“details_dialog_<?php echo $pirep->pirepid;?>” style=“display:none; border-left: 3px solid #FF6633; margin-top: 3px;padding-left: 3px;” width=“100%”> <tr> <td><strong>Client: </strong> <?php echo $pirep->source; ?></td> <td><strong>Aircraft: </strong> <?php if($pirep->aircraft == ‘’) { $error = true; echo ‘<span style=“color: red”>No aircraft! Edit to change</span>’; } else echo $pirep->aircraft. " ($pirep->registration)“; ?> </td> <td><strong>Flight Time: </strong> <?php echo $pirep->flighttime_stamp; ?></td> <td><strong>Distance: </strong><?php echo $pirep->distance; ?> </td> <td><strong>Landing Rate: </strong><?php echo $pirep->landingrate; ?> </td> </tr> <tr> <td colspan=“5”><strong>Route: </strong><?php echo $pirep->route;?> <a data-toggle=“modal” href=”<?php echo SITE_URL?>/admin/action.php/operations/viewmap?type=pirep&id=<?php echo $pirep->pirepid;?>" data-target=“#route”>View</a> </td> </tr> <tr> <td><strong>Load/Price: </strong><?php echo (($pirep->load!=‘’)?$pirep->load:‘-’).’ / ‘.FinanceData::formatMoney($pirep->price);?></td> <td><strong>Pilot Pay: </strong><?php echo FinanceData::formatMoney($pirep->pilotpay);?></td> <td><strong>Fuel Used: </strong><?php echo ($pirep->fuelused!=’‘) ? $pirep->fuelused.Config::Get(‘LIQUID_UNIT_NAMES’, Config::Get(‘LiquidUnit’)) : ‘-’;?></td> <td><strong>Revenue: </strong><?php echo FinanceData::formatMoney($pirep->revenue);?></td> <td><strong>Gross: </strong><?php echo FinanceData::formatMoney($pirep->gross);?></td> </tr> <?php // Get the additional fields // I know, badish place to put it, but it’s pulled per-PIREP $fields = PIREPData::GetFieldData($pirep->pirepid); if(!$fields) { echo ‘’; } else { $i=1; echo ‘<tr>’; foreach ($fields as $field){ if($i == 1) { echo ‘<tr>’; } echo “<td><strong>{$field->title}:</strong> {$field->value}</td>”; if($i == 5) { echo ‘</tr>’; $i = 0; } $i++; } } echo ‘</tr>’; ?> </table> </td> <td class=“<?php echo $td_class;?>” align=“center” width=“1%” nowrap> <!-- Accept Pirep Button –> <?php if($error == false) { ?> <button class=“pirepaction btn btn-success {button:{icons:{primary:‘ui-icon-trash’}}}” href="<?php echo adminaction(’/pirepadmin/‘.$load.’?pilotid=‘.$pirep->pilotid.’');?>" action=“approvepirep” id=“<?php echo $pirep->pirepid;?>”> Accept </button> <?php } ?> <!-- /. Accept Pirep Button –> <a data-toggle=“modal” class=“btn btn-danger” href=“<?php echo SITE_URL?>/admin/action.php/pirepadmin/rejectpirep?pirepid=<?php echo $pirep->pirepid;?>&pilotid=<?php echo $pirep->pilotid; ?>” data-target=“#reject”>Reject</a> </td> </tr> <?php } ?> </tbody> </table> <?php if(isset($paginate)) { ?> <div style=“float: right;”> <a href=“?admin=<?php echo $admin?>&start=<?php echo $start?>”>Next Page</a> <br /> </div> <?php } /* Close the paginate loop */ ?> <script type=“text/javascript”> $(“button, input:button, input:submit”).button(); </script> <!-- Modal –> <div class=“modal fade” id=“log” tabindex=“-1” role=“dialog” aria-labelledby=“myModalLabel”> <div class=“modal-dialog” role=“document”> <div class=“modal-content”> <div class=“modal-header”> <button type=“button” class=“close” data-dismiss=“modal” aria-label=“Close”><span aria-hidden=“true”>×</span></button> <h4 class=“modal-title” id=“myModalLabel”>Log for <?php echo $report->code.$report->pirepid?></h4> </div> <div class=“modal-body”> </div> <div class=“modal-footer”> <button type=“button” class=“btn btn-default” data-dismiss=“modal”>Close</button> <button type=“button” class=“btn btn-primary”>Save changes</button> </div> </div> </div> </div> <!-- Modal –> <div class=“modal fade” id=“comments” tabindex=“-1” role=“dialog” aria-labelledby=“myModalLabel”> <div class=“modal-dialog” role=“document”> <div class=“modal-content”> <div class=“modal-header”> <button type=“button” class=“close” data-dismiss=“modal” aria-label=“Close”><span aria-hidden=“true”>×</span></button> <h4 class=“modal-title” id=“myModalLabel”></h4> </div> <div class=“modal-body” style=“padding:5px;”> </div> <div class=“modal-footer”> <button type=“button” class=“btn btn-default” data-dismiss=“modal”>Close</button> <button type=“button” class=“btn btn-primary”>Save changes</button> </div> </div> </div> </div> <!-- Modal –> <div class=“modal fade” id=“addcomment” tabindex=“-1” role=“dialog” aria-labelledby=“myModalLabel”> <div class=“modal-dialog” role=“document”> <div class=“modal-content”> <div class=“modal-header”> <button type=“button” class=“close” data-dismiss=“modal” aria-label=“Close”><span aria-hidden=“true”>×</span></button> <h4 class=“modal-title” id=“myModalLabel”>Add Comment For <?php echo $report->code.$report->pirepid?></h4> </div> <div class=“modal-body” style=“padding:5px;”> </div> <div class=“modal-footer”> <button type=“button” class=“btn btn-default” data-dismiss=“modal”>Close</button> <button type=“button” class=“btn btn-primary”>Save changes</button> </div> </div> </div> </div> <!-- Modal –> <div class=“modal fade” id=“reject” tabindex=“-1” role=“dialog” aria-labelledby=“myModalLabel”> <div class=“modal-dialog” role=“document”> <div class=“modal-content”> <div class=“modal-header”> <button type=“button” class=“close” data-dismiss=“modal” aria-label=“Close”><span aria-hidden=“true”>×</span></button> <h4 class=“modal-title” id=“myModalLabel”>Reject Pilot Report <?php echo $report->code.$report->pirepid?></h4> </div> <div class=“modal-body”> </div> <div class=“modal-footer”> <button type=“button” class=“btn btn-default” data-dismiss=“modal”>Close</button> <button type=“button” class=“btn btn-primary”>Save changes</button> </div> </div> </div> </div> <!-- Modal –> <div class=“modal fade” id=“route” tabindex=“-1” role=“dialog” aria-labelledby=“myModalLabel”> <div class=“modal-dialog” role=“document”> <div class=“modal-content”> <div class=“modal-header”> <button type=“button” class=“close” data-dismiss=“modal” aria-label=“Close”><span aria-hidden=“true”>×</span></button> <h4 class=“modal-title” id=“myModalLabel”></h4> </div> <div class=“modal-body”> </div> <div class=“modal-footer”> <button type=“button” class=“btn btn-default” data-dismiss=“modal”>Close</button> <button type=“button” class=“btn btn-primary”>Save changes</button> </div> </div> </div> </div> </div> </div> </div> </div>
Regards,
Carlos.