Displaying N number of records from cart
<a href='delete.php?id=<?php echo $id; ?>'>Delete</a>
This is the url for deleting the particular record.
Before deleting the record i wrote a custom js dialogue box.
But i does not know how to pass the php id value to delete.php
In the below code wherever i click it sends only id of the first record not the correct record.
function Confirm(title, msg, $true, $false, $link) { /*change*/
var $content = "<div class='dialog-ovelay'>" +
"<div class='dialog'><header>" +
" <h3> " + title + " </h3> " +
"<i class='fa fa-close'></i>" +
"</header>" +
"<div class='dialog-msg'>" +
" <p> " + msg + " </p> " +
"</div>" +
"<footer>" +
"<div class='controls' style='text-align:right'>" +
" <button class='button button-danger doAction'>" + $true + "</button> " +
" <button class='button button-default cancelAction'>" + $false + "</button> " +
"</div>" +
"</footer>" +
"</div>" +
"</div>";
$('body').prepend($content);
$('.doAction').click(function() {
$(this).parents('.dialog-ovelay').fadeOut(500, function() {
location.href = "duplicate_frame.php?id=<?php echo $id; ?>";
$(this).remove();
});
});
$('.cancelAction, .fa-close').click(function() {
$(this).parents('.dialog-ovelay').fadeOut(500, function() {
$(this).remove();
});
});
}
$('.linkdup').click(function() {
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
Confirm('Are you sure you want to Duplicate Frame', 'One more frame will be added to Cart', 'Yes', 'No', ); /*change*/
});