<?php

$aValue = [
    'header' => [
        'style' => 'remarkGuide',
        'title' => '封面',
        'remark' => '',
        'value' => [
            'compute' => false, // 是否需要计算页码
            'imglist' => [
                dirname(__DIR__). '/image/header.jpg',
            ],
        ]
    ],
    
    'general' => [
        'style' => 'generalGuide',
        'title' => 'GENERAL INDEX',
        'remark' => 'GENERAL INDEX',
        'compute' => true,
        'value' => []
    ],
    
    'vehicle' => [
        'style' => 'vehicleGuide',
        'title' => 'Vehicle Index',
        'remark' => 'Vehicle Index',
        'compute' => true,
        'value' => []
    ],
    
    'rule' => [
        'style' => 'remarkGuide',
        'title' => '封面',
        'remark' => 'Coding Rule',
        'value' => [
            'compute' => true, // 是否需要计算页码
            'imglist' => [
                dirname(__DIR__). '/image/rule.jpg',
            ],
        ]
    ],
];
// 轮毂车型
$aBrand = require __DIR__. '/model.php';

$aModel = [];
foreach ($aBrand as $aVal)
{
    $aData = [];
    $sData = rand(1, 5);
    for ($sRun = 0; $sRun < $sData; $sRun ++)
    {
        $aData[] = ['col1'=> '1990.12-1994.07', 'col2' => '7AT', 'col3'=> 'FrontFrontFrontFroFroFrontFrontFrontFroFro', 'col4' => 'AWD Engine CJSB 1234', 'col5' => 'AWD Engine AAR (12.90-.)', 'col6' => 'Mounting,RadiatorRadiatorRadiator', 'col7' => '512205'];
    }
    $aModel[] = array_merge($aVal, ['value' => $aData]);
}
$aValue['model'] = ['style' => 'modelGuideByDrive', 'title' => 'Application', 'remark' => 'Application', 'value' => $aModel];

// 图片
$aLabel = ['Drive Line Part'];
foreach ($aLabel as $sLabel)
{
    $aData = [];
    $sData = rand(1, 30);
    for ($sRun = 0; $sRun < $sData; $sRun ++)
    {
        $aData[] = [
            'col1' => 510000 + $sRun,
            'col2' => [
                ['brand' => 'SEAT', 'number' => '191407181A'],
                ['brand' => 'SEAT', 'number' => '191407181B'],
            ],
            'col3' => sprintf('%s/pic/123.bmp', dirname(__DIR__)),
        ];
    }

    $aValue[sprintf('%s|photoGuideBySuspension', $sLabel)] = [
        'style' => 'photoGuideBySuspension',
        'title' => $sLabel,
        'remark' => sprintf('%s Photo', $sLabel),
        'value' => $aData
    ];
}

$aLabel = ['Propshaft' => 'propellerShaftByDrive', 'Joint,Propeller Shaft' => 'propShaftByDrive'];
foreach ($aLabel as $sKey => $sVal)
{
    $aData = [];
    $sData = rand(10, 30);
    for ($sRun = 0; $sRun < $sData; $sRun ++)
    {
        if ($sVal == 'propShaftByDrive') {
            $aTemp = ['col1' => 'Propshaft', 'col2' => '201406', 'col3' => 6, 'col4' => 97, 'col5'=> 10, 'col6' => 90, 'col7' => 37.4];
        } else {
            $aTemp = ['col1' => 'Joint,Propelle', 'col2' => '510434S', 'col3' => 6, 'col4' => 97, 'col5'=> 10, 'col6' => 90, 'col7' => 37.4, 'col8' => 90];
        }
        $aData[] = $aTemp;
    }
    
    $aValue[sprintf('param|%s', $sKey)] = [
        'style' => $sVal,
        'title' => $sKey,
        'remark' => sprintf('%s Basic Dimension Table-GSP to Dimension', $sKey),
        'value' => $aData
    ];
}

// 新号码
$aData = [];
for ($sRun = 201321; $sRun < 201821; $sRun ++) {
    $aData[] = $sRun;
}
$aValue['new'] = [
    'style' => 'new1Guide',
    'title' => 'New applications (compared with catalogue 2020)',
    'remark' => 'New applications (compared with catalogue 2020)',
    'value' => $aData
];

$aValue['footer'] = [
    'style' => 'remarkGuide',
    'title' => '封底',
    'remark' => '封底',
    'value' => [
        'compute' => false, // 是否需要计算页码
        'imglist' => [
            dirname(__DIR__). '/image/footer.jpg',
        ],
    ]
];

return $aValue;


