コード例 #1
0
ファイル: rows.php プロジェクト: nsonP/DayZAdmin
function row_deployable($row, $chbox)
{
    global $accesslvls;
    global $map;
    global $security;
    $x = 0;
    $y = 0;
    $MapCoords = worldspaceToMapCoords($row['Worldspace'], $map);
    if (array_key_exists(2, $MapCoords)) {
        $x = $MapCoords[2];
    }
    if (array_key_exists(1, $MapCoords)) {
        $y = $MapCoords[1];
    }
    $Inventory = $row['Inventory'];
    $Inventory = str_replace("", ",", $Inventory);
    $Inventory = json_decode($Inventory);
    $limit = 6;
    if (count($Inventory) > 0) {
        $bpweapons = array();
        if (array_key_exists(0, $Inventory)) {
            $bpweaponscount = count($Inventory[0][0]);
            for ($m = 0; $m < $bpweaponscount; $m++) {
                for ($mi = 0; $mi < $Inventory[0][1][$m]; $mi++) {
                    $bpweapons[] = $Inventory[0][0][$m];
                }
            }
        }
        $bpitems = array();
        if (array_key_exists(1, $Inventory)) {
            $bpitemscount = count($Inventory[1][0]);
            for ($m = 0; $m < $bpitemscount; $m++) {
                for ($mi = 0; $mi < $Inventory[1][1][$m]; $mi++) {
                    $bpitems[] = $Inventory[1][0][$m];
                }
            }
        }
        $bpacks = array();
        if (array_key_exists(2, $Inventory)) {
            $bpackscount = count($Inventory[2][0]);
            for ($m = 0; $m < $bpackscount; $m++) {
                for ($mi = 0; $mi < $Inventory[2][1][$m]; $mi++) {
                    $bpacks[] = $Inventory[2][0][$m];
                }
            }
        }
        $Inventory = array_merge($bpweapons, $bpacks, $bpitems);
    }
    $InventoryPreview = "";
    for ($i = 0; $i < $limit; $i++) {
        if (array_key_exists($i, $Inventory)) {
            $curitem = $Inventory[$i];
            if (is_array($curitem)) {
                if ($i != 0) {
                    $curitem = $Inventory[$i][0];
                    $icount = ' - ' . $Inventory[$i][1] . ' rounds';
                }
            }
            $InventoryPreview .= '<div class="preview_gear_slot" style="margin-top:0px;width:47px;height:47px;"><img style="max-width:43px;max-height:43px;" src="images/thumbs/' . $curitem . '.png" title="' . $curitem . $icount . '" alt="' . $curitem . $icount . '"/></div>';
        } else {
            $InventoryPreview .= '<div class="preview_gear_slot" style="margin-top:0px;width:47px;height:47px;"></div>';
        }
    }
    if ($accesslvls[0][3] != 'true') {
        $loc = 'Classified!';
    } else {
        $loc = sprintf("%03d%03d", $y, $x);
    }
    $tablerow = "<tr>" . $chbox . "\n\t\t<td align=\"center\" class=\"gear_preview\" ><a href=\"" . $security . ".php?view=info&show=6&ObjectID=" . $row['ObjectID'] . "\">" . $row['ObjectID'] . "</a></td>\n\t\t<td align=\"center\" class=\"gear_preview\" ><a href=\"" . $security . ".php?view=info&show=6&ObjectID=" . $row['ObjectID'] . "\">" . $row['Classname'] . "</a></td>\t\t\t\n\t\t<td align=\"center\" class=\"gear_preview\" ><a href=\"" . $security . ".php?view=info&show=1&CharacterID=" . $row['CharacterID'] . "\">" . $row['playerName'] . "</a></td>\n\t\t<td align=\"center\" class=\"gear_preview\" ><a href=\"" . $security . ".php?view=info&show=6&ObjectID=" . $row['ObjectID'] . "\">" . $loc . "</a></td>\n\t\t<td align=\"center\" class=\"gear_preview_green\">" . $InventoryPreview . "</td>\n\t</tr>";
    return $tablerow;
}
コード例 #2
0
ファイル: 5.php プロジェクト: nsonP/DayZAdmin
<?php

include 'queries.php';
if (isset($_REQUEST['ObjectUID'])) {
    $ObjectUID = $_REQUEST['ObjectUID'];
} else {
    $ObjectID = 0;
}
$res = $db->GetAll($info5, $ObjectUID);
$number = sizeof($res);
foreach ($res as $row) {
    $MapCoords = worldspaceToMapCoords($row['Worldspace']);
    ?>
	
	<div id="page-heading">
		<h3><?php 
    echo $row['Classname'];
    ?>
 - <?php 
    echo $row['ObjectUID'];
    ?>
</h3>
	</div>
	<!-- end page-heading -->

	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>