|
<?php% G; h: b: Y* ~ C
function Connect () {# v9 I: `" p3 j, T/ b, w
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
~$ A" }& c3 U" I! _- M
* Y: p6 P( K! Y9 b0 o! _Failed.');
9 k' @$ a! G4 q' j- ` N}
% s/ I; [! I( L. b' W1 b/ U3 UConnect();
7 O7 j; r m4 J0 N
2 M) A5 z) w! s9 A+ Ifunction InitForm(){
1 Y) E2 x8 e! ^/ U8 v4 D* p' ?//layout for the form6 Y5 W) Y( [% k: R9 {
echo "<strong>Send Items.</strong>
, b# y# X0 ^# g5 p$ R1 y<form name='select' method='post'>
" v3 ^: S3 P( G. t4 q4 f7 U<lable>Character Name</lable><br/>4 f( L, z% W9 Y" R$ a4 F
<input type='text' name='char'/><br/>
# i1 K, r+ ~" Z, h<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
- k; h; j# e" C( A( L' e: Q) V<input type='text' name='item_name'/><br/>$ R8 {: f6 C( n* [# h+ d5 ~
<lable>Item Amount</lable><br/>
- Q3 x1 X3 t* B, v! u/ v o<input type='text' name='item_amount'/><br/>
) F, S0 Q, e* F2 e<lable>Item Upgrade Amount</lable><br/>. p8 E0 ^6 `4 `% B% v. g) @2 j8 ]
<input type='text' name='item_upgrade'/><br/>; b! x% [# O. U5 p2 L- s
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)! M. o* J, V P. z. f- F" @; z' a
, M9 e/ H! w4 c# x$ }7 @
</lable><br/>
. X0 S2 j; r6 i o7 m$ y$ ]) z<input type='text' name='item_element'/><br/>2 q4 V( {1 I, i9 x% |0 E: @. M
<lable>Element Upgrade Amount</lable><br/>/ G; I5 J( b. t
<input type='text' name='element_upgrade'/><br/>
! W! A' y# U" W# S) p! O<lable>Pierced Amount</lable><br/>
- I8 J5 C4 z% c- g, k<input type='text' name='item_pierce'/><br/>% N8 K* U: I, j W6 G W' Z6 f$ u; _
<input type='submit'/>0 \7 N: i9 ?+ ^& F, q
</form>";, R% a0 L9 K1 B3 I* h' _- i# i
}2 D2 H2 R" s' | l4 D
* j; O! |+ r# }function PostListener (){9 _7 W6 A. z$ k6 P2 Z
//Add more post variables if needed and add them to initform() function aswell# F; b D4 H H% F {
! q6 ^$ Q9 Y: ]. E `' u3 \################################
, m' b4 d$ L6 ?! c7 }1 K##### Connection and Post ######. z3 I. |( _2 K5 j+ w* }# u
################################
$ U3 H/ |% g! B& O2 ]; y/ e f$name = @$_POST['char'];4 J. c# R8 n% f" x/ @( o C
$ItemName = @$_POST['item_name'];8 l& C0 d+ I3 T
$ItemAmount = @$_POST['item_amount'];
( h @1 i p* m8 ^9 j" A$ItemId = @$_POST['item_id'];
' A% u O/ K( m& A3 D& F$ItemUpgrade = @$_POST['item_upgrade'];# M! N2 q6 l' \( m& A' z
$ItemElement = @$_POST['item_element'];
3 W8 u5 l: Z+ s4 O. X P+ p$ElementUpgrade = @$_POST['element_upgrade'];, G9 H+ A) I2 q5 e0 p# U/ z, c
$ItemPierce = @$_POST['item_pierce'];
* s* N' F4 N0 N4 k################################
7 V& N7 P5 s( @% ]1 [! K" p+ T" E4 Q5 h; I
//Check both variables for empty value
& C+ O4 t2 ^8 n8 y5 t7 g$ d1 {! A3 y2 L3 E$ U
if (!empty($_POST['char'])){
5 z$ l$ [ n3 o) \+ s: B4 U$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where + f; z, A) g! q9 B: Z" x$ R' b
- g) l1 k6 O3 ? f2 q3 k3 K+ v
m_szName = '{$name}'");
, Z, U3 p# t: d# \% y6 Uwhile ($row = mssql_fetch_object($find)){* @. g, r7 X+ E* S2 i! T& {9 q
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
8 U& n2 Y& l9 U5 U9 j: N- E% u$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ' g8 M9 T. Q O$ J: P% c
8 ^* [! j0 @+ u
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], * L$ {0 R/ ?! l& Q
$ s* M9 X+ u7 [5 w! O/ `[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 2 a% Y/ ^6 D- y- [- [; ?
* G' }; x2 R" t, B7 O J( ~% a E) nN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 3 o( w$ W" K1 C: E
3 ~$ e6 N1 f1 _
'{$ElementUpgrade}', '{$ItemPierce}');");! J$ J. T) \% |$ G m3 z
}
3 s( k0 X5 q7 g' j& X) N2 |0 J) z ]; ]% ]
}
" B# T2 I4 u2 ~4 _; h; m, I0 M6 }* }7 f0 `
}# W, y& E7 j) j6 I& r, h% T; y
. [" o7 R% ~! Z) J4 m4 }$InitForm = InitForm();
0 b/ _! w# }$ O/ g4 @7 v# a; S! O1 a$Listener = PostListener();
7 ?: s: E4 \3 @9 H* V' Q9 Q
: d: W% `. V( h3 }- S?>
9 n6 j) V3 Y' X3 J- y( J! P: p. S% T. O4 @4 p. p- f4 [9 w
* A1 K. u* z* [6 t$ P3 V. f2 c
4 ^4 \7 |3 s; Z4 K r0 S' y" E j; n; t$ k- K' P
|
|