Rotas

Rotas

[insert_php]
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;

$servername = “185.136.235.126”;
$username = “johnbaptist”;
$password = “baptist”;
$dbname = “baptist”;

// Make connection and then select the database
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}

$str_NextSundayDate = date(‘Y-m-d’, strtotime(‘now’));
$sql = “SELECT * FROM rotas WHERE sundaydate >= ‘$str_NextSundayDate’ order by sundaydate”;
$result = $conn->query($sql);

$gbdate = date(‘d-m-Y ‘, strtotime(‘next Sunday’));
$formatteddate = strftime(“%A %d %b %Y”, strtotime($gbdate));
$i = 1;

$oldMonth = “”;
$month = “”;

if($result->num_rows > 0){
while($row = $result->fetch_assoc()) {
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
$formatteddate = strftime(“%d %b %Y”, strtotime($sundaydate));

$oldMonth = $month;

$month = substr($formatteddate, 4, 3);

if ($oldMonth != $month && ($oldMonth != “”))
{
echo “

“;
}

$i++;
$mod = $i % 2;

if ($mod == 1)
{
echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
}
else
{
echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
}

}
}
echo “

Date Table (Prep in UPPERcase) Door Hymn Books Music Powerpoint Offering“;
echo”
 
$formatteddate $table1 $door $books $music $powerpoint $offering
$formatteddate $table1 $door $books $music $powerpoint $offering

“;
[/insert_php]