当前位置: 首页>>代码示例>>PHP>>正文


PHP create_result函数代码示例

本文整理汇总了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;
 //   }
开发者ID:argl,项目名称:eternal-track-cycle,代码行数:31,代码来源:league_report.php

示例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);
}
开发者ID:norain2050,项目名称:mhFault,代码行数:6,代码来源:article.php

示例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);
        }
    }
}
开发者ID:argl,项目名称:eternal-track-cycle,代码行数:31,代码来源:report.php


注:本文中的create_result函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。