<div class="content-header">
   <div class="container-fluid">
      <div class="row mb-2">
         <div class="col-sm-6">
            <h1 class="m-0 text-dark">Settings
            </h1>
         </div>
         <!-- /.col -->
         <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
               <li class="breadcrumb-item"><a href="<?= base_url(); ?>/dashboard">Home</a></li>
               <li class="breadcrumb-item active">Settings</li>
            </ol>
         </div>
         <!-- /.col -->
      </div>
      <!-- /.row -->
   </div>
   <!-- /.container-fluid -->
</div>
<!-- Main content -->
<section class="content">
   <div class="container-fluid">
      <div class="card">
         <div class="card-header">
            <h3 class="card-title">Vehicle Type</h3>
         </div>

         <form action="<?php echo base_url().'index.php/settings/' ?>updateSettings" method="post">

            <div class="card-body">
               <div class="row">
               	<?php
               		$x="";
               	 foreach ($websitesetting as $key => $k) { 
               	 		$x.=$key.",";

               		?>
               		
                  <div class="col-sm-6 col-md-3">
                     <label class="form-label"><?php echo $k['name']; ?></label>
                     <div class="form-group">
                        <input type="text" name="<?php echo $key ;?>_name" id="v_registration_no" class="form-control" placeholder="Vahical Name" value="<?php echo $k['name']; ?>">
                     </div>
                     <div class="row">
                        <div class="col-sm-4">
                           <label>Initial Fee</label>
                           <input type="text" name="<?php echo $key ;?>_initialFee" value="<?php echo $k["initialFee"]; ?>" class="form-control" placeholder="initial Fee" />
                            <input type="hidden" name="<?php echo $key ;?>_carType" value="<?php echo $k["carType"]; ?>" class="form-control" placeholder="initial Fee" />
                            <input type="hidden" name="<?php echo $key ;?>_date" value="<?php echo $k["date"]; ?>" class="form-control" placeholder="initial Fee" />
                        </div>
                        <div class="col-sm-4">
                           <label>Per KM</label>
                           <input type="text" name="<?php echo $key ;?>_pricePerKm" value="<?php echo $k["pricePerKm"]; ?>" class="form-control" placeholder="20" />
                        </div>
                        <div class="col-sm-4">
                           <label>Per Mint</label>
                           <input type="text" name="<?php echo $key ;?>_pricePerMin" value="<?php echo $k["pricePerMin"]; ?>" class="form-control" placeholder="1H" />
                        </div>

                        <div class="col-sm-6 mt-2">
                           <label>Cost of vehicle</label>
                           <input type="text" name="<?php echo $key ;?>_costOfVehicle" value="<?php echo $k["costOfVehicle"]; ?>" class="form-control" placeholder="Cost" />
                        </div>
                        <div class="col-sm-6 mt-2">
                           <label>Discount</label>
                           <input type="text" name="<?php echo $key ;?>_finalDiscount" value="<?php echo $k["finalDiscount"]; ?>" class="form-control" placeholder="Cost" />
                        </div>
                        <span class="border-top my-3 d-block w-100 text-dark"></span>

                     </div>

                  </div>
              
                  <?php }
                 // 	print($x);


                   ?>
                   <input type="hidden" name="allKeys" value="<?php echo $x; ?>" />
                  <!--
                  <div class="col-sm-6 col-md-3">
                     <label class="form-label">MINI</label>
                     <div class="form-group">
                        <input type="text" name="business_name" id="v_registration_no" class="form-control" placeholder="business" value="<?php echo $business["name"]; ?>">
                     </div>
                     <div class="row">
                        <div class="col-sm-4">
                           <label>Initial Fee</label>
                           <input type="text" name="business_initialFee" value="<?php echo $business["initialFee"]; ?>" class="form-control" placeholder="$2" />
                        </div>
                        <div class="col-sm-4">
                           <label>Per Mile</label>
                           <input type="text" name="business_pricePerMile" value="<?php echo $business["pricePerMile"]; ?>" class="form-control" placeholder="20" />
                        </div>
                        <div class="col-sm-4">
                           <label>Per Minutes</label>
                           <input type="text" name="business_pricePerMin" value="<?php echo $business["pricePerMin"]; ?>" class="form-control" placeholder="1H" />
                        </div>

                        <div class="col-sm-6 mt-2">
                           <label>Cost of vehicle</label>
                           <input type="text" name="business_costOfVehicle" value="<?php echo $business["costOfVehicle"]; ?>" class="form-control" placeholder="Cost" />
                        </div>
                        <span class="border-top my-3 d-block w-100 text-dark"></span>

                     </div>
                  </div>
                  <div class="col-sm-6 col-md-3">
                     <label class="form-label">go</label>
                     <div class="form-group">
                        
                        <input type="text" name="go_name" id="v_name" class="form-control" value="<?php echo $go['name']; ?>">
                     </div>
                     <div class="row">
                        <div class="col-sm-4">
                           <label>Initial Fee</label>
                           <input type="text" class="form-control" name="go_initialFee" value="<?php echo $go["initialFee"]; ?>" placeholder="$2" />
                        </div>
                        <div class="col-sm-4">
                           <label>Per Mile</label>
                           <input type="text" class="form-control" name="go_pricePerMile" value="<?php echo $go["pricePerMile"]; ?>" placeholder="20" />
                        </div>
                        <div class="col-sm-4">
                           <label>Per Minutes</label>
                           <input type="text" class="form-control" name="go_pricePerMin" value="<?php echo $go["pricePerMin"]; ?>" placeholder="1H" />
                        </div>

                        <div class="col-sm-6 mt-2">
                           <label>Cost of vehicle</label>
                           <input type="text" class="form-control" name="go_costOfVehicle" value="<?php echo $go["costOfVehicle"]; ?>" placeholder="Cost" />
                        </div>

                        <span class="border-top my-3 d-block w-100 text-dark"></span>

                     </div>
                  </div>
             
                  <div class="col-sm-6 col-md-3">
                     <div class="form-group">
                        <label class="form-label">Go Plus</label>
                        <input type="text" name="goPlus_name" value="<?php echo (isset($goPlus)) ? $goPlus['name'] : '' ?>" class="form-control" placeholder="iRide Lux">
                     </div>
                     <div class="row">
                        <div class="col-sm-4">
                           <label>Initial Fee</label>
                           <input type="text" class="form-control" name="goPlus_initialFee" value="<?php echo $goPlus["initialFee"]; ?>" placeholder="$2" />
                        </div>
                        <div class="col-sm-4">
                           <label>Per Mile</label>
                           <input type="text" class="form-control" name="goPlus_pricePerMile" value="<?php echo $goPlus["pricePerMile"]; ?>" placeholder="20" />
                        </div>
                        <div class="col-sm-4">
                           <label>Per Minutes</label>
                           <input type="text" class="form-control" name="goPlus_pricePerMin" value="<?php echo $goPlus["pricePerMin"]; ?>" placeholder="1H" />
                        </div>

                        <div class="col-sm-6 mt-2">
                           <label>Cost of vehicle</label>
                           <input type="text" class="form-control" name="goPlus_costOfVehicle" value="<?php echo $goPlus["costOfVehicle"]; ?>" placeholder="Cost" />
                        </div>

                     </div>
                  </div>
              -->
               </div>
               <div class="row">
                 
                  <div class="col-sm-4 mt-2"></div>
                  <div class="col-sm-2 mt-2">
                     <label>Update your fields</label>
                     <button class="btn btn-success" type="submit">Update</button>
                  </div>
               </div>
            </div>
         </form>
      </div>
   </div>
</section>


<form id="addnewcategory" class="basicvalidation" role="form" action="websitesetting_save" method="post" class="col-md-6 d-none" enctype='multipart/form-data'>
   <div class="card-body d-none">
      <div class="row">
         <div class="col-sm-6 col-md-4">
            <div class="form-group">
               <label>Company Name</label>
               <input type="text" class="form-control" required="true" value="<?php echo output(isset($website_setting[0]['s_companyname']) ? $website_setting[0]['s_companyname'] : ''); ?>" id="s_companyname" name="s_companyname" placeholder="Enter Company Name">
            </div>
         </div>
         <div class="col-sm-6 col-md-4">
            <div class="form-group">
               <label>Address</label>
               <input type="text" class="form-control" required="true" value="<?php echo output(isset($website_setting[0]['s_address']) ? $website_setting[0]['s_address'] : ''); ?>" id="s_address" name="s_address" placeholder="Enter Address">
            </div>
         </div>
         <div class="col-sm-6 col-md-4">
            <div class="form-group">
               <label>Googel API Key</label>
               <input type="text" class="form-control" required="true" value="<?php echo output(isset($website_setting[0]['s_googel_api_key']) ? $website_setting[0]['s_googel_api_key'] : ''); ?>" id="s_googel_api_key" name="s_googel_api_key" placeholder="Enter Address">
            </div>
         </div>
         <div class="col-sm-6 col-md-4">
            <div class="form-group">
               <label>Invoice Prefix</label>
               <input type="text" class="form-control" required="true" value="<?php echo output(isset($website_setting[0]['s_inovice_prefix']) ? $website_setting[0]['s_inovice_prefix'] : ''); ?>" id="s_inovice_prefix" name="s_inovice_prefix" placeholder="Enter Invoice Prefix">
            </div>
         </div>
         <div class="col-sm-6 col-md-4">
            <div class="form-group">
               <label>Currency Prefix</label>
               <input type="text" class="form-control" required="true" value="<?php echo output(isset($website_setting[0]['s_price_prefix']) ? $website_setting[0]['s_price_prefix'] : ''); ?>" id="s_price_prefix" name="s_price_prefix" placeholder="Enter Currency Prefix">
            </div>
         </div>
         <div class="col-sm-6 col-md-4">
            <div class="form-group">
               <label>Inovice Terms and condition</label>
               <textarea id="s_inovice_termsandcondition" name="s_inovice_termsandcondition" rows="4" cols="50" class="form-control" required="true" placeholder="Enter Currency Prefix"><?php echo output(isset($website_setting[0]['s_inovice_termsandcondition']) ? $website_setting[0]['s_inovice_termsandcondition'] : ''); ?>
                        </textarea>
            </div>
         </div>
         <div class="col-sm-6 col-md-4">
            <div class="form-group">
               <label>Inovice Service Name</label>
               <input type="text" class="form-control" required="true" value="<?php echo output(isset($website_setting[0]['s_inovice_servicename']) ? $website_setting[0]['s_inovice_servicename'] : ''); ?>" id="s_inovice_servicename" name="s_inovice_servicename" placeholder="Inovice Service Name">
            </div>
         </div>
         <div class="col-sm-6 col-md-4">
            <div class="form-group">
               <label for="exampleInputFile">Logo</label>
               <div class="input-group">
                  <input type="file" class="form-control" id="file" name="file" <?php echo output(($website_setting[0]['s_logo'] != '') ? 'disabled=true' : ''); ?>>
               </div>
               <span class="bg-gradient-success btn-xs">Image sholud be in 50 X 50px and png format</span>
            </div>
            <?php if ($website_setting[0]['s_logo'] != '') { ?>
               <img src="<?= base_url() . 'assets/uploads/' . $website_setting[0]['s_logo']; ?>" alt="Logo" height="50" width="50" />
               <button type="button" class="logodelete btn btn-primary">Delete</button>
            <?php } ?>
         </div>
         <div id="addnewcategory_submit" class="btn-block text-right mt-3">
            <button type="submit" class="btn btn-primary">Submit</button>
         </div>
      </div>
   </div>
</form>