// </properties> // <list type="AA"> // <AA>...</AA> // <AA>...</AA> // ... // </list> // <list type="BB"> // <BB>...</BB> // <BB>...</BB> // ... // </list> // </A> // $structureDomFile = '../data/data.xml'; $dom = null; regenerate(); class DomAccessor { protected $domElement; protected function getProperty($property) { $thisElement = $this->domElement; $properties = $thisElement->firstChild; if ($properties != null) { while ($properties->tagName != "properties") { $properties = $properties->nextSibling; if ($properties == null) { return null; } } $goodProperty = getChildTagnamed($properties, $property);
if (is_numeric($_POST['prix_ht_new']) && is_numeric($_POST['qtt_new']) && !empty($_POST['prix_ht_new']) && !empty($_POST['line_new'])) { // Enregistrement d'une nouvelle ligne de facturation pour une facture. $q = sprintf("INSERT INTO webfinance_invoice_rows (id_facture,description,prix_ht,qtt,ordre) " . "SELECT %d, '%s', %s, %s, if(max(ordre) is NULL, 1, max(ordre) + 1) " . "FROM webfinance_invoice_rows " . "WHERE id_facture=%d", $_POST['id_facture'], mysql_real_escape_string($_POST['line_new']), $_POST['prix_ht_new'], $_POST['qtt_new'], $_POST['id_facture']); $result = mysql_query($q) or wf_mysqldie(); mysql_query("UPDATE webfinance_invoices SET date_generated=NULL WHERE id_facture=" . $_POST['id_facture']) or wf_mysqldie(); } // Enregistrement des lignes existantes foreach ($_POST as $k => $v) { if (preg_match("/^line_([0-9]+)\$/", $k, $matches)) { $q = sprintf("UPDATE webfinance_invoice_rows SET description='%s', prix_ht='%s', qtt='%s' WHERE id_facture_ligne=%d", mysql_real_escape_string($_POST['line_' . $matches[1]]), str_replace(' ', '', $_POST['prix_ht_' . $matches[1]]), $_POST['qtt_' . $matches[1]], $matches[1]); mysql_query($q) or die(mysql_error()); } } $q = sprintf("UPDATE webfinance_clients SET vat_number='%s' WHERE id_client=%d", $vat_number, $facture->id_client); mysql_query($q); regenerate($_POST['id_facture']); if ($dup_num_inv) { $_SESSION['message'] = _('Duplicate invoice number') . "<br/>" . _('Invoice updated'); $_SESSION['error'] = 1; } /* else */ /* $_SESSION['message'] = _('Invoice updated'); */ if ($type_doc == "facture" || $type_doc == "devis" && $is_paye == "on") { $Facture->updateTransaction($_POST['id_facture'], $type_prev); /* $_SESSION['message'] .= "<br>"._('Transaction updated'); */ } header("Location: edit_facture.php?id_facture=" . $_POST['id_facture']); exit; } if ($action == "delete_facture") { $id_client = "";