|
|
<?php" F' ]2 e$ B5 q+ U3 O
function Connect () {! Z) Q) I; R# y6 \$ ^5 X, x
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
6 D. c& i' o- g1 S- K7 R
5 w. T9 s# d" AFailed.');* M, K7 e4 c$ J" F6 u
}7 h" B0 W6 Z/ a* y! A9 c
Connect();
. `( B% J" [4 c% }) Q& I5 B) ]1 T* ^6 U
function InitForm(){* [" Z" X0 a$ u$ q& |
//layout for the form
+ S5 B" W3 q5 a% decho "<strong>Send Items.</strong>6 ?7 b9 ?, ?" i
<form name='select' method='post'>
+ F# V9 _; y* F6 v<lable>Character Name</lable><br/>$ h5 {, A' N. m% w2 w
<input type='text' name='char'/><br/>3 |' G! |3 Q4 z% ~3 ^
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
5 _& a8 V- x m1 D<input type='text' name='item_name'/><br/>
' h+ P* r" w1 D<lable>Item Amount</lable><br/>- F4 ^* n' v( ?6 @
<input type='text' name='item_amount'/><br/>0 o. M+ f- A5 ^; L
<lable>Item Upgrade Amount</lable><br/>
/ \$ @0 `# P6 E6 \/ p$ y. D! N" U<input type='text' name='item_upgrade'/><br/>2 j W2 {1 d+ R' |! T6 `. k2 A& w7 s
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)0 Q0 }1 D4 E9 s
) m- M6 {2 P2 M4 B( Y! S Z! _ l</lable><br/>/ _. q0 m7 `( \% k* q6 a" W
<input type='text' name='item_element'/><br/>6 w% Y+ ^5 \3 F! u, x4 p' h4 q- c5 G p
<lable>Element Upgrade Amount</lable><br/>2 n V3 p- C) d' S) k" j
<input type='text' name='element_upgrade'/><br/> ~9 v' k9 m( } o2 g
<lable>Pierced Amount</lable><br/>
5 G, z" }' p' S: K0 z<input type='text' name='item_pierce'/><br/>
; [! q: O. A# ^! T$ i<input type='submit'/>( z! w- a2 `! s; z/ V7 p$ K1 q, B
</form>";
, U( M5 k& e ~}0 P' T3 H, `) h# _8 X4 w5 n+ L! S
F* Z4 y/ d' |# D6 ^1 }
function PostListener (){
; G" Z5 z9 A; w& N//Add more post variables if needed and add them to initform() function aswell* j1 B1 s1 a' [+ I2 v7 R% z
' J/ Z) P- H1 F3 ]- u* S4 b$ _################################. i3 ^- N8 T% F. E
##### Connection and Post ######$ I; x1 R# I7 G9 f$ n5 T [& ~
################################' ]* u& @+ S& l& v
$name = @$_POST['char'];
; c, u) z1 u* c/ s: U/ |1 ^8 z$ItemName = @$_POST['item_name'];% {' o% _: _% y/ c
$ItemAmount = @$_POST['item_amount'];. y7 x0 q. R" J N2 D
$ItemId = @$_POST['item_id'];7 w: Z- r1 f2 X* q
$ItemUpgrade = @$_POST['item_upgrade'];- F7 N8 R) ~. ?
$ItemElement = @$_POST['item_element'];8 t7 f1 b. p% V4 \' O) R+ Z# I0 n2 w
$ElementUpgrade = @$_POST['element_upgrade'];/ Z& p8 h3 c: }6 ?( r! A8 D2 n
$ItemPierce = @$_POST['item_pierce'];
$ S/ C7 Y* S: _% d$ e/ o################################. P, ^6 `0 j" R
, h# S& G- r" U1 L* ^//Check both variables for empty value
, S) \4 s6 h5 _; v- l/ o+ G. p3 n# y5 n, {5 B/ N5 S7 @
if (!empty($_POST['char'])){
8 Q% U" r0 L; m! _8 Y# q, S0 k$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 0 w6 R4 t8 [: l$ U; W' \6 q7 B
: P9 V$ C% P/ e! p* M% Nm_szName = '{$name}'");
' o, E2 Y: ]0 o0 k6 E* m& [while ($row = mssql_fetch_object($find)){
" _& k5 L2 I4 s* _+ m8 j8 iecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
" j6 ^- B! z8 \2 X8 ^$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
) U4 }% m2 s; J5 y: }4 o2 [7 y. v. q! W1 a
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], , B" H( v( a1 G) t& M
N+ V; Q, Z& y4 p$ `[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
; k6 l, E4 u4 Z, ?4 G) ^
' @: B' Z2 t% Z8 }/ y5 oN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', - F6 {7 G1 O s5 M7 {7 s& o4 y4 V$ x" }
9 G3 I9 A* ?. S2 X% k+ z Y6 ~'{$ElementUpgrade}', '{$ItemPierce}');");
0 a. u* _& w4 N& G. I# t5 h' Q}( F2 Y; W/ N2 w6 @% a4 n C: S
+ H4 Z1 T4 }( `}% D2 ]; e7 r& Q! a8 o- W. T4 ?3 L
- t8 a" i) k7 i7 N- [}
4 W* Y0 \) J& n4 M% T6 R! ?+ C0 K3 g9 t& ^8 `6 }' L3 ?
$InitForm = InitForm();
3 T+ I+ y( U7 m, p* a( v( x$Listener = PostListener();
2 B/ l; W* k! ? V$ Q; ?
+ p3 ~8 o8 G1 s1 F n! {9 P?>
) D0 h8 v$ p: n7 q" ?. j; y
4 v; r: l& B. _& G/ G/ Z1 u- V
. V( \7 m5 y% M7 C$ I
# \6 }% A+ i6 o0 Y: r6 x
" T+ |; h1 N" g+ P |
|