File "atm_api.php"
Full path: /home/fsibplc/public_html/fsib/atm_api.php
File
size: 4.12 B (4.12 KB bytes)
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
if(isset($_POST["modal_id"]))
{
$output = '';
include('admin/config/dbcon.php');
$type='atm';
$stmt = $conn->prepare("select br_name from location where type= ? and id = ?");
$stmt->bind_param("si", $type, $_POST["modal_id"]);
$stmt->execute();
$result = $stmt->get_result();
// $find_sql = "select br_name from location where type='atm' and id = ".$_POST["modal_id"];
// $result = $conn->query($find_sql);
$output .='
<div class="modal-header">';
while($rows=$result->fetch_assoc()){
$output .='
<h5 class="modal-title" id="myModalLabel">'.$rows['br_name'].'</h5>';
}
$output .='<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="details_modal">
<div class="col-7">';
// $find_sql = "select lattitude,longitude from location where type='atm' and id = ".$_POST["modal_id"];
// $result = $conn->query($find_sql);
$type='atm';
$stmt = $conn->prepare("select lattitude,longitude from location where type= ? and id = ?");
$stmt->bind_param("si", $type, $_POST["modal_id"]);
$stmt->execute();
$result = $stmt->get_result();
$output .='<iframe style="width:100%;height:100%;" frameborder="0" scrolling="no" marginheight="0"
marginwidth="0"';
while($rows=$result->fetch_assoc()){
$output .=' src="https://maps.google.com/maps?q='.$rows['lattitude'].','.$rows['longitude'].'&hl=en&z=14&output=embed">';
}
$output .='</iframe>
</div>
<div class="col-5">
<table class="table table-bordered table-striped"
style="width:100%;font-size: 13px;height:100%;">
<tbody>';
$type='atm';
$find_sql = "SELECT * FROM location WHERE type=? AND id = ?";
$stmt = $conn->prepare($find_sql);
$stmt->bind_param("si",$type, $_POST["modal_id"]); // Assuming modal_id is a string. Use "i" for integer.
$stmt->execute();
$result = $stmt->get_result();
// $find_sql = "select * from location where type='atm' and id = ".$_POST["modal_id"];
// $result = $conn->query($find_sql);
while($rows=$result->fetch_assoc()){
$output .='
<tr>
<th width="40%">ATM Name</th>
<td width="60%">'.$rows["br_name"].'</td>
</tr>
<tr>
<th width="40%">ATM Address</th>
<td width="60%">'.$rows["br_address"].'</td>
</tr>
<tr>
<th width="40%">Inauguration Date</th>
<td width="60%">'.$rows["inaguration"].'</td>
</tr>';
}
$output .='</tbody>
</table>
</div>
</div>
</div>';
echo $output;
}
?>