$objMsg->setMessage($_REQUEST);
            $objComm->redirect('index.php?model=' . $model . '&action=edit&type=' . $type . '&id=' . $_REQUEST['pk_id']);
        } else {
            $row = $objMsg->getMessageSubject();
        }
        break;
    case 'EDITSUB':
        $objMsg = new messageboard();
        if (isset($_REQUEST['btn_submit']) && $_REQUEST['btn_submit'] == 'updatesub') {
            $objMsg->setMessageSubject($_REQUEST);
            $objComm->redirect('index.php?model=' . $model . '&action=editsub&type=' . $type . '&id=' . $_REQUEST['pk_id']);
        } else {
            $row = $objMsg->getSubject();
        }
        break;
    case 'DELMSG':
        $objMsg = new messageboard();
        $objMsg->delMessageSubject($_REQUEST['id']);
        $objComm->redirect('index.php?model=' . $model . '&type=' . $type);
        break;
    case 'DELSUB':
        $objMsg = new messageboard();
        $objMsg->delSubject($_REQUEST['id']);
        $objComm->redirect('index.php?model=' . $model . '&type=' . $type);
        break;
    default:
        $objMsg = new messageboard();
        $Records = $objMsg->getAllMessage($WorkGroupID);
        $ViewContent = $objMsg->displayMessage($Records, $type);
        break;
}
        if (isset($_REQUEST['btn_submit']) && $_REQUEST['btn_submit'] == 'updatesub') {
            $objMsg->setMessageSubject($_REQUEST);
            $objComm->redirect1('index.php?model=' . $model . '&action=editsub&type=' . $type . '&id=' . $_REQUEST['pk_id']);
        } else {
            $row = $objMsg->getSubject();
            $objComm->checkReadWriteAccess($row->CreatedBy);
        }
        break;
    case 'DELMSG':
        $objComm->checkReadWriteAccess($type);
        $objMsg = new messageboard();
        $row = $objMsg->getMessageSubject();
        $objComm->checkReadWriteAccess($row->CreatedBy);
        $objMsg->delMessageSubject($_REQUEST['id']);
        $objComm->redirect1('index.php?model=' . $model . '&type=' . $type);
        break;
    case 'DELSUB':
        $objComm->checkReadWriteAccess($type);
        $objMsg = new messageboard();
        $row = $objMsg->getSubject();
        $objMsg->delMessageSubject($_REQUEST['id']);
        $objMsg->delSubject($_REQUEST['id']);
        $objComm->redirect1('index.php?model=' . $model . '&type=' . $type);
        break;
    default:
        $WorkGroupID = $type == 'gen' ? '0' : $_SESSION['site']['pm_row']->WorkgroupID;
        $objMsg = new messageboard();
        $Records = $objMsg->getAllMessage($WorkGroupID);
        $row = $objMsg->displayMessage($Records, $type);
        break;
}