<div id="photos" class="drop"> <h3>Photos Module</h3> <?php echo photo_list(false, true); ?> </div> <div id="music" class="drop"> <h3>Music Module</h3> <?php echo music_list(false, true); ?> </div> <div id="location" class="drop"> <h3>Location Module</h3> <?php echo location_list(false, true); ?> </div> </div> <div> <input type="hidden" name="form_name" id="id_form_name" value="modules_form" /> <input type="submit" name="save" id="id_save_3" value="Save" /> </div> </form> </fieldset> </div> <?php
function show_record_admin($dbc, $id, $cur_page) { # Return all item details for admin $query = 'SELECT stuff.id, stuff.description, locations.name, stuff.create_date, stuff.owner, stuff.finder, stuff.status, stuff.image_url FROM stuff, locations WHERE stuff.location_id = locations.id AND stuff.id = ' . $id; # Execute the query $results = mysqli_query($dbc, $query); check_results($results); # Show results if ($results) { # But...wait until we know the query succeed before # rendering the table start. $row = mysqli_fetch_array($results, MYSQLI_ASSOC); echo '<h2> Item Details </h2>'; echo '<p>View item details below:</p>'; echo '<div class="row">'; echo '<div class="4u 12u(mobile)">'; if (empty($row['image_url'])) { $image_url = 'images/pic01.jpg'; } else { $image_url = $row['image_url']; } echo '<section class="box">'; echo '<img src="' . $image_url . '" alt="" style="max-width:100%; max-height:100%;"/>'; echo '</section>'; echo '</div>'; echo '<div class="8u 12u(mobile)">'; echo '<section class="box">'; echo '<TABLE class="default">'; echo '<TR>'; echo '<TH>ID</TH>'; echo '<TH>Description</TH>'; echo '<TH>Location</TH>'; echo '<TH>Date</TH>'; echo '<TH>Owner</TH>'; echo '<TH>Finder</TH>'; echo '<TH>Status</TH>'; echo '</TR>'; # For each row result, generate a table row echo '<TR>'; echo '<TD>' . $row['id'] . '</TD>'; echo '<TD>' . $row['description'] . '</TD>'; echo '<TD>' . $row['name'] . '</TD>'; echo '<TD>' . $row['create_date'] . '</TD>'; echo '<TD>' . $row['owner'] . '</TD>'; echo '<TD>' . $row['finder'] . '</TD>'; echo '<TD>' . $row['status'] . '</TD>'; echo '</TR>'; # End the table echo '</TABLE>'; echo '</section>'; switch ($row['status']) { case 'lost': echo '<menu><input type="button" id="contact" value="Contact Owner"/>'; break; case 'found': echo '<menu><input type="button" id="contact" value="Contact finder"/>'; break; } echo ' <input type="button" id="editbtn" value="Edit Item"/> <input type="button" id="deletebtn" value="Remove Item"/></menu> '; echo '</div></div>'; echo '<!-- Simple pop-up dialog box, containing a form --> <dialog id="contactDialog"> <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <input type="hidden" name="dialog" value="contact"> <section class="box"> <section> <p><label>Please enter your email address: *</label> <input required type="text" name="email"/></p> <p><label>Please input your message: *</label> <textarea required name="msg" class="image scaled" cols=75></textarea> <input type="hidden" name="id" value="' . $id . '"></p> </section> <menu> <button id="cancelDialog" type="reset">Cancel</button> <button type="submit">Confirm</button> </menu> </section> </form> </dialog> <script> (function() { var contactForItem = document.getElementById(\'contact\'); var favDialog = document.getElementById(\'contactDialog\'); var cancelButton = document.getElementById(\'cancelDialog\'); // Update buttons opens a modal dialog contactForItem.addEventListener(\'click\', function() { favDialog.showModal(); }); // Form cancel button closes the dialog box cancelButton.addEventListener(\'click\', function() { favDialog.close(); }); })(); </script>'; echo '<!-- Simple pop-up dialog box, containing a form --> <dialog id="editItem"> <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <input type="hidden" name="dialog" value="edit"> <section class="box"> <section> <input type="hidden" name="id" value="' . $id . '"> <p><label>Item Description:</label> <input required type="text" name="desc" value="' . $row['description'] . '"/></p> <p><label>Location:</label> <select name="location">'; location_list($dbc, $row['location']); echo '</select></p> <p><label>Owner:</label> <input type="text" name="owner" value="' . $row['owner'] . '"/></p> <p><label>Finder:</label> <input type="text" name="finder" value="' . $row['finder'] . '"/></p> <p><label>Status:</label> <input required type="text" name="status" value="' . $row['status'] . '"/></p> </section> <menu> <button id="cancelDialogEdit" type="reset">Cancel</button> <button type="submit">Confirm</button> </menu> </section> </form> </dialog> <script> (function() { var Item = document.getElementById(\'editbtn\'); var favDialog = document.getElementById(\'editItem\'); var cancelButton = document.getElementById(\'cancelDialogEdit\'); // Update buttons opens a modal dialog Item.addEventListener(\'click\', function() { favDialog.showModal(); }); // Form cancel button closes the dialog box cancelButton.addEventListener(\'click\', function() { favDialog.close(); }); })(); </script>'; echo '<!-- Simple pop-up dialog box, containing a form --> <dialog id="deleteItem"> <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <input type="hidden" name="dialog" value="delete"> <section class="box"> <section> <p><label>Are you sure you want to delete this item?</label> <input type="hidden" name="id" value="' . $id . '"></p> </section> <menu> <button id="cancelDialogDelete" type="reset">Cancel</button> <button type="submit">Confirm</button> </menu> </section> </form> </dialog> <script> (function() { var Item = document.getElementById(\'deletebtn\'); var favDialog = document.getElementById(\'deleteItem\'); var cancelButton = document.getElementById(\'cancelDialogDelete\'); // Update buttons opens a modal dialog Item.addEventListener(\'click\', function() { favDialog.showModal(); }); // Form cancel button closes the dialog box cancelButton.addEventListener(\'click\', function() { favDialog.close(); }); })(); </script>'; echo '<br>'; echo '<a href=admins.php><<< Go Back</a><br>'; echo '<a href=limbo_landing.php><<< Go Back to Home</a>'; echo '</div></div>'; # Free up the results in memory mysqli_free_result($results); } }
} ?> </div> </section> <section class="module module--by-location" id="locations"> <div class="wrap"> <header class="module__intro"> <h2><?php the_block('Jobs by Location Header',array('type' => 'one-liner','apply_filters' => false)) ?></h2> </header> <div class="office-locations-images"> <span class="location-map us-locations"><img src="/wp-content/themes/ls-careers/images/us-locations.png" alt="" /></span> <span class="location-map europe-locations"><img src="/wp-content/themes/ls-careers/images/europe-locations.png" alt="" /></span> </div> <div class="office-locations-list"> <?php location_list( 'location' ); ?> <a href="/all-jobs/" class="btn">browse all jobs</a> </div> </div> </section> <section class="module module--perks-and-benefits" id="perks"> <div class="wrap"> <header class="module__intro"> <h2><?php the_block('Perks and Benefits Header',array('type' => 'one-liner','apply_filters' => false)) ?></h2> </header> <p><?php the_block('Office Photo') ?></p> <?php the_block('Perks - Detailed') ?> <div class="perks-quick-list">