Exemplo n.º 1
0
        $db->rollback();
    }
}
if ($action == 'setnum' && !empty($_POST['num_paiement'])) {
    $object->fetch($id);
    $res = $object->update_num($_POST['num_paiement']);
    if ($res === 0) {
        $mesg = '<div class="ok">' . $langs->trans('PaymentNumberUpdateSucceeded') . '</div>';
    } else {
        $mesg = '<div class="error">' . $langs->trans('PaymentNumberUpdateFailed') . '</div>';
    }
}
if ($action == 'setdate' && !empty($_POST['datepday'])) {
    $object->fetch($id);
    $datepaye = dol_mktime(12, 0, 0, $_POST['datepmonth'], $_POST['datepday'], $_POST['datepyear']);
    $res = $object->update_date($datepaye);
    if ($res === 0) {
        $mesg = '<div class="ok">' . $langs->trans('PaymentDateUpdateSucceeded') . '</div>';
    } else {
        $mesg = '<div class="error">' . $langs->trans('PaymentDateUpdateFailed') . '</div>';
    }
}
/*
 * View
 */
llxHeader();
$form = new Form($db);
$h = 0;
$head[$h][0] = $_SERVER['PHP_SELF'] . '?id=' . $id;
$head[$h][1] = $langs->trans('Card');
$hselected = $h;
Exemplo n.º 2
0
	{
		$res = $paiement->update_num($_POST['new_num']);
		if ($res === 0) {
			$mesg = '<div class="ok">'.$langs->trans('PaymentNumberUpdateSucceeded').'</div>';
		} else {
			$mesg = '<div class="error">'.$langs->trans('PaymentNumberUpdateFailed').'</div>';
		}
	}

	if (!empty($_POST['action']) && $_POST['action'] == 'update_date' && !empty($_POST['reday']))
	{
		$datepaye = dol_mktime(12, 0 , 0,
		$_POST['remonth'],
		$_POST['reday'],
		$_POST['reyear']);
		$res = $paiement->update_date($datepaye);
		if ($res === 0) {
			$mesg = '<div class="ok">'.$langs->trans('PaymentDateUpdateSucceeded').'</div>';
		} else {
			$mesg = '<div class="error">'.$langs->trans('PaymentDateUpdateFailed').'</div>';
		}
	}


	print '<table class="border" width="100%">';

	print '<tr>';
	print '<td valign="top" width="20%" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">'.$paiement->id.'</td></tr>';

	//switch through edition options for date (only available when statut is -not 1- (=validated))
	if (empty($_GET['action']) || $_GET['action']!='edit_date')