Skip to content

Commit 2135b99

Browse files
authored
lmo-minitab_save.php ist im Download des SF Repo nicht vorhanden
1 parent e1979df commit 2135b99

1 file changed

Lines changed: 90 additions & 0 deletions

File tree

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?php
2+
/** Liga Manager Online 4
3+
*
4+
* http://lmo.sourceforge.net/
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU General Public License as
8+
* published by the Free Software Foundation; either version 2 of
9+
* the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* General Public License for more details.
15+
*
16+
* REMOVING OR CHANGING THE COPYRIGHT NOTICES IS NOT ALLOWED!
17+
*
18+
*/
19+
20+
if(($_SESSION['lmouserok']==2)||($_SESSION['lmouserok']==1)){
21+
/*Minitabellen-CSV schreiben*/
22+
if ($lmtype==0) {
23+
$fp = fopen(PATH_TO_LMO.'/'.$diroutput.basename($file).'-tab.csv',"wb"); //TabellenCSV Datei
24+
if ($st>0) {
25+
$rounds=$a;
26+
$act=$st;
27+
} else {
28+
$act=$stx;
29+
}
30+
for($i1=0;$i1<$anzsp;$i1++){
31+
if (isset($goala[$act-1][$i1]) && $goala[$act-1][$i1]=="-1") $goala[$act-1][$i1]="_";
32+
if (isset($goalb[$act-1][$i1]) && $goalb[$act-1][$i1]=="-1") $goalb[$act-1][$i1]="_";
33+
}
34+
//$endtab=$act;
35+
$endtab=$anzst;
36+
include(PATH_TO_LMO."/lmo-calctable.php");
37+
for($i1=0;$i1<$anzsp;$i1++){
38+
if (isset($goala[$act-1][$i1]) && $goala[$act-1][$i1]=="_") $goala[$act-1][$i1]="-1";
39+
if (isset($goalb[$act-1][$i1]) && $goalb[$act-1][$i1]=="_") $goalb[$act-1][$i1]="-1";
40+
}
41+
$x=0;
42+
$j = 1;
43+
foreach ($tab0 as $y) {
44+
$x++;
45+
$tabledata=explode('|',chunk_split($y,8,"|"));
46+
47+
fwrite($fp,$teams[$tabledata[4]-50000000].'|'); //TeamLongName (langer Name)
48+
fwrite($fp,$teamk[$tabledata[4]-50000000].'|'); //TeamAbbrevation (kurzer Name)
49+
fwrite($fp,applyFactor($punkte[$tabledata[4]-50000000],$pointsfaktor).'|'); //Points+
50+
if ($minus == 2) {
51+
fwrite($fp,applyFactor($negativ[$tabledata[4]-50000000],$pointsfaktor)); //Points-
52+
}
53+
fwrite($fp,'|');
54+
fwrite($fp,applyFactor($etore[$tabledata[4]-50000000],$goalfaktor).'|'); //Goals+
55+
fwrite($fp,applyFactor($atore[$tabledata[4]-50000000],$goalfaktor).'|'); //Goals-
56+
fwrite($fp,$spiele[$tabledata[4]-50000000].'|'); //Games
57+
fwrite($fp,$siege[$tabledata[4]-50000000].'|'); //Win
58+
fwrite($fp,$unent[$tabledata[4]-50000000].'|'); //Draw
59+
fwrite($fp,$nieder[$tabledata[4]-50000000].'|'); //Loss
60+
if (($tabledata[4]-50000000)==$favteam) { //Marking
61+
fwrite($fp,"F");
62+
}
63+
if (($x == 1) && ($champ != 0)) {
64+
fwrite($fp,"M");
65+
$j = 2;
66+
}
67+
if (($x >= $j) && ($x < $j+$anzcl) && ($anzcl > 0)) {
68+
fwrite($fp,"C");
69+
}
70+
if (($x >= $j+$anzcl) && ($x < $j+$anzcl+$anzck) && ($anzck > 0)) {
71+
fwrite($fp,"Q");
72+
}
73+
if (($x >= $j+$anzcl+$anzck) && ($x < $j+$anzcl+$anzck+$anzuc) && ($anzuc > 0)) {
74+
fwrite($fp,"U");
75+
}
76+
if (($x <= $anzteams-$anzab) && ($x > $anzteams-$anzab-$anzar) && ($anzar > 0)) {
77+
fwrite($fp,"R");
78+
}
79+
if (($x <= $anzteams) && ($x > $anzteams-$anzab) && ($anzab > 0)) {
80+
fwrite($fp,"A");
81+
}
82+
83+
fwrite($fp,'|'.$teamn[$tabledata[4]-50000000]); //TeamShortName (Mittellanger Name)
84+
fwrite($fp,'|'.$teamm[$tabledata[4]-50000000]);
85+
fwrite($fp,"\n");
86+
}
87+
fclose($fp);
88+
}
89+
/*Minitabellen-CSV schreiben*/
90+
}

0 commit comments

Comments
 (0)