@extends('template.layout')
@section('title', 'Items')
@section('submenuItem', 'items')
@section('content')
@php
function generateHeader($headerFrames, $centralText) {
$headerHtml = '
';
foreach ($headerFrames as $class => $style) {
if ($class === 'Text') {
$headerHtml .= '
'.$centralText.'
';
} else {
$headerHtml .= '
';
}
}
$headerHtml .= '
';
return $headerHtml;
}
$headerFrames = [
'CaptionEdgeLeftTop' => 'box-frame-edge.gif',
'CaptionEdgeRightTop' => 'box-frame-edge.gif',
'CaptionBorderTop' => 'table-headline-border.gif',
'CaptionVerticalLeft' => 'box-frame-vertical.gif',
'Text' => '',
'CaptionVerticalRight' => 'box-frame-vertical.gif',
'CaptionBorderBottom' => 'table-headline-border.gif',
'CaptionEdgeLeftBottom' => 'box-frame-edge.gif',
'CaptionEdgeRightBottom' => 'box-frame-edge.gif'
];
function generateTable($headerFrames, $centralText, $tableTitle, $numRows, $itemsPerRow, $itemsArray) {
$headerHtml = generateHeader($headerFrames, $centralText);
$tableHtml = '';
return $tableHtml;
}
$tableTitle = 'Item';
$numRows = 2;
$itemsPerRow = 5;
$itemsArray = [
['id' => 3387, 'name' => 'Helmets'],
['id' => 3388, 'name' => 'Armors'],
['id' => 3389, 'name' => 'Legs'],
['id' => 3079, 'name' => 'Boots'],
['id' => 3420, 'name' => 'Shields']
];
echo generateTable($headerFrames, "Equipaments", $tableTitle, $numRows, $itemsPerRow, $itemsArray) . "
";
$itemsArray = [
['id' => 3319, 'name' => 'Axes'],
['id' => 3309, 'name' => 'Clubs'],
['id' => 3288, 'name' => 'Swords'],
['id' => 3349, 'name' => 'Distances Weapons'],
['id' => 1781, 'name' => 'Throwing Weapons'],
['id' => 3447, 'name' => 'Ammunitions'],
['id' => 5744, 'name' => 'Wands'],
['id' => 5759, 'name' => 'Quivers'],
];
echo generateTable($headerFrames, "Weapons", $tableTitle, $numRows, $itemsPerRow, $itemsArray) . "
";
$numRows = 4;
$itemsPerRow = 5;
$itemsArray = [
['id' => 3057, 'name' => 'Amulets'],
['id' => 3006, 'name' => 'Rings'],
['id' => 3152, 'name' => 'Runes'],
['id' => 3457, 'name' => 'Tools'],
// ['id' => 2921, 'name' => 'Light sources'],
['id' => 5097, 'name' => 'Valuables'],
['id' => 5103, 'name' => 'Containers'],
// ['id' => 2901, 'name' => 'Fluids'],
// ['id' => 2876, 'name' => 'Fluid Containers'],
['id' => 3577, 'name' => 'Foods'],
// ['id' => 5210, 'name' => 'Decorations'],
// ['id' => 2029, 'name' => 'Furnitures'],
// ['id' => 2816, 'name' => 'Books'],
// ['id' => 3471, 'name' => 'Kitchen Tools'],
// ['id' => 2950, 'name' => 'Instruments'],
// ['id' => 3240, 'name' => 'Others'],
// ['id' => 5112, 'name' => 'Creature Products'],
];
echo generateTable($headerFrames, "Others", $tableTitle, $numRows, $itemsPerRow, $itemsArray) . "
";
@endphp
@endsection