File: /home/durgeshpandey215/www/zeeroprice.skilladders.com/approvedResponses.php
<? require_once "application_top.php";
require_once "protect.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Approved Responses</title>
<? require_once "scripts.php";?>
</head>
<body>
<? $pagename = 'shop'; require "header.php";?>
<div class="w3-bar w3-medium">
<a href="#" class="w3-bar-item w3-button w3-border w3-right noteicon"><i class="fa fa-lightbulb-o"></i> Help</a>
<a href="<?=HTTP_SERVER;?>product-responses.php" class="w3-bar-item w3-button w3-border w3-right">Customer Responses</a>
</div>
<div class="tip w3-border w3-card" style="display:none;">
<span onclick="this.parentElement.style.display='none'" class="w3-button w3-large w3-display-topright">×</span>
To complete transaction please enter Delivery Code.<br/>
On completion of delivery, your account will be credited instantly with the balance "ZeeroPrice Cost" (if any).
</div>
<div class="w3-col m12 w3-container"><!--w3-twothird starts here -->
<h1 class="heading">Approved Responses</h1>
<?
$db->where('sellerid',$useridsess);
$db->where('isapproved',1);
//---------------Paginate BOF---------------------------------------
$paginatetable = 'orders_detail'; //table name
$extra ="key="; //use '&' in between if more than 1 parameter
$adjacents = 2;
$limit = 20; //how many items to show per page
$db->pageLimit = $limit;
$targetpage = $_SERVER['PHP_SELF']; //your file name (the name of this file)
require "paginate.php";
//------------------------------------------------------------------
if(count($rows)){
?>
<table class="listingtable">
<th>Image</th>
<th>Order Id</th>
<th>Customer Cost</th>
<th>ZeeroPrice Cost</th>
<th>Confirm Delivery</th>
<th>Disapprove</th>
<?
foreach($rows as $row){
$db->where('pid',$row['pid']);
$rowpr = $db->getOne('products');
?>
<tr>
<td align="center"><img src="<?=HTTP_SERVER;?>images/products/<?=($rowpr['pic1'])? $rowpr['pic1']:"default.jpg";?>" style="width:70px;height:70px;"/>
<br/><?=currSign($rowpr['currency']);?>.<?=$rowpr['mrp'];?>
</td>
<td align="center"><?=$row['orderid'];?></td>
<td align="center"><?=currSign($rowpr['currency']);?>.<?=$row['customercost'];?></td>
<td align="center">
<? if($row['mrp'] > $row['customercost']){
echo currSign($rowpr['currency']) .".". ($row['mrp'] - $row['customercost']);
}?>
</td>
<td align="center">
<? if($row['isDelivered']){ ?>
Delivered
<? }else{ ?>
<form class="frm" id="frm">
<input type="text" id="otp" style="width:150px;" placeholder="Enter OTP" required /><br/>
<input type="hidden" id="id" value="<?=$row['orderid'];?>"/>
<div class="ResultDiv"></div>
<input type="submit" class="vrfotp w3-btn w3-black" value="Confirm Delivery">
</form>
<? } ?>
</td>
<td><a href="disapproved.php?id=<?=$row['orderid'];?>" class="w3-btn w3-black">Disapprove</a>
</td>
</tr>
<?
}
?>
</table>
<?
}else{
?><h4>There are no approved responses.</h4>
<a href="<?=HTTP_SERVER;?>product-responses.php" class="w3-button w3-border">Go to Responses</a>
<?
}
?>
<?=$pagination;?>
<br/><br/>
<script>
$(document).ready(function(){
var HTTP_SERVER_JQUERY = $('#HTTP_SERVER').val(); //this #id is in footer
$('.frm').on('submit', function(event) {
event.preventDefault();
var otp = $(this).find('#otp').val();
var orderid = $(this).find('#id').val();
$(this).find('.vrfotp').prop('value','Processing...');
$(this).find('.vrfotp').prop('disabled',true);
callurl = $('#HTTP_SERVER').val()+"ajax_confirmotp.php?otp="+otp+"&id="+orderid;
//window.location = callurl;return;
$.ajax({dataType : 'json',url:callurl,
context: this,
success: function(data){
if(data.error){
$(this).find('.ResultDiv').html(data.error);
}else{
$(this).find('.ResultDiv').html(data.successmsg);
}
$(this).find('.vrfotp').prop('value','Confirm Delivery');
$(this).find('.vrfotp').prop('disabled',false);
}
});
});
});
</script>
</div><!--w3-twothird ends here -->
<? include "footer.php";?>
</body>
</html>