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)); } } }
// Getting our Drone / Cargo Slot items first $stmt->execute(array($fitting['fittingid'], 'Drone')); $drone_slots = $stmt->fetchAll(PDO::FETCH_ASSOC); if ($stmt->rowCount() >= 1) { ?> <tr> <td><img style="width: 24px; height: 24px;" src="/img/slot_cargo.jpg"></td> <td></td> <td>Drone Bay and Cargo Hold</td> <td></td> </tr> <?php foreach ($drone_slots as $drone) { // Adding drones and cargo to IGB Fitting Array $igb_fitting_array[] = $drone['type_id'] . ';' . $drone['module_quantity']; $preRequisites = Fitting::checkItemPrerequisites($drone['type_id'], $user->getDefaultID()); if ($preRequisites) { $prereq_color = 'class="opaque-success"'; } elseif ($preRequisites == 'WARNING') { $prereq_color = 'class="opaque-warning"'; } else { $prereq_color = 'class="opaque-danger"'; } ?> <tr <?php echo $prereq_color; ?> > <td style="width: 32px; vertical-align: center"><img style="width: 24px; height: 24px;" src="https://image.eveonline.com/InventoryType/<?php echo $drone['type_id']; ?>