2018-03-03 01:39:22 +08:00
|
|
|
<?php
|
|
|
|
isset($_GET['id']) ? $modelId = (int)$_GET['id'] : exit('error');
|
|
|
|
|
|
|
|
require '../tools/modelList.php';
|
2019-02-09 15:17:15 +08:00
|
|
|
require '../tools/jsonCompatible.php';
|
2018-03-03 01:39:22 +08:00
|
|
|
|
|
|
|
$modelList = new modelList();
|
2019-02-09 15:17:15 +08:00
|
|
|
$jsonCompatible = new jsonCompatible();
|
2018-03-03 01:39:22 +08:00
|
|
|
|
|
|
|
$modelList = $modelList->get_list();
|
|
|
|
|
|
|
|
$modelRandNewId = true;
|
|
|
|
while ($modelRandNewId) {
|
|
|
|
$modelRandId = rand(0, count($modelList['models'])-1)+1;
|
|
|
|
$modelRandNewId = $modelRandId == $modelId ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
header("Content-type: application/json");
|
2019-02-09 15:17:15 +08:00
|
|
|
echo $jsonCompatible->json_encode(array('model' => array(
|
2018-03-03 01:39:22 +08:00
|
|
|
'id' => $modelRandId,
|
|
|
|
'name' => $modelList['models'][$modelRandId-1],
|
|
|
|
'message' => $modelList['messages'][$modelRandId-1]
|
2019-02-09 15:17:15 +08:00
|
|
|
)));
|