PageRenderTime 69ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/www/shop/engine/Shopware/Plugins/Default/Frontend/BuiswPaymentPayone/orders.php

https://bitbucket.org/weberlars/sot-shopware
PHP | 2026 lines | 1673 code | 142 blank | 211 comment | 102 complexity | 383683a43b43dc423264a3ceeabbe381 MD5 | raw file
Possible License(s): AGPL-3.0, MIT, BSD-3-Clause, LGPL-2.1, LGPL-3.0

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. if (BUIWPAYMENTTOKEN !== "securedCall"){
  3. echo "
  4. <html><title>Time-Out</title><head></head>
  5. <script language=\"javascript\">
  6. parent.location.reload();
  7. </script>
  8. <body>Bitte loggen Sie sich neu ein!</body></html>
  9. ";
  10. die();
  11. }
  12. $result = mysql_query("
  13. SELECT id, description FROM s_core_paymentmeans ORDER BY position,description ASC
  14. ");
  15. $order_status3 = array();
  16. $basepath = $_GET['basepath'];
  17. $htmlbase = str_replace('Shopware/', '', $basepath);
  18. if ($result && mysql_num_rows($result)) {
  19. while($status = mysql_fetch_assoc($result)) {
  20. $order_status3[$status["id"]] = $status["description"];
  21. $checked = 'false';
  22. if ($status['description'] == 'PAYONE') {
  23. $checked = 'true';
  24. $PAYONE_ID = $status['id'];
  25. $zahlungs_methoden[] = '{boxLabel: "' . $status['description'] . '", name:"' . $status['id'] . '", checked:' . $checked . '}';
  26. // [$status["id"]] = $status["description"];
  27. }
  28. }
  29. }
  30. // echo join (',', $zahlungs_methoden);
  31. ?>
  32. <html>
  33. <head>
  34. <base href="<?php echo '/'.$htmlbase; ?>backend/modules/orderlist/">
  35. <title></title>
  36. <link href="/templates/_default/backend/_resources/resources/css/icon-set.css" type="text/css" rel="stylesheet">
  37. <script type="text/javascript" src="http://cdn.shopware.de/assets/library/base.js"></script>
  38. <script type="text/javascript" src="http://cdn.shopware.de/assets/library/all.js"></script>
  39. <script type="text/javascript" src="http://cdn.shopware.de/assets/library/locale/de.js" charset="utf-8"></script>
  40. <link rel="stylesheet" type="text/css" href="http://cdn.shopware.de/assets/library/resources/css/all.css" />
  41. <script type="text/javascript" src="<?php echo '/'.$htmlbase; ?>backend/modules/orderlist/RowExpander.js"></script>
  42. <script type="text/javascript" src="<?php echo '/'.$htmlbase; ?>vendor/ext/build/locale/ext-lang-de.js" charset="utf-8"></script>
  43. <script type="text/javascript" src="<?php echo '/'.$htmlbase; ?>backend/js/mootools.js"></script>
  44. <link href="../../../backend/css/icons.css" rel="stylesheet" type="text/css" />
  45. <link href="../../../backend/css/icons4.css" rel="stylesheet" type="text/css" />
  46. <style type="text/css">
  47. a.money_plus { background: url(../../../Shopware/Plugins/Default/Frontend/BuiswPaymentPayone/images/preis_plus.png) no-repeat 0px 0px transparent;}
  48. a.money_minus { background: url(../../../Shopware/Plugins/Default/Frontend/BuiswPaymentPayone/images/preis_minus.png) no-repeat 0px 0px transparent;}
  49. html, body {
  50. font:normal 12px verdana;
  51. margin:0;
  52. padding:0;
  53. border:0 none;
  54. overflow:hidden;
  55. height:100%;
  56. }
  57. p {
  58. margin:5px;
  59. }
  60. .settings {
  61. background-image:url(../shared/icons/fam/folder_wrench.png);
  62. }
  63. .nav {
  64. background-image:url(../shared/icons/fam/folder_go.png);
  65. }
  66. .blue-row .x-grid3-cell-inner{
  67. color:blue;
  68. }
  69. .red-row .x-grid3-cell-inner{
  70. color:red;
  71. }
  72. .green-row .x-grid3-cell-inner{
  73. color:green;
  74. }
  75. a.ico {
  76. float:left;
  77. height:20px;
  78. margin:0 0 0 5px;
  79. padding:0;
  80. width:20px;
  81. }
  82. .x-form-label-left label {
  83. font-size:11px !important;
  84. }
  85. .x-hide-label .x-form-element {
  86. overflow:hidden !important;
  87. }
  88. </style>
  89. <script>
  90. function loadSkeleton(x,y, z){
  91. parent.loadSkeleton(x,y,z);
  92. }
  93. </script>
  94. <script type="text/javascript">
  95. var myExt = function(){
  96. var store;
  97. var storeDocuments;
  98. var storeid;
  99. var myTab;
  100. var grids = {};
  101. var window;
  102. var start;
  103. return {
  104. markAll: function(){
  105. $$('.markedOrders').each(function(e){
  106. e.checked = true;
  107. });
  108. },
  109. doCombine: function (){
  110. var countDocuments = 0;
  111. var currentDocument = 0;
  112. var progress = 0;
  113. var queue = new Array();
  114. Ext.select('.markedOrders').each ( function (e){
  115. if (e.dom.checked){
  116. queue[countDocuments] = e.dom.value;
  117. countDocuments ++;
  118. }
  119. });
  120. if (countDocuments==0){
  121. alert("Keine Belege ausgew?hlt");
  122. return;
  123. }
  124. var query = queue.join(";");
  125. var docKind = Ext.getCmp('docKind').getValue();
  126. var url = "../../../backend/ajax/combinepdf.php?files="+query+"&typ="+docKind;
  127. parent.window.open(url,"Belegdruck","width=800,height=600");
  128. },
  129. doPDF: function (){
  130. var countDocuments = 0;
  131. var currentDocument = 0;
  132. var progress = 0;
  133. var queue = new Array();
  134. /*
  135. 0 = Default
  136. 1 = Check if document exists already
  137. */
  138. var docMode = Ext.getCmp('docMode').getValue();
  139. /*
  140. 0 = RG
  141. 1 = LA
  142. 2 = GS
  143. 3 = ST
  144. */
  145. var docKind = Ext.getCmp('docKind').getValue();
  146. /*
  147. -1 = Change nothing
  148. */
  149. var docState = Ext.getCmp('docChangeState').getValue();
  150. var docPayment = Ext.getCmp('docChangePayment').getValue();
  151. Ext.select('.markedOrders').each ( function (e){
  152. if (e.dom.checked){
  153. queue[countDocuments] = e.dom.value;
  154. countDocuments ++;
  155. }
  156. });
  157. progress = function()
  158. {
  159. Ext.Ajax.request({
  160. url: '../../../../backend/document/',
  161. params: {date:'<?php echo date("d.m.Y") ?>',
  162. delivery_date: '<?php echo date("d.m.Y") ?>',
  163. id: queue[currentDocument],
  164. typ: docKind,
  165. forceTaxCheck:1,
  166. voucher: 0},
  167. method: 'POST',
  168. success: function ( result, request ) {
  169. if (docState && docState != -1){
  170. Ext.Ajax.request({
  171. url: '../../../backend/ajax/changeOrderState.php',
  172. params: {artID: queue[currentDocument],field: 'status',value: docState},
  173. method: 'POST',
  174. success: function ( result, request ) {
  175. },
  176. failure: function ( result, request) {
  177. }
  178. });
  179. }
  180. if (docPayment && docPayment != -1){
  181. Ext.Ajax.request({
  182. url: '../../../backend/ajax/changeOrderState.php',
  183. params: {artID: queue[currentDocument],field: 'cleared',value: docPayment},
  184. method: 'POST',
  185. success: function ( result, request ) {
  186. },
  187. failure: function ( result, request) {
  188. }
  189. });
  190. }
  191. currentDocument++;
  192. var progressbar = currentDocument / countDocuments;
  193. Ext.getCmp('install_progress').updateProgress(progressbar, "Beleg "+ currentDocument + " von " + countDocuments + " verarbeitet...");
  194. if (currentDocument < countDocuments)
  195. {
  196. progress();
  197. }else{
  198. if(countDocuments == "1")
  199. {
  200. Ext.getCmp('install_progress').updateProgress(1, "Beleg-Erstellung abgeschlossen (Ein Beleg erstellt)");
  201. }else{
  202. Ext.getCmp('install_progress').updateProgress(1, "Beleg-Erstellung abgeschlossen ("+countDocuments+" Belege erstellt)");
  203. }
  204. }
  205. },
  206. failure: function ( result, request) {
  207. }
  208. });
  209. };
  210. if (docMode==1){
  211. // Check if document already exists
  212. Ext.Ajax.request({
  213. url: '../../../backend/ajax/checkDocument.php',
  214. params: {id: queue.join(';'), typ: docKind},
  215. method: 'POST',
  216. success: function ( result, request ) {
  217. if (!result.responseText){
  218. alert("Nothing to do");
  219. return;
  220. }
  221. var test = JSON.decode(result.responseText);
  222. queue = test;
  223. countDocuments = queue.length;
  224. Ext.getCmp('install_progress').updateProgress(0.1, "Beleg-Erstellung l?uft...");
  225. progress();
  226. return;
  227. },
  228. failure: function ( result, request) {
  229. alert(result.responseText);
  230. return;
  231. }
  232. });
  233. return;
  234. }
  235. Ext.getCmp('install_progress').updateProgress(0.1, "Beleg-Erstellung l?uft...");
  236. progress();
  237. },
  238. showProcess: function (){
  239. myExt.window.show();
  240. },
  241. reload : function(){
  242. store.load({params:{start:0,id:storeid, limit:25}});
  243. storeDocuments.load({params:{start:0,id:storeid, limit:25}});
  244. },
  245. GetRandom : function ( min, max ) {
  246. if( min > max ) {
  247. return( -1 );
  248. }
  249. if( min == max ) {
  250. return( min );
  251. }
  252. var r = parseInt( Math.random() * ( max+1 ) );
  253. return( r + min <= max ? r + min : r );
  254. },
  255. filterByChar: function(key){
  256. store.baseParams["search"] = key;
  257. store.lastOptions.params["start"] = 0;
  258. store.reload();
  259. },
  260. filterGroup: function(key){
  261. store.baseParams["group"] = key;
  262. store.lastOptions.params["start"] = 0;
  263. store.reload();
  264. },
  265. openClient : function(id,name){
  266. var stammdaten = new Ext.ux.IFrameComponent({
  267. id: "idStammdaten"+id+myExt.GetRandom(1,10000),
  268. url: '../orders/index.php?id='+id,
  269. title: 'Bestellinformationen',
  270. listeners: {'activate': function(){Ext.getCmp('leftPanel').collapse()}}
  271. });
  272. var customer = new Ext.TabPanel({
  273. deferredRender:true,
  274. width:700,
  275. enableTabScroll:true,
  276. forceFit:true,
  277. height:500,
  278. id:'CT'+myExt.GetRandom(1,10000),
  279. title:name,
  280. activeTab:0,
  281. closable:true,
  282. items:[
  283. stammdaten
  284. ]
  285. });
  286. myTab.add(
  287. customer
  288. ).show();
  289. },
  290. deleteOrderDetail : function(id, orderID, name){
  291. Ext.MessageBox.confirm('Best?tigung', 'Soll die Position '+name+' wirklich gel?scht werden?', function(btn){
  292. if(btn == "yes")
  293. {
  294. Ext.Ajax.request({
  295. url: '../../../backend/ajax/orderes.php',
  296. params: {id:orderID,
  297. s_order_details_id: id,
  298. action:'deletePositionForExt'},
  299. success: function(){
  300. var grid = grids[orderID];
  301. grid.store.load({params:{orderID:orderID}});
  302. alert('L?schvorgang erfolgreich!');
  303. }
  304. });
  305. }else{
  306. alert('L?schvorgang abgebrochen!');
  307. }
  308. });
  309. },
  310. deleteOrder : function(id, ordernumber, customer){
  311. Ext.MessageBox.confirm('<?php echo $sLang["orderlist"]["del_order_confirmtitle"]; ?>', '<?php echo $sLang["orderlist"]["del_order_confirmtxt_1"]; ?> '+ordernumber+' <?php echo $sLang["orderlist"]["del_order_confirmtxt_2"]; ?> '+customer+' <?php echo $sLang["orderlist"]["del_order_confirmtxt_3"]; ?>', function(btn){
  312. if(btn == 'yes')
  313. {
  314. Ext.Ajax.request({
  315. url: '<?php echo $_SERVER["SERVER_PORT"] == "80" ? "http" : "https" ?>://<?php echo $sCore->sCONFIG['sBASEPATH']?>/engine/backend/ajax/deleteOrder.php',
  316. success: function(){
  317. alert('<?php echo $sLang["orderlist"]["del_order_acknowltxt_1"]; ?> '+ordernumber+' <?php echo $sLang["orderlist"]["del_order_acknowltxt_2"]; ?> '+customer+' <?php echo $sLang["orderlist"]["del_order_acknowltxt_3"]; ?>');
  318. Ext.getCmp('orderlist_grid').store.load();
  319. },
  320. params: { 'delete': id }
  321. });
  322. }else{
  323. alert('<?php echo $sLang["orderlist"]["del_order_cancel"]; ?>');
  324. }
  325. });
  326. },
  327. captureAmount : function(id, ordernumber, customer, amount){
  328. Ext.MessageBox.prompt('Betrag', 'Welcher Betrag soll eingezogen werden?', function(btn, inputAmount){
  329. if(btn == "ok") {
  330. Ext.Ajax.request({
  331. // url: '../../../../shopware.php/sViewport,BuiswPaymentPayone/sAction,captureAmount',
  332. url: '../../../../backend/BuiswPaymentPayone/captureAmount',
  333. params:{
  334. oID:ordernumber,
  335. amount:inputAmount,
  336. action: 'capture'
  337. },
  338. success: function(response){
  339. var result = Ext.util.JSON.decode(response.responseText);
  340. if(result.error) {
  341. alert(result.error);
  342. } else {
  343. alert('Der Betrag wurde erfolgreich eingezogen!');
  344. Ext.getCmp('orderlist_grid').store.load({params:{start:0, limit:25, filterPayment: "<?php echo $PAYONE_ID ?>"}});
  345. }
  346. },
  347. failure: function(){
  348. alert("FEHLER! Verbindung fehlgeschlagen!");
  349. }
  350. });
  351. }
  352. }, '', '', amount);
  353. },
  354. refundAmount : function(id, ordernumber, customer){
  355. Ext.MessageBox.prompt('Betrag', 'Welcher Betrag soll gutgeschrieben werden??', function(btn, inputAmount){
  356. if(btn == "ok") {
  357. Ext.Ajax.request({
  358. // url: '../../../../shopware.php/sViewport,BuiswPaymentPayone/sAction,refundAmount',
  359. url: '../../../../backend/BuiswPaymentPayone/refundAmount',
  360. params:{
  361. oID:ordernumber,
  362. amount:inputAmount,
  363. action: 'refund'
  364. },
  365. success: function(response){
  366. var result = Ext.util.JSON.decode(response.responseText);
  367. if(result.error) {
  368. alert(result.error);
  369. } else {
  370. alert('Der Betrag wurde erfolgreich eingezogen!');
  371. Ext.getCmp('orderlist_grid').store.load({params:{start:0, limit:25, filterPayment: "<?php echo $PAYONE_ID ?>"}});
  372. }
  373. },
  374. failure: function(){
  375. alert("FEHLER! Verindung fehlgeschlagen!");
  376. }
  377. });
  378. }
  379. });
  380. },
  381. init : function(){
  382. Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
  383. store = new Ext.data.Store({
  384. url: '<?php echo $_SERVER["SERVER_PORT"] == "80" ? "http" : "https" ?>://<?php echo $_SERVER['HTTP_HOST']?>/engine/backend/ajax/getOrders.php',
  385. baseParams: {pagingID:storeid, filterPayment: "<?php echo $PAYONE_ID ?>"},
  386. // create reader that reads the Topic records
  387. reader: new Ext.data.JsonReader({
  388. root: 'order',
  389. totalProperty: 'totalCount',
  390. id: 'id',
  391. fields: [
  392. 'id','ordertimeFormated','ordernumber','invoice_amount','transactionID','taxfree','statusDescription','pdf','status','cleared','clearingDescription','paymentTpl','paymentDescription', 'customer','userID', 'dispatch','subshop'
  393. ]
  394. }),
  395. listeners: {
  396. 'load' : {fn: function(){
  397. for (var gridID in grids)
  398. {
  399. grids[gridID].destroy();
  400. }
  401. grids = {};
  402. }}
  403. },
  404. // turn on remote sorting
  405. remoteSort: true
  406. });
  407. store.setDefaultSort('ordertime', 'desc');
  408. var statestoreArray = new Array();
  409. /*
  410. Bestellstatatus
  411. */
  412. <?php
  413. // Read possible order states
  414. $getStates = mysql_query("
  415. SELECT * FROM s_core_states WHERE `group`='state' AND id>=0 ORDER BY position ASC
  416. ");
  417. while ($state=mysql_fetch_assoc($getStates)){
  418. $states[] = "[{$state["id"]},'{$state["description"]}']";
  419. ?>
  420. statestoreArray[<?php echo $state["id"] ?>] = '<?php echo $state["description"] ?>';
  421. <?php
  422. }
  423. ?>
  424. // For use in grid
  425. var states = [<?php echo implode(",",$states) ?>];
  426. // trigger the data store load
  427. var statestore = new Ext.data.SimpleStore({
  428. fields: ['id', 'state'],
  429. data : states
  430. });
  431. // For use in filter-form
  432. var statesForm = [[-1,'<?php echo $sLang["orderlist"]["orders_show_all"] ?>'],<?php echo implode(",",$states) ?>];
  433. // trigger the data store load
  434. var statestoreForm = new Ext.data.SimpleStore({
  435. fields: ['id', 'state'],
  436. data : statesForm
  437. });
  438. var paymentArray = new Array();
  439. var groupArray = new Array();
  440. var shopArray = new Array();
  441. var dispatchArray = new Array();
  442. /*
  443. Bestellstatatus
  444. */
  445. <?php
  446. // Read possible order states
  447. $getPayment = mysql_query("
  448. SELECT id, description FROM s_core_paymentmeans ORDER BY id ASC
  449. ");
  450. while ($payment=mysql_fetch_assoc($getPayment)){
  451. $paymentmeans[] = "[{$payment["id"]},'{$payment["description"]}']";
  452. ?>
  453. paymentArray[<?php echo $payment["id"] ?>] = '<?php echo $payment["description"] ?>';
  454. <?php
  455. }
  456. ?>
  457. var paymentmeans = [[-1,'<?php echo $sLang["orderlist"]["orders_show_all"] ?>'],<?php echo implode(",",$paymentmeans) ?>];
  458. // trigger the data store load
  459. var paymentstore = new Ext.data.SimpleStore({
  460. fields: ['id', 'state'],
  461. data : paymentmeans
  462. });
  463. <?php
  464. // Read possible customergroups
  465. // -- sth, 304 --
  466. $getGroups = mysql_query("
  467. SELECT groupkey,description FROM s_core_customergroups ORDER BY id ASC
  468. ");
  469. while ($group=mysql_fetch_assoc($getGroups)){
  470. $groups[] = "['{$group["groupkey"]}','{$group["description"]}']";
  471. ?>
  472. groupArray['<?php echo $group["groupkey"] ?>'] = '<?php echo $group["description"] ?>';
  473. <?php
  474. }
  475. ?>
  476. var groups = [[-1,'<?php echo $sLang["orderlist"]["orders_show_all"] ?>'],<?php echo implode(",",$groups) ?>];
  477. // trigger the data store load
  478. var groupstore = new Ext.data.SimpleStore({
  479. fields: ['id', 'state'],
  480. data : groups
  481. });
  482. // -- sth, 304 --
  483. <?php
  484. // Read possible subshops
  485. // -- sth, 304 --
  486. $getShops = mysql_query("
  487. SELECT id AS groupkey,name AS description FROM s_core_multilanguage ORDER BY id ASC
  488. ");
  489. while ($shop=mysql_fetch_assoc($getShops)){
  490. $shops[] = "['{$shop["groupkey"]}','{$shop["description"]}']";
  491. ?>
  492. shopArray['<?php echo $shop["groupkey"] ?>'] = '<?php echo $shop["description"] ?>';
  493. <?php
  494. }
  495. ?>
  496. var shops = [[-1,'<?php echo $sLang["orderlist"]["orders_show_all"] ?>'],<?php echo implode(",",$shops) ?>];
  497. // trigger the data store load
  498. var shopstore = new Ext.data.SimpleStore({
  499. fields: ['id', 'state'],
  500. data : shops
  501. });
  502. // -- sth, 304 --
  503. <?php
  504. // Read possible dispatches
  505. // -- sth, 304 --
  506. if (!empty($sCore->sCONFIG['sPREMIUMSHIPPIUNG']))
  507. {
  508. $dispatch_table = 's_premium_dispatch';
  509. }
  510. else
  511. {
  512. $dispatch_table = 's_trueshippingcosts_dispatch';
  513. }
  514. $getDispatches = mysql_query("
  515. SELECT id AS groupkey,name AS description FROM $dispatch_table ORDER BY id ASC
  516. ");
  517. while ($dispatch=mysql_fetch_assoc($getDispatches)){
  518. $dispatches[] = "['{$dispatch["groupkey"]}','{$dispatch["description"]}']";
  519. ?>
  520. dispatchArray['<?php echo $dispatch["groupkey"] ?>'] = '<?php echo $dispatch["description"] ?>';
  521. <?php
  522. }
  523. ?>
  524. var dispatches = [[-1,'<?php echo $sLang["orderlist"]["orders_show_all"] ?>'],<?php echo implode(",",$dispatches) ?>];
  525. // trigger the data store load
  526. var dispatchstore = new Ext.data.SimpleStore({
  527. fields: ['id', 'state'],
  528. data : dispatches
  529. });
  530. // -- sth, 304 --
  531. /*
  532. Zahlstati
  533. */
  534. var paystatesArray = new Array();
  535. <?php
  536. // Read possible order states
  537. $getStates = mysql_query("
  538. SELECT * FROM s_core_states WHERE `group`='payment' AND id>=0 ORDER BY position ASC
  539. ");
  540. unset($states);
  541. while ($state=mysql_fetch_assoc($getStates)){
  542. $states[] = "[{$state["id"]},'{$state["description"]}']";
  543. ?>
  544. paystatesArray[<?php echo $state["id"] ?>] = '<?php echo utf8_encode($state["description"]) ?>';
  545. <?php
  546. }
  547. ?>
  548. var paystates = [<?php echo implode(",",$states) ?>];
  549. // trigger the data store load
  550. var paystore = new Ext.data.SimpleStore({
  551. id: id,
  552. fields: ['id', 'state'],
  553. data : paystates
  554. });
  555. // For use in filter-form
  556. var paystatesForm = [[-1,'<?php echo $sLang["orderlist"]["orders_show_all"] ?>'],<?php echo implode(",",$states) ?>];
  557. // trigger the data store load
  558. var paystoreForm = new Ext.data.SimpleStore({
  559. id: id,
  560. fields: ['id', 'state'],
  561. data : paystatesForm
  562. });
  563. function renderStatus(val, p, r){
  564. if (val==2 || val==7 || val==12){
  565. return '<span style="color:#009933;">' + r.data.statusDescription + '</span>';
  566. }else {
  567. return '<span style="color:red;">' + r.data.statusDescription + '</span>';
  568. }
  569. }
  570. function renderCleared(val, p, r){
  571. if (val==11 || val==12){
  572. return '<span style="color:#009933;">' + r.data.clearingDescription + '</span>';
  573. }else {
  574. return '<span style="color:red;">' + r.data.clearingDescription + '</span>';
  575. }
  576. }
  577. function renderOption(value, p, record){
  578. value = String.format(
  579. '<a class="ico cards_minus" style="cursor:pointer; float:right;" onclick="myExt.deleteOrderDetail({0},{1},\'{2}\');"></a>',
  580. record.data.id,record.data.orderID,record.data.name
  581. );
  582. if(record.data.articleID)
  583. {
  584. value += String.format(
  585. '<a class="ico package_green" style="cursor:pointer; float:right;" onclick="parent.loadSkeleton(\'articles\', false, \{article: {0}\});"></a>',
  586. record.data.articleID
  587. );
  588. }
  589. return value;
  590. }
  591. function renderEuro(value, meta, record, rowI, colI, store)
  592. {
  593. if(!value)
  594. return "";
  595. var val = String(value);
  596. val = val.split(",").join(".");
  597. val = val.split(" "+record.data.templatechar).join("");
  598. val = Number(val);
  599. val = val.toFixed(2);
  600. val = String(val);
  601. val = val.split(".").join(",");
  602. val = val+" "+record.data.templatechar;
  603. val.substr(0,1) == "-" ? color='red' : color='inherit';
  604. return "<div style='text-align:right;'><font color='"+color+"'>"+val+"</font></div>";
  605. }
  606. // Doc-Window -- sth -- 3.0.4
  607. var windowPanel =
  608. new Ext.Panel({
  609. frame: false,
  610. title: 'Hinweise',
  611. collapsible: false,
  612. html: 'Achtung! Falls Sie Bestellungen markiert haben, zu denen bereits ein Beleg existiert, wird dieser neu generiert!<br />Klicken Sie erst auf Belege drucken, wenn alle markierten Bestellungen bereits in Belege umgewandelt wurden!',
  613. region: 'north',
  614. height: 80
  615. });
  616. /*
  617. <option value="0"><?php echo $sLang["orders"]["main_invoice"] ?></option>
  618. <option value="1"><?php echo $sLang["orders"]["main_bill_of_delivery"] ?></option>
  619. <option value="2"><?php echo $sLang["orders"]["main_credit"] ?></option>
  620. <option value="3"><?php echo $sLang["orders"]["main_reversal"] ?></option>
  621. */
  622. var windowForm = new Ext.FormPanel({
  623. labelWidth: 180,
  624. frame: false,
  625. title: 'Einstellungen',
  626. id: 'formpanelDoc',
  627. region: 'center',
  628. bodyStyle:'padding:5px 5px 0',
  629. split:false,
  630. collapsible: false,
  631. defaults: {width: 170},
  632. items: [
  633. <?php
  634. $query = mysql_query("
  635. SELECT id, name FROM s_core_documents ORDER BY id ASC
  636. ");
  637. while ($doc = mysql_fetch_assoc($query)){
  638. $id = ($doc["id"]-1);
  639. $docs[] = "[$id,'{$doc["name"]}']";
  640. }
  641. ?>
  642. new Ext.form.ComboBox({
  643. fieldLabel: 'Art des Belegs',
  644. store:new Ext.data.SimpleStore({fields:['id','name'],data:[<?php echo implode(",",$docs) ?>]}),
  645. displayField:'name',
  646. valueField:'id',
  647. typeAhead: true,
  648. mode: 'local',
  649. id: 'docKind',
  650. triggerAction: 'all',
  651. selectOnFocus:true,
  652. value:0
  653. }),
  654. new Ext.form.ComboBox({
  655. fieldLabel: 'Modus',
  656. store:new Ext.data.SimpleStore({fields:['id','name'],data:[[0,'Alle Belege neu erstellen'],[1,'Nur nicht vorhandene erstellen']]}),
  657. displayField:'name',
  658. valueField:'id',
  659. typeAhead: true,
  660. mode: 'local',
  661. id: 'docMode',
  662. triggerAction: 'all',
  663. selectOnFocus:true,
  664. value:0
  665. }),
  666. new Ext.form.ComboBox({
  667. fieldLabel: 'Status ?ndern auf',
  668. store: statestoreForm,
  669. displayField:'state',
  670. valueField:'id',
  671. typeAhead: true,
  672. mode: 'local',
  673. id: 'docChangeState',
  674. triggerAction: 'all',
  675. emptyText:'Nicht ?ndern',
  676. selectOnFocus:true,
  677. value:-1
  678. }),
  679. new Ext.form.ComboBox({
  680. fieldLabel: 'Zahlstatus ?ndern auf',
  681. store: paystoreForm,
  682. displayField:'state',
  683. valueField:'id',
  684. typeAhead: true,
  685. mode: 'local',
  686. id: 'docChangePayment',
  687. triggerAction: 'all',
  688. emptyText:'Nicht ?ndern',
  689. selectOnFocus:true,
  690. value:-1
  691. })
  692. ]
  693. });
  694. var progressPanel =
  695. new Ext.Panel({
  696. title: 'Fortschrittsanzeige',
  697. region: 'south',
  698. collapsible: false,
  699. height: 60,
  700. items: [new Ext.ProgressBar({
  701. text:'Klicken Sie auf Belege generieren...!',
  702. id:'install_progress',
  703. cls:'left-align'
  704. })]
  705. });
  706. myExt.window = new Ext.Window({
  707. title: 'Belege verarbeiten',
  708. width: 500,
  709. id: 'window1234',
  710. closeAction: 'hide',
  711. height:400,
  712. minWidth: 300,
  713. minHeight: 400,
  714. layout: 'border',
  715. hidden:true,
  716. plain:true,
  717. bodyStyle:'padding:5px;',
  718. buttonAlign:'center',
  719. items: [windowPanel,windowForm,progressPanel],
  720. buttons: [{
  721. text: 'Belege generieren', handler: myExt.doPDF
  722. },
  723. {
  724. text: 'Belege drucken', handler: myExt.doCombine
  725. },
  726. {
  727. text: 'Schlie?en', handler: function (){
  728. Ext.getCmp('window1234').hide();
  729. }
  730. }]
  731. });
  732. // Doc-Window -- sth -- 3.0.4
  733. var expander = new Ext.grid.RowExpander({
  734. /*tpl : new Ext.Template(
  735. '<p><b>Company:</b> {company}</p><br>',
  736. '<p><b>Summary:</b> {desc}</p>'
  737. ),*/
  738. listeners: {
  739. 'beforeexpand' : {fn: function(expander, record, body, rowIndex){
  740. if(grids[record.data.id])
  741. {
  742. grids[record.data.id].store.load({params:{orderID:record.data.id}});
  743. return;
  744. }
  745. var grid = new Ext.grid.EditorGridPanel({
  746. store: new Ext.data.Store({
  747. url: '<?php echo $_SERVER["SERVER_PORT"] == "80" ? "http" : "https" ?>://<?php echo $sCore->sCONFIG['sBASEPATH']?>/engine/backend/ajax/getOrderDetails.php',
  748. baseParams: {orderID:record.data.id},
  749. reader: new Ext.data.JsonReader({
  750. root: 'articles',
  751. totalProperty: 'count',
  752. id: 'id',
  753. fields: [
  754. 'id','articleordernumber','name','quantity','price','amount','status','tax', 'instock', 'articleID', 'status_description', 'orderID','priceCalc1SourcePrice','priceCalc1Supplier','priceCalc1SKU', 'templatechar', 'attr1', 'attr2'
  755. ]
  756. })
  757. }),
  758. columns: [
  759. {header: "Art-Nr.", dataIndex: "articleordernumber", width:40, sortable: true},
  760. {header: "Bezeichnung", dataIndex: 'name', width: 80, sortable: true},
  761. {header: "Anzahl", dataIndex: 'quantity', width: 40, sortable: true},
  762. //{header: "Bestand", dataIndex: 'instock', width: 30, sortable: true},
  763. {header: "Status", dataIndex: 'status', width: 60, sortable: true,
  764. editor: new Ext.form.ComboBox({
  765. typeAhead: true,
  766. forceSelection: true,
  767. triggerAction: 'all',
  768. store: new Ext.data.SimpleStore({
  769. fields: ['id', 'value'],
  770. data: [
  771. [0, 'Offen'],
  772. [1, 'In Bearbeitung'],
  773. [2, 'Storniert'],
  774. [3, 'Abgeschlossen']
  775. ]
  776. }),
  777. displayField: 'value',
  778. valueField: 'id',
  779. lazyRender: true,
  780. mode:'local',
  781. selectOnFocus:true
  782. }),
  783. renderer: function(value, p, record){
  784. return record.data.status_description;
  785. }
  786. },
  787. {header: "MwSt", dataIndex: 'tax', width: 40, sortable: true, align: 'right'},
  788. {header: "Preis", dataIndex: 'price', width: 40, sortable: true, align: 'right', renderer:renderEuro},
  789. {header: "Gesamt", dataIndex: 'amount', width: 40, sortable: true, align: 'right', renderer:renderEuro},
  790. {header: "Optionen", dataIndex: 'options', width: 40, sortable: true, renderer:renderOption}
  791. ],
  792. stripeRows: false,
  793. trackMouseOver: false,
  794. viewConfig: {
  795. forceFit:true,
  796. stripeRows: false
  797. },
  798. listeners : {
  799. "afteredit" : {fn: function(e){
  800. if (e.value instanceof Date) {
  801. var value = e.value.format('Y-m-d H:i:s');
  802. } else {
  803. var value = e.value;
  804. }
  805. if(e.field=="status")
  806. {
  807. var record = e.grid.colModel.config[e.column].editor.store.getAt(value);
  808. e.record.set("status_description", record.data.value);
  809. }
  810. Ext.Ajax.request({
  811. url: '<?php echo $_SERVER["SERVER_PORT"] == "80" ? "http" : "https" ?>://<?php echo $sCore->sCONFIG['sBASEPATH']?>/engine/backend/ajax/updateOrderDetails.php',
  812. params: {
  813. id: e.record.id,
  814. field: e.field,
  815. value: value
  816. },
  817. success:function(response,options){
  818. e.record.store.commitChanges();
  819. }
  820. });
  821. }, scope:this}
  822. }
  823. });
  824. grids[record.data.id] = grid;
  825. grid.render(body);
  826. grid.store.load();
  827. //body.innerHTML = "<p>test</p>";
  828. }, scope:this},
  829. 'beforecollapse' : {fn: function(expander, record, body, rowIndex){
  830. //console.log(rowIndex);
  831. }, scope:this}
  832. }
  833. });
  834. var cm = new Ext.grid.ColumnModel([
  835. {
  836. header: "",
  837. width: 20,
  838. sortable: false,
  839. locked:true,
  840. renderer: function (v,p,r,rowIndex,i,ds){
  841. if (r.data.pdf){
  842. var pdf = '<a class="ico page_white_acrobat"></a>';
  843. }else {
  844. var pdf = '';
  845. }
  846. return '<input type="checkbox" class="markedOrders" name="markedOrders" value="'+r.data.id+'" style="float:left;margin-right:3px" />'+pdf;
  847. }
  848. },
  849. expander,
  850. {
  851. id: 'customernumber',
  852. header: "<?php echo $sLang["orderlist"]["orders_time"] ?>",
  853. dataIndex: 'ordertimeFormated',
  854. width: 150,
  855. sortable: true
  856. },
  857. {
  858. id: 'regdate',
  859. header: "<?php echo $sLang["orderlist"]["orders_ordernumber"] ?>",
  860. dataIndex: 'ordernumber',
  861. width: 70,
  862. sortable: true
  863. },
  864. {
  865. header: "<?php echo $sLang["orderlist"]["orders_Amount"] ?>",
  866. dataIndex: 'invoice_amount',
  867. width: 35,
  868. align: 'right',
  869. sortable: true
  870. },
  871. {
  872. id: 'transactionID',
  873. header: "<?php echo $sLang["orderlist"]["orders_Transaction"] ?>",
  874. dataIndex: 'transactionID',
  875. width: 80,
  876. editor: new Ext.form.TextField({readOnly:true}),
  877. sortable: true
  878. },
  879. {
  880. id: 'dispatch',
  881. header: "Versandart",
  882. dataIndex: 'dispatch',
  883. width: 80,
  884. sortable: true
  885. },
  886. {
  887. id: 'subshopID',
  888. header: "Shop",
  889. dataIndex: 'subshop',
  890. width: 80,
  891. sortable: true
  892. },
  893. {
  894. id: 'orderstate',
  895. header: "<?php echo $sLang["orderlist"]["orders_Order_Status"] ?>",
  896. dataIndex: 'status',
  897. width: 100,
  898. renderer: renderStatus,
  899. editor: new Ext.form.ComboBox({
  900. typeAhead: true,
  901. forceSelection: true,
  902. triggerAction: 'all',
  903. store: statestore,
  904. width: 200,
  905. displayField: 'state',
  906. valueField: 'id',
  907. lazyRender: false,
  908. mode:'local',
  909. selectOnFocus:true
  910. }),
  911. sortable: true
  912. },
  913. {
  914. id: 'lastname',
  915. header: "<?php echo $sLang["orderlist"]["orders_paymentstatus"] ?>",
  916. dataIndex: 'cleared',
  917. width: 100,
  918. renderer: renderCleared,
  919. editor: new Ext.form.ComboBox({
  920. typeAhead: true,
  921. forceSelection: true,
  922. triggerAction: 'all',
  923. store: paystore,
  924. width: 200,
  925. displayField: 'state',
  926. valueField: 'id',
  927. lazyRender: false,
  928. mode:'local',
  929. selectOnFocus:true
  930. }),
  931. sortable: true
  932. },
  933. {
  934. header: "<?php echo $sLang["orderlist"]["orders_paymentdescription"] ?>",
  935. dataIndex: 'paymentDescription',
  936. width: 75,
  937. sortable: true
  938. },
  939. {
  940. header: "<?php echo $sLang["orderlist"]["orders_customer"] ?>",
  941. dataIndex: 'customer',
  942. width: 75,
  943. sortable: true
  944. },
  945. {
  946. header: "<?php echo $sLang["orderlist"]["orders_options"] ?>",
  947. dataIndex: 'options',
  948. width: 85,
  949. align: 'right',
  950. renderer: renderOptions
  951. }
  952. ]);
  953. cm.defaultSortable = true;
  954. function renderOptions(value, p, r){
  955. var id = r.data.id;
  956. var name = r.data.ordernumber + " " + r.data.customer;
  957. var ordernumber = r.data.ordernumber;
  958. var customer = r.data.customer;
  959. var orderAmount = r.data.invoice_amount;
  960. return String.format(
  961. '<a class="ico pencil" style="cursor:pointer" onclick="myExt.openClient({0},{1})"></a><a class="ico pencil_arrow" style="cursor:pointer" onclick="parent.loadSkeleton({2},false,{3})"></a><a class="ico delete" style="cursor:pointer" onclick="myExt.deleteOrder({4},{5},{6})"></a><a class="ico money_plus" style="cursor:pointer" title="Betrag einziehen" onclick="myExt.captureAmount({4},{5},{6},{7})"></a><a class="ico money_minus" style="cursor:pointer" title="Betrag gutschreiben" onclick="myExt.refundAmount({4},{5},{6})"></a>',id,"'"+name+"'","'orders'","{'id':"+r.data.id+"}",id,"'"+ordernumber+"'","'"+customer+"'","'"+orderAmount+"'"
  962. );
  963. }
  964. Ext.ux.IFrameComponent = Ext.extend(Ext.BoxComponent, {
  965. onRender : function(ct, position){
  966. this.el = ct.createChild({tag: 'iframe', id: 'framepanel'+this.id, frameBorder: 0, src: this.url});
  967. }
  968. });
  969. var limitArray = [['25'],['50'],['100'],['250'],['500']];
  970. var limitStore = new Ext.data.SimpleStore({
  971. fields: ['limitArray'],
  972. data : limitArray
  973. });
  974. var pager = new Ext.PagingToolbar({
  975. pageSize: 25,
  976. store: store,
  977. displayInfo: true,
  978. displayMsg: '<?php echo $sLang["orderlist"]["orders_orders"] ?> {0} - {1} <?php echo $sLang["orderlist"]["orders_from"] ?> {2}',
  979. emptyMsg: "<?php echo $sLang["orderlist"]["orders_no_orders_found"] ?>",
  980. items:[
  981. '<?php echo $sLang["orderlist"]["orders_numbers_of_orders"] ?>',
  982. {
  983. xtype: 'combo',
  984. id: 'status',
  985. fieldLabel: 'Last Name',
  986. typeAhead: false,
  987. title:'<?php echo $sLang["orderlist"]["orders_numbers_of_orders"] ?>',
  988. forceSelection: false,
  989. triggerAction: 'all',
  990. store: limitStore,
  991. displayField: 'limitArray',
  992. lazyRender: false,
  993. lazyInit: false,
  994. mode:'local',
  995. width: 120,
  996. selectOnFocus:true,
  997. listClass: 'x-combo-list-small',
  998. listeners: {
  999. 'change' : {fn: limitFilter, scope:this}
  1000. }
  1001. },
  1002. '-'
  1003. ,
  1004. '<?php echo $sLang["user"]["user_search"] ?> ',
  1005. {
  1006. xtype: 'textfield',
  1007. id: 'search',
  1008. selectOnFocus: true,
  1009. width: 120,
  1010. listeners: {
  1011. 'render': {fn:function(ob){
  1012. ob.el.on('keyup', searchFilter, this, {buffer:500});
  1013. }, scope:this}
  1014. }
  1015. },new Ext.Button ( {
  1016. text: '<?php echo $sLang["orderlist"]["orders_update"] ?>',
  1017. handler: myExt.reload
  1018. }),
  1019. new Ext.Button ({
  1020. text: 'Alle markieren',
  1021. handler: myExt.markAll
  1022. })
  1023. ,new Ext.Button ( {
  1024. text: 'Belege verarbeiten',
  1025. handler: myExt.showProcess
  1026. })
  1027. ]
  1028. });
  1029. var AutoHeightGridView = Ext.extend(Ext.grid.GridView, {
  1030. onLayout: function () {
  1031. Ext.get(this.innerHd).setStyle("float", "none");
  1032. this.scroller.setStyle("overflow-x", "auto");
  1033. }
  1034. });
  1035. var grid = new Ext.grid.EditorGridPanel({
  1036. region:'center',
  1037. id: 'orderlist_grid',
  1038. width:700,
  1039. title:'<?php echo $sLang["orderlist"]["orders_Order_Summary"] ?>',
  1040. store: store,
  1041. cm: cm,
  1042. plugins: expander,
  1043. autoHeight:false,
  1044. autoSizeColumns: true,
  1045. trackMouseOver:true,
  1046. //Ext Bug Using Hotfix "emptyFn"
  1047. sm: new Ext.grid.RowSelectionModel({selectRow:Ext.emptyFn}),
  1048. loadMask: true,
  1049. stripeRows: true,
  1050. view: new AutoHeightGridView(),
  1051. bbar: pager,
  1052. listeners: {
  1053. 'activate': function(){Ext.getCmp('leftPanel').expand();},
  1054. 'rowclick' : {fn: function(grid,number,event){
  1055. var gridField = grid.store.data.items[number].data;
  1056. if (!gridField.pdf){
  1057. storeDocuments.removeAll();
  1058. return;
  1059. }
  1060. //console.log(gridField);
  1061. var id = gridField.id;
  1062. // baseParams: {pagingID:storeid,type:'forExt3',id: 6},
  1063. storeDocuments.load({params:{start:0,id:id, limit:25,type:'forExt3'}});
  1064. return false;
  1065. }
  1066. }
  1067. }});
  1068. //grid.store.on('load',grid.autoSizeColumns,grid);
  1069. function limitFilter () {
  1070. var status = Ext.getCmp("status");
  1071. grid.store.baseParams["limit"] = status.getValue();
  1072. pager.pageSize = parseInt(status.getValue());
  1073. grid.store.lastOptions.params["start"] = 0;
  1074. grid.store.reload();
  1075. }
  1076. grid.addListener('afteredit', changeStatus);
  1077. grid.addListener('beforeedit', function(grid){
  1078. if(grid.field == "cleared")
  1079. {
  1080. if(grid.value == 0)
  1081. {
  1082. store.getAt(grid.row).set('cleared', 17);
  1083. }
  1084. }
  1085. });
  1086. function changeStatus(oGrid_Event) {
  1087. //console.log(oGrid_Event);
  1088. if (oGrid_Event.value instanceof Date) {
  1089. var fieldValue = oGrid_Event.value.format('Y-m-d H:i:s');
  1090. } else {
  1091. var fieldValue = oGrid_Event.value;
  1092. }
  1093. Ext.Ajax.request({
  1094. waitMsg: 'Saving changes...',
  1095. url: "<?php echo $_SERVER["SERVER_PORT"] == "80" ? "http" : "https" ?>://<?php echo $sCore->sCONFIG['sBASEPATH']?>/engine/backend/ajax/changeOrderState.php",
  1096. params: {
  1097. //task: "update",
  1098. //key: 'articleID',
  1099. artID: oGrid_Event.record.id,
  1100. field: oGrid_Event.field,
  1101. value: fieldValue,
  1102. originalValue: oGrid_Event.record.modified
  1103. },
  1104. success:function(response,options){
  1105. if (oGrid_Event.field=="status"){
  1106. oGrid_Event.record.data.statusDescription = oGrid_Event.grid.store.stateArray[fieldValue];
  1107. var newState = oGrid_Event.grid.store.stateArray[fieldValue];
  1108. var payment = oGrid_Event.record.data.paymentTpl;
  1109. StageChangeMailRequest (oGrid_Event.record.id,fieldValue,payment,oGrid_Event.record.data.ordernumber);
  1110. }else if(oGrid_Event.field=="cleared"){
  1111. oGrid_Event.record.data.clearingDescription = oGrid_Event.grid.store.clearedArray[fieldValue];
  1112. var newState = oGrid_Event.grid.store.clearedArray[fieldValue];
  1113. StageChangeMailRequest (oGrid_Event.record.id,fieldValue,"","");
  1114. }else if (oGrid_Event.field=="trackingcode"&&fieldValue!="")
  1115. {
  1116. //var myAjax = new Ajax('OrderStateMail.php',{method: 'post', onComplete: function(){
  1117. // parent.Growl("<?php echo$sLang["orderlist"]["orders_mail_send"]?>");
  1118. //}}).request("action=sendTrackingCodeMail&id="+oGrid_Event.record.data.id);
  1119. StageChangeMailRequest (oGrid_Event.record.id,"TrackingCode","","");
  1120. }
  1121. //parent.Growl("<?php echo $sLang["orderlist"]["orders_The_status_of_the_order"] ?> "+oGrid_Event.record.data.ordernumber+" <?php echo $sLang["orderlist"]["orders_has_left"] ?> "+newState+" <?php echo $sLang["orderlist"]["orders_amended"] ?>");
  1122. //console.log(oGrid_Event.record);
  1123. store.commitChanges();
  1124. // Show window to send email notification about state change
  1125. }
  1126. });
  1127. }
  1128. function searchFilter () {
  1129. var search = Ext.getCmp("search");
  1130. store.baseParams["search"] = search.getValue();
  1131. store.lastOptions.params["start"] = 0;
  1132. store.reload();
  1133. }
  1134. store.load({params:{start:0, limit:25, filterPayment: "<?php echo $PAYONE_ID ?>"}});
  1135. store.stateArray = statestoreArray;
  1136. store.paymentArray = paymentArray;
  1137. store.clearedArray = paystatesArray;
  1138. store.on('load',function(x,y,z){
  1139. // Reload store
  1140. var data = x.reader.jsonData;
  1141. // => Refresh statistics
  1142. var amountData = [
  1143. ['<?php echo $sLang["orderlist"]["orders_Turnover"] ?>',data.totalAmount],
  1144. ['<?php echo $sLang["orderlist"]["orders_Orders"] ?>',data.totalCount]
  1145. ];
  1146. for (var item in data){
  1147. if (item.match(/payment/)){
  1148. var paymentID = item.replace(/payment/,"");
  1149. amountData[amountData.length] = ['Per '+x.paymentArray[paymentID],data[item]];
  1150. }
  1151. if (item.match(/status/)){
  1152. var stateID = item.replace(/status/,"");
  1153. amountData[amountData.length] = [x.stateArray[stateID],data[item]];
  1154. }
  1155. }
  1156. storeAmount.loadData(amountData);
  1157. });
  1158. var checkboxgroup = {
  1159. xtype: 'checkboxgroup',
  1160. hideLabel: true,
  1161. itemCls: 'x-check-group-alt',
  1162. id: 'x1',
  1163. columns: 1,
  1164. items: [<?php
  1165. $result = mysql_query("
  1166. SELECT id, description FROM s_core_states WHERE `group`='state' AND id>=0 ORDER BY position ASC
  1167. ");
  1168. $order_status = array();
  1169. if($result&&mysql_num_rows($result))
  1170. while ($status = mysql_fetch_assoc($result)){
  1171. $order_status[$status["id"]] = $status["description"];
  1172. }
  1173. $a=0;
  1174. foreach ($order_status as $id=>$value){
  1175. if($a != 0 && $a < count($order_status)) echo ",";
  1176. ?>{boxLabel: '<?php echo$value?>', name: '<?php echo$id?>', checked: false}<?php
  1177. $a++;
  1178. }
  1179. ?>]
  1180. };
  1181. var checkboxgroup2 = {
  1182. xtype: 'checkboxgroup',
  1183. hideLabel: true,
  1184. itemCls: 'x-check-group-alt',
  1185. columns: 1,
  1186. id: 'x2',
  1187. items: [<?php
  1188. $result = mysql_query("
  1189. SELECT id, description FROM s_core_states WHERE `group`='payment' AND id>=0 ORDER BY position ASC
  1190. ");
  1191. $order_status2 = array();
  1192. if($result&&mysql_num_rows($result))
  1193. while ($status = mysql_fetch_assoc($result)){
  1194. $order_status2[$status["id"]] = $status["description"];
  1195. }
  1196. $a = 0;
  1197. foreach ($order_status2 as $id=>$value){
  1198. if($a != 0 && $a < count($order_status2)) echo ",";
  1199. ?>{boxLabel: '<?php echo$value?>', name: '<?php echo$id?>', checked: false}<?php
  1200. $a++;
  1201. }
  1202. ?>]
  1203. };
  1204. var checkboxgroup3 = {
  1205. xtype: 'checkboxgroup',
  1206. hideLabel: true,
  1207. itemCls: 'x-check-group-alt',
  1208. columns: 1,
  1209. id: 'x3',
  1210. style: 'overflow:hidden;',
  1211. items: [<?php
  1212. echo join (',', $zahlungs_methoden);
  1213. ?>]
  1214. };
  1215. var dr = new Ext.FormPanel({
  1216. labelWidth: 80,
  1217. frame: true,
  1218. id: 'formpanel',
  1219. layout:'form',
  1220. bodyStyle:'padding:5px 5px 0',
  1221. split:true,
  1222. collapsible: true,
  1223. defaults: {width: 170},
  1224. defaultType: 'datefield',
  1225. items: [{
  1226. fieldLabel: '<?php echo $sLang["orderlist"]["orders_from"] ?>',
  1227. name: 'startdt',
  1228. id: 'startdt',
  1229. format: 'd.m.Y',
  1230. value: '<?php echo date("d.m.Y",mktime(0,0,0,date("m"),date("d")-7,date("Y"))) ?>',
  1231. endDateField: 'enddt' // id of the end date field
  1232. },{
  1233. fieldLabel: '<?php echo $sLang["orderlist"]["orders_until"] ?>',
  1234. name: 'enddt',
  1235. id: 'enddt',
  1236. format: 'd.m.Y',
  1237. value: '<?php echo date("d.m.Y") ?>',
  1238. startDateField: 'startdt' // id of the start date field
  1239. },
  1240. /*
  1241. new Ext.form.ComboBox({
  1242. fieldLabel: 'Status',
  1243. store: statestoreForm,
  1244. displayField:'state',
  1245. valueField:'id',
  1246. typeAhead: true,
  1247. mode: 'local',
  1248. id: 'filterstate',
  1249. triggerAction: 'all',
  1250. emptyText:'<?php echo $sLang["orderlist"]["orders_Please_select"] ?>',
  1251. selectOnFocus:true,
  1252. value:-1
  1253. }),
  1254. */
  1255. new Ext.form.ComboBox({
  1256. fieldLabel: 'Status',
  1257. id: 'filterstate',
  1258. name:'state2',
  1259. hiddenName:'state2',
  1260. layout: 'form',
  1261. store:new Ext.data.SimpleStore({fields:[["id"],["name"]],data:[[]]}),
  1262. valueField:'id',
  1263. displayField:'name',
  1264. editable:true,
  1265. forceSelection : true,
  1266. shadow:false,
  1267. mode: 'local',
  1268. triggerAction:'all',
  1269. emptyText:'<?php echo $sLang["orderlist"]["orders_show_all"] ?>',
  1270. maxHeight: 200,
  1271. lazyInit: true,
  1272. tpl: '<tpl for="."></tpl>',
  1273. selectedClass:'',
  1274. onSelect:Ext.emptyFn,
  1275. //emptyText:'<?php echo $sLang["orderlist"]["orders_show_all"] ?>',
  1276. //value:-1,
  1277. listeners: {
  1278. 'render': {fn:function(combobox){
  1279. //combobox.store.add(new Ext.data.Record({id: -1,name: '<?php echo $sLang["orderlist"]["orders_show_all"] ?>'},-1));
  1280. //combobox.setValue(-1);
  1281. }, scope:this},
  1282. 'expand': {fn:function(combobox){
  1283. Ext.destroy(Ext.getCmp('checkboxgroupform1'));
  1284. var checkboxgroupform1 = new Ext.FormPanel({
  1285. id: 'checkboxgroupform1',
  1286. items: checkboxgroup,
  1287. style: "font-size:12px"
  1288. });
  1289. checkboxgroupform1.render(combobox.innerList);
  1290. }, scope:this},
  1291. 'collapse': {fn:function(combobox){
  1292. var values = Ext.getCmp('checkboxgroupform1').getForm().getValues();
  1293. var id = "";
  1294. var text = "";
  1295. var count = 0;
  1296. for (var itemID in checkboxgroup.items)
  1297. {
  1298. if(values[checkboxgroup.items[itemID].name]=='on')
  1299. checkboxgroup.items[itemID].checked = true;
  1300. else
  1301. checkboxgroup.items[itemID].checked = false;
  1302. }
  1303. for (var statusID in values)
  1304. {
  1305. if(count) id += ",";
  1306. if(count) text += ", ";
  1307. id += statusID;
  1308. text += statestoreArray[statusID];
  1309. count++;
  1310. }
  1311. if(count!=0&&count!=statestoreArray.length)
  1312. {
  1313. combobox.store.add(new Ext.data.Record({id: id,name: text},id));
  1314. combobox.setValue(id);
  1315. }
  1316. else
  1317. {
  1318. combobox.setValue(null);
  1319. }
  1320. }, scope:this}
  1321. }
  1322. }),
  1323. new Ext.form.ComboBox({
  1324. fieldLabel: '<?php echo $sLang["orderlist"]["orders_Number_status"] ?>',
  1325. id: 'filtercleared',
  1326. name:'state',
  1327. hiddenName:'state',
  1328. layout: 'form',
  1329. store:new Ext.data.SimpleStore({fields:[["id"],["name"]],data:[[]]}),
  1330. valueField:'id',
  1331. displayField:'name',
  1332. editable:true,
  1333. forceSelection : true,
  1334. shadow:false,
  1335. mode: 'local',
  1336. triggerAction:'all',
  1337. emptyText:'<?php echo $sLang["orderlist"]["orders_show_all"] ?>',
  1338. maxHeight: 200,
  1339. lazyInit: true,
  1340. tpl: '<tpl for="."></tpl>',
  1341. selectedClass:'',
  1342. onSelect:Ext.emptyFn,
  1343. listeners: {
  1344. 'render': {fn:function(combobox){
  1345. //combobox.store.add(new Ext.data.Record({id: -1,name: '<?php echo $sLang["orderlist"]["orders_show_all"] ?>'},-1));
  1346. //combobox.setValue(-1);
  1347. }, scope:this},
  1348. 'expand': {fn:function(combobox){
  1349. Ext.destroy(Ext.getCmp('checkboxgroupform2'));
  1350. var checkboxgroupform2 = new Ext.FormPanel({
  1351. id: 'checkboxgroupform2',
  1352. items: checkboxgroup2
  1353. });
  1354. checkboxgroupform2.render(combobox.innerList);
  1355. }, scope:this},
  1356. 'collapse': {fn:function(combobox){
  1357. var values = Ext.getCmp('checkboxgroupform2').getForm().getValues();
  1358. var id = "";
  1359. var text = "";
  1360. var count = 0;
  1361. for (var itemID in checkboxgroup2.items)
  1362. {
  1363. if(values[checkboxgroup2.items[itemID].name]=='on')
  1364. checkboxgroup2.items[itemID].checked = true;
  1365. else
  1366. checkboxgroup2.items[itemID].checked = false;
  1367. }
  1368. for (var statusID in values)
  1369. {
  1370. if(count) id += ",";
  1371. if(count) text += ", ";
  1372. id += statusID;
  1373. text += paystatesArray[statusID];
  1374. count++;
  1375. }
  1376. if(count!=0&&count!=<?php echo (int)count($order_status2);?>)
  1377. {
  1378. combobox.store.add(new Ext.data.Record({id: id,name: text},id));
  1379. combobox.setValue(id);
  1380. }
  1381. else
  1382. {
  1383. combobox.setValue(null);
  1384. }
  1385. }, scope:this}
  1386. }
  1387. }),
  1388. /*
  1389. new Ext.form.ComboBox({
  1390. fieldLabel: '<?php echo $sLang["orderlist"]["orders_payment"] ?>',
  1391. store: paymentstore,
  1392. displayField:'state',
  1393. valueField:'id',
  1394. typeAhead: true,
  1395. mode: 'local',
  1396. id: 'filterpayment',
  1397. triggerAction: 'all',
  1398. emptyText:'<?php echo $sLang["orderlist"]["orders_Please_select"] ?>',
  1399. selectOnFocus:true,
  1400. value:-1
  1401. }),
  1402. */
  1403. new Ext.form.ComboBox({
  1404. fieldLabel: 'Zahlungsart',
  1405. id: 'filterpayment',
  1406. name:'state3',
  1407. hiddenName:'state3',
  1408. layout: 'form',
  1409. store:new Ext.data.SimpleStore({fields:[["id"],["name"]],data:[[]]}),
  1410. valueField:'id',
  1411. displayField:'name',
  1412. editable:false,
  1413. disabled:true,
  1414. forceSelection : true,
  1415. shadow:false,
  1416. mode: 'local',
  1417. triggerAction:'all',
  1418. emptyText:'<?php echo $sLang["orderlist"]["orders_show_all"] ?>',
  1419. value: 'PAYONE',
  1420. maxHeight: 200,
  1421. lazyInit: true,
  1422. tpl: '<tpl for="."></tpl>',
  1423. selectedClass:'',
  1424. onSelect:Ext.emptyFn,
  1425. listeners: {
  1426. 'render': {fn:function(combobox){
  1427. //combobox.store.add(new Ext.data.Record({id: -1,name: '<?php echo $sLang["orderlist"]["orders_show_all"] ?>'},-1));
  1428. //combobox.setValue(-1);
  1429. }, scope:this},
  1430. 'expand': {fn:function(combobox){
  1431. Ext.destroy(Ext.getCmp('checkboxgroupform3'));
  1432. var checkboxgroupform3 = new Ext.FormPanel({
  1433. id: 'checkboxgroupform3',
  1434. items: checkboxgroup3
  1435. });
  1436. checkboxgroupform3.render(combobox.innerList);
  1437. }, scope:this},
  1438. 'collapse': {fn:function(combobox){
  1439. var values = Ext.getCmp('checkboxgroupform3').getForm().getValues();
  1440. var id = "";
  1441. var text = "";
  1442. var count = 0;
  1443. for (var itemID in checkboxgroup3.items)
  1444. {
  1445. if(values[checkboxgroup3.items[itemID].name]=='on')
  1446. checkboxgroup3.items[itemID].checked = true;
  1447. else
  1448. checkboxgroup3.items[itemID].checked = false;
  1449. }
  1450. for (var statusID in values)
  1451. {
  1452. if(count) id += ",";
  1453. if(count) text += ", ";
  1454. id += statusID;
  1455. text += paymentArray[stat

Large files files are truncated, but you can click here to view the full file