<?php
$id='';
$route_title='';
$route_start_point='';
$route_end_point='';
$route_fare='';
$route_table='transport_routes';
if(isset($data)){
    $id=$data;
    $get_route_data=$this->TransportModel->get_item_data($id,$route_table);
    if($get_route_data){
        foreach($get_route_data as $route_data){
            $route_title=$route_data['route_title'];
            $route_start_point=$route_data['route_start'];
            $route_end_point=$route_data['route_end'];
            $route_fare=$route_data['route_fare'];
        }

    }

}

?>

<style>
    .list-group-item a{text-decoration:none;font-weight:600;}
</style>
<div class="container-fluid mt-3 mb-3 bg-white">
    <div class="row">
        <div class="col-sm-12 pt-3 pb-3">
            <ul class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Welcome">Home</a></li>
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Transport">Transport</a></li>
                <li class="breadcrumb-item">Add New Route</li>
                <li class="breadcrumb-item" style="vertical-align:middle;padding-top:auto;paddding-bottom:auto;">
                    <a href="<?php echo base_url();?>Transport/routes">All Routes</a>
                </li>
            </ul>
        </div>
        
        <div class="col-sm-12 pt-3 pb-3">
            <ul class="nav nav-tabs tab-item-1">
                <li class="nav-item">
                    <a class="nav-link active" href="#">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-node-plus-fill" viewBox="0 0 16 16">
                            <path d="M11 13a5 5 0 1 0-4.975-5.5H4A1.5 1.5 0 0 0 2.5 6h-1A1.5 1.5 0 0 0 0 7.5v1A1.5 1.5 0 0 0 1.5 10h1A1.5 1.5 0 0 0 4 8.5h2.025A5 5 0 0 0 11 13zm.5-7.5v2h2a.5.5 0 0 1 0 1h-2v2a.5.5 0 0 1-1 0v-2h-2a.5.5 0 0 1 0-1h2v-2a.5.5 0 0 1 1 0z"/>
                        </svg>  Add New Route
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo base_url();?>Transport/routes">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list-ol" viewBox="0 0 16 16">
                            <path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5z"/>
                            <path d="M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317 0-.185-.158-.31-.361-.31-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309.254 0 .424-.145.422-.35-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844.583 0 .96.326.96.756 0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508 0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338v.041zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635V5z"/>
                        </svg>
                        All Routes</a>
                </li>
            </ul>
            
            
            <form method="post" action="#" class="mt-2">
                <?php
                if($success){
                ?>
                <div class="alert alert-success"><?php echo $success;?></div>
                <?php
                }
                if($error){
                ?>    
                <div class="alert alert-success"><?php echo $error;?></div>
                <?php    
                }
                ?>
                
                
                <div class="form-group">
                    <label></label>
                    <input type="hidden" value="<?php echo $id;?>" name="id">
                    <input type="text" name="route_title" class="form-control" placeholder="Transport Route Title" value="<?php if($route_title){echo $route_title;} ?>">
                </div>
                
                <div class="form-group">
                    <label>Transport Route Start Point</label>
                    <input type="text" name="route_start_point" class="form-control" placeholder="Transport Route Start Point" readonly value="From School">
                </div>
                
                <div class="form-group">
                    <label>Transport Route End Point</label>
                    <input type="text" name="route_end_point" class="form-control" value="<?php if($route_end_point){echo $route_end_point;}?>" placeholder="Transport Route End Point" >
                </div>
                <div class="form-group">
                    <label>Route Fare</label>
                    <input type="number" name="route_fare" class="form-control" placeholder="Route Fare" value="<?php if($route_fare){echo $route_fare;} ?>">
                </div>
                
                <div class="form-group">
                    <button class="btn btn-sm btn-success" type="submit" name="add_new_route"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-node-plus-fill" viewBox="0 0 16 16">
                        <path d="M11 13a5 5 0 1 0-4.975-5.5H4A1.5 1.5 0 0 0 2.5 6h-1A1.5 1.5 0 0 0 0 7.5v1A1.5 1.5 0 0 0 1.5 10h1A1.5 1.5 0 0 0 4 8.5h2.025A5 5 0 0 0 11 13zm.5-7.5v2h2a.5.5 0 0 1 0 1h-2v2a.5.5 0 0 1-1 0v-2h-2a.5.5 0 0 1 0-1h2v-2a.5.5 0 0 1 1 0z"/>
                    </svg>  Add New Route</button>
                </div>            
                
                
            </form>
            
        </div>
        
        <div class="col-sm-12 pt-3 pb-3">
            <?php $this->load->view('erp/transport/quick-links');?>
        </div>
    </div>
</div>