









<!-- popup fare Modal Dialog
============================================= -->
<div id="select-busseats<?php echo $t++;?>" class="modal fade" role="dialog" aria-hidden="true">
                    <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
                      <div class="modal-content">
                        <div class="modal-header">
                         <h4 style="color:#507006" ><strong style="float: left;margin: 29px 0px 0px 0px;">Cost Estimate</strong>
                         &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;<strong class="outfare" style="float:right;padding-right:30px;margin: 0px 0px 0px 10px;">Total Cost: <?php if(isset($_SESSION['currency_type'])){ echo $_SESSION['currency_type']; }else {echo 'INR'; }  
									 

#========== PARTNER/AGENT MARKUP ============#
 $sscarloc=$dbf->fetchSingle($dbf->partner_con,"markup_location","inventory='Car'");

if($sscarloc['location'] == 'S')
{
if($_SESSION['utype'] == 'agent')
{
	$pmarkup = $dbf->fetchSingle($dbf->partner_con,"manage_markup","agent_id='".$_SESSION['tvr_id']."' AND inventory='Car'");
	if(strtoupper($pmarkup['type']) == 'RS')
	{
		 $markupAmount = round($pmarkup['amt']);
		
		
	}
	else
	{
		 $markupAmount = round($estimate*$pmarkup['amt']/100);
		
	}
	$partnerMarkup = $markupAmount;
	$estimate += $markupAmount;
	#=========== AGENT MARKUP  ============#
	$amarkup = $dbf->fetchSingle($dbf->partner_con,"agent_markup","agent_id='".$_SESSION['tvr_id']."' AND inventory='Car'");
	if(strtoupper($amarkup['type']) == 'RS')
	{
		 $markupAmount = round($amarkup['amt']);
		
		
	}
	else
	{
		 $markupAmount = round($estimate*$amarkup['amt']/100);
		
	} 
	$agentMarkup = $markupAmount;
	$estimate += $markupAmount;
	#=========== AGENT MARKUP  ============#
}
else
{
	$pmarkup = $dbf->fetchSingle($dbf->partner_con,"manage_markup","agent_id='0' AND inventory='Car'");
	//print_r($pmarkup);
	if(strtoupper($pmarkup['type']) == 'RS')
	{
		$markupAmount = round($pmarkup['amt']);
		
		$vkppm=$pmarkup['amt'];
	}
	else
	{
		$markupAmount = round($estimate*$pmarkup['amt']/100);
		$vkppm=$pmarkup['amt']/100;
	}
	$partnerMarkup = $markupAmount;
		$estimate += $markupAmount;
		$agentMarkup = 0;
$vkppmar=$vkppm;
}
$ppmarkup =round($partnerMarkup);
$carttlmrkup = $partnerMarkup+$agentMarkup;
$caragemrkp = $agentMarkup;	
 
	if($up_down<$minkmchrgs && $trip_duration>1){
	    
								    $totalv=round(($package_detailv['driver_allowance']*$trip_duration)+(($trip_duration-1)*$nightchrgs)+$package_detailv['day_charges']*$trip_duration);
								    $servchrge=$totalv*$vkppmar;
								    $totalvkpc=round($totalv+$servchrge);
								}
								else{
								    
								    $totalv=round(($package_detailv['driver_allowance']*$trip_duration)+(($trip_duration-1)*$nightchrgs)+$package_detailv['day_charges']*$trip_duration);
								    $servchrge=$totalv*$vkppmar;
								     $totalvkpc=round($totalv+$servchrge);
								}

//$_SESSION[$searchid]['ttlcarfare'] = $ttlamt;

}	

			//$estimate=$estimate+$daychrgs;
															?> 
          <?php  if($_SESSION['currency_type']=='INR'){echo $currency_amt=round(($totalvkpc)*$_SESSION['currency_value'],0);}else{echo $currency_amt=number_format(($totalvkpc));}
                       $amttl=$currency_amt;
                       
                       
                      
                       ?></strong></h4>
                          <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button>
                        </div>
                        <div class="modal-body">
                          <table class="table table-bordered table-striped table-booking-history">
    
   
    
    
    
    
           <tbody>
               
    <tr class="row_bgcolor">
         <td class="booking-history-title">Vehicle Type:</td>
         <td class="booking-history-title"><?php echo $vehicle_detail['category'];?></td>
    </tr>
    <tr>
        <td class="booking-history-title">Car Type:</td>
        <td class="booking-history-title"><?=$cname['car_name']?></td>
    </tr>
                <?php   
                          $trip_durationn=$trip_duration-1;     ?>
    <tr>
        <td class="booking-history-title">Per day cost:</td>
        <td class="booking-history-title"><?php echo $package_detailv['day_charges'] ?></td>
    </tr>
    <tr class="row_bgcolor">
        <td class="booking-history-title"> Night Charge : (
        <?php if(isset($_SESSION['currency_type'])){ echo ' '.$_SESSION['currency_type'].' '; }else {echo ' INR '; }   
        if($_SESSION['currency_type']=='INR'){echo $curr_amt=number_format($nightchrgs*$_SESSION['currency_value'],1);}else{echo $curr_amt=number_format($nightchrgs*$_SESSION['currency_value'],2);} ?>
        X <?php echo $trip_durationn;?> Nights)
        </td>
      <td class="booking-history-title">
                <?php $night_charge=round($nightchrgs,0);
      				if($_SESSION['currency_type']=='INR')
      				{echo $currency_amt=round($night_charge*$trip_durationn);}
      				else{echo $currency_amt=number_format($night_charge*$trip_durationn,2);}
				//echo $currency_amt=round($night_charge*$_SESSION['currency_value']); 
				if(isset($_SESSION['currency_type'])){ echo ' '.$_SESSION['currency_type'].' '; }else {echo ' INR '; }  ?>
				
	  </td>
    </tr>
    <tr>
      <td class="booking-history-title"> Driver Allowance:
                ( <?php echo $trip_duration;?>
                <?php if($trip_duration>1){?>
                Days
                <?php }else{?>
                Day
                <?php }?>
                X
                <?php if(isset($_SESSION['currency_type'])){ echo ' '.$_SESSION['currency_type'].' '; }else {echo ' INR '; } 
                if($_SESSION['currency_type']=='INR'){echo number_format($package_detailv['driver_allowance']*$_SESSION['currency_value'],1);}else{echo number_format($package_detailv['day_charges']*$_SESSION['currency_value'],2);} ?>
                Per Day )
    </td>
      <td class="booking-history-title">
                   <?php $tdcharge=round($trip_duration*$package_detailv['driver_allowance'],0);
            		if($_SESSION['currency_type']=='INR'){echo $currency_amt=round($tdcharge*$_SESSION['currency_value']);}else{echo $currency_amt=number_format($tdcharge*$_SESSION['currency_value'],2);}
            		if(isset($_SESSION['currency_type'])){ echo ' '.$_SESSION['currency_type'].' '; }else {echo ' INR '; }  ?>
	</td>
    </tr>
    <tr class="row_bgcolor">
      <td class="booking-history-title">Service Charge:</td>
      <td class="booking-history-title">
      <?php 
	    if($_SESSION['currency_type']=='INR')
	    {
	        echo round($servchrge*$_SESSION['currency_value']);
	        
	    }else
	    {
	        echo number_format($servchrge*$_SESSION['currency_value'],2);
	        
	    }
	 
	    if(isset($_SESSION['currency_type']))
	    {
	        echo ' '.$_SESSION['currency_type'].' '; 
	   }else 
	   {echo ' INR '; }
	?>      
	</td>
    </tr>
    <tr>
      <td class="booking-history-title">Total Cost:</td>
      <td class="booking-history-title">
       <?php include 'cost.php'; ?>
       
       </td>
    </tr>
    <tr class="row_bgcolor">
      <td class="booking-history-title"><?php echo $admin['adpay_ocity'];?>% Advance Amount (Pay Now):</td>
      <td class="booking-history-title"> 
                              <?php if(isset($_SESSION['currency_type'])){ echo $_SESSION['currency_type']; }else {echo 'INR'; }  ?>
    
    <?php  
    if($_SESSION['currency_type']=='INR'){echo $currency_amt=round($totalvkpc*$adv_pay*$_SESSION['currency_value'],0);}
    else{echo $currency_amt=number_format($totalvkpc*$adv_pay*$_SESSION['currency_value'],2);} 
    ?>
                             
                              <?php  if($dest_c=="Out"){ 
                          $trip_duration=$trip_duration;    } ?>
                         </td>
    </tr>
    <tr>
      <td class="booking-history-title"><?php echo round(100-$admin['adpay_ocity'],0);?>% Remaining Amount:</td>
      <td class="booking-history-title">
          <?php echo  $totalvkpc-round(($totalvkpc*$adv_pay*$_SESSION['currency_value']),0); if(isset($_SESSION['currency_type'])){ echo ' '.$_SESSION['currency_type']; }else { echo ' INR '; }  ?><b>(Have to pay to Driver)</b> 
	 
	 </td>
    </tr>
        
    <tr class="row_bgcolor">
      <td class="booking-history-title">Max KM Per Day:</td>
      <td class="booking-history-title"><?php echo $minkmchrgs;?></td>
    </tr>
    <tr>
      <td class="booking-history-title">Inclusion Policy:</td>
      <td class="booking-history-title"><?php echo $package_detailv['outside_inclusions'];?></td>
    </tr>
    <tr class="row_bgcolor">
      <td class="booking-history-title">Exclusion Policy:</td>
      <td class="booking-history-title"><?php echo $package_detailv['outside_exclusions'];?></td>
    </tr>
    <!--<tr class="row_bgcolor">
	<td class="booking-history-title">Cancellation Policy:</td>
	<td class="booking-history-title"> </td>
	</tr>-->
    <tr>
      <td class="booking-history-title">KM reading &amp; Time starts/ends:</td>
      <td class="booking-history-title"><?php if($package_detailv['km_reading']==1){
			echo "From Operator Garage/Office Location";	
	}else{
			echo "From Pick-p/Drop-up Points";
	}
	?></td>
    </tr>
    <tr><td colspan="2" class="booking-history-title">Note:</td></tr>
    <tr>
      <td class="booking-history-title" style="font-weight:bold;">Extra Fare/KM :</td>
      <td class="booking-history-title" style="font-weight:bold;">
          <?php echo $_SESSION['currency_type'];?>&nbsp;<?php echo $package_detailv['outside_km_charge'];?>/KM
       </td>
    </tr>
    <tr>
      <td colspan="2" class="booking-history-title">1.Distance travelled beyond <?php echo $package_detailv['min_km_charge'];?> km will be charged at <?php echo $_SESSION['currency_type'];?>&nbsp;<?php echo $package_detailv['outside_km_charge'];?>/km.</td>
    </tr>
    <tr>
      <td colspan="2" class="booking-history-title"> 2.Please pay directly to the authorities and collect the receipt.</td>
    </tr>
    <tr>
      <td colspan="2" class="booking-history-title"> 3.For night driving between 10:00 pm to 6:00 am, an allowance of <?php echo $_SESSION['currency_type'];?>&nbsp;<?php echo $package_detailv['night_charge'];?> (per night) will need to be paid to the driver.</td>
    </tr>
  </tbody></table>
                        </div>
                      </div>
                    </div>
                  </div>
                  
                  
<!--popup fare Modal Dialog end -->
                  
                  
                  
                  
                  
                  <!--  popup terms Modal Dialog1
============================================= -->
<div id="select" class="modal fade" role="dialog" aria-hidden="true">
                    <div class="modal-dialog modal-lg modal-dialog-centered" 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">&times;</span> </button>
                        </div>
                        <div class="modal-body">
                          <table width="100%">
	<tbody>
		<tr class="fancy_hcolor">
			<td align="center" height="25" valign="middle" bgcolor="brown"> <font color="white">Terms &amp; Conditions</font> 
				</td>
				<td></td>
		</tr>
		<tr align="left" valign="middle">
			<td>
				<ul>
					<li>
						<p>
							You have to pay 30% of the booking amount now to us as a booking confirmation.</p>
					</li>
					<li>
						<p>
							You have to pay 70% of the booking amount to driver at the time of using the services.</p>
					</li>
					
				</ul>
			</td>
		</tr>
	</tbody>
</table>
                        </div>
                      </div>
                    </div>
                  </div>
                  <!--popup terms Modal Dialog1 end -->
                  
                  
                  
