本文整理汇总了PHP中create_result函数的典型用法代码示例。如果您正苦于以下问题:PHP create_result函数的具体用法?PHP create_result怎么用?PHP create_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_result函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: finished
echo "race not finished (did not last long enough)";
exit;
}
}
# ok we have a valid race, store it
$track = $xml->RaceResults->TrackCourse;
$race_time = $race->TimeString;
#print_r($league);
$race_id = create_race($track, $mod, $league->id, $race_time);
# insert results
foreach ($race->Driver as $driver_data) {
$driver_name = $driver_data->Name;
if ($driver = check_existence_of_registered_driver($driver_name, $league)) {
echo "valid driver: {$driver->rfname} ({$driver->username})\n";
# create result for driver
create_result($race_id, $driver->user_id, $driver_data->FinishTime, $driver_data->FinishStatus, $driver_data->BestLapTime, $driver_data->Pitstops, $driver_data->Position, $driver_data->GridPos, $driver_data->Laps);
} else {
echo "driver {$driver_data->Name} does not exist or is not registered for league {$league->name}\n";
}
}
# distribute points
distribute_points($race_id);
// $res = $xml->xpath("/rFactorXML/RaceResults/Race");
// if (sizeof($res) == 1) {
// $race = $res[0];
// $race_laps = $race->Laps;
// $most_laps = $race->MostLapsCompleted;
// if (intval($most_laps) < intval($race_laps)) {
// echo "race not finished";
// exit;
// }
示例2: drop_link_goods
function drop_link_goods($goods_id, $article_id)
{
$sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_article') . " WHERE goods_id = '{$goods_id}' AND article_id = '{$article_id}' LIMIT 1";
$GLOBALS['db']->query($sql);
create_result(true, '', $goods_id);
}
示例3: trim
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$xmlstr = trim(file_get_contents('php://input'));
$xmlstr = iconv('UTF-8', 'UTF-8//IGNORE', $xmlstr);
$xml = new SimpleXMLElement($xmlstr);
$res = $xml->xpath("/rFactorXML/RaceResults/Race");
if (sizeof($res) == 1) {
$race = $res[0];
$race_laps = $race->Laps;
$most_laps = $race->MostLapsCompleted;
if (intval($most_laps) < intval($race_laps)) {
echo "race not finished";
exit;
}
# find/create event
$track = $xml->RaceResults->TrackCourse;
$mod = $xml->RaceResults->Mod;
$season_id = find_or_create_season($_GET["season"]);
echo "season_id: " . $season_id . " " . $_GET["season"] . "\n";
$event_id = find_or_create_event($season_id, $track, $mod);
echo "event_id: " . $event_id . "\n";
$timestring = $race->TimeString;
$laps = intval($race->Laps);
echo "laps:";
$race_id = create_race($event_id, $timestring, $laps);
echo "race_id: " . $race_id . "\n";
foreach ($race->Driver as $driver) {
$driver_id = find_or_create_driver($driver->Name);
$result_id = create_result($driver_id, $race_id, $driver->BestLapTime, $driver->FinishTime, $driver->FinishStatus, $driver->Laps);
}
}
}