Last active
December 4, 2021 22:47
-
-
Save CodexAdrian/afe66c6363696865750c721da435f70d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html class="bg-gray-900"> | |
| <head> | |
| <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | |
| <link href="https://unpkg.com/tailwindcss@^2.2.15/dist/tailwind.min.css" rel="stylesheet"> | |
| <title>Regis Contacts</title> | |
| </head> | |
| <body id="root"> | |
| <?php | |
| $database = null; | |
| require_once 'api/db.php'; | |
| $query = " | |
| select * from abk_constituents | |
| inner join abk_constituentTypes on abk_constituents.constituentTypeID = abk_constituentTypes.constituentTypeID | |
| inner join abk_states on abk_constituents.stateID = abk_states.stateID"; | |
| $rs = mysqli_query($database, $query); | |
| $constituents = mysqli_fetch_all($rs, MYSQLI_ASSOC) | |
| ?> | |
| <div class="bg-gray-900 flex flex-row" style="height: 100vh"> | |
| <div class="" style="width: 100%;"> | |
| <div class="flex flex-row content-center"> | |
| <p class="text-white text-3xl mt-10 mb-5 font-bold ml-5">Contacts</p> | |
| <div style="width: 100%"></div> | |
| <button onclick="window.location.reload()"><span class="material-icons text-white mr-5" style="font-size: 3vw">refresh</span></button> | |
| </div> | |
| <div class="overflow-auto grid grid-cols-5" style="width: 100%"> | |
| <?php | |
| foreach($constituents as $constituent) { | |
| $id = $constituent['constituentID']; | |
| ?> | |
| <div class="pt-5 text-white bg-gray-800 m-5 border-l-5 border-gray-700 rounded-md flex flex-col" style="height: 35vh"> | |
| <?php | |
| $type = $constituent['constituentType']; | |
| $address = $constituent['address']; | |
| $city = $constituent['city'] . ", ". $constituent['abbreviation']. " ". $constituent['zipCode']; | |
| $color = '#FF0000'; | |
| switch ($constituent['constituentTypeID']) { | |
| case 1: $color = '#30fc03'; | |
| break; | |
| case 2: $color = '#ffdd00'; | |
| break; | |
| case 3: $color = '#f700ff'; | |
| break; | |
| case 4: $color = '#7700ff'; | |
| break; | |
| case 5: $color = '#00ffe1'; | |
| } | |
| echo "<p class='pl-2 border-l-4 border-red-100 text-xl mb-3' style='border-color: $color'>$type</p>"; | |
| echo "<p class='pl-2 border-l-4 border-red-100 text-xl mb-3' style='border-color: #ff3729'>$address</p>"; | |
| echo "<p class='pl-2 border-l-4 border-red-100 text-xl mb-3' style='border-color: #ff9f29'>$city</p>"; | |
| ?> | |
| <div style="height: 100%"></div> | |
| <div class="ml-6 mb-5 text-xl flex flex-row justify-center"> | |
| <div style="width: 100%"> | |
| <p><?php echo $constituent['firstName'] ?></p> | |
| <p><?php echo $constituent['lastName'] ?></p> | |
| </div> | |
| <a class="mr-5 p-0" href=<?php echo "'editPage.php?id=$id'";?> > | |
| <span class="material-icons text-4xl">edit</span> | |
| </a> | |
| <a onclick="return confirm('Are you sure you want to delete <?php echo $constituent['firstName']. " " . $constituent['lastName']?>?');" class="mr-5 p-0" href =<?php echo "'api/delete.php?id=$id'"?>> | |
| <span class="material-icons text-4xl">delete</span> | |
| </a> | |
| </div> | |
| </div> | |
| <?php } ?> | |
| <a href="newUser.php"> | |
| <div class="p-auto text-white bg-gray-800 m-5 border-gray-700 rounded-md text-center" style="height: 35vh; padding-top: 12vh;"> | |
| <span class="material-icons text-white" style="font-size: 11vh">add_circle</span> | |
| </div> | |
| </a> | |
| </div> | |
| </div> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment