Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parssing error #61

Open
Dereje548 opened this issue Jun 6, 2024 · 0 comments
Open

Parssing error #61

Dereje548 opened this issue Jun 6, 2024 · 0 comments

Comments

@Dereje548
Copy link

( ! ) Parse error: syntax error, unexpected ',' in C:\wamp\www\InventorySystem_PHP\report.php on line 77

<title>EPSS Page</title> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.3/dist/chart.umd.min.js "></script> <style> .link-container { text-align: right; margin-top: -20px;
    }
    .link-container a {
        display: inline-block;
        margin: 0 1px; /* Adjust the space between the links as needed */
        font-family: Arial, sans-serif; /* Change to your desired font */
        font-size: 12px; /* Adjust the font size as needed */
        text-decoration: none; /* Removes underline from links */
        color: #000; /* Set the text color */
        padding: 10px 20px; /* Add padding around the links */
        background-color: #f0f0f0; /* Optional: Add a background color */
        border-radius: 5px; /* Optional: Add rounded corners */
        transition: background-color 0.3s; /* Optional: Add a hover effect */
    }
</style>

VRF Submission to EPSS and EPSS Vaccine Distribution Analysis

REPORT ANALYSIS
Home Search Edit/Delete
</div>
        </div>
     </div>
  </nav>

  <form action="report.php" method="POST" enctype="multipart/form-data">
     <input type="submit" value="Submit" name="report1" class="box3">
     <select name="year1" class="box4" required style="width: 150px">
        <option>select year</option>
        <!-- Options for years -->
        <?php 
        for ($year = 2015; $year <= 2034; $year++) {
            echo "<option value=\"$year\">$year</option>";
        }
        ?>
     </select>
select month $month"; } ?>
// SQL query to count timely VRF submissions for each condition
$sql = "
SELECT
SUM(CASE WHEN Is_the_VRF_submission_is_timly = 'Y' THEN 1 ELSE 0 END) AS timely_count1,
SUM(CASE WHEN Is_the_VRF_submission_is_timly = 'N' THEN 1 ELSE 0 END) AS timely_count2,
SUM(CASE WHEN Is_the_VRF_submission_is_timly = '' THEN 1 ELSE 0 END) AS timely_count3,
SUM(CASE WHEN Is_the_VRF_submission_is_timly = 'YET NOT' THEN 1 ELSE 0 END) AS timely_count4
FROM epss_timelinus_table
WHERE year1 = '$start_year' AND month1 = '$start_month'
";

// Execute the query
$result = $conn->query($sql);

// Check if the query was successful
if ($result && $result->num_rows > 0) {
// Fetch the result as an associative array
$row = $result->fetch_assoc();
$total1 = $row['timely_count1'];
$total2 = $row['timely_count2'];
$total3 = $row['timely_count3'];
$total4 = $row['timely_count4'];
$total_result = $total1 + $total2;
$total_perc = $total1+$total2+$total3+$total4;
$percent = ($total_result * 100) / $total_perc;
$percent1 = round($percent, 1);
} else {
echo "

No records found

";
}
}
?>





TIMELY VRF SUBMITTED VRF LATELY SUBMITTED YET NOT SUBMITTED TOTAL VRF SUBMITTED PERCENTAGE OF SUBMITTED
// SQL query to count timely VRF submissions for each condition
$sql = "
SELECT
SUM(CASE WHEN Is_the_vaccine_delivery_is_timly = 'Y' THEN 1 ELSE 0 END) AS timely_count1,
SUM(CASE WHEN Is_the_vaccine_delivery_is_timly = 'N' THEN 1 ELSE 0 END) AS timely_count2,
SUM(CASE WHEN Is_the_vaccine_delivery_is_timly= '' THEN 1 ELSE 0 END) AS timely_count3,
SUM(CASE WHEN Is_the_vaccine_delivery_is_timly= 'YET NOT' THEN 1 ELSE 0 END) AS timely_count4
FROM epss_timelinus_table
WHERE year1 = '$start_year' AND month1 = '$start_month'
";

// Execute the query
$result = $conn->query($sql);

// Check if the query was successful
if ($result && $result->num_rows > 0) {
// Fetch the result as an associative array
$row = $result->fetch_assoc();
$totald1 = $row['timely_count1'];
$totald2 = $row['timely_count2'];
$totald3 = $row['timely_count3'];
$totald4 = $row['timely_count4'];
$total_resultd = $totald1 + $totald2;
$total_perc = $total1+$total2+$total3+$total4;
$percentd = ($total_resultd * 100) / $total_perc;
$percentd1 = round($percentd, 1);
} else {
echo "

No records found

";
}
}
?>

     <thead>
     <td style="font-size: 12px"><?php echo $totald1; ?></td>
     <td style="font-size: 12px"><?php echo $totald2; ?></td>
     <td style="font-size: 12px"><?php echo $totald3 + $totald4; ?></td>
     <td style="font-size: 12px"><?php echo $total_resultd; ?></td>
     <td style="font-size: 12px"><?php echo $percentd1. '%'; ?></td>
TIMELY DELIVERD LATELY DELIVERD YET NOT DELIVERD TOTAL DELIVERD PERCENTAGE OF DELIVERY

<script> var ctx = document.getElementById('myPieChart').getContext('2d'); var myPieChart = new Chart(ctx, { type: 'pie', data: { labels: ['Timely', 'LATELY', 'YET NOT SUBMITTED', 'TOTAL VRF SUBMITTED'], datasets: [{ data: [, , , ], backgroundColor: ['#00cc66', '#ffdd00', 'rgb(255, 51, 0)', '#3399ff'] }] }, options: { responsive: true, plugins: { legend: { position: 'top', }, tooltip: { callbacks: { label: function(tooltipItem) { var label = tooltipItem.label || ''; var value = tooltipItem.raw || 0; var total = ; var percentage = ((value / total) * 100).toFixed(1); return label + ': ' + value + ' (' + percentage + '%)'; } } } } } }); </script>

<script> var ctx = document.getElementById('myPieChart1').getContext('2d'); var myPieChart = new Chart(ctx, { type: 'pie', data: { labels: ['Timely', 'LATELY', 'YET NOT SUBMITTED', 'TOTAL VRF SUBMITTED'], datasets: [{ data: [, , , ], backgroundColor: ['#00cc66', '#ffdd00', 'rgb(255, 51, 0)', '#3399ff'] }] }, options: { responsive: true, plugins: { legend: { position: 'top', }, tooltip: { callbacks: { label: function(tooltipItem) { var label = tooltipItem.label || ''; var value = tooltipItem.raw || 0; var total = ; var percentage = ((value / total) * 100).toFixed(1); return label + ': ' + value + ' (' + percentage + '%)'; } } } } } }); </script> <script> if(window.history.replaceState) { window.history.replaceState(null,null,null,null,null,null,null,null,null,null,null,null,null,null, window.location.href); } </script> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant