{"id":208,"date":"2017-09-02T14:40:46","date_gmt":"2017-09-02T14:40:46","guid":{"rendered":"http:\/\/fraserburghbaptist.co.uk\/wordpress\/?page_id=208"},"modified":"2019-12-28T20:42:02","modified_gmt":"2019-12-28T20:42:02","slug":"rotas","status":"publish","type":"page","link":"https:\/\/fraserburghbaptist.co.uk\/?page_id=208","title":{"rendered":"Rotas"},"content":{"rendered":"<p>[insert_php]<br \/>\n        echo &#8220;<\/p>\n<table>\n<tr>\n<td>\n<h3><\/h3>\n<\/td>\n<\/tr>\n<\/table>\n<p>&#8220;;<\/p>\n<p>        echo &#8220;<\/p>\n<table>&#8220;;<br \/>\n\techo &#8220;<\/p>\n<tr>&#8220;;<br \/>\n\techo &#8220;<\/p>\n<td><b>Date<\/b><\/td>\n<td><b>Table (Prep in UPPERcase)<\/b><\/td>\n<td><b>Door<\/b><\/td>\n<td><b>Hymn Books<\/b><\/td>\n<td><b>Music<\/b><\/td>\n<td><b>Powerpoint<\/b><\/td>\n<td><b>Offering<\/b>&#8220;;<br \/>\n        echo&#8221;<\/td>\n<p>&#8220;;<br \/>\n\techo &#8220;<\/tr>\n<p>&#8220;;<\/p>\n<p>        $servername = &#8220;185.136.235.126&#8221;;<br \/>\n        $username = &#8220;johnbaptist&#8221;;<br \/>\n        $password = &#8220;baptist&#8221;;<br \/>\n        $dbname = &#8220;baptist&#8221;;<\/p>\n<p>         \/\/ Make connection and then select the database<br \/>\n         \/\/ Create connection<br \/>\n         $conn = new mysqli($servername, $username, $password, $dbname);<\/p>\n<p>         if ($conn->connect_error) {<br \/>\n           die(&#8220;Connection failed: &#8221; . $conn->connect_error);<br \/>\n        } <\/p>\n<p>\t$str_NextSundayDate = date(&#8216;Y-m-d&#8217;, strtotime(&#8216;now&#8217;));<br \/>\n\t$sql = &#8220;SELECT * FROM rotas WHERE sundaydate >= &#8216;$str_NextSundayDate&#8217; order by sundaydate&#8221;;<br \/>\n        $result = $conn->query($sql);<\/p>\n<p>\t$gbdate = date(&#8216;d-m-Y\t&#8216;, strtotime(&#8216;next Sunday&#8217;));<br \/>\n\t$formatteddate = strftime(&#8220;%A %d %b %Y&#8221;, strtotime($gbdate));<br \/>\n\t$i = 1;<\/p>\n<p>\t$oldMonth = &#8220;&#8221;;<br \/>\n\t$month = &#8220;&#8221;;<\/p>\n<p>\tif($result->num_rows > 0){<br \/>\n  \t\twhile($row = $result->fetch_assoc()) {<br \/>\n\t\t\tforeach( $row AS $key => $val ){<br \/>\n\t\t\t\t$$key = stripslashes( $val );<br \/>\n\t\t\t}<br \/>\n\t\t\t$formatteddate = strftime(&#8220;%d %b %Y&#8221;, strtotime($sundaydate));<\/p>\n<p>\t\t\t$oldMonth = $month;<\/p>\n<p>\t\t\t$month = substr($formatteddate, 4, 3);<\/p>\n<p>\t\t\tif ($oldMonth != $month &#038;&#038; ($oldMonth  != &#8220;&#8221;))<br \/>\n\t\t\t{<br \/>\n\t\t\t\techo &#8220;<\/p>\n<tr>\n<td>&nbsp;<\/td>\n<\/tr>\n<p>&#8220;;<br \/>\n\t\t\t}<\/p>\n<p>\t\t\t$i++;<br \/>\n\t\t\t$mod = $i % 2;<\/p>\n<p>\t\t\tif ($mod == 1)<br \/>\n\t\t\t{<br \/>\n\t\t\t\techo &#8220;<\/p>\n<tr>\n<td width = '9%' valign = 'top'>$formatteddate<\/td>\n<p>&#8220;;<br \/>\n\t\t\t\techo &#8220;<\/p>\n<td width = '20%' valign = 'top'>$table1<\/td>\n<p>&#8220;;<br \/>\n\t\t\t\techo &#8220;<\/p>\n<td width = '20%' valign = 'top'>$door<\/td>\n<p>&#8220;;<br \/>\n\t\t\t\techo &#8220;<\/p>\n<td width = '12%' valign = 'top'>$books<\/td>\n<p>&#8220;;<\/p>\n<p>\t\t\t\techo &#8220;<\/p>\n<td width = '7%' valign = 'top'>$music<\/td>\n<p>&#8220;;<br \/>\n\t\t\t\techo &#8220;<\/p>\n<td width = '7%' valign = 'top'>$powerpoint<\/td>\n<p>&#8220;;<br \/>\n                                echo &#8220;<\/p>\n<td width = '8%' valign = 'top'>$offering<\/td>\n<\/tr>\n<p>&#8220;;<br \/>\n\t\t\t}<br \/>\n\t\t\telse<br \/>\n\t\t\t{<br \/>\n\t\t\t        echo &#8220;<\/p>\n<tr>\n<td bgcolor = '#f4f4f4' valign = 'top'>$formatteddate<\/td>\n<p>&#8220;;<br \/>\n\t\t\t\techo &#8220;<\/p>\n<td bgcolor = '#f4f4f4' valign = 'top'>$table1<\/td>\n<p>&#8220;;<br \/>\n\t\t\t\techo &#8220;<\/p>\n<td bgcolor = '#f4f4f4' valign = 'top'>$door<\/td>\n<p>&#8220;;<br \/>\n\t\t\t\techo &#8220;<\/p>\n<td bgcolor = '#f4f4f4' valign = 'top'>$books<\/td>\n<p>&#8220;;<\/p>\n<p>\t\t\t\techo &#8220;<\/p>\n<td bgcolor = '#f4f4f4' valign = 'top'>$music<\/td>\n<p>&#8220;;<br \/>\n\t\t\t\techo &#8220;<\/p>\n<td bgcolor = '#f4f4f4' valign = 'top'>$powerpoint<\/td>\n<p>&#8220;;<br \/>\n                                echo &#8220;<\/p>\n<td bgcolor = '#f4f4f4' valign = 'top'>$offering<\/td>\n<\/tr>\n<p>&#8220;;<br \/>\n\t\t\t}<\/p>\n<p>\t\t}<br \/>\n\t}<br \/>\necho &#8220;<\/table>\n<p>&#8220;;<br \/>\n[\/insert_php]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[insert_php] echo &#8220; &#8220;; echo &#8220; &#8220;; echo &#8220; &#8220;; echo &#8220; Date Table (Prep in UPPERcase) Door Hymn Books Music Powerpoint Offering&#8220;; echo&#8221; &#8220;; echo &#8220; &#8220;; $servername = &#8220;185.136.235.126&#8221;; $username = &#8220;johnbaptist&#8221;; $password = &#8220;baptist&#8221;; $dbname = &#8220;baptist&#8221;; \/\/ Make connection and then select the database \/\/ Create[&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template-fullwidth.php","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/fraserburghbaptist.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/208"}],"collection":[{"href":"https:\/\/fraserburghbaptist.co.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/fraserburghbaptist.co.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/fraserburghbaptist.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fraserburghbaptist.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208"}],"version-history":[{"count":90,"href":"https:\/\/fraserburghbaptist.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/208\/revisions"}],"predecessor-version":[{"id":1125,"href":"https:\/\/fraserburghbaptist.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/208\/revisions\/1125"}],"wp:attachment":[{"href":"https:\/\/fraserburghbaptist.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}