';
//----------------------------------------------------------------------
// change
if ( $sb=='change')
{
if ( !isset($_GET['id'])) exit;
$row=new Acc_Payment($cn,$_GET['id']);
$row->load();
$javascript="return confirm('"._('Vous confirmez')."')";
echo '';
exit();
}
//----------------------------------------------------------------------
// Save the change
//
if ( $sb=='save')
{
$row=new Acc_Payment($cn,$_POST ['id']);
$row->from_array($_POST);
$row->update();
}
//---------------------------------------------------------------------------
// Delete a card
//---------------------------------------------------------------------------
if (isset($_POST['delete']))
{
$row=new Acc_Payment($cn,$_POST['id']);
$row->from_array($_POST);
$row->delete();
}
//---------------------------------------------------------------------------
// Show form to enter a new one
//---------------------------------------------------------------------------
if ($sb=='ins')
{
$mp=new Acc_Payment($cn);
$r=$mp->blank();
echo '';
echo HtmlInput::button_anchor(_('Retour sans sauvez'),
'?p_action=divers&sa=mp&'.dossier::get()
);
exit();
}
//---------------------------------------------------------------------------
// Insert a new mod of payment
//---------------------------------------------------------------------------
if ( $sb=='insert')
{
$row=new Acc_Payment($cn);
$row->from_array($_POST);
$row->insert();
}
//----------------------------------------------------------------------
// LEDGER PURCHASE
//----------------------------------------------------------------------
echo '';
//----------------------------------------------------------------------
// LEDGER SOLD
//----------------------------------------------------------------------
echo '';
// Button to insert new one
echo HtmlInput::button_anchor(_('Ajout'),'?p_action=divers&sa=mp&sb=ins&'.dossier::get());
echo '