|
|
<?php
# K2 u# R7 D8 ifunction Connect () {' f- ?! O4 f9 @! I' _7 _
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB ' M/ ^8 c8 B" c* p' s
& v, L! ?* U' rFailed.');
, u4 q1 E3 _9 O- w4 H) j}# }* P. O# o" Y, a- ], @- P- K$ m8 L
Connect();- G- G3 X+ R N/ A3 O' y! u
V( |; d2 a: R5 H5 t, ]' Ofunction InitForm(){3 S4 x! i+ q+ y' [. e2 h
//layout for the form
1 _: |6 g# h$ R9 `$ pecho "<strong>Send Items.</strong>
. z; ?; U, Z* G8 q<form name='select' method='post'>
" F+ i& K0 M- j& S- O8 e1 E<lable>Character Name</lable><br/>* b! c1 ^, c. X" T' B
<input type='text' name='char'/><br/>2 E2 T# Q V; I# N. J+ M# j: U
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>9 {6 d6 E" E6 p9 ]
<input type='text' name='item_name'/><br/>. S( f+ f; L2 o( i7 }. \, G
<lable>Item Amount</lable><br/>
" Z. G% D9 L# ~3 w1 Z<input type='text' name='item_amount'/><br/>
T6 F" a0 Q. M u" z<lable>Item Upgrade Amount</lable><br/>
; q& n3 \9 U9 `( \+ J<input type='text' name='item_upgrade'/><br/>
& e0 _/ T. m6 f1 Y/ y+ J3 g<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.); O1 v5 {3 a. M/ T
5 @# J! K" t! i4 g+ n( a
</lable><br/>/ z! M$ V9 T( u. C+ l' B
<input type='text' name='item_element'/><br/>7 H) D8 K+ U& Z. f; @5 G
<lable>Element Upgrade Amount</lable><br/>/ \9 I( g$ f0 j' l6 u, g! o, M; x
<input type='text' name='element_upgrade'/><br/>
% ~+ a! B Z8 }1 |7 p<lable>Pierced Amount</lable><br/>
4 A- K" s9 S C8 Q0 H<input type='text' name='item_pierce'/><br/>, h0 ~% }: y2 `7 @
<input type='submit'/>! U, _$ N5 @& N6 r+ U% }
</form>";
8 w, Y1 i7 ^( n}5 T* c, [3 M' u; w3 O
9 A" a; L3 r, h3 Q1 s
function PostListener (){
7 W. ~, U5 [7 b# `" a! n, m" y//Add more post variables if needed and add them to initform() function aswell& l. P5 ]) G# O
1 X' r5 u: v7 k ]
################################
+ q$ D7 L" f; d3 C4 V4 e3 q##### Connection and Post ######; m: x: ~( M6 ]$ u( ^. z
################################
/ t# i* j8 {5 t& }3 _" e$name = @$_POST['char'];
0 K) o; v7 C8 |$ItemName = @$_POST['item_name'];- l; P- z+ |# L; u0 h" _' G
$ItemAmount = @$_POST['item_amount'];
5 M) e5 ~5 f# e- v9 I" Q$ItemId = @$_POST['item_id'];3 ?( H! R* c' t/ a% T
$ItemUpgrade = @$_POST['item_upgrade'];1 l& e/ H! H& `6 D, `' ^+ i3 {; N
$ItemElement = @$_POST['item_element'];
0 I" o2 u( ^8 X$ t9 Z3 e" V$ElementUpgrade = @$_POST['element_upgrade'];
9 D* G% N( F3 _6 J+ L$ItemPierce = @$_POST['item_pierce'];
9 M" b# x7 G5 w& l, Y" t, K################################. ?+ R' k/ l9 N9 R2 R# C% [+ G) t8 _
5 F E9 b# I- m- z2 J3 n! p$ V2 C! d//Check both variables for empty value( w% P" g9 b1 k9 J3 s* C. E; L! V! T
7 {( Q4 ^/ F% V. K9 G8 r- i
if (!empty($_POST['char'])){
) A( c6 a2 R) W& h$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
6 y7 @3 r! o; L( Z1 R2 \* j2 H/ _% [( u, n, @
m_szName = '{$name}'");& t) Y; U7 V4 O& X+ j7 L* l
while ($row = mssql_fetch_object($find)){
, n2 Y7 U& Q$ ~/ q+ wecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
# S, R( N% h! C0 { r3 R$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 8 E7 s5 R" {; A' v5 Q
! ~) f8 ~2 H+ X( |& v! f M# y( }
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ) T& \! P) ^ H- t5 x
, Q. w( s/ l \: o9 y[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', : s# @+ D$ X& n: E2 e; @
7 ^, c3 q6 m6 [N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', . F3 [" B- ^0 C* l1 @' W0 E
# n2 w \7 m% l. M1 }, h+ L2 D$ ]
'{$ElementUpgrade}', '{$ItemPierce}');");0 b! g% ?$ Z& S+ u
}, F7 }2 ^# I1 k4 M% r
7 j5 W* q' k1 s& }) `- P4 h" o! F0 C}2 H+ R7 ~# a' x( ]" X' m
6 T& O, d) E$ g9 B6 R}
4 b0 g. n' U5 X: M2 g0 Q0 F( B
$InitForm = InitForm();
3 q% F6 |' @5 \% t3 A6 `; o. r$Listener = PostListener();
6 b4 B6 s$ n1 F; n- t( ?9 O9 ~
$ I' C6 r7 X3 y( Y?>
1 g* S3 N8 X: u, r. V4 X
' Y6 r. B, Z, v5 ^" S- g1 Q. @( v$ E$ _' S* L) |1 f8 |; J z6 m
% j4 x" j5 m+ R6 ]/ y4 m/ o1 k' g' P* K
|
|