| Zeile 22... |
Zeile 22... |
| 22 |
*
|
22 |
*
|
| 23 |
* @return
|
23 |
* @return
|
| 24 |
*/
|
24 |
*/
|
| 25 |
public function index($anker = '')
|
25 |
public function index($anker = '')
|
| 26 |
{
|
26 |
{
|
| - |
|
27 |
$ausgabearten = array(
|
| - |
|
28 |
array(
|
| - |
|
29 |
"id" => 0,
|
| - |
|
30 |
"name" => "Bestellung",
|
| - |
|
31 |
),
|
| - |
|
32 |
array(
|
| - |
|
33 |
"id" => 1,
|
| - |
|
34 |
"name" => "Artikel",
|
| - |
|
35 |
),
|
| - |
|
36 |
array(
|
| - |
|
37 |
"id" => 2,
|
| - |
|
38 |
"name" => "Schnelleditor",
|
| - |
|
39 |
),
|
| - |
|
40 |
array(
|
| - |
|
41 |
"id" => 3,
|
| - |
|
42 |
"name" => "Bestelldetail",
|
| - |
|
43 |
),
|
| - |
|
44 |
);
|
| - |
|
45 |
|
| - |
|
46 |
$ausgabearten_sel = select_tpl( "filter[ausgabeart]", $ausgabearten, "id",
|
| - |
|
47 |
"name", $filter["ausgabeart"], true );
|
| - |
|
48 |
$bestellarten_sel = "";
|
| - |
|
49 |
if ( is_array( $bestellarten ) )
|
| - |
|
50 |
{
|
| - |
|
51 |
$showAlle = ( isset( $user_rechte["Warenwirtschaft"]["bestellung"]["bestellart"] ) &&
|
| - |
|
52 |
isset( $_SESSION["datenquellen"]["bestellarten"] ) && count( $_SESSION["datenquellen"]["bestellarten"] ) <=
|
| - |
|
53 |
1 );
|
| - |
|
54 |
$bestellarten_sel = select_tpl( "filter[bestellart_id]", $bestellarten,
|
| - |
|
55 |
"id", "name", $filter["bestellart_id"], $showAlle );
|
| - |
|
56 |
}
|
| - |
|
57 |
$shops_neu = getShops();
|
| - |
|
58 |
$showAlle = ( isset( $_SESSION["datenquellen"]["shops"] ) && count( $_SESSION["datenquellen"]["shops"] ) <=
|
| - |
|
59 |
1 );
|
| - |
|
60 |
$shops_sel = select_tpl( "filter[shopID]", $shops_neu, "ID", "Name", $filter["shopID"],
|
| - |
|
61 |
$showAlle );
|
| - |
|
62 |
|
| - |
|
63 |
$stati = array(
|
| - |
|
64 |
"" => "alle",
|
| - |
|
65 |
"op_ib" => "offen und in B.",
|
| - |
|
66 |
"op_ib_re" => "of.,in B.u.res.",
|
| - |
|
67 |
"op" => "offene Posten",
|
| - |
|
68 |
"ib" => "in Bearbeitung",
|
| - |
|
69 |
"re" => "reserviert",
|
| - |
|
70 |
"er" => "erledigt",
|
| - |
|
71 |
"ab" => "abgeschlossen",
|
| - |
|
72 |
);
|
| - |
|
73 |
$zeiten = array(
|
| - |
|
74 |
"alle",
|
| - |
|
75 |
"heute",
|
| - |
|
76 |
"gestern",
|
| - |
|
77 |
"vorgestern",
|
| - |
|
78 |
"lfd. Woche",
|
| - |
|
79 |
"letzte Woche",
|
| - |
|
80 |
strftime( "%B %G" ),
|
| - |
|
81 |
strftime( "%B %G", strtotime( "-1 month" ) ),
|
| - |
|
82 |
strftime( "%B %G", strtotime( "-2 months" ) ),
|
| - |
|
83 |
strftime( "%B %G", strtotime( "-3 months" ) ),
|
| - |
|
84 |
strftime( "%B %G", strtotime( "-4 months" ) ),
|
| - |
|
85 |
strftime( "%B %G", strtotime( "-5 months" ) ),
|
| - |
|
86 |
strftime( "%B %G", strtotime( "-6 months" ) ),
|
| - |
|
87 |
strftime( "%B %G", strtotime( "-7 months" ) ),
|
| - |
|
88 |
strftime( "%Y", time() ),
|
| - |
|
89 |
strftime( "%Y", strtotime( "-1 year" ) ) );
|
| - |
|
90 |
$rstati = array(
|
| - |
|
91 |
"" => "alle",
|
| - |
|
92 |
"S" => "schreiben",
|
| - |
|
93 |
"G" => "geschrieben",
|
| - |
|
94 |
"B" => "bezahlt",
|
| - |
|
95 |
"O" => "ohne",
|
| - |
|
96 |
);
|
| - |
|
97 |
|
| - |
|
98 |
$laender_filter = getBestelllaender();
|
| - |
|
99 |
|
| - |
|
100 |
if (isset($GLOBALS["web_rechte"]["Warenwirtschaft"]["logistiker"]["logistiker"]))
|
| - |
|
101 |
{
|
| - |
|
102 |
$logistiker_filter = getLogistikerFilter();
|
| - |
|
103 |
$this->smarty->assign("logistiker_filter", $logistiker_filter);
|
| - |
|
104 |
$this->smarty->assign("logistiker_filter_sel", $filter["logistiker"]);
|
| - |
|
105 |
}
|
| - |
|
106 |
// Variablen zu Template zuweisen
|
| - |
|
107 |
$this->smarty->assign("stati", $stati);
|
| - |
|
108 |
$this->smarty->assign("stati_sel", $filter["status"]);
|
| - |
|
109 |
$this->smarty->assign("rstati", $rstati);
|
| - |
|
110 |
$this->smarty->assign("rstati_sel", $filter["rechnungsstatus"]);
|
| - |
|
111 |
$this->smarty->assign("zeiten", $zeiten);
|
| - |
|
112 |
$this->smarty->assign("zeiten_sel", $filter["zeit"]);
|
| - |
|
113 |
$this->smarty->assign("bStatus", $bStatus);
|
| - |
|
114 |
$this->smarty->assign("bStatus_sel", $filter["bStatus"]);
|
| - |
|
115 |
$this->smarty->assign("ausgabearten", $ausgabearten_sel);
|
| - |
|
116 |
$this->smarty->assign("bestellarten", $bestellarten_sel);
|
| - |
|
117 |
$this->smarty->assign("bestellart", $bestellart);
|
| - |
|
118 |
$this->smarty->assign("bestellung_ID", $filter["bestellung_ID"]);
|
| - |
|
119 |
$this->smarty->assign("fremd_ID", $filter["fremd_ID"]);
|
| - |
|
120 |
$this->smarty->assign("artikelsuche", $filter["artikelsuche"]);
|
| - |
|
121 |
$this->smarty->assign("kundensuche", $filter["kundensuche"]);
|
| - |
|
122 |
$this->smarty->assign("paketnummer", $filter["paketnummer"]);
|
| - |
|
123 |
$this->smarty->assign("start", $filter["start"]);
|
| - |
|
124 |
$this->smarty->assign("shortline1", $filter["shortline1"]);
|
| - |
|
125 |
$this->smarty->assign("webs", $webs);
|
| - |
|
126 |
$this->smarty->assign("status1", $filter["status1"]);
|
| - |
|
127 |
$this->smarty->assign("dokument", $filter["dokument"]);
|
| - |
|
128 |
$this->smarty->assign("bezahlstatus", $filter["bezahlstatus"]);
|
| - |
|
129 |
$this->smarty->assign("versandstatus", $filter["versandstatus"]);
|
| - |
|
130 |
$this->smarty->assign("user_rechte", $GLOBALS["user_rechte"]);
|
| - |
|
131 |
$this->smarty->assign("web_rechte", $GLOBALS["web_rechte"]);
|
| - |
|
132 |
$this->smarty->assign("web_settings", $web_settings);
|
| - |
|
133 |
$this->smarty->assign("shops", $shops_sel);
|
| - |
|
134 |
$this->smarty->assign("filter_maske", $filter_maske);
|
| - |
|
135 |
$this->smarty->assign("laender_filter", $laender_filter);
|
| - |
|
136 |
$this->smarty->assign("laender_filter_sel", $filter["laender"]);
|
| - |
|
137 |
|
| - |
|
138 |
if (isset($GLOBALS["user_rechte"]["Warenwirtschaft"]["bestellung"]["shortline1"]))
|
| - |
|
139 |
{
|
| - |
|
140 |
if ($GLOBALS["web_rechte"]["Warenwirtschaft"]["bestellung"]["shortline1"])
|
| - |
|
141 |
{
|
| - |
|
142 |
list($shortline1_name, $shortline1_size) = explode(";", $GLOBALS["web_rechte"]["Warenwirtschaft"]["bestellung"]["shortline1"]);
|
| - |
|
143 |
}
|
| - |
|
144 |
else
|
| - |
|
145 |
{
|
| - |
|
146 |
$shortline1_name = "Shortline1:";
|
| - |
|
147 |
$shortline1_size = 10;
|
| - |
|
148 |
}
|
| - |
|
149 |
|
| - |
|
150 |
$this->smarty->assign("shortline1_size", $shortline1_size);
|
| - |
|
151 |
$this->smarty->assign("shortline1_name", $shortline1_name);
|
| - |
|
152 |
}
|
| - |
|
153 |
if (isset($GLOBALS["user_rechte"]["Warenwirtschaft"]["bestellung"]["status1"]))
|
| - |
|
154 |
{
|
| - |
|
155 |
if ($GLOBALS["web_rechte"]["Warenwirtschaft"]["bestellung"]["status1"])
|
| - |
|
156 |
{
|
| - |
|
157 |
list($status1_name, $status1_option_str) = explode(";", $GLOBALS["web_rechte"]["Warenwirtschaft"]["bestellung"]["status1"],
|
| - |
|
158 |
2);
|
| - |
|
159 |
$status1_options_arr = explode(";", $status1_option_str);
|
| - |
|
160 |
$status1_options = array("");
|
| - |
|
161 |
$status1_options_filter = array("alle");
|
| - |
|
162 |
foreach ($status1_options_arr as $option)
|
| - |
|
163 |
{
|
| - |
|
164 |
$status1_options[$option] = $option;
|
| - |
|
165 |
$status1_options_filter[$option] = $option;
|
| - |
|
166 |
}
|
| - |
|
167 |
//$status1_options = array_merge( $status1_options );
|
| - |
|
168 |
}
|
| - |
|
169 |
$this->smarty->assign("status1_name", $status1_name);
|
| - |
|
170 |
$this->smarty->assign("status1_options", $status1_options);
|
| - |
|
171 |
$this->smarty->assign("status1_options_filter", $status1_options_filter);
|
| - |
|
172 |
}
|
| - |
|
173 |
// Versandstatus
|
| - |
|
174 |
if (isset($GLOBALS["user_rechte"]["Warenwirtschaft"]["bestellung"]["versandstatus"]))
|
| - |
|
175 |
{
|
| - |
|
176 |
$versandstatus_options_filter = array(
|
| - |
|
177 |
"alle",
|
| - |
|
178 |
"offen",
|
| - |
|
179 |
"freigegeben",
|
| - |
|
180 |
"versand",
|
| - |
|
181 |
"ohne",
|
| - |
|
182 |
"offen+ohne",
|
| - |
|
183 |
);
|
| - |
|
184 |
$this->smarty->assign("versandstatus_options_filter", $versandstatus_options_filter);
|
| - |
|
185 |
}
|
| - |
|
186 |
|
| - |
|
187 |
$start_date = date('Y-m-d', strtotime("-10 days"));
|
| - |
|
188 |
$i = 0;
|
| - |
|
189 |
$versanddatum_options_filter[''] = 'Alle';
|
| - |
|
190 |
while ($i <= 30)
|
| - |
|
191 |
{
|
| - |
|
192 |
$i = $i + 1;
|
| - |
|
193 |
$date = new DateTime($start_date);
|
| - |
|
194 |
$date->modify('+'.$i.' day');
|
| - |
|
195 |
$versanddatum_options_filter[$date->format('Y-m-d')] = $date->format('d.m.Y');
|
| - |
|
196 |
}
|
| - |
|
197 |
$this->smarty->assign("versanddatum_options_filter", $versanddatum_options_filter);
|
| - |
|
198 |
|
| - |
|
199 |
// Bezahlstatus SELECT BOX
|
| - |
|
200 |
if (isset($GLOBALS["user_rechte"]["Warenwirtschaft"]["bezahlstatus"]["bezahlstatus"]))
|
| - |
|
201 |
{
|
| - |
|
202 |
$bezahlstatus_options_filter[] = "alle";
|
| - |
|
203 |
$bezahlstatus_options_filter[] = "offen";
|
| - |
|
204 |
$bezahlstatus_options_filter[] = "bezahlt";
|
| - |
|
205 |
if (isset($GLOBALS["user_rechte"]["Warenwirtschaft"]["bezahlstatus"]["vorbezahlt_setzen"]))
|
| - |
|
206 |
{
|
| - |
|
207 |
$bezahlstatus_options_filter[] = "vorbezahlt";
|
| - |
|
208 |
$bezahlstatus_options_filter[] = "bezahlt und vorbezahlt";
|
| - |
|
209 |
}
|
| - |
|
210 |
|
| - |
|
211 |
$this->smarty->assign("bezahlstatus_name", $bezahlstatus_name);
|
| - |
|
212 |
$this->smarty->assign("bezahlstatus_options", $bezahlstatus_options);
|
| - |
|
213 |
$this->smarty->assign("bezahlstatus_options_filter", $bezahlstatus_options_filter);
|
| - |
|
214 |
}
|
| - |
|
215 |
if (isset($_POST["anker"]))
|
| - |
|
216 |
{
|
| - |
|
217 |
$this->smarty->assign("anker", $_POST["anker"] + 1);
|
| - |
|
218 |
}
|
| 27 |
$orders = $this->order->get_list();
|
219 |
$orders = $this->order->get_list();
|
| 28 |
$this->smarty->assign('anker', $anker);
|
220 |
$this->smarty->assign('anker', $anker);
|
| 29 |
$this->smarty->assign('orders', $orders);
|
221 |
$this->smarty->assign('orders', $orders);
|
| 30 |
$this->smarty->view('orders.tpl');
|
222 |
$this->smarty->view('orders.tpl');
|
| 31 |
}
|
223 |
}
|