$mode = ''; $edit = true; } else { switch ($mode) { case 'save': //$db->debug=true; /* Validate important data */ $_POST['firm_id'] = trim($_POST['firm_id']); $_POST['name'] = trim($_POST['name']); if (!(empty($_POST['firm_id']) || empty($_POST['name']))) { # Check if insurance ID exists if ($ins_obj->FirmIDExists($_POST['firm_id'])) { # Notify $mode = 'firm_exists'; } else { if ($ins_obj->saveFirmInfoFromArray($_POST)) { header("location:insurance_co_info.php?sid={$sid}&lang={$lang}&firm_id={$firm_id}&mode=show&save_ok=1&retpath={$retpath}"); exit; } else { echo "{$sql}<br>{$LDDbNoSave}"; } } } else { $mode = 'bad_data'; } break; } // end of switch($mode) } $bgc = $root_path . 'gui/img/skin/default/tableHeaderbg3.gif'; $bgc2 = '#eeeeee';