Post Pacific  

Go Back   Post Pacific > Lineage 2 Russian > Помощь
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 11.07.2007, 08:57   #1
NightSpirit
Архивный участник
 
Join Date: Jun 2007
Posts: 13
Default Помогите в php!

Всем Здрасте, поставил вот таку перед собой задачку в личном кабинете воткнуть просмотр инвенторя, написать то написал а вот незаработало вот теперь и ломаю голову, теория Жжёт, а практика отсутствует..... помогёте чем могёте...Я думаю в посте жёстка не будут ругать.... ибо новечёк есть Желание но мало знаний... Подскажите де че подправить ибо уже сил нету, к стати Зачем я хочу зделать просмотр инвенторя?, да думаю прикрутить аукцион от Ra1n0....

<tr>
<td class="ac">
<form name="sub" method="post" action="index.php?act=show_chars_info">
<input type="submit" name="subinfo" value="Вещи" style="width:60">
<!-- <input type="submit" name="subinfo" value="Умения" style="width:60"> -->
<input type="submit" name="subinfo" value="Список друзей" style="width:100">
<input type="submit" name="subinfo" value="Список врагов" style="width:100">
<input type="hidden" name="c_name" value="<?=$online_users[$x]['char_name']?>">
<input type="hidden" name="c_id" value="<?=$online_users[$x]['char_id']?>">
<input type="hidden" name="p_id" value="<?=$online_users[$x]['pledge_id']?>">
</form>
</td>
</tr>
</table>
</tr>
</td>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<?=$sep?>
</table>
<? } ?>

<?
$subinfo = $_POST['subinfo'];
$c_name = $_POST['c_name'];
$c_id = $_POST['c_id'];
$p_id = $_POST['p_id'];

if ($subinfo !='')
{
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td class="h-cell b-tblr">'.$c_name.': <span class="info">'.$subinfo.'</span></td></tr></table>';
switch($subinfo):
case 'Вещи':
$result=mssql_query ("
SELECT *
FROM user_item AS i
INNER JOIN la2info.dbo.items b ON i.item_type = b.id
INNER JOIN la2info.dbo.item_names c ON i.item_type = c.id
WHERE i.char_id = $c_id
ORDER BY warehouse");

$items=array();
for ($x=0;$items[$x]=mssql_fetch_assoc($result);$x++);
unset($items[count($items)-1]);
if (count($items) == 0) { ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?=$sep?>
<tr>
<td class="n-cell b-tblr p-2 ac">У персонажа нет вещей</td>
</tr>
</table>
<? } else { ?>
<!--inventory-->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?=$sep?>
<tr>
<td class="b-cell b-tblr p-2 ac">Вещи в инвентаре и на самом персонаже</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="h-cell">
<td width="32" class="b-bl"> </td>
<td class="b-bl">Название</td>
<td width="80" class="b-blr">Количество</td>
</tr>
<?
$items_found = false;
for ($i=0; $i<count($items); $i++)
{
if ($items[$i]['warehouse'] == 0)
{
$items_found = true;
?>
<tr class="n-cell">
<td class="b-bl ac"><img src="<?=$la2info_dir?>/images/icons/<?=$items[$i]['icon']?>" alt=""></td>
<td class="b-bl p-2 al"><?=$items[$i]['name']; if ($items[$i]['enchant'] != 0) echo '<span class="t-small info"> (+'.$items[$i]['enchant'].')</span>'?></td>
<td class="b-blr p-2 ar"><?=$items[$i]['amount']?></td>
</tr>
<?
}
}
if (!$items_found)
echo '<tr><td colspan="3" class="n-cell b-blr p-2 ac">Вещей нет</td></tr>';
?>
</table>
<!-- warhouse -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?=$sep?>
<tr>
<td class="b-cell b-tblr p-2 ac">Вещи на личном складе</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="h-cell">
<td width="32" class="b-bl"> </td>
<td class="b-bl">Название</td>
<td width="80" class="b-blr">Количество</td>
</tr>
<?
$items_found = false;
for ($i=0; $i<count($items); $i++)
{
if ($items[$i]['warehouse'] == 1)
{
$items_found = true;
?>
<tr class="n-cell">
<td class="b-bl ac"><img src="<?=$la2info_dir?>/images/icons/<?=$items[$i]['icon']?>" alt=""></td>
<td class="b-bl p-2 al"><?=$items[$i]['name']; if ($items[$i]['enchant'] != 0) echo '<span class="t-small info"> (+'.$items[$i]['enchant'].')</span>'?></td>
<td class="b-blr p-2 ar"><?=$items[$i]['amount']?></td>
</tr>
<?
}
}
if (!$items_found)
echo '<tr><td colspan="3" class="n-cell b-blr p-2 ac">Вещей нет</td></tr>'; ?>
</table>
<?
}
if ($p_id != 0)
{
$clan = array();
$result=mssql_query("
SELECT *
FROM pledge
WHERE (pledge_id = ".$p_id.")");
$clan=mssql_fetch_assoc($result);
if ($clan['ruler_id'] == $c_id && $clan['skill_level'] > 0)
{
$result=mssql_query ("
SELECT *
FROM user_item AS i
INNER JOIN la2info.dbo.items b ON i.item_type = b.id
INNER JOIN la2info.dbo.item_names c ON i.item_type = c.id
WHERE (i.char_id = $p_id) AND (i.warehouse = 2)
ORDER BY warehouse");

$items=array();
for ($x=0;$items[$x]=mssql_fetch_assoc($result);$x++);
unset($items[count($items)-1]); ?>
<!-- clan warehouse -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?=$sep?>
<tr>
<td class="b-cell b-tblr p-2 ac">Вещи на клановом складе</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="h-cell">
<td width="32" class="b-bl"> </td>
<td class="b-bl">Название</td>
<td width="80" class="b-blr">Количество</td>
</tr>
<?
$items_found = false;
for ($i=0; $i<count($items); $i++)
{
$items_found = true;
?>
<tr class="n-cell">
<td class="b-bl ac"><img src="<?=$la2info_dir?>/images/icons/<?=$items[$i]['icon']?>" alt=""></td>
<td class="b-bl p-2 al"><?=$items[$i]['name']; if ($items[$i]['enchant'] != 0) echo '<span class="t-small info"> (+'.$items[$i]['enchant'].')</span>'?></td>
<td class="b-blr p-2 ar"><?=$items[$i]['amount']?></td>
</tr>
<?
}
if (!$items_found)
echo '<tr><td colspan="3" class="n-cell b-blr p-2 ac">Вещей нет</td></tr>';
?>
</table>
NightSpirit is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 22:50.