Revonzy Mini Shell

Revonzy Mini Shell

Şuanki Dizin: /home/wwwdreamtechnolo/www/sharemarkettraders.com/software/admin/
Dosya Yükle :
Şuanki Dosya : /home/wwwdreamtechnolo/www/sharemarkettraders.com/software/admin/user-trading-history-report.php

<?php 
	require_once('../lib/function.php');

	$db		=	new login_function();
	$SuccessMsg =0;	
	if(isset($_SESSION['current_login_admin']))
	{
		$current_login_admin	=	$_SESSION['current_login_admin'];
	}
	if(!isset($_SESSION['current_login_admin']))
	{	
		header("location:login.php");
	}
	
	
	if(isset($_GET['delete_id']))
	{
		$delete_id	=	$_GET['delete_id'];
		
		if($db->delete_history_info($delete_id))
		{

			$SuccessMsg = 3;
		}
	}
	
	
	if(isset($_GET['delete_trade_history_data']))
	{
		if($db->delete_trade_history_info())
		{
			$SuccessMsg = 1;
		}
	}
	
	if(isset($_GET['status_change_target']))
	{
		 $order_number	=	$_GET['status_change_target'];
		 $target_stoploss =   "target";
		 $db->update_target_or_stoploss_status($target_stoploss,$order_number);
	}
	
	if(isset($_GET['status_change_stoploss']))
	{
		 $order_number	=	$_GET['status_change_stoploss'];
		 $target_stoploss =   "stoploss";
		 $db->update_target_or_stoploss_status($target_stoploss,$order_number);
	}
	
?>



<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width initial-scale=1.0">
    <title> <?php echo $project_title; ?></title>
    <!-- GLOBAL MAINLY STYLES-->
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <link href="css/font-awesome.min.css" rel="stylesheet" />
    <link href="css/line-awesome.min.css" rel="stylesheet" />
    <link href="css/themify-icons.css" rel="stylesheet" />
    <link href="css/animate.min.css" rel="stylesheet" />
    <link href="css/toastr.min.css" rel="stylesheet" />
    <link href="css/bootstrap-select.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
  
    <!-- PLUGINS STYLES-->
    <!-- THEME STYLES-->
    <link href="css/main.min.css" rel="stylesheet" />
	 <link href="datatable/datatables.min.css" rel="stylesheet" />
    <!-- PAGE LEVEL STYLES-->
<style>
.col-md-12
{
	width:100%;
	margin:auto;
	margin-top:20px;
}
table,th,td
{
	text-align:center;
}
@media only screen and (max-width: 600px) {
	.col-md-12
	{
		width:100%;
	}
	.alert
	{
		width:100%;
	}
	.side-row
	{
		width:49%;
		display:inline-table;
	}
}
</style>

<link href="css/animate.css" rel="stylesheet" type="text/css" media="all">
<script src="js/wow.min.js"></script>

</head>

<body class="fixed-navbar">
		<div class="page-wrapper">
		<?php include('header.php'); ?>
		<?php include('side-bar.php'); ?>
		<div class="content-wrapper">
		<div class="row">
		<div class="col-md-12">
		<?php 
		if($SuccessMsg == 3)
		{
		?>
		<div class="alert alert-pink">
		<span class="alert-link">Successfully ! </span> Record Deleted...
		</div>	
		<?php 
		} 
if($SuccessMsg == 3)
		{
		?>
		<div class="alert alert-pink">
		<span class="alert-link">Successful ! </span> ALL TRADE HISTORY DELETED!!!!!!!!!!!!!!
		</div>	
		<?php 
		} 
		?>

		<div class="page-content fade-in-up">
		<div class="ibox">
		<div class="ibox-body">
		     <a href="<?php echo $_SERVER['PHP_SELF']."?delete_trade_history_data"; ?>" onclick="return confirm('Are you sure?');" style="float:right; padding:10px; border-radius:15px; background-color:#511252; color:#FFFFFF; display:inline-table;">Delete All Data</a>
		
		<h1 class="font-strong mb-4" style="font-size:25px;">Users Trading History Report  </h1>

		<div class="flexbox mb-4">
		<div class="input-group-icon input-group-icon-left mr-3">
		<span class="input-icon input-icon-right font-16"><i class="fas fa-search"></i></span>
		<input class="form-control form-control-rounded form-control-solid" id="key-search" type="text" placeholder="Search ...">
		</div>
		</div>
		<div class="table-responsive row">
		<table class="table table-bordered table-hover" id="example" style="overflow-x:auto;overflow-y:auto; font-size:10px;">
		<thead class="thead-default thead-lg">
		<tr>
			<th>Signal</th> 
			<!--<th>Mobile No</th> -->
			<th>Signal Time</th> 
			<th>Symbol</th>
			<th>STRAT</th>
			<th>Type</th>
			<th>Quantity</th>
			<th>Entry Price</th>
			<th>Exit Price</th>
			<th>P & L</th>
			<th>Cumulative P & L</th>
			
			<!--<th>Square Off</th>
			<th> Stop Loss</th>
			<th>Quantity</th>
			<th>Api Response Data</th>
			<th>Order Date</th>
			<th>Order Time</th>-->
			<th>Delete</th>
		</tr>
		</thead>
		<tbody>
		<?php
		
		$total_investment   =   0;
		
		$total_profit_loss  =   0;
		$data	=	array();
		$data	=	$db->get_all_trading_history_details();

if(!empty($data))
{
	$counter=0;
	foreach($data as $record)
	{
		$id				                         =	$record[0];
		$mobile_no			             =	$record[1];
		$variety			                 =  $record[2];
		$trading_symbol				                     =	$record[3];
		$symbol_token			             =	$record[4];
		$transation_type                      =	$record[5];
		$exchange              =	$record[6];
		$order_type                        =	$record[7];
		$product_type                        =	$record[8];
		$duration                       =	$record[9];
		$price                         =	$record[10];
		$square_off                         =	$record[11];
		$stop_loss                         =	$record[12];
		$quantity                         =	$record[13];
		$api_response_data                         =	$record[14];
		$order_date			                 =  $record[15];
		$order_time				         =	$record[16];
		$target_stoploss     =	$record[17];
		$order_number    =	$record[18];
		
		
		$total_investment = $total_investment + ($quantity * $price);
		
		?>
		<tr> 
		    <td><?php echo $counter+1; ?></td>
			<!--<td><?php echo $mobile_no; ?></td>-->
			<td><?php echo $order_date." ".$order_time; ?></td>
			<td><?php echo $trading_symbol." <br />".$symbol_token; ?>
			
			    <br />
				<?php
				    if($target_stoploss=="stoploss")
				    {
				?>
				<label style="color:red; font-weight:bold;"><?php echo $target_stoploss; ?></label>
				<a href="<?php echo $_SERVER['PHP_SELF']."?status_change_target=".$order_number; ?>" style="color:#666666; margin-left:10px;">Target Hit</a>
				<?php
				    }
				    else if($target_stoploss=="target")
				    {
				?>
				<label style="color:green; font-weight:bold;"><?php echo $target_stoploss; ?></label>
				<a href="<?php echo $_SERVER['PHP_SELF']."?status_change_stoploss=".$order_number; ?>" style="color:#666666; margin-left:10px;">Stoploss Hit</a>
				<?php        
				    }
				    else
				    {
				        ?>
				        <a href="<?php echo $_SERVER['PHP_SELF']."?status_change_target=".$order_number; ?>" style="color:#666666; margin-left:10px;">Target Hit</a>
				        <a href="<?php echo $_SERVER['PHP_SELF']."?status_change_stoploss=".$order_number; ?>" style="color:#666666; margin-left:10px;">Stoploss Hit</a>
				        <?php
				    }
				?>
				
			
			</td>
			
			<td><?php echo $transation_type; ?></td>
			<td><?php echo $exchange; ?></td>
			<td><?php echo $quantity; ?></td>
			
			<td><?php echo $price; ?></td>
			
			<?php
			    $exit_price =   0;
			
			    $profit_or_loss =   0;
			    
			    if($target_stoploss=="target")
			    {
			        $exit_price =   $price + $square_off;

			        $profit_or_loss = $square_off * $quantity;
			    }
			    else if($target_stoploss=="stoploss")
			    {
			        $exit_price =   $price - $stop_loss;
			        $profit_or_loss = $stop_loss * $quantity;
			    }
			?>
			
			<td><?php echo $exit_price; ?></td>
			
			
			    <?php
			        if($target_stoploss=="target")
			        {
			     ?>
			     <td>
			     <label style="color:green; font-weight:bold;">
			     <?php echo $profit_or_loss; ?>
			     </label>
			     </td>
			     
			     <td>
			     <label style="color:green; font-weight:bold;">
			     <?php echo $profit_or_loss; ?>
			     </label>
			     </td>
			     <?php
			            $total_profit_loss  =   $total_profit_loss + $profit_or_loss;
			        }
			        else
			        {
			     ?>
			     <td>
			     <label style="color:red; font-weight:bold;">
			     <?php echo "-".$profit_or_loss; ?>
			     </label>
			     </td>
			     
			     <td>
			     <label style="color:red; font-weight:bold;">
			     <?php echo "-".$profit_or_loss; ?>
			     </label>
			     </td>
			     <?php       
			            $total_profit_loss  =   $total_profit_loss - $profit_or_loss;
			        }
			    ?>
			    
			    
			    <!--<td><?php echo $profit_or_loss; ?></td>-->
			    
			<!--<td><?php echo $price; ?></td>
			<td><?php echo $square_off; ?></td>
			<td><?php echo $stop_loss; ?></td>
			<td><?php echo $quantity; ?></td>
			<td><?php echo $api_response_data; ?></td>
			<td><?php echo $order_date; ?></td>
			<td><?php echo $order_time; ?></td>-->
			<td class="center"><a href="user-trading-history-report.php?delete_id=<?php echo $id;?>" onclick="return confirm('Are you sure?');"><i class="fas fa-trash-alt"style="color:red; margin-left:20px;"></i></a></td>
			<!--<td class="center"><a href="user-login-edit-report.php?edit_id=<?php echo $id;?>"<i class="fas fa-edit"style="color:blue; margin-left:20px;"></i></a></td>-->
		</tr>
		<?php
		$counter++;
	}
	?>
	<tr>
	    <td><?php echo $counter+1; ?></td>
	    <td></td>
	    <td></td>
	    <td></td>
	    <td></td>
	    <td></td>
	    <td></td>
	    <td>TOTAL ==></td>
	    <?php
	        $percentage_of_profit = $total_investment / $total_profit_loss;
	        $percentage_of_profit = number_format((float)$percentage_of_profit, 2, '.', '');
	    ?>
	    <td style="color:purple !important; font-weight:bold;"><?php echo $total_profit_loss; ?></td>
	    <td style="color:purple !important; font-weight:bold;"><?php echo $total_profit_loss; ?></td>
	    <td></td>
	</tr>
	<?php
}
?>
</tbody> 
</table> 

<br />
<br />

<div style="color:orangered; font-size:25px; padding:10px;">Profit Percentage : <?php echo $percentage_of_profit; ?>%</div>

</div>
</div>
</div>
</div>
</div>
</div>
                <?php include('footer.php'); ?>
	</div>
    </div>
   
    <!--<?php include('search.php'); ?>-->
    <!-- END SEARCH PANEL-->
    <!-- BEGIN THEME CONFIG PANEL-->
    
    <!-- END THEME CONFIG PANEL-->
    <!-- BEGIN PAGA BACKDROPS-->
    <div class="sidenav-backdrop backdrop"></div>
    <div class="preloader-backdrop">
        <div class="page-preloader">Loading</div>
    </div>
    <!-- END PAGA BACKDROPS-->
    <!-- New question dialog-->
    
    <!-- End New question dialog-->
    <!-- QUICK SIDEBAR-->
    <?php include('side-bar.php'); ?>
    <script src="js/jquery.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/metisMenu.min.js"></script>
    <script src="js/jquery.slimscroll.min.js"></script>
    <script src="js/idle-timer.min.js"></script>
    <script src="js/toastr.min.js"></script>
    <script src="js/jquery.validate.min.js"></script>
    <script src="js/bootstrap-select.min.js"></script>
    <!-- PAGE LEVEL PLUGINS-->
    <!-- CORE SCRIPTS-->
	<script src="datatable/datatables.min.js"></script>
    <script src="js/app.min.js"></script>
	<script>
  $(function() {
            $('#example').DataTable({
                pageLength: 25,
                fixedHeader: true,
                responsive: true,
                "sDom": 'rtip',
                columnDefs: [{
                    targets: 'no-sort',
                    orderable: false
                }]
            });

            var table = $('#example').DataTable();
            $('#key-search').on('keyup', function() {
                table.search(this.value).draw();
            });
          
        });
</script>
	
    <!-- PAGE LEVEL SCRIPTS-->
</body>

</html>

EliteHackz.ORG
Revonzy Mini Shell
root@revonzy.com

Linux 65-254-81-4.cprapid.com 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 05:49:00 EDT 2023 x86_64
Apache
65.254.81.4