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


PHP Character::fetchCharacterName方法代码示例

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


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

示例1: foreach

        $i = 1;
        foreach ($lookup_results as $result) {
            $stmt_acct = $db->prepare('SELECT * FROM characters WHERE charid = ? LIMIT 1');
            $stmt_acct->execute(array($result['charid']));
            $character = $stmt_acct->fetch(PDO::FETCH_ASSOC);
            $stmt_username = $db->prepare('SELECT * FROM user_accounts WHERE uid = ? LIMIT 1');
            $stmt_username->execute(array($character['uid']));
            $account = $stmt_username->fetch(PDO::FETCH_ASSOC);
            ?>
							<tr style="text-align: center">
								<td style="width: 10%"><?php 
            echo $i;
            ?>
</td>
								<td><?php 
            echo Character::fetchCharacterName($result['charid']);
            ?>
</td>
								<td><?php 
            echo $account['username'];
            ?>
</td>
								<td><?php 
            echo $result['level'];
            ?>
</td>
							</tr>
							<?php 
            $i++;
        }
    }
开发者ID:jgrancell,项目名称:eveadmin-import,代码行数:31,代码来源:search.php

示例2: getDoctrineCompliance

 public static function getDoctrineCompliance($characterID)
 {
     //Globalizing the DB variable
     global $db;
     // Getting the group ID
     $groupID = Character::fetchGroupID($characterID);
     $characterName = Character::fetchCharacterName($characterID);
     // Getting the list of doctrines
     $stmt = $db->prepare('SELECT * FROM doctrines WHERE gid = ? ORDER BY doctrineid ASC');
     $stmt->execute(array($groupID));
     $doctrines = $stmt->fetchAll(PDO::FETCH_ASSOC);
     // Creating some statements for future use with getting fitting and module information for each doctrine and fitting respectively
     $stmtFittings = $db->prepare('SELECT * FROM doctrines_fits WHERE doctrineid = ? ORDER BY fittingid ASC');
     $stmtModules = $db->prepare('SELECT * FROM doctrines_fittingmods WHERE fittingid = ? ORDER BY type_id ASC');
     //Looping through each doctrine to get fitting information
     foreach ($doctrines as $doctrine) {
         $stmtFittings->execute(array($doctrine['doctrineid']));
         $fittings = $stmtFittings->fetchAll(PDO::FETCH_ASSOC);
         // Looping through each fitting to get module information
         foreach ($fittings as $fitting) {
             // Setting the default failure, warning, and success levels for the fitting
             $fittingFailure = 0;
             $fittingSuccess = 0;
             $fittingWarning = 0;
             $fittingTotal = 0;
             $stmtModules->execute(array($fitting['fittingid']));
             $modules = $stmtModules->fetchAll(PDO::FETCH_ASSOC);
             // Getting skill information about the ship hull itself
             $hullCheck = Fitting::checkItemPrerequisites($fitting['fitting_ship'], $characterID);
             if ($hullCheck === TRUE) {
                 $fittingSuccess += 1;
             } elseif ($hullCheck == "Warning") {
                 $fittingWarning += 1;
             } else {
                 $fittingFailure += 1;
             }
             $fittingTotal += 1;
             // Looping through each module to get skill information, and compare it to the character in question
             foreach ($modules as $module) {
                 $moduleCheck = Fitting::checkItemPrerequisites($module['type_id'], $characterID);
                 if ($moduleCheck === TRUE) {
                     $fittingSuccess += 1;
                 } elseif ($hullCheck == "Warning") {
                     $fittingWarning += 1;
                 } else {
                     $fittingFailure += 1;
                 }
                 $fittingTotal += 1;
             }
             if ($fittingFailure >= 1) {
                 $colorStatus = 'failure';
             } elseif ($fittingWarning >= 1) {
                 $colorStatus = 'warning';
             } else {
                 $colorStatus = 'success';
             }
             // Inputting the fitting into the tracking database
             $stmt = $db->prepare('INSERT INTO doctrines_tracking (charid,character_name,gid,doctrineid,fittingid,usable_items,total_items,color_status) VALUES (?,?,?,?,?,?,?,?)' . ' ON DUPLICATE KEY UPDATE character_name=VALUES(character_name),gid=VALUES(gid),usable_items=VALUES(usable_items),total_items=VALUES(total_items),color_status=VALUES(color_status)');
             $stmt->execute(array($characterID, $characterName, $groupID, $doctrine['doctrineid'], $fitting['fittingid'], $fittingSuccess, $fittingTotal, $colorStatus));
         }
     }
 }
开发者ID:jgrancell,项目名称:eveadmin-import,代码行数:62,代码来源:Fitting.class.php


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