Esempio n. 1
0
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if ($objLogin->IsLoggedInAs('owner', 'mainadmin') && Modules::IsModuleInstalled('customers')) {
    $action = MicroGrid::GetParameter('action');
    $rid = MicroGrid::GetParameter('rid');
    $mode = 'view';
    $msg = '';
    $objCustomerGroups = new CustomerGroups();
    if ($action == 'add') {
        $mode = 'add';
    } else {
        if ($action == 'create') {
            if ($objCustomerGroups->AddRecord()) {
                $msg = draw_success_message(_ADDING_OPERATION_COMPLETED, false);
                $mode = 'view';
            } else {
                $msg = draw_important_message($objCustomerGroups->error, false);
                $mode = 'add';
            }
        } else {
            if ($action == 'edit') {
                $mode = 'edit';
            } else {
                if ($action == 'update') {
                    if ($objCustomerGroups->UpdateRecord($rid)) {
                        $msg = draw_success_message(_UPDATING_OPERATION_COMPLETED, false);
                        $mode = 'view';
                    } else {