View file File name : wallet-add-balance.php Content :<?php include("../include/config.php"); include("../include/functions.php"); include("../include/simpleimage.php"); validate_admin(); $attribute_type= mysqli_real_escape_string($GLOBALS['conn'],$_POST['attribute_type']); $attribute=ucfirst(mysqli_real_escape_string($GLOBALS['conn'],$_POST['attribute'])); if(count($_REQUEST['attribute_cat'])>0){ $attribute_cat=implode(",",$_REQUEST['attribute_cat']); } $enable_searching=mysqli_real_escape_string($GLOBALS['conn'],$_POST['enable_searching']); if($_REQUEST['submitForm']=='yes'){ $userEmail = $_POST['qusr_emailid']; $qusr_oid = $_POST['qusr_oid']; $qusr_wamt = $_POST['qusr_wamt']; $uresult=$obj->query("select id,user_type,email from tbl_user where email='$userEmail' order by id desc limit 1"); $resuserInfo=$obj->fetchNextObject($uresult); $num=$obj->numRows($uresult); echo "<pre>===";print_r($resuserInfo); if($num>0 && $userEmail!=''){ echo $userIdWa = $resuserInfo->id; echo $userIdWaEmail = $resuserInfo->email; echo $userIdWaType = $resuserInfo->user_type; $obj->query("insert into tbl_wallet set user_id='$userIdWa', order_id='$qusr_oid', wallet_balance='$qusr_wamt',type='Cr',added_date=now(),status='1'"); $rduid = $userIdWa; $_SESSION['sess_msg']='Wallet balance updated successfully'; header("location:wallet-add-balance.php?id=$rduid"); exit(); //$_REQUEST['id'] } die; if($_REQUEST['idvvv']==''){ $obj->query("insert into $tbl_attribute set attribute='$attribute',attribute_type='$attribute_type',enable_searching='$enable_searching',status=1 "); $_SESSION['sess_msg']='Attribute added successfully'; }else{ $sql=" update $tbl_attribute set attribute='$attribute',attribute_type='$attribute_type',enable_searching='$enable_searching' "; $sql.=" where id='".$_REQUEST['id']."'"; $obj->query($sql); $_SESSION['sess_msg']='Wallet balance updated successfully'; } header("location:attribute-list.php"); exit(); } if($_REQUEST['idddd']!=''){ $sql=$obj->query("select * from $tbl_wallet where id=".$_REQUEST['id']); $result=$obj->fetchNextObject($sql); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo SITE_TITLE; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="css/admin.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" language="javascript"> function validate(obj) { if(obj.qusr_emailid.value==''){ alert("Please enter email id"); obj.qusr_emailid.focus(); return false; } if(obj.qusr_wamt.value==''){ alert("Please enter amount"); obj.qusr_wamt.focus(); return false; } } </script> </head> <body> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <?php include("header.php") ?> <tr> <td align="right" class="paddRtLt70" valign="top"> <table width="99%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle" class="headingbg bodr text14"> <em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: Add Balance To Wallet <span style="float:right; padding-right:10px;"> <input type="button" name="add" value="Add balance" class="button" onclick="location.href='wallet-add-balance.php'" /></span></td> </tr> <tr> <td height="100" align="left" valign="top" bgcolor="#f3f4f6" class="bodr"> <form name="frm" method="POST" enctype="multipart/form-data" action="" onsubmit="return validate(this)"> <input type="hidden" name="submitForm" value="yes" /> <input type="hidden" name="id" value="<?php echo $_REQUEST['id'];?>" /> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="center" colspan="2" class="paddRt14 paddBot11"> <font color="#FF0000"><strong><?php echo $_SESSION['sess_msg']; $_SESSION['sess_msg']='';?></strong></font></td> </tr> <tr> <td align="right" class="paddBot11 paddRt14"><strong>Email Id:</strong></td> <td align="left" class="paddBot11"><input name="qusr_emailid" type="text" id="qusr_emailid" size="50" /></td> </tr> <tr> <td align="right" class="paddBot11 paddRt14"><strong>Order Id:</strong></td> <td align="left" class="paddBot11"><input name="qusr_oid" type="text" id="qusr_oid" size="50" /></td> </tr> <tr> <td align="right" class="paddBot11 paddRt14"><strong>Amount:</strong></td> <td align="left" class="paddBot11"><input name="qusr_wamt" type="text" id="qusr_wamt" size="10" /></td> </tr> <tr> <td align="right" class="paddRt14 paddBot11"> </td> <td align="left" class="paddBot11"> </td> </tr> <tr> <td width="18%" align="right" class="paddRt14 paddBot11"> </td> <td width="82%" align="left" class="paddBot11"> <input type="submit" name="submit" value="Submit" class="submit" border="0"/> <input name="Reset" type="reset" id="Reset" value="Reset" class="submit" border="0" /> </td> </tr> </table></form> </td> </tr> </table> </td> </tr> </table> </td> </tr> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle" class="headingbg bodr text14"> <em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>View Wallet Status <?php echo $_REQUEST['order_id']; ?></td> </tr> <tr><td> <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#f7faf9" class="bodr"> <?php $reuserIdWa=$_REQUEST['id']; $commentArr=$obj->query("select wa.*, u.id,u.email from tbl_wallet wa join tbl_user as u on wa.user_id=u.id where wa.user_id='$reuserIdWa' and wa.type='Cr' order by wa.id desc; "); if($obj->numRows($commentArr)>0){?> <tr><td><table width="100%" border="0" cellspacing="4" cellpadding="4" bgcolor="#f7faf9" class="bodr"> <tr> <td width="21%"><strong>Date</strong></td> <td width="21%"><strong>User Email</strong></td> <td width="21%"><strong>User ID</strong></td> <td width="21%"><strong>Wallet Amount</strong></td> <td width="21%"><strong>Type</strong></td> </tr> <?php while($resultComment=$obj->fetchNextObject($commentArr)){ ?> <tr> <td><?php echo date('d M Y H:i',strtotime($resultComment->added_date)); ?></td> <td><?php echo $resultComment->email; ?></td> <td><?php echo $resultComment->user_id; ?></td> <td><?php echo stripslashes($resultComment->wallet_balance); ?></td> <td><?php echo stripslashes($resultComment->type); ?></td> </tr> <?php } ?> </table> </td></tr> <?php }else{ ?> <tr><td align="center" ><strong>No Record Found.</strong></td></tr> <?php } ?> <tr><td align="center"> </td></tr></table> </td></tr> </table> <?php include('footer.php'); ?> </table> </body> </html>