|
<?php: |! p1 z: h" a
function Connect () {8 d6 ~9 `5 X3 F7 P& Q
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB ) y1 i ~: F1 \2 a! @
) A3 \ {+ d: R) A# C3 T3 S# Q+ V$ r
Failed.');
0 [( G' ~3 c5 y$ N# E0 r" k5 I}3 t# n' H) f# b3 f" n' G
Connect();6 v/ v" d! T; E! _
" n0 Y2 G' B- g7 N3 U% Z* }+ R6 C" ?function InitForm(){
; Y6 @8 t8 R/ o, y//layout for the form
, ^' w" e# q3 T& r! Lecho "<strong>Send Items.</strong>
, L5 x3 ^ ^2 Z% G- x4 `<form name='select' method='post'>
T0 m% U6 N4 ~* y' ]/ U0 N( c<lable>Character Name</lable><br/>
/ p. L6 l6 {0 h, C, F V! L" a7 H<input type='text' name='char'/><br/>
& t8 A- g7 l2 y9 x8 E<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
. Z8 a# s& ^$ |<input type='text' name='item_name'/><br/>
2 C) m* S' I! H0 O* b- L<lable>Item Amount</lable><br/>
( i; [- B5 k6 i<input type='text' name='item_amount'/><br/>
: e- t$ O( y( I1 a) H- o x<lable>Item Upgrade Amount</lable><br/>
! Y( ? v/ ^9 Q+ U. w$ q* k! }<input type='text' name='item_upgrade'/><br/>
+ \! a* A4 ^* x0 s7 @$ ]<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
# r# c3 [$ n; u6 X# R9 V
4 @# Q0 e" I5 d* y: f0 U S</lable><br/>
4 S" q. u: v" s" p d! `<input type='text' name='item_element'/><br/>
, _$ ?3 w: _$ e<lable>Element Upgrade Amount</lable><br/>. b5 K0 g6 ]3 e- r+ ?
<input type='text' name='element_upgrade'/><br/>- [6 o! b+ s- [5 r# `4 E* K
<lable>Pierced Amount</lable><br/>
3 J; ]* V2 W6 V+ U: r: Z<input type='text' name='item_pierce'/><br/>1 k' B4 u" k: t4 D$ o# @
<input type='submit'/>6 G2 T$ l; ]& p" I4 p" l4 W% K. |
</form>";4 q( z J4 u; d9 G
}
9 P! x5 `1 C, J- Y6 K/ {" ~, f" p* q7 h9 I& H
function PostListener (){0 _5 b/ M. Z. `. `
//Add more post variables if needed and add them to initform() function aswell
0 v/ U) ^3 z/ w& t6 V8 f$ H1 K7 H* Y5 `* X g# B
################################" k$ V) M' n2 f/ [6 _
##### Connection and Post ######
h- V: p% c" j# e' D0 w- j################################
5 @; t& A2 Z- {- F K' t$name = @$_POST['char'];
t: H# {1 }7 W2 h, z# _$ItemName = @$_POST['item_name'];; L( l8 Q5 ^) z
$ItemAmount = @$_POST['item_amount'];
% B* H/ h7 j; F: `6 L3 Y2 r$ItemId = @$_POST['item_id'];
' ~+ w9 [% P O9 v9 m9 L* |$ItemUpgrade = @$_POST['item_upgrade'];/ x/ ~- y) m0 n; j2 @
$ItemElement = @$_POST['item_element'];
+ V* Z! a P. ~/ Y$ElementUpgrade = @$_POST['element_upgrade'];2 [; x/ W; Z z3 V9 A+ i( q
$ItemPierce = @$_POST['item_pierce'];
- K8 i8 N9 ^/ w7 h; _' x################################: z6 Q8 G" P1 B v4 o3 ^0 }6 j
u4 M4 g0 z& N2 M9 F6 i6 H//Check both variables for empty value
5 W) f; g% [; v
# }! c! r5 W: h* M: Cif (!empty($_POST['char'])){1 Q F# T7 V" ~+ I2 j
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
- N4 y! f& N: B3 Q* ~# @/ k( i+ h: s0 ^) [7 a
m_szName = '{$name}'");1 u- R, g, j4 l8 B
while ($row = mssql_fetch_object($find)){9 G& r$ d1 P, E: L
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";& A& \/ W( ]8 n. |8 b+ F$ R- C: R
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
& f8 _6 `: C' ~: d2 r8 j, n* [9 C$ n# h G; Q. Y% B
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
" S% W! K5 A) Y' Z/ q! t; m7 K% A
+ R/ V6 h: f8 ]' `+ Z3 n[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', . k% z5 s) m2 j2 H' T
. D( G& X- y2 n+ H* R5 hN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 3 ~1 l T& [# n1 u
7 l. G9 {9 y- n4 |% t" {# ]
'{$ElementUpgrade}', '{$ItemPierce}');");- [1 {% s: x% C {: x
}7 p4 \% X7 k: d/ b( x. O
" j- S& M) s& ?+ e}! z$ S: I, I/ K H# p: \& x$ O
8 E# P5 }; \( _% ~
}; `0 X, N9 C2 N
9 @" @' L& ~$ E& v$InitForm = InitForm();
0 j; p. C& j# o& N0 r2 I$Listener = PostListener();
% N5 E! A: y0 B7 \( ~! @
) G. C9 G1 P: i+ X0 {4 m% f?>
' s2 ]7 i9 x3 O+ m' f: ^3 x2 A, R4 b+ ]0 q, s
* L+ a7 q% _2 Q6 K$ ]5 m C6 G
9 d, V: R9 w1 d- B9 `8 f: W: f; @5 H0 e9 I% p: ?, n$ r2 \9 C
|
|