<?php
session_start();
require('../lib/dbclass.php');



$where = 'tbl_transaction.status=0 and tbl_transaction.sponsorship=0 AND tbl_transaction.Received>0 ';
$where1 .= 'tbl_transaction.status=0 AND tbl_transaction.Received>0';

if ($_POST) {
    $_SESSION['searchname'] = $_POST['searchname'];

    $_SESSION['searchuser_drop'] = $_POST['searchuser_drop'];

    $_SESSION['searchward_drop'] = $_POST['searchward_drop'];
}


if (($_POST['reset'] == 'Reset')) {
    $_SESSION['searchname'] = '';

    $_SESSION['searchuser_drop'] = 0;

    $_SESSION['searchward_drop'] = 0;

    $searchname = '';

    $searchuser_drop = 0;

    $searchward_drop = 0;

    $_SESSION['where']  = '';
    $_SESSION['where1'] = '';
}



if ($_SESSION['searchname']) {
    $searchname = $_SESSION['searchname'];
    $where  .= " and tbl_customer.name like '%$searchname%'";
    $where1 .= " and tbl_customer.name like '%$searchname%'";
}



if ($_SESSION['searchuser_drop'] > 0) {
    $searchuser_drop = $_SESSION['searchuser_drop'];
    $where  .= " and tbl_transaction.volunteer=$searchuser_drop";
    $where1 .= " and tbl_transaction.volunteer=$searchuser_drop";
}




if ($_SESSION['searchward_drop'] > 0) {
    $searchward_drop = $_SESSION['searchward_drop'];
    $where  .= " and tbl_customer.Ward=$searchward_drop";
    $where1 .= " and tbl_customer.Ward=$searchward_drop";
}

$_SESSION['where']  = $where;
$_SESSION['where1'] = $where1;

$trantype = 'tbl_transaction.status=0';
//$chlngid=0;
$data = [];











$trantype .= ' and tbl_transaction.donation=1';


$data = findQuery("SELECT 
    tbl_transaction.id,
    tbl_transaction.orderforothers,
    tbl_customer.id cuid,
    tbl_customer.name,
     tbl_customer.Mobile
    ,tbl_ward.ward_name
    ,tbl_panchayat.panchayat_name
    ,tbl_assembly.name assembly
    ,
    tbl_district.district_name
    ,tbl_transaction.Received
    ,tbl_transaction.Amount
    ,tbl_transaction.clubid
    ,tbl_transaction.dateadded ordrddate
    ,tbl_transaction.Transid
     from tbl_transaction
     inner join tbl_customer on tbl_customer.id=tbl_transaction.customerid left join tbl_ward on tbl_ward.id=tbl_customer.Ward inner join tbl_panchayat on tbl_panchayat.id=tbl_customer.Panchayat
    inner join tbl_assembly on tbl_assembly.id=tbl_customer.Assembly 
    inner join tbl_district on tbl_district.id=tbl_customer.District where tbl_transaction.status=0 and tbl_transaction.donation=1 and $where1
    
");




















?>

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

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Language" content="en">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><?php echo sitename ?></title>
    <meta name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" />
    <meta name="description" content="<?php echo sitename ?>">

    <link rel="icon" type="image/x-icon" href="../assets/images/Shade logo.png">
    <link href="..\assets\css\main.css" rel="stylesheet">
    <link rel="stylesheet" href="../assets/css/daterangepicker.css">

</head>

<body>
    <div class="app-container app-theme-white body-tabs-shadow fixed-sidebar fixed-header">
        <div class="app-header header-shadow">
            <div class="app-header__logo">
                <div class="logo-sr">
                    <img width="55px" src="../assets/images/Shade logo.png" alt="">
                </div>
                <div class="header__pane ml-auto">
                    <div>
                        <button type="button" class="hamburger close-sidebar-btn hamburger--elastic"
                            data-class="closed-sidebar">
                            <span class="hamburger-box">
                                <span class="hamburger-inner"></span>
                            </span>
                        </button>
                    </div>
                </div>
            </div>





            <div class="app-header__mobile-menu">
                <div>
                    <button type="button" class="hamburger hamburger--elastic mobile-toggle-nav">
                        <span class="hamburger-box">
                            <span class="hamburger-inner"></span>
                        </span>
                    </button>
                </div>
            </div>
            <div class="app-header__menu">
                <span>
                    <button type="button"
                        class="btn-icon btn-icon-only btn btn-primary btn-sm mobile-toggle-header-nav">
                        <span class="btn-icon-wrapper">
                            <i class="fa fa-ellipsis-v fa-w-6"></i>
                        </span>
                    </button>
                </span>
            </div>
            <div class="app-header__content">

                <div class="app-header-right">
                    <div class="header-btn-lg pr-0">
                        <div class="widget-content p-0">
                            <div class="widget-content-wrapper">

                                <div class="widget-content-left  ml-3 header-user-info">
                                    <!--<div class="widget-heading">
                                      <?php
            // $data1 = findQuery("select * from tbl_user where status=0");
?>
                                    </div>
                                    <div class="widget-subheading">
                                        Admin
                                    </div>-->
                                </div>

                                <div class="d-inline-block dropdown ml-3 p-0">
                                    <button style="width: 40px;" type="button" data-toggle="dropdown"
                                        aria-haspopup="true" aria-expanded="false"
                                        class="btn-shadow dropdown-toggle btn btn-info" fdprocessedid="rwibbh">


                                        <img style="width: 100%;" src="../assets/images/Shade logo.png" alt="">
                                    </button>
                                    <div tabindex="-1" role="menu" aria-hidden="true"
                                        class="dropdown-menu dropdown-menu-right">
                                        <ul class="nav flex-column">
                                            <li class="nav-item">
                                                <a href="logout.php" class="nav-link">
                                                    <i class="nav-link-icon lnr-inbox"></i>
                                                    <span> Logout</span>
                                                </a>
                                            </li>

                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="app-main">
            <div class="app-sidebar sidebar-shadow">
                <div class="app-header__logo">

                    <div class="header__pane ml-auto">
                        <div>
                            <button type="button" class="hamburger close-sidebar-btn hamburger--elastic "
                                id="toggleButton-header">
                                <span class="hamburger-box">
                                    <span class="hamburger-inner"></span>
                                </span>
                            </button>

                        </div>
                    </div>
                </div>
                <div class="app-header__mobile-menu">
                    <div>
                        <img src="../../assets/images/Shade logo.png" alt="">
                        <button type="button" class="hamburger hamburger--elastic mobile-toggle-nav">
                            <span class="hamburger-box">
                                <span class="hamburger-inner"></span>
                            </span>
                        </button>
                    </div>
                </div>
                <div class="app-header__menu">
                    <span>
                        <button type="button"
                            class="btn-icon btn-icon-only btn btn-primary btn-sm mobile-toggle-header-nav">
                            <span class="btn-icon-wrapper">
                                <i class="fa fa-ellipsis-v fa-w-6"></i>
                            </span>
                        </button>
                    </span>
                </div>
                <div class="scrollbar-sidebar ps ps--active-y">
                    <div class="app-sidebar__inner">
                        <ul class="vertical-nav-menu metismenu">

                            
                            
                            
                            <li>
                                <a href="../User/user_management.php">

                                    <i class="fa fa-users" aria-hidden="true"></i>User Management
                                </a>
                            </li>
                              <li>
                                <a href="../ChallengeReport/challengereport.php">

                                    <i class="fa fa-users" aria-hidden="true"></i>Challenge Report
                                </a>
                            </li>


                        </ul>
                    </div>
                    <div class="ps__rail-x" style="left: 0px; bottom: 0px;">
                        <div class="ps__thumb-x" tabindex="0" style="left: 0px; width: 0px;"></div>
                    </div>
                    <div class="ps__rail-y" style="top: 0px; height: 643px; right: 0px;">
                        <div class="ps__thumb-y" tabindex="0" style="top: 0px; height: 610px;"></div>
                    </div>
                </div>
            </div>

            <div class="app-main__outer w-100">
                <div class="app-main__inner">

                    <div class="app-page-title app-page-title-simple">
                        <div class="page-title-wrapper d-flex justify-content-between">
                            <div class="page-title-heading">
                                <div>
                                    <div class="page-title-head center-elem mb-3">
                                        <span class="d-inline-block">
                                            <i class="lnr-apartment opacity-6"></i>
                                        </span>
                                        <span class="d-inline-block">Challenge Report</span>

                                    </div>


                                </div>
                            </div>

                            <nav class="" aria-label="breadcrumb">
                                <ol class="breadcrumb">
                                    <li class="breadcrumb-item"><a href="challengereport.php">Challenge Report</a></li>

                                </ol>
                            </nav>






                        </div>
                        
                        
                        
                       <div class="row">
							<div class="col-md-6 col-xl-4">
								<div class="card mb-3 widget-content">
									<div class="widget-content-outer">
										<div class="widget-content-wrapper">
											<div class="widget-content-left">
											    	<?php

                if ($searchassembly_name_drop == 1) {
                    ?>
												<div class="widget-heading">Total Count</div>
													  <?php
                } else {
                    ?>
												<div class="widget-heading">Total</div> 
													   <?php
                }
?>
												<div class="widget-subheading"></div>
											</div>
											<div class="widget-content-right">
												<div class="widget-numbers text-info">
													<?php
                                                    $count = 0;
$count                                                     = count($data);
echo $count;
?>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="col-md-6 col-xl-4">
								<div class="card mb-3 widget-content">
									<div class="widget-content-outer">
										<div class="widget-content-wrapper">
											<div class="widget-content-left">
												<div class="widget-heading">Amount Received </div>
												<div class="widget-subheading"></div>
											</div>
											<div class="widget-content-right">
												<div class="widget-numbers text-success">
													<?php
                                                $count = 0;

if ($searchassembly_name_drop == 0) {
    $totalReceived = 0;

    foreach ($data as $entry) {
        $totalReceived += $entry['Received'];
    }
    $count = $totalReceived;
}

echo $count;
?>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
			
						</div>



<div class="row ">
                            <div class="col-md-12">
                                <div class="main-card mb-3 card">
                                    <div class="card-body">
                                        <h5 class="card-title">Search</h5>
                                        <form class="" novalidate="true" action="<?php echo siteurl . 'ChallengeReport/challengereport.php'; ?>" method="post">
                               
                                                     
                                                     
                                                     <div class="form-row">
                                                    <div class="col-md-4 mb-3">
                                                    <label for="validationCustom01">Volunteer</label>
                                                    <?php
$user = get_option('tbl_user', 'name', 'id!=0');
?>
                                                     <select name="searchuser_drop" id="searchuser_drop" class="mb-2 form-control select2" >
				  	<?php echo array_options($user, $searchuser_drop); ?>
				  </select>
                                               
                                                   
                                                    </div>
                                                    
                                                    
                                                    
                                                     <div class="col-md-4 mb-3">
                                                    <label for="validationCustom01">Ward</label>
                                                    <?php
$ward = get_option('tbl_ward', 'ward_name', 'id!=0 and status=0');
?>
                                                     <select name="searchward_drop" id="searchward_drop" class="mb-2 form-control select2" >
				  	<?php echo array_options($ward, $searchward_drop); ?>
				  </select>
                                               
                                                    </div>
                                                    
                                                     <div class="col-md-4 mb-3">
                                                    <label for="validationCustom01">Name</label>
                                                    <input type="text" class="form-control" id="searchname" name="searchname" fdprocessedid="6j5eqm" value="<?php echo $searchname ?>">
                                                    
                                                    
                                                    
                                                     
                                                </div>
                                                    
                                                    </div>
                                                    
                                                  
                                            <div class="d-flex justify-content-end">
                                                <button class="btn btn-outline-dark mx-3" name="reset" type="submit" value="Reset">Reset</button>

                                                <button class="btn btn-success" type="submit" fdprocessedid="xryn1r">Search
                                                </button>

                                            </div>


                                        </form>

                                    </div>
                                </div>
                            </div>
                        </div>




                        <div class="row">
                            <div class="col-md-12">
                                <div class="main-card mb-3 card" >
                                    <div class="card-header d-flex justify-content-center">Report
                                        <div class="btn-actions-pane-right">
                                            <div role="group" class="btn-group-sm btn-group">

                                                <div class="app-header-left py-1">
                                                    <div class="search-wrapper">
                                                        <div class="input-holder">
                                                            <!--<input type="text" class="search-input"
                                                                placeholder="Type to search" id="searchInput-header"
                                                                onkeyup="searchTable()">
                                                            <button class="search-icon"><span></span></button>-->
                                                        </div>
                                                       <button id="search-close-new" class="close"></button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        
                                        </button>
                                        
                                        
                                    </div>
                                    <div class="table-responsive">
                                        <table
                                            class="align-middle mb-0 table table-borderless table-striped table-hover">
                                            <thead>
                                                
                                                <?php
                                                 if ($_SESSION['wardconsolidated'] == 1 || $_SESSION['clubconsolidated'] == 1) {
                                                     ?>
                                                      <th class="text-left">Si.No</th>
                                                    <th class="text-left">Name</th>
                                                     <th class="text-left">Product</th>
													  <th class="text-left">Qty</th>
												<?php
                                                 } else {
                                                     ?>
                                                     
                                                     <tr>
                                                    <th class="text-left">Si.No</th>
                                                    <th class="text-left">Name</th>
                                                    <th class="text-left">Mobile</th>
                                                    <th class="text-left">Address</th>
                                                    <th class="text-left">Date</th>
                                                    <th class="text-left">Assembly</th>
                                                    <th class="text-left">Panchayat</th>
                                                    <th class="text-left">Ward/Organisation</th>
                                                    <?php
                                                    if ($searchassembly_name_drop == 1) {
                                                        ?>
													  <th class="text-left">Product</th>
													  <th class="text-left">Qty</th>
													  <th class="text-left">Product</th>
													  <th class="text-left">Qty</th>
													  <th class="text-left">Product</th>
													  <th class="text-left">Qty</th>
													<?php

                                                    } elseif ($searchassembly_name_drop == 2) {
                                                        ?>
													  <th class="text-left">Product & Qty</th>
													 
													<?php

                                                    }
                                                     ?>
                                                    <th class="text-left">Amount</th>
                                                    <th class="text-left">Received</th>
                                                    <th class="text-left">Transaction ID</th>
                                                    


                                                </tr>
                                                
                                                <?php

                                                 }
?>
                                            </thead>
                                            <tbody id="tabledata-new">
                                                <?php
// Define the number of records per page
$recordsPerPage = 1000;

// Calculate the total number of pages
$totalPages = ceil(count($data) / $recordsPerPage);

// Determine the current page number
if (isset($_GET['page']) && is_numeric($_GET['page'])) {
    $currentPage = $_GET['page'];
} else {
    $currentPage = 1;
}

// Calculate the starting record for the current page
$start = ($currentPage - 1) * $recordsPerPage;

// Slice the data array to display only the records for the current page
$paginatedData = array_slice($data, $start, $recordsPerPage);
$name          = '';

// Display the paginated data
foreach ($paginatedData as $index => $row) {
    if ($_SESSION['wardconsolidated'] == 0 && $_SESSION['clubconsolidated'] == 0) {
        $id     = $row['id'];
        $cuid   = $row['cuid'];
        $clubid = $row['clubid'];

        $dataclub = findQuery("SELECT * FROM tbl_club WHERE id=$clubid");
        $clubname = '';

        if ($dataclub) {
            $clubname = $dataclub[0]['club_name'];
        }


        if ($row['orderforothers'] == 1) {
        } else {
            $dataaddrs = findQuery("SELECT * FROM tbl_customer WHERE id=$cuid");
            $address   = $dataaddrs[0]['Address'];

            if ($address == '') {
                $address = 'NA';
            }
        }

        if ($searchassembly_name_drop == 1) {
        } else {
            $dataprod = findQuery("SELECT tbl_product.product_name,tbl_transactiondetails.qty,tbl_transactiondetails.rate FROM `tbl_transaction` inner join tbl_transactiondetails on tbl_transaction.id=tbl_transactiondetails.hdrid inner join tbl_product on tbl_product.id=tbl_transactiondetails.item where tbl_transactiondetails.hdrid=$id");
            $product  = '';

            if ($dataprod) {
            }
        }
    }


    ?>
												
												<?php
    if ($_SESSION['wardconsolidated'] == 1 || $_SESSION['clubconsolidated'] == 1) {
    } else {
        ?>
												   <tr>
														<td class="text-left text-muted"><?php echo $index + $start + 1 ?>.</td>
															<td class="text-left"><?php echo $row['name'] ?></td>
														<td class="text-left"><?php echo $row['Mobile'] ?></td>
														<td class="text-left"><?php echo $address ?></td>
														
														<td class="text-left"><?php echo date('d-m-Y', strtotime($row['ordrddate']))  ?></td>
														<td class="text-left"><?php echo $row['assembly'] ?></td>
														<td class="text-left"><?php echo $row['panchayat_name'] ?></td>
														<td class="text-left"><?php echo $row['ward_name'] ? $row['ward_name'] : $clubname ?></td>
														
														<?php
            if ($searchassembly_name_drop == 1) {
            } elseif ($searchassembly_name_drop == 2) {
            }
        ?>
														
														
														<td class="text-left"><?php echo $row['Amount'] ?></td>
														<td class="text-left"><?php echo $row['Received'] ?></td>
														<td class="text-left"><?php echo $row['Transid'] ? $row['Transid'] : 'NA' ?></td>
														
															
													
											
                                                        
                                                            

														
													</tr> 
														<?php
    }
} ?>
                                            </tbody>
                                            
                                        </table>
<div class="d-flex justify-content-end">
<?php
          if ($totalPages > 0) {
              if ($searchassembly_name_drop == 1) {
                  ?>
<button class="mb-2 mr-2 btn btn-success" fdprocessedid="07uj0u"><a
                                                class="text-white" href="Challengeexport.php">Export</a>
                                        </button>
 <?php
              } elseif ($searchassembly_name_drop == 2) {
                  ?>
<button class="mb-2 mr-2 btn btn-success" fdprocessedid="07uj0u"><a
                                                class="text-white" href="Sponsorexport.php">Export</a>
                                        </button>
 <?php
              } elseif ($searchassembly_name_drop == 0) {
                  ?>
<button class="mb-2 mr-2 btn btn-success" fdprocessedid="07uj0u"><a
                                                class="text-white" href="Donationexport.php">Export</a>
                                        </button>
 <?php
              } elseif ($_POST['wardconsolidated'] == 'on') {
                  ?>
<button class="mb-2 mr-2 btn btn-success" fdprocessedid="07uj0u"><a
                                                class="text-white" href="wardconsolidatedexport.php">Export</a>
                                        </button>
 <?php
              } elseif ($_POST['clubconsolidated'] == 'on') {
                  ?>
<button class="mb-2 mr-2 btn btn-success" fdprocessedid="07uj0u"><a
                                                class="text-white" href="clubconsolidated.php">Export</a>
                                        </button>
 <?php
              }
          }
?>
                                    </div>
                                    </div>
                                    
                                    
                                </div>
                                <?php

                                if ($totalPages > 0) {
                                    ?>                           
                              <ul class="pagination pagination-sm d-flex justify-content-end">
    <!-- Previous page link -->
    <?php if ($currentPage > 1) { ?>
        <li class="page-item"><a href="?page=<?php echo($currentPage - 1); ?>" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
    <?php } else { ?>
        <li class="page-item disabled"><span class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></span></li>
    <?php } ?>

    <!-- Page numbers -->
    <li class="page-item <?php echo ($currentPage == 1) ? 'active' : ''; ?>"><a href="?page=1" class="page-link">1</a></li>

    <?php
    // Define the range of neighboring pages to show
    $neighboringPages = 2;

                                    // Show ellipsis if there are more than 5 pages after the current page
                                    if ($totalPages - $currentPage - $neighboringPages > 1) { ?>
        <li class="page-item disabled"></li>
    <?php }







                                    // Loop through the pages
                                    for ($i = max(2, $currentPage - $neighboringPages); $i <= min($currentPage + $neighboringPages, $totalPages); $i++) { ?>
        <?php if ($i != 1 && $i != $totalPages) { ?>
            <li class="page-item <?php echo ($i == $currentPage) ? 'active' : ''; ?>"><a href="?page=<?php echo $i; ?>" class="page-link"><?php echo $i; ?></a></li>
        <?php } ?>
    <?php }


                                    // Show ellipsis if there are more than 5 pages after the current page
                                    if ($totalPages - $currentPage - $neighboringPages > 1) { ?>
        <li class="page-item disabled"><span class="page-link">...</span></li>
    <?php } ?>

    <!-- End of pagination -->
    <?php if ($totalPages != 1) { ?>
        <li class="page-item"><a href="?page=<?php echo $totalPages; ?>" class="page-link"><?php echo $totalPages; ?></a></li>
    <?php } ?>

    <!-- Next page link -->
    <?php if ($currentPage < $totalPages) { ?>
        <li class="page-item"><a href="?page=<?php echo($currentPage + 1); ?>" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
    <?php } else { ?>
        <li class="page-item disabled"><span class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></span></li>
    <?php } ?>
</ul>
<?php
                                }
?>

                            </div>
                        </div>
                    </div>
                </div>

                <div class="app-wrapper-footer">
                    <div class="app-footer">
                        <div class="app-footer__inner d-flex justify-content-center">
                            <li style="list-style-type: none;">Developed by <a
                                    href="https://workmateinfotech.com/">Workmate Infotech Pvt Ltd</a> </li>
                        </div>
                    </div>
                </div>
                
            </div>
        </div>
        
        <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
            style="display: none;" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <div class="modal-file-import">

                        <form id="uploadForm" role="form" method="post" action="<?php echo siteurl . 'Panchayat/import/save.php'; ?>" enctype="multipart/form-data">
							<div class="card">
								<h3>Import Files</h3>
								<div class="drop_box">
									<header>
										<h4>Select File here</h4>
									</header>
									<p>Please choose file for importing</p>
								
		                            
		                           <input class="mb-3" style="margin-left: 100px;" type="file" name="csv_file[]" accept=".xlsx,.xls" required>
										
									<button type="submit" name="upload" class="btn btn-primary">- Import-</button>
								</div>
							</div>
							<!-- Add any other form fields or buttons here if needed -->
						</form>
						
						
						

						<script>
							document.getElementById('fileInput').addEventListener('change', function() {
								document.getElementById('uploadForm').submit();
							});
						</script>


                    </div>
                </div>
            </div>
        </div>


        <!-- Modal HTML -->
        <div class="yes-or-n0-modal">
            <div id="myModalyesorno" class="modal fade">
                <div class="modal-dialog modal-confirm">
                    <div class="modal-content">
                        <div class="modal-header bg-white flex-column">
                            <div class="icon-box">
                                <i class="fa fa-exclamation-circle" aria-hidden="true"></i>
                            </div>
                            <h4 class="modal-title w-100">Sure to block?</h4>
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        </div>
                        <div class="modal-body">
                            <p>Do you really want to block these record? </p>
                        </div>
                        <div class="modal-footer bg-white justify-content-center">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                            <button type="button" class="btn btn-danger">Delete</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="success_modal_new">
            <div class="modal fade show" id="statusSuccessModal" tabindex="-1" role="dialog" data-bs-backdrop="static" data-bs-keyboard="false">
                <div class="modal-dialog modal-dialog-centered modal-sm" role="document">
                    <div class="modal-content">
                        <div class="modal-body text-center p-lg-4">
                            <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 130.2 130.2">
                                <circle class="path circle" fill="none" stroke="#198754" stroke-width="6" stroke-miterlimit="10" cx="65.1" cy="65.1" r="62.1" />
                                <polyline class="path check" fill="none" stroke="#198754" stroke-width="6" stroke-linecap="round" stroke-miterlimit="10" points="100.2,40.2 51.5,88.8 29.8,67.5 " />
                            </svg>
                            <h4 class="text-success mt-3">Oh Yeah!</h4>
                            <p class="mt-3">
                            <div id="messagesuccess"></div>
                            </p>
                            <button type="button" class="btn btn-sm  btn-success" data-dismiss="modal">Ok</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="success_modal_new">
            <div class="modal fade show" id="statusErrorsModal" tabindex="-1" role="dialog" data-bs-backdrop="static" data-bs-keyboard="false">
                <div class="modal-dialog modal-dialog-centered modal-sm" role="document">
                    <div class="modal-content">
                        <div class="modal-body text-center p-lg-4">
                            <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 130.2 130.2">
                                <circle class="path circle" fill="none" stroke="#db3646" stroke-width="6" stroke-miterlimit="10" cx="65.1" cy="65.1" r="62.1" />
                                <line class="path line" fill="none" stroke="#db3646" stroke-width="6" stroke-linecap="round" stroke-miterlimit="10" x1="34.4" y1="37.9" x2="95.8" y2="92.3" />
                                <line class="path line" fill="none" stroke="#db3646" stroke-width="6" stroke-linecap="round" stroke-miterlimit="10" x1="95.8" y1="38" X2="34.4" y2="92.2" />
                            </svg>
                            <h4 class="text-danger mt-3">Oh No!</h4>
                            <p class="mt-3">
                            <div id="messagefailed"></div>
                            </p>
                            <button type="button" class="btn btn-sm mt-3 btn-danger" data-dismiss="modal">Ok</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <script src="../assets/scripts/jquery.min.js"></script>
		<script src="../assets/scripts/moment.min.js"></script>
		<script src="../assets/scripts/daterangepicker.min.js"></script>
		<script src="../assets/scripts/custome.js"></script>
		<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.1/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="../assets/scripts/main.js"></script>
		<script src="https://use.fontawesome.com/f9637666d8.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.jquery.js"></script>


		<script>
			$(document).ready(function() {
				// Check if the URL has a parameter indicating invalid login
				const urlParams = new URLSearchParams(window.location.search);
				const message = urlParams.get('message');

				if (message == 'Blocked successfully!') {
					$('#statusSuccessModal').modal('show');
					$('#messagesuccess').text(message);
				}
				else if (message == 'Something went wrong, please try again.') {
					$('#statusErrorsModal').modal('show');
					$('#messagefailed').text(message);
				}
				else if (message == 'Imported Successfullly') {
						$('#statusSuccessModal').modal('show');
					$('#messagesuccess').text(message);
				}
 else if (message == 'Reference exist cannot block') {
						$('#statusErrorsModal').modal('show');
					$('#messagefailed').text(message);
				}
				// Event listener for modal close event
				$('#statusSuccessModal').on('hidden.bs.modal', function() {
					// Remove the message parameter from the URL
					window.history.replaceState({}, document.title, window.location.pathname);
				});
				$('#statusErrorsModal').on('hidden.bs.modal', function() {
					// Remove the message parameter from the URL
					window.history.replaceState({}, document.title, window.location.pathname);
				});
			});
		</script>
    </div>

	<script>
function setFries(obj){
    
    var opt1= document.getElementById("clubconsolidated");
    var opt2 = document.getElementById("wardconsolidated");
    
  
  
    
     if(obj.id=='clubconsolidated'){
      opt2.checked = false;
    
     }
     else if(obj.id=='wardconsolidated'){
      opt1.checked = false;
      
    }
}
	</script>
</body>
<style>
       .table th,
        .table td { 
            font-size: 12px;
            padding: 0.25rem;

      }
</style>
</html>