<h5>Address: <strong><?php echo $customer_info[0]['address']; ?> </strong></h5> <h5>Login Time: <strong><?php echo date("d-m-Y h:i:sA", strtotime($customer_info[0]['start_time'])); ?> </strong></h5> <h5>Logout Time: <strong><?php echo date("d-m-Y h:i:sA", strtotime($customer_info[0]['end_time'])); ?> </strong></h5> </div> <div> <?php $tariff = $tariff_info->getTariff(); $current_time = strtotime($customer_info[0]['end_time']) - strtotime($customer_info[0]['start_time']); $spend_time = gmdate("H:i:s", $current_time); $hour = gmdate("H", $current_time); $total_amount = $hour * $tariff[0]['amount_per_hour']; $munite = gmdate("i", $current_time); $pulse_amount = ceil($munite / 15) * $tariff[0]['pulse_amount']; if ($pulse_amount >= $tariff[0]['amount_per_hour']) { $total_amount = $total_amount + $tariff[0]['amount_per_hour']; } else { $total_amount = $total_amount + $pulse_amount; } ?> <div class="alert alert-danger">Rate: <strong>TK<?php echo $tariff[0]['amount_per_hour']; ?>
<?php use src\Tariff; use src\Utilities; $tariffs = new Tariff(); if (isset($_POST['amount_per_hour']) && $_POST['amount_per_hour'] != 0 && isset($_POST['pulse_in_munite']) && $_POST['pulse_in_munite'] != 0 && isset($_POST['pulse_amount']) && $_POST['pulse_amount'] != 0) { echo $tariffs->update($_POST['amount_per_hour'], $_POST['pulse_in_munite'], $_POST['pulse_amount']); } $tariff = $tariffs->getTariff(); $amount_per_hour = $tariff[0]['amount_per_hour']; $pulse_in_munite = $tariff[0]['pulse_in_munite']; $pulse_amount = $tariff[0]['pulse_amount']; ?> <div class="container"> <div class="row"> <div class="col-md-10" id="home-second-half" style="overflow-x:hidden; overflow-y: auto; height:400px;"> <form action="?view=tariff_setup" method="post" class="form-horizontal"> <input type='hidden' value='1' name='tariff_id'> <div class="form-group"> <label for="amount_per_hour" class="col-sm-2 control-label">Amount Per Hour</label> <div class="col-sm-4"> <input type="text" maxlength="9" class="form-control" id="amount_per_hour" name="amount_per_hour" value="<?php echo $amount_per_hour; ?> " placeholder="Amount Per Hour" required> </div> </div> <div class="form-group"> <label for="pulse_in_munite" class="col-sm-2 control-label">Pulse In Munite</label> <div class="col-sm-4"> <input type="text" maxlength="6" class="form-control" id="pulse_in_munite" name="pulse_in_munite" value="<?php