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

/html.php

https://gitlab.com/vado/scadi
PHP | 1729 lines | 1496 code | 170 blank | 63 comment | 109 complexity | a87a270e071aac4140a3457bc006c73a MD5 | raw file
  1. <?php
  2. //-------------------------------------------------------
  3. function taulaResumComanda() //llista cac
  4. {
  5. global $mPars,$rutaStr,$mParametres;
  6. if($mPars['grup_id']==0)
  7. {
  8. echo "
  9. <p style='font-size:10px;'>* Resum del total reservat segons el % MS dels productors:
  10. <br>
  11. (s'apliquen els filtres seleccionats)
  12. </p>
  13. ";
  14. }
  15. else
  16. {
  17. echo "
  18. <p style='font-size:10px;'>* Resum del total de la comanda segons el % MS dels productors:
  19. <br>
  20. (no s'apliquen els filtres seleccionats)</p>
  21. ";
  22. }
  23. echo "
  24. <table border='0' cellspacing='1' cellpadding='1' align='center' style='width:400px;'>
  25. <tr>
  26. <th align='right' bgcolor='#D1FABB' style='width:50%; '>
  27. </th>
  28. <th align='right' bgcolor='#D1FABB' style='width:10%; '>
  29. <p></p>
  30. </th>
  31. <th align='right' bgcolor='#D1FABB' style='width:13%; '>
  32. <p>ums</p>
  33. </th>
  34. <th bgcolor='#D1FABB' align='right' style='width:13%; '>
  35. <p>Ecos</p>
  36. </th>
  37. <th bgcolor='#D1FABB' align='right' style='width:13%;'>
  38. <p>Euros</p>
  39. </th>
  40. </tr>
  41. <tr>
  42. <td bgcolor='#EDF8E6' align='left'>
  43. <a title=\"Cost Transport Extern per kg sobre el producte\"><p style='font-size:11px;'>&nbsp;(CTEK)</p></a>
  44. </td>
  45. <td bgcolor='#EDF8E6' align='right'>
  46. </td>
  47. <td bgcolor='#EDF8E6' align='right' id='td_totalCtekUnitats'>
  48. <p>0</p>
  49. </td>
  50. <td bgcolor='#EDF8E6' align='right' id='td_totalCtekEcos' >
  51. <p>0</p>
  52. </td>
  53. <td bgcolor='#EDF8E6' align='right' id='td_totalCtekEuros' >
  54. <p>0</p>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td bgcolor='#EDF8E6' align='left'>
  59. <a title=\"Cost Transport Extern Repartit\"><p style='font-size:11px;'>&nbsp;(CTER)</p></a>
  60. </td>
  61. <td bgcolor='#EDF8E6' align='right' >
  62. </td>
  63. <td bgcolor='#EDF8E6' align='right' id='td_totalCterUnitats' >
  64. <p>0</p>
  65. </td>
  66. <td bgcolor='#EDF8E6' align='right' id='td_totalCterEcos' >
  67. <p>0</p>
  68. </td>
  69. <td bgcolor='#EDF8E6' align='right' id='td_totalCterEuros' >
  70. <p>0</p>
  71. </td>
  72. </tr>
  73. <tr>
  74. <td bgcolor='#EDF8E6' align='left'>
  75. <a title=\"Cost Transport Intern per kg sobre el producte\"><p style='font-size:11px;'>&nbsp;(CTIK)</p></a>
  76. </td>
  77. <td bgcolor='#EDF8E6' align='right' style='width:10%;'>
  78. </td>
  79. <td bgcolor='#EDF8E6' align='right' id='td_totalCtikUnitats' >
  80. <p>0</p>
  81. </td>
  82. <td bgcolor='#EDF8E6' align='right' id='td_totalCtikEcos'>
  83. <p>0</p>
  84. </td>
  85. <td bgcolor='#EDF8E6' align='right' id='td_totalCtikEuros'>
  86. <p>0</p>
  87. </td>
  88. </tr>
  89. <tr>
  90. <td bgcolor='#EDF8E6' align='left'>
  91. <a title=\"Cost Transport Intern Repartit\"><p style='font-size:11px;'>&nbsp;(CTIR)</p></a>
  92. </td>
  93. <td bgcolor='#EDF8E6' align='right' style='width:10%;'>
  94. </td>
  95. <td bgcolor='#EDF8E6' align='right' id='td_totalCtirUnitats'>
  96. <p>0</p>
  97. </td>
  98. <td bgcolor='#EDF8E6' align='right' id='td_totalCtirEcos' >
  99. <p>0</p>
  100. </td>
  101. <td bgcolor='#EDF8E6' align='right' id='td_totalCtirEuros'>
  102. <p>0</p>
  103. </td>
  104. </tr>
  105. <tr>
  106. <td bgcolor='#D1FABB' align='left'>
  107. <a title=\"Total Cost Transport Productes CAC\"><p style='font-size:11px;'>&nbsp;Total Cost Transport (CAC)</p></a>
  108. </td>
  109. <td bgcolor='#D1FABB' align='right' style='width:10%;'>
  110. </td>
  111. <th bgcolor='#D1FABB' align='right' id='td_totalCostTransportUnitats'>
  112. <p>0</p>
  113. </th>
  114. <th bgcolor='#D1FABB' align='right' id='td_totalCostTransportEcos'>
  115. <p>0</p>
  116. </th>
  117. <th bgcolor='#D1FABB' align='right' id='td_totalCostTransportEuros'>
  118. <p>0</p>
  119. </th>
  120. </tr>
  121. <tr>
  122. <td bgcolor='#EDF8E6' align='left'>
  123. <a title=\"Total kg\"><p style='font-size:11px;'>&nbsp;Total kg</p></a>
  124. </td>
  125. <td bgcolor='#EDF8E6' align='right' id='td_totalQuantitat' >
  126. <p>0</p>
  127. </td>
  128. <td bgcolor='#EDF8E6' >
  129. </td>
  130. <td bgcolor='#EDF8E6' align='right'>
  131. </td>
  132. <td bgcolor='#EDF8E6' align='right'>
  133. </td>
  134. </tr>
  135. <tr>
  136. <td bgcolor='#D1FABB' align='left'>
  137. <a title=\"Preu productes CAC\"><p style='font-size:11px;'>&nbsp;<b>Preu productes CAC</b></p></a>
  138. </td>
  139. <td bgcolor='#D1FABB' align='right'>
  140. </td>
  141. <th bgcolor='#D1FABB' align='right' id='td_totalUnitats'>
  142. <p>0</p>
  143. </th>
  144. <th bgcolor='#D1FABB' align='right' id='td_totalEcos'>
  145. <p>0</p>
  146. </th>
  147. <th bgcolor='#D1FABB' align='right' id='td_totalEuros'>
  148. <p>0</p>
  149. </th>
  150. </tr>
  151. <tr>
  152. <td bgcolor='#C0FAF8' align='left'>
  153. <a title=\"Fons Despeses CAC (".$mParametres['FDCpp']['valor']."% sobre preus, ".$mParametres['msFDCpp']['valor']."% MS)\"><p style='font-size:11px;'>&nbsp;<b>Fons despeses CAC</b></p></a>
  154. </td>
  155. <td bgcolor='#C0FAF8' align='right'>
  156. </td>
  157. <th bgcolor='#C0FAF8' align='right' id='td_totalUnitatsFDC'>
  158. <p>0</p>
  159. </th>
  160. <th bgcolor='#C0FAF8' align='right' id='td_totalEcosFDC'>
  161. <p>0</p>
  162. </th>
  163. <th bgcolor='#C0FAF8' align='right' id='td_totalEurosFDC'>
  164. <p>0</p>
  165. </th>
  166. </tr>
  167. <tr>
  168. <td bgcolor='#EDF8E6' align='left'>
  169. <a title=\"Total kg Intercanvis entre Rebosts\"><p style='font-size:11px;'>&nbsp;<b>kg Inter-Rebosts</b></p></a>
  170. </td>
  171. <td bgcolor='#EDF8E6' align='right' id='td_totalKgIntercanvisRebosts'>
  172. <p>0</p>
  173. </td>
  174. <td bgcolor='#EDF8E6' align='right' style='width:10%;'>
  175. </td>
  176. <td bgcolor='#EDF8E6' align='right'><p>&nbsp;</p></td>
  177. <td bgcolor='#EDF8E6' align='right' ><p>&nbsp;</p></td>
  178. </tr>
  179. <tr>
  180. <th bgcolor='#D1FABB' align='left'>
  181. <a title=\"Cost transport Intercanvis entre Rebosts\"><p style='font-size:11px;'>&nbsp;<b>Cost Transp. Inter-Rebosts</b></p></a>
  182. </th>
  183. <th bgcolor='#D1FABB' align='right' style='width:10%;'>
  184. </th>
  185. <th bgcolor='#D1FABB' align='right' id='td_totalCostTransportIntercanvisRebostsUnitats'><p>&nbsp;</p></th>
  186. <th bgcolor='#D1FABB' align='right' id='td_totalCostTransportIntercanvisRebostsEcos'><p>&nbsp;</p></th>
  187. <th bgcolor='#D1FABB' align='right' id='td_totalCostTransportIntercanvisRebostsEuros'><p>&nbsp;</p></th>
  188. </tr>
  189. <tr>
  190. <th bgcolor='#D1FABB' align='right'>
  191. <a title=\"Import Total\"><p style='font-size:11px;'>&nbsp;<b>Import Total</b></p></a>
  192. </th>
  193. <td bgcolor='#D1FABB' align='right' ' >
  194. <p></p>
  195. </td>
  196. <th bgcolor='#D1FABB' align='right' id='td_totalFacturaUnitats' >
  197. </th>
  198. <th bgcolor='#D1FABB' align='right' id='td_totalFacturaEcos' >
  199. </th>
  200. <th bgcolor='#D1FABB' align='right' id='td_totalFacturaEuros' >
  201. </th>
  202. </tr>
  203. <tr>
  204. <td bgcolor='#D1FABB' align='right' id='td_pcMs'>
  205. <a title=\"% moneda social de la comanda, segons la moneda social dels productes demanats\"><p style='font-size:11px;'>&nbsp;</p></a>
  206. </td>
  207. <td bgcolor='#D1FABB' align='right' >
  208. </td>
  209. <td bgcolor='#D1FABB' align='right' style='width:10%;' >
  210. </td>
  211. <td bgcolor='#D1FABB' >
  212. </td>
  213. <td bgcolor='#D1FABB' >
  214. </td>
  215. </tr>
  216. </table>
  217. ";
  218. return;
  219. }
  220. //-------------------------------------------------------
  221. function taulaResumComandaLocal()
  222. {
  223. global $rutaStr,$mPropietatsPeriodeLocal;
  224. echo "
  225. <p> Resum de la comanda segons el % MS dels productors:</p>
  226. <table border='0' cellspacing='1' cellpadding='1' align='center' style='width:400px;'>
  227. <tr>
  228. <th align='right' bgcolor='#D1FABB' style='width:50%; '>
  229. </th>
  230. <th align='right' bgcolor='#D1FABB' style='width:10%; '>
  231. <p></p>
  232. </th>
  233. <th align='right' bgcolor='#D1FABB' style='width:13%; '>
  234. <p>ums</p>
  235. </th>
  236. <th bgcolor='#D1FABB' align='right' style='width:13%; '>
  237. <p>Ecos</p>
  238. </th>
  239. <th bgcolor='#D1FABB' align='right' style='width:13%;'>
  240. <p>Euros</p>
  241. </th>
  242. </tr>
  243. ";
  244. /*
  245. echo "
  246. <tr>
  247. <td bgcolor='#EDF8E6' align='left'>
  248. <a title=\"Cost Transport Intern per kg sobre el producte\"><p style='font-size:11px;'>&nbsp;(CTIK)</p></a>
  249. </td>
  250. <td bgcolor='#EDF8E6' align='right' style='width:10%;'>
  251. </td>
  252. <td bgcolor='#EDF8E6' align='right' id='td_totalCtikUnitats' >
  253. <p>0</p>
  254. </td>
  255. <td bgcolor='#EDF8E6' align='right' id='td_totalCtikEcos'>
  256. <p>0</p>
  257. </td>
  258. <td bgcolor='#EDF8E6' align='right' id='td_totalCtikEuros'>
  259. <p>0</p>
  260. </td>
  261. </tr>
  262. ";
  263. */
  264. echo "
  265. <tr>
  266. <td bgcolor='#D1FABB' align='left'>
  267. <a title=\"Total Cost Transport Productes\"><p style='font-size:11px;'>&nbsp;Total Cost Transport</p></a>
  268. </td>
  269. <td bgcolor='#D1FABB' align='right' style='width:10%;'>
  270. </td>
  271. <th bgcolor='#D1FABB' align='right' id='td_totalCostTransportUnitats'>
  272. <p>0</p>
  273. </th>
  274. <th bgcolor='#D1FABB' align='right' id='td_totalCostTransportEcos'>
  275. <p>0</p>
  276. </th>
  277. <th bgcolor='#D1FABB' align='right' id='td_totalCostTransportEuros'>
  278. <p>0</p>
  279. </th>
  280. </tr>
  281. <tr>
  282. <td bgcolor='#EDF8E6' align='left'>
  283. <a title=\"Total kg\"><p style='font-size:11px;'>&nbsp;Total kg</p></a>
  284. </td>
  285. <td bgcolor='#EDF8E6' align='right' id='td_totalQuantitat' >
  286. <p>0</p>
  287. </td>
  288. <td bgcolor='#EDF8E6' >
  289. </td>
  290. <td bgcolor='#EDF8E6' align='right'>
  291. </td>
  292. <td bgcolor='#EDF8E6' align='right'>
  293. </td>
  294. </tr>
  295. <tr>
  296. <td bgcolor='#D1FABB' align='left'>
  297. <a title=\"Preu productes\"><p style='font-size:11px;'>&nbsp;<b>Preu productes</b></p></a>
  298. </td>
  299. <td bgcolor='#D1FABB' align='right'>
  300. </td>
  301. <th bgcolor='#D1FABB' align='right' id='td_totalUnitats'>
  302. <p>0</p>
  303. </th>
  304. <th bgcolor='#D1FABB' align='right' id='td_totalEcos'>
  305. <p>0</p>
  306. </th>
  307. <th bgcolor='#D1FABB' align='right' id='td_totalEuros'>
  308. <p>0</p>
  309. </th>
  310. </tr>
  311. <tr>
  312. <td bgcolor='#C0FAF8' align='left'>
  313. <p style='font-size:11px;'>&nbsp;Fons despeses Grup:<br>
  314. (".$mPropietatsPeriodeLocal['fdLocal']."% sobre preus, ".$mPropietatsPeriodeLocal['ms_fdLocal']."% MS)</p>
  315. </td>
  316. <td bgcolor='#C0FAF8' align='right'>
  317. </td>
  318. <th bgcolor='#C0FAF8' align='right' id='td_totalUnitatsFDC'>
  319. <p>0</p>
  320. </th>
  321. <th bgcolor='#C0FAF8' align='right' id='td_totalEcosFDC'>
  322. <p>0</p>
  323. </th>
  324. <th bgcolor='#C0FAF8' align='right' id='td_totalEurosFDC'>
  325. <p>0</p>
  326. </th>
  327. </tr>
  328. <tr>
  329. <th bgcolor='#D1FABB' align='right'>
  330. <a title=\"Import Total\"><p style='font-size:11px;'>&nbsp;<b>Import Total</b></p></a>
  331. </th>
  332. <td bgcolor='#D1FABB' align='right' ' >
  333. <p></p>
  334. </td>
  335. <th bgcolor='#D1FABB' align='right' id='td_totalFacturaUnitats' >
  336. </th>
  337. <th bgcolor='#D1FABB' align='right' id='td_totalFacturaEcos' >
  338. </th>
  339. <th bgcolor='#D1FABB' align='right' id='td_totalFacturaEuros' >
  340. </th>
  341. </tr>
  342. <tr>
  343. <td bgcolor='#D1FABB' align='right' id='td_pcMs'>
  344. <a title=\"% moneda social de la comanda, segons la moneda social dels productes demanats\"><p style='font-size:11px;'>&nbsp;</p></a>
  345. </td>
  346. <td bgcolor='#D1FABB' align='right' >
  347. </td>
  348. <td bgcolor='#D1FABB' align='right' style='width:10%;' >
  349. </td>
  350. <td bgcolor='#D1FABB' >
  351. </td>
  352. <td bgcolor='#D1FABB' >
  353. </td>
  354. </tr>
  355. </table>
  356. ";
  357. return;
  358. }
  359. //------------------------------------------------------------------------------
  360. function taulaEinesGrups()
  361. {
  362. global $mAjuda,
  363. $mPars,
  364. $mRebost,
  365. $mProductors,
  366. $mCategories,
  367. $mSubCategories,
  368. $mEtiquetes,
  369. $mColors,
  370. $colorLlista;
  371. echo "
  372. <table style='width:100%;' align='center'>
  373. <tr>
  374. <td align='center' valign='bottom' style='width:16.66%;'>
  375. <table>
  376. <tr>
  377. <td><p>cercador 'id':</b>".(html_ajuda1('html.php',34))."</p>
  378. <input id='i_cercarProducteId' type='text' size='6' value='".$mPars['crPrId']."'>
  379. <input type='button' onClick=\"javascript:if(checkCercarProdId()){enviarFpars('comandes.php?crPrId='+cercarProdId,'_self');}\" value='cercar'>
  380. </td>
  381. </tr>
  382. </table>
  383. </td>
  384. <td align='center' valign='bottom' style='width:16.66%;'>
  385. <table>
  386. <tr>
  387. <td><p>cercador text:</b>".(html_ajuda1('html.php',35))."</p>
  388. ";
  389. if($mPars['crPrText']!='')
  390. {
  391. $bgcolor='orange';
  392. }
  393. else
  394. {
  395. $bgcolor='white';
  396. }
  397. echo "
  398. <input id='i_cercarProducteText' type='text' size='10' style='background-color:".$bgcolor."' value='".(urldecode($mPars['crPrText']))."'>
  399. <input type='button' onClick=\"javascript:if(checkCercarProdText()){enviarFpars('comandes.php?crPrText='+cercarProdText,'_self');}\" value='cercar'>
  400. </td>
  401. </tr>
  402. </table>
  403. </td>
  404. <td align='center' valign='bottom' style='width:16.66%;'>
  405. <table>
  406. <tr>
  407. <td>
  408. <select id='sel_vProductor' onChange=\"javascript: f_vistaProductor();\">
  409. ";
  410. $selected='';
  411. $selected2='selected';
  412. while(list($key,$mProductor)=each($mProductors))
  413. {
  414. //v37- condicio
  415. if($mPars['selLlistaId']==0)
  416. {
  417. if($mPars['vProductor']==$mProductor['id']){$selected='selected';$selected2='';}else{$selected='';}
  418. if($mProductor['estat']=='1')
  419. {
  420. echo "
  421. <option ".$selected." value='".$mProductor['id']."'>".(urldecode($mProductor['projecte']))."</option>
  422. ";
  423. }
  424. }
  425. else
  426. {
  427. if(@substr_count($mRebost['productors_associats'],','.$mProductor['id'].',')>0)
  428. {
  429. if($mPars['vProductor']==$mProductor['id']){$selected='selected';$selected2='';}else{$selected='';}
  430. if($mProductor['estat']=='1')
  431. {
  432. echo "
  433. <option ".$selected." value='".$mProductor['id']."'>".(urldecode($mProductor['projecte']))."</option>
  434. ";
  435. }
  436. }
  437. }
  438. }
  439. echo "
  440. <option ".$selected2." value='TOTS'>- tots els productors -</option>
  441. ";
  442. reset($mProductors);
  443. echo "
  444. </select>
  445. </td>
  446. <td>
  447. ".(html_ajuda1('html.php',1))."
  448. </td>
  449. </tr>
  450. </table>
  451. ";
  452. /*
  453. echo "
  454. <td align='center' valign='bottom' style='width:17%;'>
  455. <select id='sel_vCategoria' onChange=\"javascript: f_vistaCategoria();\">
  456. ";
  457. $selected='';
  458. $selected2='selected';
  459. while(list($key,$categoria)=each($mCategories))
  460. {
  461. if($mPars['vCategoria']==$categoria){$selected='selected';$selected2='';}else{$selected='';}
  462. echo "
  463. <option ".$selected." value='".$categoria."'>".$categoria."</option>
  464. ";
  465. }
  466. echo "
  467. <option ".$selected2." value='TOTS'>- totes les categories -</option>
  468. ";
  469. reset($mCategories);
  470. echo "
  471. </select>
  472. ".(html_ajuda1($mAjuda['html.php'][16]))."
  473. </td>
  474. ";
  475. */
  476. echo "
  477. <td align='center' valign='bottom' style='width:16.66;'>
  478. <table>
  479. <tr>
  480. <td>
  481. <select id='sel_vSubCategoria' onChange=\"javascript: f_vistaSubCategoria();\">
  482. ";
  483. $disabled='disabled';
  484. $selected='';
  485. $selected2='selected';
  486. while(list($key,$mSubCategoria)=each($mSubCategories))
  487. {
  488. if($mPars['vSubCategoria']==$mSubCategoria['categoria0'].'-'.$mSubCategoria['categoria10']){$selected='selected';$selected2='';}else{$selected='';}
  489. if($mSubCategoria['estoc_previst']>0){$disabled='';}else{$disabled='disabled';}
  490. echo "
  491. <option ".$selected." ".$disabled." value='".$mSubCategoria['categoria0'].'-'.$mSubCategoria['categoria10']."'>".$mSubCategoria['categoria0'].'-'.$mSubCategoria['categoria10']."</option>
  492. ";
  493. }
  494. echo "
  495. <option ".$selected2." value='TOTS'>- totes les SUB-categories -</option>
  496. ";
  497. reset($mSubCategories);
  498. echo "
  499. </select>
  500. </td>
  501. <td>
  502. ".(html_ajuda1('html.php',2))."
  503. </td>
  504. </tr>
  505. </table>
  506. </td>
  507. <td align='left' valign='bottom' style='width:16.66;'>
  508. <table>
  509. <tr>
  510. <td>
  511. <select id='sel_etiqueta' onChange=\"javascript: f_vistaEtiqueta();\">
  512. ";
  513. $selected='';
  514. $selected2='selected';
  515. while(list($key,$mEtiqueta)=each($mEtiquetes))
  516. {
  517. if($mPars['etiqueta']==$mEtiqueta['nom']){$selected='selected';$selected2='';}else{$selected='';}
  518. echo "
  519. <option style='color:".$mEtiqueta['color'].";' ".$selected." value='".$mEtiqueta['nom']."'>".$mEtiqueta['nom']."</option>
  520. ";
  521. }
  522. echo "
  523. <option ".$selected2." value='TOTS'>- cap etiqueta -</option>
  524. ";
  525. reset($mEtiquetes);
  526. echo "
  527. </select>
  528. </td>
  529. <td>
  530. ".(html_ajuda1('html.php',3))."
  531. </td>
  532. </tr>
  533. </table>
  534. </td>
  535. <td align='center' valign='bottom' style='width:16.66;'>
  536. <table>
  537. <tr>
  538. <td>
  539. <select id='sel_etiqueta2' onChange=\"javascript: f_vistaEtiqueta2();\">
  540. ";
  541. $selected='';
  542. $selected2='selected';
  543. while(list($key,$mEtiqueta)=each($mEtiquetes))
  544. {
  545. if($mPars['etiqueta2']==$mEtiqueta['nom']){$selected='selected';$selected2='';}else{$selected='';}
  546. echo "
  547. <option ".$selected." style='color:".$mEtiqueta['color'].";' value='".$mEtiqueta['nom']."'>".$mEtiqueta['nom']."</option>
  548. ";
  549. }
  550. echo "
  551. <option ".$selected2." value='CAP'>- cap etiqueta -</option>
  552. ";
  553. reset($mEtiquetes);
  554. echo "
  555. </select>
  556. </td>
  557. <td>
  558. ".(html_ajuda1('html.php',4))."
  559. </td>
  560. </tr>
  561. </table>
  562. </td>
  563. </tr>
  564. </table>
  565. ";
  566. return;
  567. }
  568. //------------------------------------------------------------------------------
  569. function html_selectorUsuarisGrup()
  570. {
  571. global $mPars,$mUsuarisGrupRef,$mUsuarisRef,$mAnticsUsuarisGrupAmbComanda,$mAjuda;
  572. $styleComanda='';
  573. echo "
  574. <table align='left'>
  575. <tr>
  576. <td valign='bottom'>
  577. <table><tr><td><p>Membres actuals:</p></p></td><td> ".(html_ajuda1('html.php',5))."</td></tr></table>
  578. <select onChange=\"javascript:enviarFpars('comandes.php?sUid='+this.value,'_self');\">
  579. ";
  580. $selected0='';
  581. $selected1='selected';
  582. while(list($key,$mUsuari_)=each($mUsuarisGrupRef))
  583. {
  584. if($mUsuari_['usuari']['estat']=='actiu')
  585. {
  586. if($mUsuari_['usuari']['id']==$mPars['selUsuariId']){$selected0='selected';$selected1='';}
  587. if(array_key_exists($mPars['grup_id'],$mUsuari_['comanda']))
  588. {
  589. $styleComanda=" style='color:#007700;' ";
  590. }
  591. else
  592. {
  593. $styleComanda='';
  594. }
  595. echo "
  596. <option ".$selected0." ".$styleComanda." value='".$mUsuari_['usuari']['id']."'>".(urldecode($mUsuari_['usuari']['usuari']))." (".$mUsuari_['usuari']['email'].")</option>
  597. ";
  598. $selected0='';
  599. }
  600. }
  601. reset($mUsuarisGrupRef);
  602. echo "
  603. <option ".$selected1." value='0'>- GRUP -</option>
  604. </select>
  605. </p>
  606. </td>
  607. </tr>
  608. </table>
  609. ";
  610. if(count($mAnticsUsuarisGrupAmbComanda)>0)
  611. {
  612. $styleComanda=" style='color:#007700;' ";
  613. echo "
  614. <br>
  615. <table align='left'>
  616. <tr>
  617. <td valign='bottom'>
  618. <p>Membres anteriors amb comanda:
  619. <select onChange=\"javascript:val=this.value; if(val!=''){enviarFpars('comandes.php?sUid='+this.value,'_self');}\">
  620. ";
  621. $selected0='';
  622. $selected1='selected';
  623. $estat='';
  624. while(list($key,$mUsuari_)=each($mAnticsUsuarisGrupAmbComanda))
  625. {
  626. if($mUsuari_['usuari']['estat']=='inactiu'){$estat='[inactiu]';}else{$estat='';}
  627. if($mUsuari_['usuari']['id']==$mPars['selUsuariId']){$selected0='selected';$selected1='';}
  628. echo "
  629. <option ".$selected0." ".$styleComanda." value='".$mUsuari_['usuari']['id']."'>".(urldecode($mUsuari_['usuari']['usuari']))." (".$mUsuari_['usuari']['email'].")".$estat."</option>
  630. ";
  631. $selected0='';
  632. }
  633. reset($mAnticsUsuarisGrupAmbComanda);
  634. echo "
  635. <option ".$selected1." value='0'>- GRUP -</option>
  636. </select>
  637. </p>
  638. </td>
  639. </tr>
  640. </table>
  641. ";
  642. }
  643. return;
  644. }
  645. //------------------------------------------------------------------------------
  646. function html_triaGrup()
  647. {
  648. global $mGrupsUsuari,$mPars,$parsChain;
  649. echo "
  650. <form id='f_grup' name='f_grup' action='comandes.php' target='_blank' method='post'>
  651. <table align='center' width='100%'>
  652. <tr>
  653. <td align='left' valign='bottom' width='50%'>
  654. <p>Selecciona un dels teus grups:<br>
  655. <select name='sel_grupUsuari' onChange=\"javascript: document.getElementById('f_grup').submit();\">
  656. ";
  657. $selected1='';
  658. $selected2='selected';
  659. $selected3='';
  660. while(list($grupId,$mGrupUsuari)=each($mGrupsUsuari))
  661. {
  662. if($mPars['grup_id']!=0)
  663. {
  664. if($grupId==$mPars['grup_id']){$selected1='selected'; $selected2=''; $selected3='';}else{$selected1='';}
  665. }
  666. echo "
  667. <option ".$selected1." value='".$grupId."'>".(urldecode($mGrupUsuari['nom']))."</option>
  668. ";
  669. }
  670. reset($mGrupsUsuari);
  671. if($mPars['nivell']=='sadmin' OR $mPars['nivell']=='admin' OR $mPars['nivell']=='coord')
  672. {
  673. echo "
  674. <option ".$selected2." value='0'>CAC</option>
  675. ";
  676. }
  677. echo "
  678. </select>
  679. </p>
  680. </td>
  681. </tr>
  682. </table>
  683. <input type='hidden' name='i_pars' value='".$parsChain."'>
  684. </form>
  685. ";
  686. return;
  687. }
  688. //----------------------------------------
  689. function mostrarDadesRebost($db)
  690. {
  691. global
  692. $periodeBases,
  693. $colorLlista,
  694. $mAbonamentsCarrecs,
  695. $mAjuda,
  696. $mCategoriesGrup,
  697. $mColors,
  698. $mComandaPerProductors,
  699. $mIncidencies,
  700. $mGrupsUsuari,
  701. $mGrup,
  702. $mPars,
  703. $mPeticionsGrup,
  704. $mRebosts,
  705. $mUsuarisRef,
  706. $mUsuarisGrupRef,
  707. $mParametres,
  708. $mPropietatsUsuari,
  709. $mPropietatsUsuaris,
  710. $mReservesComandes,
  711. $mPropietatsPeriodeLocal,
  712. $mRuta;
  713. echo "
  714. <table width=100%' bgcolor='".$mColors['table']."'>
  715. <tr>
  716. <td id='td_missatgeAlerta' style=' width:100%;' align='center' valign='bottom'>
  717. </td>
  718. </tr>
  719. <tr>
  720. <td id='td_recordatoriGuardarComanda' align='center' width='100%' valign='bottom'>
  721. </td>
  722. </tr>
  723. </table>
  724. <table border='0' width='100%' bgcolor='".$mColors['table']."'>
  725. <tr>
  726. <td valign='middle' align='left' width='5%'>
  727. <table align='left'>
  728. <tr>
  729. <td>
  730. <a title='Inici'><img src='imatges/casap.jpeg' ALT=\"pāgina d'usuari\" style='cursor:pointer' onClick=\"javascript: enviarFpars('index.php?us=".$mPars['usuari_id']."&pasw=".$mPars['pasw']."','_self')\"></a>
  731. </td>
  732. <td>
  733. <a title='Sortir'><img src='imatges/out2p.jpg' ALT=\"sortir\" style='cursor:pointer' onClick=\"javascript: document.getElementById('i_pars').value='';enviarFpars('index.php','_self')\"></a>
  734. </td>
  735. </tr>
  736. </table>
  737. </td>
  738. <td valign='middle' align='left' width='15%'>
  739. <p class='compacte' >
  740. Usuari:<b> ".(urldecode($mPars['usuari']))."</b> (".$mPars['nivell'].")
  741. </p>
  742. ";
  743. if(isset($mPropietatsUsuari['comissio']) && $mPropietatsUsuari['comissio']!='')
  744. {
  745. echo "
  746. <p class='p_micro2' >Comissió/oficina: ";
  747. $mComissionsUsuari=explode(',',$mPropietatsUsuari['comissio']);
  748. while(list($key,$val)=each($mComissionsUsuari))
  749. {
  750. echo "<br>".$mPropietatsUsuaris['comissio'][$val];
  751. }
  752. echo "</p>
  753. ";
  754. }
  755. else
  756. {
  757. echo "
  758. <p class='compacte' >Comissió/oficina: - CAP -</p>
  759. ";
  760. }
  761. echo "
  762. </td>
  763. <td align='middle' width='50px'>
  764. ";
  765. $mostrar=0;
  766. $botoText="guardar pre-comanda";
  767. if
  768. (
  769. $mPars['grup_id']!=0
  770. &&
  771. $mPars['nivell']!='visitant'
  772. &&
  773. (
  774. $mPars['nivell']=='admin' || $mPars['nivell']=='sadmin'
  775. ||
  776. (
  777. !$mParametres['precomandaTancada']['valor']
  778. &&
  779. (
  780. (
  781. $mPars['selUsuariId']!='0'
  782. &&
  783. $mPars['selUsuariId']==$mPars['usuari_id']
  784. )
  785. ||
  786. (
  787. $mPars['selUsuariId']!='0'
  788. &&
  789. $mPars['usuari_id']==@$mGrup['usuari_id']
  790. )
  791. ||
  792. (
  793. $mPars['selUsuariId']=='0'
  794. &&
  795. $mPars['usuari_id']==@$mGrup['usuari_id']
  796. )
  797. )
  798. )
  799. )
  800. )
  801. {
  802. if($mPars['selUsuariId']==0)
  803. {
  804. $botoText='guardar forma pagament';
  805. }
  806. if(($mPars['nivell']=='sadmin' || $mPars['nivell']=='admin') && $mParametres['precomandaTancada']['valor'])
  807. {
  808. echo "<font style='color:#FC7202; font-size:12px;'>[".$mPars['nivell']."]</font><br>";
  809. }
  810. echo "
  811. <a title='".$botoText."'><img src='imatges/guardarpp.gif' style='cursor:pointer;' onClick=\"guardarComanda();\" value='".$botoText."'></a>
  812. ";
  813. }
  814. echo "
  815. </td>
  816. ";
  817. if(@$mPars['grup_id']!=0 && (($mPars['selUsuariId']==0 && (str_replace(',','',$mGrup['productors_associats'])!='')) || selUsuariEsProductorAssociatDelGrup($db)))
  818. {
  819. echo "
  820. <td valign='bottom' width='50px'>
  821. <a title=\"productes dels productors associats al grup que es troben a l'inventari de la CAC\">
  822. <img src='imatges/productesp.gif' style='cursor:pointer;' onClick=\"enviarFpars('inventariPerProductors.php?mRef=".$mGrup['id'].'-'.$mGrup['productors_associats']."&psw=".$mPars['pasw']."','_blank');\">
  823. </a>
  824. </td>
  825. ";
  826. }
  827. //*v36-3-12-15-condicional
  828. if(
  829. count($mRuta)==1
  830. &&
  831. (
  832. $mPars['grup_id']=='0'
  833. ||
  834. (
  835. substr_count($mGrup['categoria'],'magatzem')>0
  836. &&
  837. $mPars['selUsuariId']==0
  838. )
  839. )
  840. )
  841. {
  842. echo "
  843. <td width='5px'>
  844. <p>&nbsp;</p>
  845. </td>
  846. <td valign='bottom' width='50px'>
  847. <a title='gestió inventaris magatzem CAC local'>
  848. <img src='imatges/magatzemp.gif' style='cursor:pointer;' onClick=\"javascrit:enviarFpars('gestioMagatzems.php?mRef=".$mPars['grup_id']."','_blank');\">
  849. </a>
  850. </td>
  851. <td>
  852. <p>&nbsp;</p>
  853. </td>
  854. ";
  855. }
  856. echo "
  857. ";
  858. if($mPars['nivell']!='visitant')
  859. {
  860. echo "
  861. <td valign='bottom' align='right' width='60%'>
  862. <table width='100%'>
  863. <tr>
  864. <td align='left'>
  865. ";
  866. if($mPars['nivell']=='sadmin' || $mPars['nivell']=='admin' || $mPars['nivell']=='coord' || $mPars['usuari_id']==$mGrup['usuari_id'])
  867. {
  868. echo "
  869. ";
  870. if($mPars['grup_id']!='0')
  871. {
  872. html_selectorUsuarisGrup();
  873. }
  874. }
  875. echo "
  876. <td align='left'>
  877. ";
  878. mostrarSelectorRuta(1,'comandes.php');
  879. if
  880. (
  881. $mPars['grup_id']!=0
  882. &&
  883. (
  884. count($mRuta)==1 //no es llista especial
  885. ||
  886. $mRuta[0]=='grups' //es llista local
  887. )
  888. )
  889. {
  890. echo "
  891. ";
  892. if($mParametres['precomandaTancada']['valor']==1)
  893. {
  894. $imatgeSemafor='semafor_vermell.gif';
  895. $semaforText="Aquest periode de reserves a la llista de CAC estā TANCAT";
  896. }
  897. else
  898. {
  899. $imatgeSemafor='semafor_verd.gif';
  900. $semaforText="Aquest periode de reserves a la llista de la CAC estā OBERT";
  901. }
  902. echo "
  903. </td>
  904. <td align='left'>
  905. ";
  906. mostrarSelectorLlista('comandes.php');
  907. echo "
  908. </td>
  909. ";
  910. }
  911. echo "
  912. </tr>
  913. </table>
  914. </td>
  915. ";
  916. }
  917. echo "
  918. </tr>
  919. </table>
  920. <table bgcolor='".$mColors['comandes.php'][$colorLlista]['t2_bg']."' bordercolor='#A2CBCA' border='0' width='100%' align='center'>
  921. <tr>
  922. <td width='100%' valign='middle' align='left'>
  923. <table border='0' align='left' valign='top' style='width:100%;'>
  924. <tr>
  925. <td width='25%' align='left' valign='top'>
  926. <p class='compacte' style='font-size:16px;'>
  927. <b>GRUP: &nbsp;".(urldecode($mGrup['nom']))." </b></p>
  928. <table width='100%'>
  929. <tr>
  930. <td>
  931. <a title='membres del grup'><img src='imatges/grup2p.gif'></a>
  932. </td>
  933. <td>
  934. ";
  935. if(isset($mPars['grup_id']) && $mPars['grup_id']!='0')
  936. {
  937. if(isset($mUsuarisGrupRef[$mGrup['usuari_id']]))
  938. {
  939. $mRespGrup=$mUsuarisGrupRef[$mGrup['usuari_id']]['usuari'];
  940. }
  941. else
  942. {
  943. $mRespGrup=$mUsuarisRef[$mGrup['usuari_id']];
  944. }
  945. echo "
  946. <p class='nota'>
  947. Responsable:&nbsp;".(strtoupper(urldecode($mRespGrup['usuari'])))."
  948. <br>(".@$mRespGrup['email'].")
  949. </p>
  950. ";
  951. }
  952. echo "
  953. </td>
  954. </tr>
  955. </table>
  956. </td>
  957. <td width='25%' valign='top'>
  958. ";
  959. if($mPars['grup_id']==0)
  960. {
  961. echo "
  962. <p class='compacte' style='font-size:12px;'>
  963. <input type='checkbox' ";
  964. if($mPars['veureProductesDisponibles']==1)
  965. {
  966. echo " CHECKED ";
  967. }
  968. echo "
  969. id='ck_veureProductesDisponibles' onClick=\"f_veureProductesDisponibles();\" value='".$mPars['veureProductesDisponibles']."'>
  970. Veure només productes actius&nbsp;".(html_ajuda1('html.php',21))."
  971. </p>
  972. ";
  973. }
  974. else if($mPars['selUsuariId']==0)
  975. {
  976. echo "
  977. <p class='compacte' id='p_vistaAlbara' onClick=\"vistaAlbara('totals');\" style='cursor:pointer;'><u>Vista Albarā (totals)</u></p>
  978. <p class='compacte' id='p_vistaAlbara' onClick=\"vistaAlbara('desglossat');\" style='cursor:pointer;'><u>Vista Albarā (desglossat)</u>&nbsp;".(html_ajuda1('html.php',9))."</p>
  979. <p class='compacte' id='p_vistaAlbara' onClick=\"vistaAlbara('resumUsuaris');\" style='cursor:pointer;'><u>Resum Imports Usuaries</u>&nbsp;".(html_ajuda1('html.php',10))."</p>
  980. ";
  981. if(substr_count($mGrup['categoria'],'rebost')>0 && $mPars['selRutaSufix']*1<=1503)
  982. {
  983. echo "
  984. <p class='compacte' style='color:#000000; cursor:pointer;' onClick=\"enviarFpars('tramsRuta.php','_blank');\"><u>Full de ruta CAC</u></p>
  985. ";
  986. }
  987. }
  988. else
  989. {
  990. echo "
  991. <p class='compacte' id='p_vistaAlbara' onClick=\"vistaAlbara('');\" style='cursor:pointer;'><u>Albarā (usuari)</u>&nbsp;".(html_ajuda1('html.php',11))."</p>
  992. <p class='compacte' id='p_vistaAlbara' onClick=\"vistaAlbara('desglossat');\" style='cursor:pointer;'><u>Albarā (grup)</u>&nbsp;".(html_ajuda1('html.php',12))."</p>
  993. ";
  994. }
  995. echo "
  996. <p class='compacte' onClick=\"enviarFpars('db_llistaProductesCSV.php','_blank');\" style='color:#885500; cursor:pointer;'><u>vista productes segons filtre actual (CSV)</u>&nbsp;".(html_ajuda1('html.php',13))."</p>
  997. ";
  998. $getP=selUsuariEsProductorAssociatDelGrup($db);
  999. if
  1000. (
  1001. @$mPars['grup_id']==0
  1002. ||
  1003. @$mPars['grup_id']!=0 &&
  1004. (
  1005. (
  1006. $mPars['selUsuariId']==0
  1007. &&
  1008. (
  1009. substr_count($mGrup['categoria'],',1-rebost')>0 || substr_count($mGrup['categoria'],',1-productorBasic')>0
  1010. )
  1011. )
  1012. ||
  1013. (
  1014. $mPars['selUsuariId']!=0 && $getP!=false
  1015. )
  1016. )
  1017. )
  1018. {
  1019. if($getP!=false)
  1020. {
  1021. echo "
  1022. <p class='compacte' onClick=\"enviarFpars('distribucioGrups.php?getP=".$getP."','_blank');\" style='color:#000000; cursor:pointer;'><u><b>Quč t'estan demanant els altres GRUPS</b></u></p>
  1023. ";
  1024. }
  1025. else
  1026. {
  1027. echo "
  1028. <p class='compacte' onClick=\"enviarFpars('distribucioGrups.php?getP=".$getP."','_blank');\" style='color:#000000; cursor:pointer;'><u>Quč estan demanant els altres GRUPS</u></p>
  1029. ";
  1030. }
  1031. }
  1032. echo "
  1033. </td>
  1034. <td width='25%' align='left' valign='top'>
  1035. ";
  1036. if
  1037. (
  1038. (
  1039. $mPars['nivell']=='sadmin'
  1040. ||
  1041. $mPars['nivell']=='admin'
  1042. ||
  1043. $mPars['nivell']=='coord'
  1044. ||
  1045. $mPars['usuari_id']==$mGrup['usuari_id']
  1046. )
  1047. &&
  1048. $mPars['selUsuariId']==0
  1049. )
  1050. {
  1051. if($mPars['grup_id']==0){$text1='Missatges a usuaries';}else{$text1='Missatges a membres del grup';}
  1052. echo "
  1053. <p class='compacte' onClick=\"javascript:enviarFpars('mail.php','_blank');\" style='cursor:pointer;'>
  1054. <u>".$text1."</u>&nbsp;".(html_ajuda1('html.php',7))."</p>
  1055. ";
  1056. if(substr_count($mGrup['categoria'],'magatzem')>0 || substr_count($mGrup['categoria'],'rebost')>0)
  1057. {
  1058. if(isset($mReservesComandes[$mPars['grup_id']]))
  1059. {
  1060. $recepcionsText="<font style='color:#ff0000;'><b>".(count($mReservesComandes[$mPars['grup_id']]))."</b></font>";
  1061. }
  1062. else
  1063. {
  1064. $recepcionsText="<font style='color:#000000;'><b>0</b></font>";
  1065. }
  1066. echo "
  1067. <p class='compacte' style='cursor:pointer;' onClick=\"enviarFpars('vistaReservesSZ.php','_blank');\" >
  1068. <u>Recepcions d'altres comandes</u> [".$recepcionsText."]&nbsp;".(html_ajuda1('html.php',8))."
  1069. </p>
  1070. ";
  1071. }
  1072. if(count($mPeticionsGrup)>0){ $peticionsText="<font style='color:#ff0000;'><b>".(count($mPeticionsGrup))."</b></font>";}
  1073. else { $peticionsText="<font style='color:#000000;'><b>".(count($mPeticionsGrup))."</b></font>";}
  1074. if(count($mIncidencies)>0){ $incidenciesText="<font style='color:#ff0000;'><b>".(count($mIncidencies))."</b></font>";}
  1075. else { $incidenciesText="<font style='color:#000000;'><b>".(count($mIncidencies))."</b></font>";}
  1076. if(count($mAbonamentsCarrecs)>0){ $incidenciesAbcaText="<font style='color:#ff0000;'><b>".(count($mAbonamentsCarrecs))."</b></font>";}
  1077. else { $incidenciesAbcaText="<font style='color:#000000;'><b>".(count($mAbonamentsCarrecs))."</b></font>";}
  1078. //v37-condicio
  1079. if(count($mRuta)==1 || $mPars['grup_id']==0) //no es ruta especial
  1080. {
  1081. echo "
  1082. <p class='compacte' onClick=\"javascript: enviarFpars('gestioGrup.php?gRef=".$mPars['grup_id']."','_blank');\" style='color:#000000; cursor:pointer;'><u>Peticions d'usuaries</u>&nbsp;[".$peticionsText."]
  1083. ";
  1084. if($mPars['selUsuariId']==0){echo "&nbsp;".(html_ajuda1('html.php',6));}
  1085. }
  1086. echo "</p>
  1087. <p class='compacte' onClick=\"javascript: enviarFpars('incidencies.php?opt2=incd&gRef=".$mPars['grup_id']."&vLlista=0','_blank');\" style='color:#000000; cursor:pointer;'><u>Incidčncies</u> [".$incidenciesText."]</p>
  1088. <p class='compacte' onClick=\"javascript: enviarFpars('incidencies.php?opt2=abCa&gRef=".$mPars['grup_id']."&vLlista=0','_blank');\" style='color:#000000; cursor:pointer;'><u>Abonaments/cārrecs</u> [".$incidenciesAbcaText."]</p>
  1089. ";
  1090. }
  1091. else if($mPars['grup_id']!='0' && $mPars['selUsuariId']!='0')
  1092. {
  1093. if(count($mPeticionsGrup)>0){ $peticionsText="<font style='color:#ff0000;'><b>".(count($mPeticionsGrup))."</b></font>";}
  1094. else { $peticionsText="<font style='color:#000000;'><b>".(count($mPeticionsGrup))."</b></font>";}
  1095. if(count($mIncidencies)>0){ $incidenciesText="<font style='color:#ff0000;'><b>".(count($mIncidencies))."</b></font>";}
  1096. else { $incidenciesText="<font style='color:#000000;'><b>".(count($mIncidencies))."</b></font>";}
  1097. if(count($mAbonamentsCarrecs)>0){ $incidenciesAbcaText="<font style='color:#ff0000;'><b>".(count($mAbonamentsCarrecs))."</b></font>";}
  1098. else { $incidenciesAbcaText="<font style='color:#000000;'><b>".(count($mAbonamentsCarrecs))."</b></font>";}
  1099. echo "
  1100. <p class='compacte' onClick=\"javascript: enviarFpars('incidencies.php?opt2=incd&gRef=".$mPars['grup_id']."&vLlista=0','_blank');\" style='color:#000000; cursor:pointer;'><u>incidčncies</u> [".$incidenciesText."]</p>
  1101. <p class='compacte' onClick=\"javascript: enviarFpars('incidencies.php?opt2=abCa&gRef=".$mPars['grup_id']."&vLlista=0','_blank');\" style='color:#000000; cursor:pointer;'><u>abonaments/cārrecs</u> [".$incidenciesAbcaText."]</p>
  1102. ";
  1103. }
  1104. echo "
  1105. </td>
  1106. <td width='25%' valign='top'>
  1107. ";
  1108. //<p class='compacte' onClick=\"javascript: enviarFpars('llistat_grups.php','_blank');\" style='color:#000000; cursor:pointer;'><u>Llistat de grups i equip cac</u></p>
  1109. //<p class='compacte' onClick=\"javascript: enviarFpars('informacio_gestor.php','_blank');\" style='color:#000000; cursor:pointer;'><u>Info general sobre el gestor</u></p>
  1110. echo "
  1111. </td>
  1112. </tr>
  1113. </table>
  1114. </td>
  1115. </tr>
  1116. <tr>
  1117. <td width='100%'>
  1118. <table width='100%'>
  1119. <tr>
  1120. <td align='left' valign='bottom' width='20%'>
  1121. </td>
  1122. <td align='left' valign='bottom' width='70%'>
  1123. <table style='width:100%;'>
  1124. <tr>
  1125. <td align='left' width='100%' valign='bottom'>
  1126. ";
  1127. if($mPars['grup_id']!=0)
  1128. {
  1129. echo "
  1130. <p style='font-size:11px;'>* A l'import total s'inclouen tots els productes de la comanda del GRUP o de l'usuari, independentment del filtre aplicat i de la pāgina mostrada.</p>
  1131. <p style='font-size:11px;'>* Les reserves de productes especials es mostren pero no es comptabilitzen</p>
  1132. ";
  1133. }
  1134. else
  1135. {
  1136. echo "
  1137. <p style='font-size:11px;'>* A l'import total s'inclouen tots els productes de la comanda CAC seleccionats segons els filtres, independentment de la pāgina mostrada.</p>
  1138. <p style='font-size:11px;'>* Es ressalten en verd tots els productes oferits per la CAC, excepte els productes especials</p>
  1139. ";
  1140. }
  1141. echo "
  1142. </td>
  1143. </tr>
  1144. </table>
  1145. </td>
  1146. </tr>
  1147. </table>
  1148. </td>
  1149. </tr>
  1150. </table>
  1151. ";
  1152. return;
  1153. }
  1154. //----------------------------------------
  1155. function mostrarDadesRebostGrup($db)
  1156. {
  1157. global
  1158. $hiHaUnAltrePeriodeNoTancat,
  1159. $hiHaAlgunPeriodeNoTancat,
  1160. $mIncidencies,
  1161. $mAbonamentsCarrecs,
  1162. $mAjuda,
  1163. $mDatesReservesLocals,
  1164. $mPeticionsGrup,
  1165. $mGrupsUsuari,
  1166. $mGrup,
  1167. $mGrupsRef,
  1168. $mRebosts,
  1169. $mPars,
  1170. $mCategoriesGrup,
  1171. $mColors,
  1172. $colorLlista,
  1173. $mComandaPerProductors,
  1174. $mUsuarisRef,
  1175. $mUsuarisGrupRef,
  1176. $mParametres,
  1177. $mReservesComandes,
  1178. $periodeBases,
  1179. $mPropietatsUsuari,
  1180. $mPropietatsUsuaris,
  1181. $mPropietatsGrupConfig,
  1182. $mPropietatsGrup,
  1183. $mPropietatsPeriodeLocalConfig,
  1184. $mPropietatsPeriodeLocal,
  1185. $mPropietatsPeriodesLocals,
  1186. $mGrupsEsResponsable;
  1187. echo "
  1188. <table width=100%' bgcolor='".$mColors['table']."'>
  1189. <tr>
  1190. <td id='td_missatgeAlerta' style=' width:100%;' align='center' valign='bottom'>
  1191. </td>
  1192. </tr>
  1193. <tr>
  1194. <td id='td_recordatoriGuardarComanda' align='center' width='100%' valign='bottom'>
  1195. </td>
  1196. </tr>
  1197. </table>
  1198. <table border='0' width='100%' bgcolor='".$mColors['table']."'>
  1199. <tr>
  1200. <td valign='middle' align='left' width='5%'>
  1201. <table align='left'>
  1202. <tr>
  1203. <td>
  1204. <a title='Inici'><img src='imatges/casap.jpeg' ALT=\"pāgina d'usuari\" style='cursor:pointer' onClick=\"javascript: enviarFpars('index.php?us=".$mPars['usuari_id']."&pasw=".$mPars['pasw']."','_self')\"></a>
  1205. </td>
  1206. <td>
  1207. <a title='Sortir'><img src='imatges/out2p.jpg' ALT=\"sortir\" style='cursor:pointer' onClick=\"javascript: document.getElementById('i_pars').value='';enviarFpars('index.php','_self')\"></a>
  1208. </td>
  1209. </tr>
  1210. </table>
  1211. </td>
  1212. <td valign='middle' align='left' width='15%'>
  1213. <p class='compacte' >
  1214. Usuari:<b> ".(urldecode($mPars['usuari']))."</b> (".$mPars['nivell'].")
  1215. </p>
  1216. </td>
  1217. <td width='10%' align='middle'>
  1218. ";
  1219. $mostrar=0;
  1220. echo "
  1221. </td>
  1222. <td width='70%' valign='bottom'>
  1223. <table align='right'>
  1224. <tr>
  1225. <td >
  1226. ";
  1227. if($mPars['nivell']=='sadmin' || $mPars['nivell']=='admin' || $mPars['nivell']=='coord' || $mPars['usuari_id']==$mGrup['usuari_id'])
  1228. {
  1229. echo "
  1230. ";
  1231. if($mPars['grup_id']!='0')
  1232. {
  1233. html_selectorUsuarisGrup();
  1234. }
  1235. }
  1236. echo "
  1237. </td>
  1238. <td>
  1239. ";
  1240. if(isset($mPropietatsPeriodesLocals))
  1241. {
  1242. mostrarSelectorPeriodeLocal(1,'comandes.php');
  1243. }
  1244. echo " </td>
  1245. ";
  1246. if
  1247. (
  1248. $mPars['usuari_id']!='visitant'
  1249. )
  1250. {
  1251. echo "
  1252. <td>
  1253. ";
  1254. if(isset($mPropietatsPeriodeLocal['comandesLocalsTancades']) && $mPropietatsPeriodeLocal['comandesLocalsTancades']==1)
  1255. {
  1256. $imatgeSemafor='semafor_vermell.gif';
  1257. $semaforText="Reserves a la llista LOCAL estā TANCAT";
  1258. }
  1259. else if(isset($mPropietatsPeriodeLocal['comandesLocalsTancades']) && $mPropietatsPeriodeLocal['comandesLocalsTancades']==-1)
  1260. {
  1261. $imatgeSemafor='semafor_verd.gif';
  1262. $semaforText="Reserves a la llista LOCAL estā OBERT";
  1263. }
  1264. else if(isset($mPropietatsPeriodeLocal['comandesLocalsTancades']) && $mPropietatsPeriodeLocal['comandesLocalsTancades']==0)
  1265. {
  1266. $imatgeSemafor='semafor_vermell.gif';
  1267. $semaforText="Reserves a la llista LOCAL estā TANCAT";
  1268. }
  1269. else
  1270. {
  1271. $imatgeSemafor='semafor_vermell.gif';
  1272. $semaforText="No s'ha creat cap periode";
  1273. }
  1274. echo "
  1275. <a title=\"".$semaforText."\"><img src='imatges/".$imatgeSemafor."'></a>
  1276. </td>
  1277. <td align='left' width='50px' >
  1278. <p>&nbsp;&nbsp;</p>
  1279. </td>
  1280. <td align='left'>
  1281. ";
  1282. mostrarSelectorLlista('comandes.php');
  1283. echo "
  1284. </td>
  1285. </tr>
  1286. ";
  1287. }
  1288. echo "
  1289. </table>
  1290. </td>
  1291. </tr>
  1292. </table>
  1293. <table bgcolor='".$mColors['comandes.php'][$colorLlista]['t2_bg']."' bordercolor='#A2CBCA' border='0' width='100%' align='center'>
  1294. <tr>
  1295. <td width='100%' valign='middle' align='left'>
  1296. <table border='0' align='left' valign='top' style='width:100%;'>
  1297. <tr>
  1298. <td width='20%' align='left' valign='top'>
  1299. <p class='compacte' style='font-size:16px;'>
  1300. <b>GRUP:&nbsp;".(urldecode($mGrup['nom']))." </b></p>
  1301. <table width='100%'>
  1302. <tr>
  1303. <td>
  1304. <a title='membres del grup'><img src='imatges/grup2p.gif'></a>
  1305. </td>
  1306. <td>
  1307. ";
  1308. if(isset($mPars['grup_id']) && $mPars['grup_id']!='0')
  1309. {
  1310. echo "
  1311. <p class='nota'>
  1312. Responsable:&nbsp;".(strtoupper(urldecode($mUsuarisGrupRef[$mGrup['usuari_id']]['usuari']['usuari'])))."
  1313. <br>(".@$mUsuarisGrupRef[$mGrup['usuari_id']]['usuari']['email'].")
  1314. </p>
  1315. ";
  1316. }
  1317. echo "
  1318. </td>
  1319. </tr>
  1320. </table>
  1321. </td>
  1322. <td width='20%' valign='top'>
  1323. ";
  1324. if($mPars['grup_id']==0)
  1325. {
  1326. echo "
  1327. <p class='compacte' style='font-size:12px;'>
  1328. <input type='checkbox' ";
  1329. if($mPars['veureProductesDisponibles']==1)
  1330. {
  1331. echo " CHECKED ";
  1332. }
  1333. echo "
  1334. id='ck_veureProductesDisponibles' onClick=\"f_veureProductesDisponibles();\" value='".$mPars['veureProductesDisponibles']."'>
  1335. Veure només productes actius&nbsp;".(html_ajuda1('html.php',21))."
  1336. </p>
  1337. <p id='p_vistaAlbara' onClick=\"vistaAlbara('totals');\" style='cursor:pointer;'><u>Veure Vista Albarā</u></p>
  1338. ";
  1339. }
  1340. else if($mPars['selUsuariId']==0)
  1341. {
  1342. if($mPars['selLlistaId']!=0) //local
  1343. {
  1344. echo "
  1345. <p class='compacte' style='font-size:12px;'>
  1346. <input type='checkbox'
  1347. ";
  1348. if($mPars['veureProductesDisponibles']==1)
  1349. {
  1350. echo " CHECKED ";
  1351. }
  1352. echo "
  1353. id='ck_veureProductesDisponibles' onClick=\"f_veureProductesDisponibles();\" value='".$mPars['veureProductesDisponibles']."'>
  1354. Veure només productes actius&nbsp;".(html_ajuda1('html.php',21))."
  1355. </p>
  1356. ";
  1357. }
  1358. echo "
  1359. <p class='compacte' id='p_vistaAlbara' onClick=\"vistaAlbara('totals');\" style='cursor:pointer;'><u>Vista Albarā (totals)</u></p>
  1360. <p class='compacte' id='p_vistaAlbara' onClick=\"vistaAlbara('desglossat');\" style='cursor:pointer;'><u>Vista Albarā (desglossat)</u>&nbsp;".(html_ajuda1('html.php',9))."</p>
  1361. <p class='compacte' id='p_vistaAlbara' onClick=\"vistaAlbara('resumUsuaris');\" style='cursor:pointer;'><u>Resum Imports Usuaries</u>&nbsp;".(html_ajuda1('html.php',10))."</p>
  1362. <p class='compacte' id='p_vistaAlbara' onClick=\"enviarFpars('distribucioGrupsLocals.php?getP=TOTS','_blank');\" style='cursor:pointer;'><u>Resum reserves locals per productora</u>&nbsp".(html_ajuda1('html.php',22))."</p>
  1363. <p class='compacte' id='p_vistaAlbara' onClick=\"enviarFpars('comptesGrupLocal.php?llId=".$mPars['selLlistaId']."','_blank');\" style='cursor:pointer;'><u>Resum balanįos d'intercanvi</u>&nbsp".(html_ajuda1('html.php',23))."</p>
  1364. ";
  1365. if(substr_count($mGrup['categoria'],'rebost')>0 && $mPars['selRutaSufix']*1<=1503)
  1366. {
  1367. echo "
  1368. <p class='compacte' style='color:#000000; cursor:pointer;' onClick=\"enviarFpars('tramsRuta.php','_blank');\"><u>Full de ruta CAC</u></p>
  1369. ";
  1370. }
  1371. }
  1372. else
  1373. {
  1374. echo "
  1375. <p class='compacte' id='p_vistaAlbara' onClick=\"vistaAlbara('');\" style='cursor:pointer;'><u>Albarā (usuari)</u>".(html_ajuda1('html.php',11))."</p>
  1376. <p class='compacte' id='p_vistaAlbara' onClick=\"vistaAlbara('desglossat');\" style='cursor:pointer;'><u>Albarā (grup)</u>".(html_ajuda1('html.php',12))."</p>
  1377. ";
  1378. }
  1379. echo "
  1380. <p class='compacte' onClick=\"enviarFpars('db_llistaProductesCSV.php','_blank');\" style='color:#885500; cursor:pointer;'><u>vista productes segons filtre actual (CSV)</u>&nbsp;".(html_ajuda1('html.php',13))."</p>
  1381. ";
  1382. /*
  1383. echo "
  1384. <p class='compacte' onClick=\"enviarFpars('db_resumPeriodeLocalCSV.php','_blank');\" style='color:#885500; cursor:pointer;'><u>resum actual periode local seleccionat (CSV)</u></p>
  1385. ";
  1386. */
  1387. echo "
  1388. <br>
  1389. ";
  1390. $getP=selUsuariEsProductorAssociatDelGrup($db);
  1391. if
  1392. (
  1393. (
  1394. $mPars['nivell']=='sadmin'
  1395. ||
  1396. $mPars['nivell']=='admin'
  1397. ||
  1398. $mPars['nivell']=='coord'
  1399. ||
  1400. $mPars['usuari_id']==$mGrup['usuari_id']
  1401. )
  1402. &&
  1403. $mPars['selUsuariId']==0
  1404. )
  1405. {
  1406. echo "
  1407. <p class='compacte' onClick=\"javascript:enviarFpars('mail.php','_blank');\" style='cursor:pointer;'>
  1408. <u>Missatges a membres del grup</u>&nbsp;".(html_ajuda1('html.php',7))."
  1409. </p>
  1410. ";
  1411. if(count($mPeticionsGrup)>0){ $peticionsText="<font style='color:#ff0000;'><b>".(count($mPeticionsGrup))."</b></font>";}
  1412. else { $peticionsText="<font style='color:#000000;'><b>".(count($mPeticionsGrup))."</b></font>";}
  1413. if(count($mIncidencies)>0){ $incidenciesText="<font style='color:#ff0000;'><b>".(count($mIncidencies))."</b></font>";}
  1414. else { $incidenciesText="<font style='color:#000000;'><b>".(count($mIncidencies))."</b></font>";}
  1415. if(count($mAbonamentsCarrecs)>0){ $incidenciesAbcaText="<font style='color:#ff0000;'><b>".(count($mAbonamentsCarrecs))."</b></font>";}
  1416. else { $incidenciesAbcaText="<font style='color:#000000;'><b>".(count($mAbonamentsCarrecs))."</b></font>";}
  1417. echo "
  1418. <p class='compacte' onClick=\"javascript: enviarFpars('gestioGrup.php?gRef=".$mPars['grup_id']."','_blank');\" style='color:#000000; cursor:pointer;'><u>Peticions d'usuaries</u> [".$peticionsText."]&nbsp;".(html_ajuda1('html.php',6))."
  1419. </p>
  1420. <p class='compacte' onClick=\"javascript: enviarFpars('incidencies.php?opt2=incd&gRef=".$mPars['grup_id']."&vLlista=".$mPars['selLlistaId']."','_blank');\" style='color:#000000; cursor:pointer;'><u>Incidčncies (llista productes local)</u> [".$incidenciesText."]</p>
  1421. <p class='compacte' onClick=\"javascript: enviarFpars('incidencies.php?opt2=abCa&gRef=".$mPars['grup_id']."&vLlista=".$mPars['selLlistaId']."','_blank');\" style='color:#000000; cursor:pointer;'><u>Abonaments/cārrecs (llista productes local)</u> [".$incidenciesAbcaText."]</p>
  1422. ";
  1423. }
  1424. else if($mPars['grup_id']!='0' && $mPars['selUsuariId']!='0')
  1425. {
  1426. if(count($mPeticionsGrup)>0){ $peticionsText="<font style='color:#ff0000;'><b>".(count($mPeticionsGrup))."</b></font>";}
  1427. else { $peticionsText="<font style='color:#000000;'><b>".(count($mPeticionsGrup))."</b></font>";}
  1428. if(count($mIncidencies)>0){ $incidenciesText="<font style='color:#ff0000;'><b>".(count($mIncidencies))."</b></font>";}
  1429. else { $incidenciesText="<font style='color:#000000;'><b>".(count($mIncidencies))."</b></font>";}
  1430. if(count($mAbonamentsCarrecs)>0){ $incidenciesAbcaText="<font style='color:#ff0000;'><b>".(count($mAbonamentsCarrecs))."</b></font>";}
  1431. else { $incidenciesAbcaText="<font style='color:#000000;'><b>".(count($mAbonamentsCarrecs))."</b></font>";}
  1432. echo "
  1433. <p class='compacte' onClick=\"javascript: enviarFpars('incidencies.php?opt2=incd&gRef=".$mPars['grup_id']."&vLlista=".$mPars['selLlistaId']."','_blank');\" style='color:#000000; cursor:pointer;'><u>incidčncies (llista productes local)</u> [".$incidenciesText."]</p>
  1434. <p class='compacte' onClick=\"javascript: enviarFpars('incidencies.php?opt2=abCa&gRef=".$mPars['grup_id']."&vLlista=".$mPars['selLlistaId']."','_blank');\" style='color:#000000; cursor:pointer;'><u>abonaments/cārrecs (llista productes local)</u> [".$incidenciesAbcaText."]</p>
  1435. ";
  1436. }
  1437. echo "
  1438. </td>
  1439. ";
  1440. if
  1441. (
  1442. (
  1443. $mPars['nivell']=='sadmin'
  1444. ||
  1445. $mPars['nivell']=='admin'
  1446. ||
  1447. $mPars['nivell']=='coord'
  1448. ||
  1449. $mPars['usuari_id']==$mGrup['usuari_id']
  1450. )
  1451. &&
  1452. $mPars['selUsuariId']==0
  1453. &&
  1454. $mPars['selLlistaId']!=0
  1455. )
  1456. {
  1457. echo "
  1458. <td width='20%' valign='top'>
  1459. <table align='left'>
  1460. ";
  1461. if
  1462. (
  1463. isset($mPropietatsPeriodeLocal['comandesLocalsTancades']) && $mPropietatsPeriodeLocal['comandesLocalsTancades']==0
  1464. ||
  1465. isset($mPropietatsPeriodeLocal['comandesLocalsTancades']) && $mPropietatsPeriodeLocal['comandesLocalsTancades']==-1
  1466. )
  1467. {
  1468. echo "
  1469. <tr>
  1470. <td valign='top'>
  1471. <p class='p_micro5' >Comandes Locals Tancades:</p>
  1472. </td>
  1473. <td valign='top'>
  1474. <p class='p_micro5' ><input type='checkbox'
  1475. ";
  1476. if
  1477. (
  1478. $mPropietatsPeriodeLocal['comandesLocalsTancades']==0
  1479. ||
  1480. $mPropietatsPeriodeLocal['comandesLocalsTancades']==1
  1481. )
  1482. {
  1483. echo " CHECKED ";
  1484. }
  1485. echo "
  1486. id='ck_comandesLocalsTancades' onClick=\"f_comandesLocalsTancades();\" value='".$mPropietatsPeriodeLocal['comandesLocalsTancades']."'>
  1487. &nbsp;".(html_ajuda1('html.php',14))."
  1488. </p>
  1489. </td>
  1490. </tr>
  1491. ";
  1492. if
  1493. (
  1494. $mPropietatsPeriodeLocal['comandesLocalsTancades']==0
  1495. )
  1496. {
  1497. echo "
  1498. <tr>
  1499. <td valign='top'>
  1500. <input class='i_micro' id='i_tancarPeriode' DISABLED type='button' onClick=\"tancarPeriodeLocal();\" value='tancar periode ".$mPars['sel_periode_comanda_local']."'>
  1501. </td>
  1502. <td valign='top'>
  1503. <p class='p_micro5' ><input type='checkbox' id='ck_activarTancarPeriode' onClick=\"javascript: activarTancarPeriode();\" value='0'>
  1504. &nbsp;".(html_ajuda1('html.php',15))."
  1505. </p>
  1506. </td>
  1507. </tr>
  1508. ";
  1509. }
  1510. }
  1511. if
  1512. (
  1513. isset($mPropietatsPeriodeLocal['comandesLocalsTancades'])
  1514. &&
  1515. @$mPropietatsPeriodeLocal['comandesLocalsTancades']!=1
  1516. )
  1517. {
  1518. echo "
  1519. <tr>
  1520. <td valign='top'>
  1521. <p class='p_micro5'>Cost Transport Local:&nbsp;".(html_ajuda1('html.php',16))."</p>
  1522. </td>
  1523. <td valign='top'>
  1524. <p class='p_micro5'><input class='i_micro' size='4' type='text' id='i_local_ctik' value='".$mPropietatsPeriodeLocal['ctikLocal']."'>
  1525. <input class='i_micro' type=