<?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',
        'compute' => true,
        'value' => [
            'compute' => true, // 是否需要计算页码
            'imglist' => [
                dirname(__DIR__). '/image/rule.jpg',
            ],
        ]
    ],
];

// 轮毂车型
$aBrand = require __DIR__. '/model.php';

$aModel = [];
foreach ($aBrand as $aVal)
{
    $aData = [];
    $sData = rand(1, 10);
    for ($sRun = 0; $sRun < $sData; $sRun ++) {
        $aData[] = ['col1' => '1990.12-1994.07', 'col2' => 'Front', 'col3' => 'AWD Engine AAR (12.90-.)', 'col4' => 'remark', 'col5' => 'Mounting,Radiator', 'col6' => '512205'];
    }
    $aModel[] = array_merge($aVal, ['value' => $aData]);
}
// $aModel = require dirname(__DIR__, 2). '/tests.php';
$aValue['model'] = ['style' => 'modelGuideBySuspension', 'title' => 'Application', 'remark' => 'Application', 'value' => $aModel];

// 图片
$sData = rand(1, 60);
$aLabel = ['Steering And Suspension Parts'];
foreach ($aLabel as $sLabel)
{
    $aData = [];
    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('photo_%s_photoGuideBySuspension', $sLabel)] = [
        'style' => 'photoGuideBySuspension', 'title' => $sLabel, 'remark' => sprintf('%s Photo', $sLabel), '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;


