<? include('includes/main.php'); ?>
<? include('includes/glfunctions.php'); ?>
<? //GLACCTUPD.PHP
echo texttitle('Account Update');
if ($id) {
if ($delete) {
glaccountdelete($id);
} elseif ($account) {
if ($accounttypeid==40) $companyid=0; //this one applies to all companies
glaccountupdate($id, $account, $name, $accounttypeid, $companyid, $summaryaccountid,$lastchangedate);
} else {
echo '<form action="glacctupd.php" method="post">';
$recordSet = &$conn->Execute('select name from glaccount where (companyid=0 or companyid='.sqlprep($active_company).') and id='.$id);
if (!$recordSet->EOF) {
echo '<table><tr><th colspan="2">GENERAL LEDGER ACCOUNT - '.$recordSet->fields[0].'</th></tr>';
echo '<input type="hidden" name="name" value="'.$recordSet->fields[0].'">';
echo '<input type="hidden" name="id" value="'.$id.'">';
formglaccountupdate($id);
echo '</select></td></tr></table><input type="submit" value="Update"></form> <a href="javascript:confirmdelete(\'glacctupd.php?delete=1&id='.$id.'\')">Delete this Account</a>';
};
};
} else {
echo '<form action="glacctupd.php" method="post"><table>';
formglaccountselect('id');
echo '</table><input type="submit" value="Select"></form>';
echo '<a href="glacctadd.php">Add new GL Account</a>';
};
?>
<? include('includes/footer.php'); ?>