| Current Path : /home2/wtmwscom/public_html/admin/ |
| Current File : /home2/wtmwscom/public_html/admin/base_rate.php |
<?php
$title= "Base Rate";
include 'header.php';
include_once('lib/ps_pagination.php');
if(isset($_POST['base_rate'])){
mysqli_query($connection,"UPDATE base_rate SET base_rate='".$_POST['base_rate']."' WHERE recid='".$_POST['recid']."'");
setMessage('Base rate edit successfully.', 'alert-msg success');
redirect('./base_rate.php');
die();
}
?>
<h1>Base Rate</h1>
<section id="comments">
<?php echo getMessage();?>
<form name="form" id="form" action="base_rate.php" method="post">
<p>
<label for="country_currency">Country Currency <span>*</span></label>
<select name="recid" id="recid" required="required">
<option value="" selected="selected">-- Country Currency --</option>
<?php
$rate_rs = mysqli_query($connection,"SELECT recid, country_currency FROM base_rate");
while($rate = mysqli_fetch_object($rate_rs)){
?>
<option value="<?php echo $rate->recid;?>"><?php echo $rate->country_currency;?></option>
<?php }?>
</select>
</p>
<p>
<label for="base_rate">Base Rate <span>*</span></label>
<input type="text" name="base_rate" id="base_rate" required="required" maxlength="20">
</p>
<p><br />
<input style="position: relative; left: 180px;" name="submit" type="submit" id="submit" value="Edit">
</p>
</form>
</section>
<section id="comments">
<h1>Base Rate Detail</h1>
<?php
if(!isset($_GET['page'])){$i=1;}else{$i=(($_GET['page']-1)*20)+1;}
$query= "SELECT * FROM base_rate";
$pager = new PS_Pagination($link, $query, 20, 5);
$pager->setDebug(true);
$rs = $pager->paginate();
if($rs){
?>
<table>
<thead>
<tr>
<th>S.No</th>
<th>Country Currency</th>
<th>Base Rate</th>
</tr>
</thead>
<tbody>
<?php
while($row= mysqli_fetch_object($rs)){
?>
<tr <?php if($i%2){echo "class='light'";}else{echo "class='dark'";}?>>
<td><?php echo $i; ?></td>
<td><?php echo $row->country_currency;?></td>
<td><?php echo $row->base_rate;?></td>
</tr>
<?php $i++;}?>
</tbody>
</table>
<?php echo $pager->renderFullNav();?>
<?php }?>
</section>
<?php include('footer.php');?>