Hi, I don’t know how to explain or how do you call this method but to show what do I want to achieve. I have this code:
based on the picture, I want to delete a selected message by clicking the link. But I can’t think of any method how can I accomplish it. Here’s my view:
<?php echo '<div class="modal-body">';?>
<?php if( !empty($unread) ) {
$n = 0;
foreach($unread as $row ){
echo '<div class="row" style="border-bottom: 1px dotted #111; margin-top: 15px;">';
echo '<div class="col-md-10">';
echo '<form id="deleteMessage['.$n.']" method="POST" role="form" accept-charset="utf-8">';
echo '<input type="hidden" id="hiddenMessageId" name="hiddenMsgId" value="'. $row->id .'">';
echo '<p style="color: #111;"><span><label>Message from: </label> '.$row->firstname. ' '.$row->lastname. ' Date: ' .$row->date. '</span></p><p style="color: #111;">';
echo '<p style="color: #111;"><span><label>Message: </label> '.$row->inquiry. '</span></p>';
echo '<p style="text-align:cener; color: green;"><span style="text-align:cener; color: green;">** End of Message **</span><span><a href="#" type="Button" value="Submit" name="delteinquiry['.$n.']" class="deleteMessage['.$n.']">Mark as read</a></span></p>';
echo '</form>';
echo '</div>';
echo '</div>';
$n++;}}?>
<?php echo '</div>';?>
Any help please. Thanks