Hello,
I have inserted a button in the list page. When a record is selected on the list page and the user clicks the button it will take them to the add or edit page. This works fine. I am only allowing to select one record at a time. The problem is when the modal popup is closed and the user clicks the button again it opens the list page instead of the add or edit page how it's supposed to be. It's driving me nuts I can't figure out what is going on. Here is my code hopefully someone can help me on this :/ Thank you
////client before
var total=$('input[name="selection[]"]:checked').length;
if(total > 1){
alert('Please select one record at a time');
return false;
}
///on the server
global $dal;
$record = $button->getNextSelectedRecord();
$result['id'] = $record['employee_id'];
$sql = "SELECT employee_id FROM employee_docs WHERE employee_id = '".$record['employee_id']."'";
$rs = CustomQuery($sql);
$data = db_fetch_array($rs);
if($data){
$result['exist'] = 1;
}else{
$result['exist'] = 0;
}
///client after
if(result['exist'] == 0){
var url = 'employee_docs_add.php?cid='+result['id'];
var num = result['id'];
AddLog(url,num,'850','450','','Employee Documents');
//AddLog('ies_case_log_list.php?cid={$show_key1}','{$show_key1}','830','600','','File Note')
}else{
var url = 'employee_docs_edit.php?editid1='+result['id'];
var num = result['id'];
AddLog(url,num,'850','450','','Employee Documents');
}