/* Decoded by unphp.net */
@ob_start();
session_start();
include("connect.php");
include("inc_logincheck.php");
$userid=$_SESSION['id'];
;echo '
';
include("header.php");
$return=mysqli_fetch_array(mysqli_query($cnn,"select * from return_state where up_status='0' and user_id='$userid'"));
$rid=$return['id'];
$todate=date('Y-m-d');
if($rid)
{
$upto_date=date('Y-m-d',strtotime($todate.' + 150 days'));
mysqli_query($cnn,"update return_state set cashback_date='$todate',upto_date='$upto_date',up_status='1' where id='$rid'");
}
$cashback_ndate=date('Y-m-d',strtotime($todate.' + 1 days'));
$state=mysqli_query($cnn,"select * from return_state where user_id='$userid'");
while($setstate=mysqli_fetch_array($state))
{
$cashback_date=strtotime($setstate['cashback_date']);
$now_date=strtotime($todate);
if($cashback_date<=$now_date)
{
$amount=$setstate['amount'];
$id=$setstate['id'];
mysqli_query($cnn,"update total_income set return_income=return_income+'$amount',return_wallet=return_wallet+'$amount' where user_id='$userid'");
mysqli_query($cnn,"update return_state set cashback_date='$cashback_ndate',status_count=status_count+'1' where id='$id'");
}
}
$ref=mysqli_fetch_array(mysqli_query($cnn,"select * from user_details where user_id='$userid'"));
$getuser=mysqli_fetch_array(mysqli_query($cnn,"select user_details.reward,user_details.user_id,upgrade.* from user_details inner join upgrade on upgrade.user_id=user_details.user_id where user_details.user_id='$userid'"));
$dupgrade=$getuser['down_amount'];
$dstate=$getuser['down_state'];
if($dstate=='1')
{
$dupgrade_per='100';
$dupgrade='4000';
}
else
{
$dupgrade_per=round($dupgrade/4000 * 100);
}
;echo '
';
$tincome=mysqli_query($cnn,"select * from total_income where user_id='$userid' group by user_id");
$income=mysqli_fetch_array($tincome);
$tincomea=mysqli_query($cnn,"select * from autogrowth_totalincome where user_id='$userid'");
$incomea=mysqli_fetch_array($tincomea);
$tincomear=mysqli_query($cnn,"select * from royalty_income where user_id='$userid'");
$incomer=mysqli_fetch_array($tincomear);
;echo '
₹ ';echo $income['joining_income'];;echo '
Joining Income
₹ ';echo $incomea['total_income'];;echo '
Single Leg
₹ ';echo $income['recharge_income'];;echo '
Recharge Income
₹ ';echo $incomer['holding_income'];;echo '
Holding Income
ROI ₹';echo $income['return_income'];;echo '
Upgrade Return
';
$tincome=mysqli_query($cnn,"select * from total_income where user_id='$userid'");
$income=mysqli_fetch_array($tincome);
;echo '
';
include("mainfunctions.php");
;echo '
';
$user=mysqli_fetch_array(mysqli_query($cnn,"select usa.*,us.user_name as sname,us.user_phone as sphone,us.user_id as uid from user_details as usa inner join user_details as us on us.user_id=usa.sponser_id where usa.user_id='$userid'"));
$kyca=mysqli_query($cnn,"select * from kyc where user_id='$userid'");
$kyc=mysqli_fetch_array($kyca);
$num=mysqli_num_rows($kyca);
if($num)
{
$bs=$kyc['banks'];
if($bs=='0')
{
$app='0';
}
elseif($bs=='2'){
$app='2';
}
else
{
$app='1';
}
}
else{
$app='0';
}
if(isset($_POST['kyc']))
{
$pan=$_POST['pan'];
$accname=$_POST['acc_name'];
$bankname=$_POST['bank_name'];
$accno=$_POST['acc_no'];
$ifsc=$_POST['bank_ifsc'];
$uploadDir = "../uploads/";
if($pan=='')
{
$pan='1';
}
$pfileName = $_FILES['pan_photo']['name'];
if(file_exists("../uploads/".$_FILES['pan_photo']['name']))
{
$pfilePath = rand().$pfileName;
$path = $uploadDir .$pfilePath;
move_uploaded_file($_FILES["pan_photo"]["tmp_name"],$path);
$pfilePath = "uploads/".$pfilePath;
}
else{
$pfilePath = $pfileName;
$path = $uploadDir .$pfilePath;
move_uploaded_file($_FILES["pan_photo"]["tmp_name"],$path);
$pfilePath = "uploads/".$pfilePath;
}
$bfileName = $_FILES['bank_photo']['name'];
if($num)
{
mysqli_query($cnn,"update kyc set pan='$pan',bank_holder='$accname',bank_name='$bankname',bank_accno='$accno',bank_ifsc='$ifsc',pan_photo='$pfilePath',banks='0' where user_id='$userid'");
echo "";
}
else{
mysqli_query($cnn,"insert into kyc(user_id,pan,pan_photo,bank_holder,bank_name,bank_accno,bank_ifsc) values('$userid','$pan','$pfilePath','$accname','$bankname','$accno','$ifsc')");
echo "";
}
echo "";
}
;echo '
';
include("footer.php");
;echo '