Merge Functions ??
Posted: Wed Jun 29, 2005 3:27 am
Any idea on how I could merge the following functions ?
tia, Will./
Code: Select all
function view($stockId) {
if (!$stockId) { echo "<script language=\"javascript\">alert('Selection required')</script>"; }
else {
echo "<script language=\"javascript\">var newWindow = window.open
('".$_SERVER['PHP_SELF']."?action=viewFaceStock&stockId=".$stockId."','','scrollbars=yes,status=yes,windowX=10,windowY=10,width=440,height=550')</script>";
}
}
function viewLiners($linerId) {
if (!$linerId) { echo "<script language=\"javascript\">alert('Selection required')</script>"; }
else {
echo "<script language=\"javascript\">var newWindow = window.open
('".$_SERVER['PHP_SELF']."?action=viewLiner&linerId=".$linerId."','','scrollbars=yes,status=yes,windowX=10,windowY=10,width=440,height=550')</script>";
}
}
function viewAdhesives($adhesiveId) {
if (!$adhesiveId) { echo "<script language=\"javascript\">alert('Selection required')</script>"; }
else {
echo "<script language=\"javascript\">var newWindow = window.open
('".$_SERVER['PHP_SELF']."?action=viewAdhesive&adhesiveId=".$adhesiveId."','','scrollbars=yes,status=yes,windowX=10,windowY=10,width=440,height=550')</script>";
}
}