<? include('includes/main.php'); ?>
<? include('includes/glfunctions.php'); ?>
<?
echo texttitle(STR_ACCOUNT_TYPE_UPDATE);
if ($id) { // if the user has submitted info
if ($delete) { //if we should be deleting the entry
if (glaccounttypedelete($id)) die(textsuccess(STR_GL_ACCOUNT_TYPE_DELETED_SUCCESSFULLY));
} elseif ($accounttype) { //if we should update the entry
glaccounttypeupdate($id, $accounttype, $lastchangedate);
}; //if we should display more info about the entry that the user can edit
echo '<form action="adminglaccttypeupd.php" method="post"><table><input type="hidden" name="id" value="'.$id.'">';
formglaccounttypeupdate($id);
echo '</table><input type="submit" value="'.STR_SAVE_CHANGES.'"></form> <a href="javascript:confirmdelete(\'adminglaccttypeupd.php?delete=1&id='.$id.'\')">'.STR_DELETE_THIS_ACCOUNT_TYPE.'</a>';
} else { //display account types, let the user pick one to edit
echo '<form action="adminglaccttypeupd.php" method="post"><table>';
formglaccounttypeselect('id');
echo '</table><input type="submit" value="'.STR_EDIT_SELECTION.'"></form>';
echo '<a href="adminglaccttypeadd.php">'.STR_ADD_NEW_GL_ACCOUNT_TYPE.'</a>';
};
?>
<? include('includes/footer.php'); ?>