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


PHP Match::player_validation方法代码示例

本文整理汇总了PHP中Match::player_validation方法的典型用法代码示例。如果您正苦于以下问题:PHP Match::player_validation方法的具体用法?PHP Match::player_validation怎么用?PHP Match::player_validation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Match的用法示例。


在下文中一共展示了Match::player_validation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: die

<?php

require "header.php";
if (!Coach::isLoggedIn()) {
    die("You must be logged into OBBLM to use this webservice.");
}
$action = $_REQUEST["action"];
if ($action == "update") {
    $match = new Match($_POST["match_id"]);
    $match->update(array('submitter_id' => (int) $_SESSION['coach_id'], 'stadium' => (int) $_POST['stadium'], 'gate' => (int) $_POST['gate'] * 1000, 'fans' => (int) $_POST['fans'], 'ffactor1' => (int) $_POST['ff1'], 'ffactor2' => (int) $_POST['ff2'], 'income1' => (int) $_POST['inc1'] * 1000, 'income2' => (int) $_POST['inc2'] * 1000, 'team1_score' => (int) $_POST['result1'], 'team2_score' => (int) $_POST['result2'], 'smp1' => (int) $_POST['smp1'], 'smp2' => (int) $_POST['smp2'], 'tcas1' => (int) $_POST['tcas1'], 'tcas2' => (int) $_POST['tcas2'], 'fame1' => (int) $_POST['fame1'], 'fame2' => (int) $_POST['fame2'], 'tv1' => (int) $_POST['tv1'] * 1000, 'tv2' => (int) $_POST['tv2'] * 1000));
    $team = new Team($_POST["team_id"]);
    foreach ($team->getPlayers() as $player) {
        if (!Match::player_validation($player, $match)) {
            continue;
        }
        // We create zero entries for MNG player(s). This is required!
        $pid = $player->player_id;
        if ($player->getStatus($match->match_id) == MNG) {
            $_POST["mvp_{$pid}"] = 0;
            $_POST["cp_{$pid}"] = 0;
            $_POST["td_{$pid}"] = 0;
            $_POST["intcpt_{$pid}"] = 0;
            $_POST["bh_{$pid}"] = 0;
            $_POST["si_{$pid}"] = 0;
            $_POST["ki_{$pid}"] = 0;
            $_POST["ir1_d1_{$pid}"] = 0;
            $_POST["ir1_d2_{$pid}"] = 0;
            $_POST["ir2_d1_{$pid}"] = 0;
            $_POST["ir2_d2_{$pid}"] = 0;
            $_POST["ir3_d1_{$pid}"] = 0;
            $_POST["ir3_d2_{$pid}"] = 0;
开发者ID:rythos42,项目名称:naflm,代码行数:31,代码来源:match_webservice.php

示例2: main


//.........这里部分代码省略.........
         $pdf->SetFont('Tahoma', 'B', 8);
         $pdf->setLineWidth(1.5);
         // Printing headline for player table
         $pdf->Cell($smallFieldSize, $h, 'Nr', 1, 0, 'C', true, '');
         $pdf->Cell($mediumFieldSize, $h, 'Position', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'MA', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'ST', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'AG', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'AV', 1, 0, 'C', true, '');
         $pdf->Cell($skillFieldSize, $h, 'Skills', 1, 0, 'L', true, '');
         $pdf->Cell($smallFieldSize, $h, 'SPP', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'MVP', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'Cp', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'Td', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'Int', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'BH', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'SI', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'Ki', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'Inj', 1, 0, 'C', true, '');
         $currenty += 13;
         $pdf->SetXY($currentx - 20, $currenty);
         $pdf->SetFont('Tahoma', '', 6);
         $h = 10;
         // Row/cell height for player table
         $pdf->SetFillColorBB($pdf->hex2cmyk('#FFFFFF'));
         $pdf->SetDrawColorBB($pdf->hex2cmyk('#000000'));
         $pdf->SetFontSize(8);
         $pdf->SetLineWidth(0.6);
         // Printing player rows
         $tmp_players = array();
         if ($FILLED) {
             $players = ${"team{$i}"}->getPlayers();
             foreach ($players as $p) {
                 if (!Match::player_validation($p, $match)) {
                     continue;
                 }
                 array_push($tmp_players, $p);
             }
         }
         $players = $tmp_players;
         $j = 0;
         while ($j < 16) {
             $j++;
             $nr = '';
             //reset all strings to clear
             $pos = '';
             $ma = '';
             $st = '';
             $ag = '';
             $av = '';
             $skills_injuries = '';
             $skillfn = '';
             $spp = '';
             $bgc = COLOR_ROSTER_NORMAL;
             if (count($players) >= $j) {
                 $p = $players[$j - 1];
                 $name = $p->name;
                 $pos = $p->position;
                 //Get position
                 $bgc = COLOR_ROSTER_NORMAL;
                 if ($p->is_journeyman) {
                     $name = "{$p->name} [J]";
                     $bgc = COLOR_ROSTER_JOURNEY;
                 }
                 if ($p->is_journeyman_used) {
                     $name = "{$p->name} [J]";
开发者ID:TheNAF,项目名称:naflm,代码行数:67,代码来源:class_pdfmatchreport.php

示例3: matchEntry

 function matchEntry($team_id, $teamPlayers)
 {
     $addZombie = false;
     $match = new Match($this->match_id);
     $team = new Team($team_id);
     $players = $team->getPlayers();
     $merc_nr = 1;
     foreach ($teamPlayers as $player) {
         $f_player_id = '';
         if ($player['nr'] == 100) {
             $addZombie = true;
         } else {
             $addZombie = false;
         }
         if ($player['star'] == "true") {
             global $stars;
             $stname = strval($player['name']);
             if (strpos($stname, "Morg ") === 0) {
                 $stname = "Morg 'n' Thorg";
             }
             if (strpos($stname, "Brick Far") === 0) {
                 $stname = "Brick Far'th (+ Grotty)";
             }
             if ($stname == "Grotty") {
                 $stname = "Grotty (included in Brick Far'th)";
             }
             $f_player_id = $stars[$stname]['id'];
             $player['inj'] = '';
         }
         if ($player['merc'] == "true") {
             $f_player_id = ID_MERCS;
         }
         foreach ($players as $p) {
             if ($p->nr == $player['nr'] && Match::player_validation($p, $match) && !$f_player_id) {
                 $f_player_id = $p->player_id;
                 break;
             }
         }
         // Make $player[$f] into $$f.
         foreach (array('mvp', 'cp', 'td', 'intcpt', 'bh', 'ki', 'si') as $f) {
             if (array_key_exists($f, $player)) {
                 ${$f} = $player[$f];
                 # NOTE: These fields are validated and typecasted correctly already in parse_results(), no further processing needed.
                 if (empty(${$f})) {
                     ${$f} = 0;
                 }
             } else {
                 ${$f} = 0;
             }
         }
         $inj = $this->switchInjury($player['inj']);
         $agn1 = $this->switchInjury($player['agn1']);
         if ($agn1 > $inj) {
             list($inj, $agn1) = array($agn1, $inj);
         }
         if ($agn1 == 8 || $agn1 == 2) {
             $agn1 = 1;
         }
         if ($f_player_id == ID_MERCS) {
             $match->entry($f_player_id, $input = array('f_team_id' => $team_id, "mvp" => $mvp, "cp" => $cp, "td" => $td, "intcpt" => $intcpt, "bh" => $bh, "si" => $si, "ki" => $ki, "ir1_d1" => $player['ir1_d1'], "ir1_d2" => $player['ir1_d2'], "ir2_d1" => $player['ir2_d1'], "ir2_d2" => $player['ir2_d2'], "ir3_d1" => $player['ir3_d1'], "ir3_d2" => $player['ir3_d2'], "inj" => $inj, "agn1" => NONE, "agn2" => $agn1, "skills" => 0, "nr" => $merc_nr), $player['EPS']);
             $merc_nr++;
             continue;
         }
         if (!$addZombie && (Match::player_validation($p, $match) || $player['star'] == "true")) {
             $match->entry($f_player_id, $input = array('f_team_id' => $team_id, "mvp" => $mvp, "cp" => $cp, "td" => $td, "intcpt" => $intcpt, "bh" => $bh, "si" => $si, "ki" => $ki, "ir1_d1" => $player['ir1_d1'], "ir1_d2" => $player['ir1_d2'], "ir2_d1" => $player['ir2_d1'], "ir2_d2" => $player['ir2_d2'], "ir3_d1" => $player['ir3_d1'], "ir3_d2" => $player['ir3_d2'], "inj" => $inj, "agn1" => $agn1, "agn2" => NONE), $player['EPS']);
         } else {
             global $DEA;
             $pos_id = $DEA[$team->f_rname]['players']['Zombie']['pos_id'];
             list($exitStatus, $pid) = Player::create($input = array('nr' => $player['nr'], 'f_pos_id' => $pos_id, 'team_id' => $team_id, 'name' => $player['name']), $opts = array('free' => true, 'force' => true));
             if ($exitStatus == Player::T_CREATE_SUCCESS) {
                 $match->entry($pid, $input = array('f_team_id' => $team_id, "mvp" => $mvp, "cp" => $cp, "td" => $td, "intcpt" => $intcpt, "bh" => $bh, "si" => $si, "ki" => $ki, "ir1_d1" => $player['ir1_d1'], "ir1_d2" => $player['ir1_d2'], "ir2_d1" => $player['ir2_d1'], "ir2_d2" => $player['ir2_d2'], "ir3_d1" => $player['ir3_d1'], "ir3_d2" => $player['ir3_d2'], "inj" => $inj, "agn1" => $agn1, "agn2" => NONE), $player['EPS']);
             }
         }
     }
     ##ADD EMPTY RESULTS FOR PLAYERS WITHOUT RESULTS MAINLY FOR MNG
     foreach ($players as $p) {
         if (Match::player_validation($p, $match)) {
             $player = new Player($p->player_id);
             $p_matchdata = $match->getPlayerEntry($player->player_id);
             if (empty($p_matchdata)) {
                 $match->entry($p->player_id, $input = array('f_team_id' => $team_id, "mvp" => 0, "cp" => 0, "td" => 0, "intcpt" => 0, "bh" => 0, "si" => 0, "ki" => 0, "ir1_d1" => 0, "ir1_d2" => 0, "ir2_d1" => 0, "ir2_d2" => 0, "ir3_d1" => 0, "ir3_d2" => 0, "inj" => NONE, "agn1" => NONE, "agn2" => NONE), array());
             }
         }
     }
     return true;
 }
开发者ID:TheNAF,项目名称:naflm,代码行数:86,代码来源:class_upload_botocs.php

示例4: main


//.........这里部分代码省略.........
         //Headers for player table
         $h = 20;
         $pdf->SetFillColorBB($pdf->hex2cmyk(HEADLINEBGCOLOR));
         $pdf->SetDrawColorBB($pdf->hex2cmyk(DEFLINECOLOR));
         $pdf->SetFont('Tahoma', 'B', 8);
         $pdf->setLineWidth(1.5);
         // Printing headline for player table
         $pdf->Cell($smallFieldSize, $h, 'Nr', 1, 0, 'C', true, '');
         $pdf->Cell($nameFieldSize, $h, 'Name', 1, 0, 'L', true, '');
         $pdf->Cell($smallFieldSize, $h, 'MVP', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'Cp', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'Td', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'Int', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'BH', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'SI', 1, 0, 'C', true, '');
         $pdf->Cell($smallFieldSize, $h, 'Ki', 1, 0, 'C', true, '');
         $pdf->Cell($mediumFieldSize, $h, 'IR D1', 1, 0, 'C', true, '');
         $pdf->Cell($mediumFieldSize, $h, 'IR D2', 1, 0, 'C', true, '');
         $pdf->Cell($mediumFieldSize, $h, 'Inj', 1, 0, 'C', true, '');
         $currenty += 23;
         $pdf->SetXY($currentx, $currenty);
         $pdf->SetFont('Tahoma', '', 8);
         $h = 15;
         // Row/cell height for player table
         $pdf->SetFillColorBB($pdf->hex2cmyk('#FFFFFF'));
         $pdf->SetDrawColorBB($pdf->hex2cmyk('#000000'));
         $pdf->SetFontSize(10);
         $pdf->SetLineWidth(0.6);
         // Printing player rows
         $tmp_players = array();
         if ($FILLED) {
             $players = ${"team{$i}"}->getPlayers();
             foreach ($players as $p) {
                 if (!Match::player_validation($p, $match)) {
                     continue;
                 }
                 array_push($tmp_players, $p);
             }
         }
         $players = $tmp_players;
         $j = 0;
         while ($j < 16) {
             $j++;
             $nr = '';
             $name = '';
             $bgc = COLOR_ROSTER_NORMAL;
             if (count($players) >= $j) {
                 $p = $players[$j - 1];
                 $name = $p->name;
                 $bgc = COLOR_ROSTER_NORMAL;
                 if ($p->is_journeyman) {
                     $name = "{$p->name} [J]";
                     $bgc = COLOR_ROSTER_JOURNEY;
                 }
                 if ($p->is_journeyman_used) {
                     $name = "{$p->name} [J]";
                     $bgc = COLOR_ROSTER_JOURNEY_USED;
                 }
                 if ($p->is_mng) {
                     $name = "{$p->name} [MNG]";
                     $bgc = COLOR_ROSTER_MNG;
                 }
                 if ($p->mayHaveNewSkill()) {
                     $name = "{$p->name}";
                     $bgc = COLOR_ROSTER_NEWSKILL;
                 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:67,代码来源:class_pdfmatchreport.php


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