I need child record button to open in new window
Posted: 2021-01-10 15:30
How do I edit the code to make the button open in a new window on a child record?
// child table: starmath
$res = sql("SELECT `st_id` FROM `students` WHERE `st_id`='{$selected_id}'", $eo);
$st_id = db_fetch_row($res);
$rires = sql("SELECT COUNT(1) FROM `starmath` WHERE `student`='" . makeSafe($st_id[0]) . "'", $eo);
$rirow = db_fetch_row($rires);
if($rirow[0] && !$AllowDeleteOfParents && !$skipChecks) {
$RetMsg = $Translation["couldn't delete"];
$RetMsg = str_replace('<RelatedRecords>', $rirow[0], $RetMsg);
$RetMsg = str_replace('<TableName>', 'starmath', $RetMsg);
return $RetMsg;
} elseif($rirow[0] && $AllowDeleteOfParents && !$skipChecks) {
$RetMsg = $Translation['confirm delete'];
$RetMsg = str_replace('<RelatedRecords>', $rirow[0], $RetMsg);
$RetMsg = str_replace('<TableName>', 'starmath', $RetMsg);
$RetMsg = str_replace('<Delete>', '<input type="button" class="button" value="' . $Translation['yes'] . '" onClick="window.location = \'students_view.php?SelectedID=' . urlencode($selected_id) . '&delete_x=1&confirmed=1\';">', $RetMsg);
$RetMsg = str_replace('<Cancel>', '<input type="button" class="button" value="' . $Translation[ 'no'] . '" onClick="window.location = \'students_view.php?SelectedID=' . urlencode($selected_id) . '\';">', $RetMsg);
return $RetMsg;
}
// child table: starmath
$res = sql("SELECT `st_id` FROM `students` WHERE `st_id`='{$selected_id}'", $eo);
$st_id = db_fetch_row($res);
$rires = sql("SELECT COUNT(1) FROM `starmath` WHERE `student`='" . makeSafe($st_id[0]) . "'", $eo);
$rirow = db_fetch_row($rires);
if($rirow[0] && !$AllowDeleteOfParents && !$skipChecks) {
$RetMsg = $Translation["couldn't delete"];
$RetMsg = str_replace('<RelatedRecords>', $rirow[0], $RetMsg);
$RetMsg = str_replace('<TableName>', 'starmath', $RetMsg);
return $RetMsg;
} elseif($rirow[0] && $AllowDeleteOfParents && !$skipChecks) {
$RetMsg = $Translation['confirm delete'];
$RetMsg = str_replace('<RelatedRecords>', $rirow[0], $RetMsg);
$RetMsg = str_replace('<TableName>', 'starmath', $RetMsg);
$RetMsg = str_replace('<Delete>', '<input type="button" class="button" value="' . $Translation['yes'] . '" onClick="window.location = \'students_view.php?SelectedID=' . urlencode($selected_id) . '&delete_x=1&confirmed=1\';">', $RetMsg);
$RetMsg = str_replace('<Cancel>', '<input type="button" class="button" value="' . $Translation[ 'no'] . '" onClick="window.location = \'students_view.php?SelectedID=' . urlencode($selected_id) . '\';">', $RetMsg);
return $RetMsg;
}