php – achor tag <a> is not clickable HTML-ThrowExceptions

Exception or error:

The anchor tag on the saturday of the first month is not working and I do not know why.
I am trying to figure out why saturday buttons for the first month displayed are not clickable.
All other days in both months are clickable.
My idea is that i want the dates to redirect to a different class that renders the classes for the clicked date.
this system is already live at https://app.aerafrica.com , this is a really annoying bug that is blocking bookings for specific days in the month.

[![February Satruday is disabled ][2]][2]

//include ('../configs/DbConnect.php');
$maindate=date('Y-m-d');
$dayofweek=date('w', strtotime($maindate));
$maindate1=date('Y-m-d', strtotime($maindate));
switch ($dayofweek){
    case 0:
        $dayofweek=7;
        break;
    default:
        $dayofweek;

}


function showMonth($month, $year)
{
    $date = mktime(12, 0, 0, $month, 1, $year);
    $daysInMonth = date("t", $date);
    // calculate the position of the first day in the calendar (sunday = 1st column, etc)
    $offset = date("w", $date);
    $rows = 1;

    echo "<h4>" . date("F Y", $date) . "</h4>\n";

    echo "<table class='table table-bordered' border=\"1\">\n";
    echo "\t<tr><th>Su</th><th>M</th><th>Tu</th><th>W</th><th>Th</th><th>F</th><th>Sa</th></tr>";
    echo "\n\t<tr>";

    for($i = 1; $i <= $offset; $i++)
    {
        echo "<td style='font-size: small'></td>";
    }

    for($day = 1; $day <= $daysInMonth; $day++)
    {
        if( ($day + $offset - 1) % 7 == 0 && $day != 1)
        {
            echo "</tr>\n\t<tr>";
            $rows++;
        }

        echo "<td> <a class='btn-outline-secondary' href='classes.php?day=$day-$month'>$day</a> </td>";
    }


    while( ($day + $offset) <= $rows * 7)
    {
        echo "<td></td>";
        $day++;
    }

    echo "</tr>\n";
    echo "</table>\n";

}
$mon=date('m');

$year=date('Y');
//$db=new DbConnect();
//$classesquery = $db->querydb("SELECT c.id as id, cp.product_name as classname,cp.description as details, p.name as coachname,c.dayscheduled as day ,cp.class_requirement as class_requirements 
  //   ,(c.spotsvailable-c.spots_used ) as spots, c.timefrom as starttime ,loc.name as location_name ,c.duration as classduration , c.datefrom as datefrom from tbl_classes c  join tbl_locations loc on loc.id=c.locationid 
    //join tbl_persons p on p.id=c.coachid join tbl_products cp on cp.id = c.productid where c.is_active=0 and c.spots_used < c.spotsvailable and c.dayscheduled='$dayofweek' and c.dateto>= '$maindate1' 
//order by c.timefrom asc ");
?>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>AER Portal</title>

    <!-- Bootstrap core CSS -->
    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">


    <!-- Custom styles for this template -->
    <link href="css/heroic-features.css" rel="stylesheet">

</head>

<body>

<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
    <div class="container">
        <a class="navbar-brand" href="index.php">Class Schedule</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarResponsive">
            <ul class="navbar-nav ml-auto">
                <li class="nav-item">
                    <a class="nav-link" href="https://aerafrica.com">Home</a>
                </li>

                <li class="nav-item active">
                    <a class="nav-link" href="#">Schedule
                        <span class="sr-only">(current)</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="../login.php">Login</a>
                </li>
                <!--li- class="nav-item">
                  <a class="nav-link" href="../register.php">Register</a>
                </li-->
            </ul>
        </div>
    </div>
</nav>

<!-- Page Content -->
<div class="container">
    <br>
    <div class="row">




        <div class="col-sm-3"   style="text-align: center">
            <div><?php showMonth($mon,$year)?> </div>

        </div>

        <div class="col-sm-3"></div>
        <div class="col-sm-3"   style="text-align: center">
            <div><?php showMonth($mon+1,$year)?></div>

        </div>



    </div>
    <table class="table table-striped table-bordered table-list">
        <thead>


        </tbody>
    </table>
    <!-- /.container -->
</div>
<!-- Footer -->
<footer class="py-5 bg-dark">
    <div class="container">
        <p class="m-0 text-center text-white">Copyright &copy; AER Africa <?php echo date('Y')?></p>
    </div>
    <!-- /.container -->
</footer>

<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>


</body>

</html>
<style>
    .center {
        margin-top:50px;
    }

    .modal-header {
        padding-bottom: 5px;
    }

    .modal-footer {
        padding: 0;
    }

    .modal-footer .btn-group button {
        height:40px;
        border-top-left-radius : 0;
        border-top-right-radius : 0;
        border: none;
        border-right: 1px solid #ddd;
    }

    .modal-footer .btn-group:last-child > button {
        border-right: 0;
    }
    .main-parallax {
        z-index: 1;
    }
</style>```


  [1]: https://i.stack.imgur.com/mLRdF.png
  [2]: https://i.stack.imgur.com/t3rsA.png
How to solve:

You have a row that contains your calendars. There are three divs with the class col-sm-3. Try changing them all to col-sm-4. Bootstrap grids are based on 12 columns and you’re only using 9, which pushes everything too close together.

Leave a Reply

Your email address will not be published. Required fields are marked *