PageRenderTime 51ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/compta/bank/ligne.php

https://github.com/asterix14/dolibarr
PHP | 603 lines | 477 code | 74 blank | 52 comment | 94 complexity | d25e968bc86ceef3e8c92f4a355d297f MD5 | raw file
Possible License(s): LGPL-2.0
  1. <?php
  2. /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com>
  4. * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  5. * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file htdocs/compta/bank/ligne.php
  22. * \ingroup compta
  23. * \brief Page to edit a bank transaction record
  24. */
  25. require("./pre.inc.php");
  26. if (! $user->rights->banque->lire && ! $user->rights->banque->consolidate)
  27. accessforbidden();
  28. $langs->load("banks");
  29. $langs->load("compta");
  30. $langs->load("bills");
  31. $langs->load("categories");
  32. if ($conf->adherent->enabled) $langs->load("members");
  33. $action=GETPOST('action');
  34. $rowid=GETPOST("rowid");
  35. $ref=GETPOST("ref");
  36. $orig_account=GETPOST("orig_account");
  37. $accountid=GETPOST('accountid');
  38. $confirm=GETPOST('confirm');
  39. $form = new Form($db);
  40. /*
  41. * Actions
  42. */
  43. if ($user->rights->banque->consolidate && $_GET["action"] == 'dvnext')
  44. {
  45. $ac = new Account($db);
  46. $ac->datev_next($_GET["rowid"]);
  47. }
  48. if ($user->rights->banque->consolidate && $_GET["action"] == 'dvprev')
  49. {
  50. $ac = new Account($db);
  51. $ac->datev_previous($_GET["rowid"]);
  52. }
  53. if ($action == 'confirm_delete_categ' && $confirm == "yes" && $user->rights->banque->modifier)
  54. {
  55. $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = ".$rowid." AND fk_categ = ".GETPOST("cat1");
  56. if (! $db->query($sql))
  57. {
  58. dol_print_error($db);
  59. }
  60. }
  61. if ($action == 'class')
  62. {
  63. $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid = ".$rowid." AND fk_categ = ".$_POST["cat1"];
  64. if (! $db->query($sql))
  65. {
  66. dol_print_error($db);
  67. }
  68. $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ) VALUES (".$_GET["rowid"].", ".$_POST["cat1"].")";
  69. if (! $db->query($sql))
  70. {
  71. dol_print_error($db);
  72. }
  73. }
  74. if ($action == "update")
  75. {
  76. // Avant de modifier la date ou le montant, on controle si ce n'est pas encore rapproche
  77. $conciliated=0;
  78. $sql = "SELECT b.rappro FROM ".MAIN_DB_PREFIX."bank as b WHERE rowid=".$rowid;
  79. $result = $db->query($sql);
  80. if ($result)
  81. {
  82. $objp = $db->fetch_object($result);
  83. $conciliated=$objp->rappro;
  84. }
  85. $db->begin();
  86. $amount = price2num($_POST['amount']);
  87. $dateop = dol_mktime(12,0,0,$_POST["dateomonth"],$_POST["dateoday"],$_POST["dateoyear"]);
  88. $dateval= dol_mktime(12,0,0,$_POST["datevmonth"],$_POST["datevday"],$_POST["datevyear"]);
  89. $sql = "UPDATE ".MAIN_DB_PREFIX."bank";
  90. $sql.= " SET ";
  91. // Always opened
  92. if (isset($_POST['value'])) $sql.=" fk_type='".$db->escape($_POST['value'])."',";
  93. if (isset($_POST['num_chq'])) $sql.=" num_chq='".$db->escape($_POST["num_chq"])."',";
  94. if (isset($_POST['banque'])) $sql.=" banque='".$db->escape($_POST["banque"])."',";
  95. if (isset($_POST['emetteur'])) $sql.=" emetteur='".$db->escape($_POST["emetteur"])."',";
  96. // Blocked when conciliated
  97. if (! $conciliated)
  98. {
  99. if (isset($_POST['label'])) $sql.=" label='".$db->escape($_POST["label"])."',";
  100. if (isset($_POST['amount'])) $sql.=" amount='".$amount."',";
  101. if (isset($_POST['dateomonth'])) $sql.=" dateo = '".$db->idate($dateop)."',";
  102. if (isset($_POST['datevmonth'])) $sql.=" datev = '".$db->idate($dateval)."',";
  103. }
  104. $sql.= " fk_account = ".$accountid;
  105. $sql.= " WHERE rowid = ".$rowid;
  106. $result = $db->query($sql);
  107. if ($result)
  108. {
  109. $mesg=$langs->trans("RecordSaved");
  110. $db->commit();
  111. }
  112. else
  113. {
  114. $db->rollback();
  115. dol_print_error($db);
  116. }
  117. }
  118. // Reconcile
  119. if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action == 'setreconcile'))
  120. {
  121. $num_rel=trim($_POST["num_rel"]);
  122. $rappro=$_POST['reconciled']?1:0;
  123. // Check parameters
  124. if ($rappro && empty($num_rel))
  125. {
  126. $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountStatement"));
  127. $error++;
  128. }
  129. if (! $error)
  130. {
  131. $db->begin();
  132. $sql = "UPDATE ".MAIN_DB_PREFIX."bank";
  133. $sql.= " SET num_releve=".($num_rel?"'".$num_rel."'":"null");
  134. if (empty($num_rel)) $sql.= ", rappro = 0";
  135. else $sql.=", rappro = ".$rappro;
  136. $sql.= " WHERE rowid = ".$rowid;
  137. dol_syslog("ligne.php sql=".$sql, LOG_DEBUG);
  138. $result = $db->query($sql);
  139. if ($result)
  140. {
  141. $mesg=$langs->trans("RecordSaved");
  142. $db->commit();
  143. }
  144. else
  145. {
  146. $db->rollback();
  147. dol_print_error($db);
  148. }
  149. }
  150. }
  151. /*
  152. * View
  153. */
  154. llxHeader();
  155. // On initialise la liste des categories
  156. $sql = "SELECT rowid, label";
  157. $sql.= " FROM ".MAIN_DB_PREFIX."bank_categ";
  158. $sql.= " ORDER BY label";
  159. $result = $db->query($sql);
  160. if ($result)
  161. {
  162. $var=True;
  163. $num = $db->num_rows($result);
  164. $i = 0;
  165. $options = "<option value=\"0\" selected=\"true\">&nbsp;</option>";
  166. while ($i < $num)
  167. {
  168. $obj = $db->fetch_object($result);
  169. $options .= "<option value=\"$obj->rowid\">$obj->label</option>\n";
  170. $i++;
  171. }
  172. $db->free($result);
  173. }
  174. $var=False;
  175. $h=0;
  176. $head[$h][0] = DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$_GET["rowid"];
  177. $head[$h][1] = $langs->trans('Card');
  178. $hselected=$h;
  179. $h++;
  180. $head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$_GET["rowid"];
  181. $head[$h][1] = $langs->trans("Info");
  182. $h++;
  183. dol_fiche_head($head, $hselected, $langs->trans('LineRecord'),0,'account');
  184. dol_htmloutput_mesg($mesg);
  185. $sql = "SELECT b.rowid,b.dateo as do,b.datev as dv, b.amount, b.label, b.rappro,";
  186. $sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, b.fk_account, b.fk_bordereau as receiptid,";
  187. $sql.= " b.emetteur,b.banque";
  188. $sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
  189. $sql.= " WHERE rowid=".$rowid;
  190. $sql.= " ORDER BY dateo ASC";
  191. $result = $db->query($sql);
  192. if ($result)
  193. {
  194. $i = 0; $total = 0;
  195. if ($db->num_rows($result))
  196. {
  197. $objp = $db->fetch_object($result);
  198. $total = $total + $objp->amount;
  199. $acct=new Account($db);
  200. $acct->fetch($objp->fk_account);
  201. $account = $acct->id;
  202. $bankline = new AccountLine($db);
  203. $bankline->fetch($rowid,$ref);
  204. $links=$acct->get_url($rowid);
  205. $bankline->load_previous_next_ref('','rowid');
  206. // Confirmations
  207. if ($action == 'delete_categ')
  208. {
  209. $ret=$form->form_confirm("ligne.php?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1);
  210. if ($ret == 'html') print '<br>';
  211. }
  212. print '<form name="update" method="post" action="ligne.php?rowid='.$rowid.'">';
  213. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  214. print '<input type="hidden" name="action" value="update">';
  215. print '<input type="hidden" name="orig_account" value="'.$orig_account.'">';
  216. print '<input type="hidden" name="accountid" value="'.$acct->id.'">';
  217. print '<table class="border" width="100%">';
  218. // Ref
  219. print '<tr><td width="20%">'.$langs->trans("Ref")."</td>";
  220. print '<td colspan="4">';
  221. print $form->showrefnav($bankline,'rowid','',1,'rowid','rowid');
  222. print '</td>';
  223. print '</tr>';
  224. $i++;
  225. // Bank account
  226. print "<tr><td>".$langs->trans("Account")."</td>";
  227. print '<td colspan="4">';
  228. print $acct->getNomUrl(1,'transactions');
  229. print '</td>';
  230. print '</tr>';
  231. // Show links of bank transactions
  232. if (count($links))
  233. {
  234. print "<tr><td>".$langs->trans("Links")."</td>";
  235. print '<td colspan="4">';
  236. foreach($links as $key=>$val)
  237. {
  238. if ($key) print '<br>';
  239. if ($links[$key]['type']=='payment') {
  240. print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$links[$key]['url_id'].'">';
  241. print img_object($langs->trans('ShowPayment'),'payment').' ';
  242. print $langs->trans("Payment");
  243. print '</a>';
  244. }
  245. else if ($links[$key]['type']=='payment_supplier') {
  246. print '<a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$links[$key]['url_id'].'">';
  247. print img_object($langs->trans('ShowPayment'),'payment').' ';
  248. print $langs->trans("Payment");
  249. print '</a>';
  250. }
  251. else if ($links[$key]['type']=='company') {
  252. print '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$links[$key]['url_id'].'">';
  253. print img_object($langs->trans('ShowThirdParty'),'company').' ';
  254. print $links[$key]['label'];
  255. print '</a>';
  256. }
  257. else if ($links[$key]['type']=='sc') {
  258. print '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$links[$key]['url_id'].'">';
  259. print img_object($langs->trans('ShowSocialContribution'),'bill').' ';
  260. print $langs->trans("SocialContribution").($links[$key]['label']?' - '.$links[$key]['label']:'');
  261. print '</a>';
  262. }
  263. else if ($links[$key]['type']=='payment_sc') {
  264. print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">';
  265. print img_object($langs->trans('ShowPayment'),'payment').' ';
  266. print $langs->trans("SocialContributionPayment");
  267. print '</a>';
  268. }
  269. else if ($links[$key]['type']=='payment_vat') {
  270. print '<a href="'.DOL_URL_ROOT.'/compta/tva/fiche.php?id='.$links[$key]['url_id'].'">';
  271. print img_object($langs->trans('ShowVAT'),'payment').' ';
  272. print $langs->trans("VATPayment");
  273. print '</a>';
  274. }
  275. else if ($links[$key]['type']=='member') {
  276. print '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$links[$key]['url_id'].'">';
  277. print img_object($langs->trans('ShowMember'),'user').' ';
  278. print $links[$key]['label'];
  279. print '</a>';
  280. }
  281. else if ($links[$key]['type']=='banktransfert') {
  282. print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$links[$key]['url_id'].'">';
  283. print img_object($langs->trans('ShowTransaction'),'payment').' ';
  284. print $langs->trans("TransactionOnTheOtherAccount");
  285. print '</a>';
  286. }
  287. else {
  288. print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
  289. print img_object('','generic').' ';
  290. print $links[$key]['label'];
  291. print '</a>';
  292. }
  293. }
  294. print '</td></tr>';
  295. }
  296. $rowspan=0;
  297. //$user->rights->banque->modifier=false;
  298. //$user->rights->banque->consolidate=true;
  299. // Type of payment / Number
  300. print "<tr><td>".$langs->trans("Type")." / ".$langs->trans("Numero");
  301. print "</td>";
  302. if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
  303. {
  304. print '<td colspan="3">';
  305. print $form->select_types_paiements($objp->fk_type,"value",'',2);
  306. print '<input type="text" class="flat" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">';
  307. if ($objp->receiptid)
  308. {
  309. include_once(DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php');
  310. $receipt=new RemiseCheque($db);
  311. $receipt->fetch($objp->receiptid);
  312. print ' &nbsp; &nbsp; '.$langs->trans("CheckReceipt").': '.$receipt->getNomUrl(2);
  313. }
  314. print '</td>';
  315. $rowspan=7;
  316. print '<td align="center" rowspan="'.$rowspan.'" width="20%"><input type="submit" class="button" value="'.$langs->trans("Update").'">';
  317. print '</td>';
  318. }
  319. else
  320. {
  321. print '<td colspan="4">'.$objp->fk_type.' '.$objp->num_chq.'</td>';
  322. }
  323. print "</tr>";
  324. // Bank of cheque
  325. print "<tr><td>".$langs->trans("Bank")."</td>";
  326. if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
  327. {
  328. print '<td colspan="3">';
  329. print '<input type="text" class="flat" size="40" name="banque" value="'.(empty($objp->banque) ? '' : $objp->banque).'">';
  330. print '</td>';
  331. }
  332. else
  333. {
  334. print '<td colspan="'.($rowspan?'3':'4').'">'.$objp->banque.'</td>';
  335. }
  336. print "</tr>";
  337. // Transmitter
  338. print "<tr><td>".$langs->trans("CheckTransmitter")."</td>";
  339. if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
  340. {
  341. print '<td colspan="3">';
  342. print '<input type="text" class="flat" size="40" name="emetteur" value="'.(empty($objp->emetteur) ? '' : stripslashes($objp->emetteur)).'">';
  343. print '</td>';
  344. }
  345. else
  346. {
  347. print '<td colspan="'.($rowspan?'3':'4').'">'.$objp->emetteur.'</td>';
  348. }
  349. print "</tr>";
  350. // Date ope
  351. print '<tr><td>'.$langs->trans("DateOperation").'</td>';
  352. if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
  353. {
  354. print '<td colspan="3">';
  355. print $form->select_date($db->jdate($objp->do),'dateo','','','','update',1,0,1,$objp->rappro);
  356. print '</td>';
  357. }
  358. else
  359. {
  360. print '<td colspan="'.($rowspan?'3':'4').'">';
  361. print dol_print_date($db->jdate($objp->do),"day");
  362. print '</td>';
  363. }
  364. print '</tr>';
  365. // Value date
  366. print "<tr><td>".$langs->trans("DateValue")."</td>";
  367. if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
  368. {
  369. print '<td colspan="3">';
  370. print $form->select_date($db->jdate($objp->dv),'datev','','','','update',1,0,1,$objp->rappro);
  371. if (! $objp->rappro)
  372. {
  373. print ' &nbsp; ';
  374. print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;account='.$_GET["account"].'&amp;rowid='.$objp->rowid.'">';
  375. print img_edit_remove() . "</a> ";
  376. print '<a href="'.$_SERVER['PHP_SELF'].'?action=dvnext&amp;account='.$_GET["account"].'&amp;rowid='.$objp->rowid.'">';
  377. print img_edit_add() ."</a>";
  378. }
  379. print '</td>';
  380. }
  381. else
  382. {
  383. print '<td colspan="'.($rowspan?'3':'4').'">';
  384. print dol_print_date($db->jdate($objp->dv),"day");
  385. print '</td>';
  386. }
  387. print "</tr>";
  388. // Description
  389. print "<tr><td>".$langs->trans("Label")."</td>";
  390. if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
  391. {
  392. print '<td colspan="3">';
  393. print '<input name="label" class="flat" '.($objp->rappro?' disabled="disabled"':'').' value="';
  394. if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
  395. {
  396. // Label generique car entre parentheses. On l'affiche en le traduisant
  397. print $langs->trans($reg[1]);
  398. }
  399. else
  400. {
  401. print $objp->label;
  402. }
  403. print '" size="50">';
  404. print '</td>';
  405. }
  406. else
  407. {
  408. print '<td colspan="'.($rowspan?'3':'4').'">';
  409. if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
  410. {
  411. // Label generique car entre parentheses. On l'affiche en le traduisant
  412. print $langs->trans($reg[1]);
  413. }
  414. else
  415. {
  416. print $objp->label;
  417. }
  418. print '</td>';
  419. }
  420. print '</tr>';
  421. // Amount
  422. print "<tr><td>".$langs->trans("Amount")."</td>";
  423. if ($user->rights->banque->modifier)
  424. {
  425. print '<td colspan="3">';
  426. print '<input name="amount" class="flat" size="10" '.($objp->rappro?' disabled="disabled"':'').' value="'.price($objp->amount).'"> '.$langs->trans("Currency".$conf->monnaie);
  427. print '</td>';
  428. }
  429. else
  430. {
  431. print '<td colspan="'.($rowspan?'3':'4').'">';
  432. print price($objp->amount);
  433. print '</td>';
  434. }
  435. print "</tr>";
  436. print "</table>";
  437. print "</form>";
  438. // Releve rappro
  439. if ($acct->canBeConciliated() > 0) // Si compte rapprochable
  440. {
  441. print '<br>'."\n";
  442. print_fiche_titre($langs->trans("Reconciliation"),'','');
  443. print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
  444. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  445. print '<input type="hidden" name="action" value="setreconcile">';
  446. print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
  447. print '<table class="border" width="100%">';
  448. print '<tr><td width="20%">'.$langs->trans("Conciliation")."</td>";
  449. if ($user->rights->banque->consolidate)
  450. {
  451. print '<td colspan="3">';
  452. if ($objp->rappro)
  453. {
  454. print $langs->trans("AccountStatement").' <input name="num_rel_bis" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro?' disabled="disabled"':'').'>';
  455. print '<input name="num_rel" type="hidden" value="'.$objp->num_releve.'">';
  456. }
  457. else
  458. {
  459. print $langs->trans("AccountStatement").' <input name="num_rel" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro?' disabled="disabled"':'').'>';
  460. }
  461. print '</td><td align="center" rowspan="2" width="20%"><input type="submit" class="button" value="'.$langs->trans("Update").'"></td>';
  462. }
  463. else
  464. {
  465. print '<td colspan="4">'.$objp->num_releve.'&nbsp;</td>';
  466. }
  467. print '</tr>';
  468. print "<tr><td>".$langs->trans("BankLineConciliated")."</td>";
  469. if ($user->rights->banque->consolidate)
  470. {
  471. print '<td colspan="3">';
  472. print '<input type="checkbox" name="reconciled" class="flat" '.(isset($_POST["reconciled"])?($_POST["reconciled"]?' checked="checked"':''):($objp->rappro?' checked="checked"':'')).'">';
  473. print '</td>';
  474. }
  475. else
  476. {
  477. print '<td colspan="4">'.yn($objp->rappro).'</td>';
  478. }
  479. print '</tr>';
  480. print "</table>";
  481. print '</form>';
  482. }
  483. }
  484. $db->free($result);
  485. }
  486. else dol_print_error($db);
  487. print '</div>';
  488. // List of bank categories
  489. print '<br>';
  490. print '<table class="noborder" width="100%">';
  491. print "<form method=\"post\" action=\"ligne.php?rowid=$rowid&amp;account=$account\">";
  492. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  493. print "<input type=\"hidden\" name=\"action\" value=\"class\">";
  494. print "<input type=\"hidden\" name=\"orig_account\" value=\"".$orig_account."\">";
  495. print "<tr class=\"liste_titre\"><td>".$langs->trans("Rubriques")."</td><td colspan=\"2\">";
  496. print "<select class=\"flat\" name=\"cat1\">".$options."</select>&nbsp;";
  497. print '<input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
  498. print "</tr>";
  499. print "</form>";
  500. $sql = "SELECT c.label, c.rowid";
  501. $sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c";
  502. $sql.= " WHERE a.lineid=".$rowid." AND a.fk_categ = c.rowid";
  503. $sql.= " ORDER BY c.label";
  504. $result = $db->query($sql);
  505. if ($result)
  506. {
  507. $var=True;
  508. $num = $db->num_rows($result);
  509. $i = 0; $total = 0;
  510. while ($i < $num)
  511. {
  512. $objp = $db->fetch_object($result);
  513. $var=!$var;
  514. print "<tr ".$bc[$var].">";
  515. print "<td>".$objp->label."</td>";
  516. print "<td align=\"center\"><a href=\"budget.php?bid=".$objp->rowid."\">".$langs->trans("ListBankTransactions")."</a></td>";
  517. if ($user->rights->banque->modifier)
  518. {
  519. print "<td align=\"right\"><a href=\"ligne.php?action=delete_categ&amp;rowid=".$rowid."&amp;fk_categ=$objp->rowid\">".img_delete($langs->trans("Remove"))."</a></td>";
  520. }
  521. print "</tr>";
  522. $i++;
  523. }
  524. $db->free($result);
  525. }
  526. print "</table>";
  527. $db->close();
  528. llxFooter();
  529. ?>