The above are my records in a table.
My username is CHIEFME and I can only select the rows Uploaded By
CHIEFME.
If I select other rows it will pop up a alert box saying that I can only select records uploaded by me.
This is my sample codeine
The above are my records in a table.
My username is CHIEFME and I can only select the rows Uploaded By
CHIEFME.
If I select other rows it will pop up a alert box saying that I can only select records uploaded by me.
This is my sample codeine
When you loop the rows in table at first check if logged user name is not the name of the user that added this record:
<?php
// .... your code here
<td align...> <input class="checkbox-row" type="checkbox" ($loggedUsername !== $row[username] ? readonly : "")>... </td>
// or
<td align... < input class="checkbox-row" type="checkbox" ($loggedUsername !== $row[username] ? "onclick=\"alert(this is not added by you!); return;\"" : "") >... </td>
Then in client use javascript or jQuery to check if the user click on readonly checkbox:
$(document).on('click', '.checkbox-row', function(){
if($(this).is('[readonly]')) {
alert('This is not added by you');
}
}