}
echo '<h1>План продаж и закупки по магазинам</h1>';
-$array = [2019, 2020, 2021, 2022];
-
-
-foreach ($array as $y) {
- echo "<a href=\"/shipment/store-plan/?year=$y\" class=\"btn btn-";
- if ($year == $y) {
+$current_year = date('Y');
+for ($i = $current_year - 5; $i <= $current_year + 1; $i++) {
+ echo "<a href=\"/shipment/store-plan/?year=$i\" class=\"btn btn-";
+ if ($year == $i) {
echo "success";
} else echo "warning";
- echo " btn-sm m-1\">$y ";
+ echo " btn-sm m-1\">$i ";
echo "</a> ";
}
-$array = array(
+$array = [
1 => 'Январь',
2 => 'Февраль',
3 => 'Март',
10 => 'Октябрь',
11 => 'Ноябрь',
12 => 'Декабрь'
-);
+];
echo "<br>";
<tbody>';
foreach ($stores as $strid => $namestore) {
- if ($values_data[$strid] ?? false) {
- echo "<tr><td class=\"text-right\">$namestore</td><td><input value=\"" . $values_data[$strid]["summ"] . "\" type=text class=\"form-control\" name=summ[$strid]></td>
-<td><input type=text class=\"form-control\" value=\"" . $values_data[$strid]["summ_week"] . "\" name=summ_week[$strid]></td>
-<td><input type=text class=\"form-control\" value=\"" . $values_data[$strid]["summ_fact"] . "\" name=summ_fact[$strid]></td>
+ echo "<tr><td class=\"text-right\">$namestore</td><td><input value=\"" . ($values_data[$strid]["summ"] ?? 0) . "\" type=text class=\"form-control\" name=summ[$strid]></td>
+<td><input type=text class=\"form-control\" value=\"" . ($values_data[$strid]["summ_week"] ?? 0) . "\" name=summ_week[$strid]></td>
+<td><input type=text class=\"form-control\" value=\"" . ($values_data[$strid]["summ_fact"] ?? 0) . "\" name=summ_fact[$strid]></td>
</tr>";
- }
}
echo '</tbody></table>