Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The template for displaying all pages.
- *
- * This is the template that displays all pages by default.
- * Please note that this is the WordPress construct of pages
- * and that other 'pages' on your WordPress site will use a
- * different template.
- *
- * @package impact
- */
- get_header(); ?>
- <?php // Top A
- if ( is_active_sidebar( 'top-a' ) ) : ?>
- <div class="top-a">
- <?php dynamic_sidebar( 'top-a' ); ?>
- </div>
- <?php endif; ?>
- <?php // Top B
- if ( is_active_sidebar( 'top-b' ) ) : ?>
- <div class="top-b">
- <?php dynamic_sidebar( 'top-b' ); ?>
- </div>
- <?php endif; ?>
- <?php // Top C
- if ( is_active_sidebar( 'top-c' ) ) : ?>
- <div class="top-c">
- <?php dynamic_sidebar( 'top-c' ); ?>
- </div>
- <?php endif; ?>
- <?php // Top D
- if ( is_active_sidebar( 'top-d' ) ) : ?>
- <div class="top-d">
- <?php dynamic_sidebar( 'top-d' ); ?>
- </div>
- <?php endif; ?>
- <?php // Top E
- if ( is_active_sidebar( 'top-e' ) ) : ?>
- <div class="top-e">
- <?php dynamic_sidebar( 'top-e' ); ?>
- </div>
- <?php endif; ?>
- <header class="entry-header">
- <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
- </header><!-- .entry-header -->
- <div id="primary" class="content-area">
- <main id="main" class="site-main" role="main">
- <?php
- error_reporting(1);
- //db
- $con=mysqli_connect($_ENV['DB_HOST'] . ':' . $_ENV['DB_PORT'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']);
- // Check connection
- if (mysqli_connect_errno()){
- echo "Failed to connect to MySQL: " . mysqli_connect_error($con);
- }else{
- }
- if(2==$_GET['author_page']){
- $sql="select * from authors order by last_name limit 10,10";
- }else if(3==$_GET['author_page']){
- $sql="select * from authors order by last_name limit 20,10";
- }else if(4==$_GET['author_page']){
- $sql="select * from authors order by last_name limit 40,10";
- }else if(5==$_GET['author_page']){
- $sql="select * from authors order by last_name limit 50,10";
- }else if(6==$_GET['author_page']){
- $sql="select * from authors order by last_name limit 60,10";
- }else if(7==$_GET['author_page']){
- $sql="select * from authors order by last_name limit 70,10";
- }else if(8==$_GET['author_page']){
- $sql="select * from authors order by last_name limit 80,10";
- }else if(9==$_GET['author_page']){
- $sql="select * from authors order by last_name limit 90,10";
- }else if(10==$_GET['author_page']){
- $sql="select * from authors order by last_name limit 100,10";
- }else{
- $sql="select * from authors order by last_name limit 10";
- }
- if(isset($_GET['filter']) && $_GET['filter'] != ""){
- $sql="select * from authors order by last_name limit " . $_GET['filter'];
- }
- if(isset($_GET['letter']) && $_GET['letter'] != ""){
- $sql = "select * from authors where UPPER(SUBSTRING(last_name,1,1)) ='" . $_GET['letter'] . "'";
- }else if(isset($_GET['search-name'])){
- //$sql = "select * from authors where first_name + ' ' + last_name like '%" . $_GET['search-name'] . "%' or first_name like '%" . $_GET['search-name'] . "%'";
- $sql ="select * from authors where full_name like '%" . $_GET['search-name'] . "%'";
- }
- if(isset($_GET['author_id']) && $_GET['author_id'] != ""){
- $sql = "select * from authors where author_id = " . $_GET['author_id'];
- }
- $result = mysqli_query($con,$sql);
- mysqli_close($con);
- ?>
- <div id="system">
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <article class="item no-date">
- <header>
- <?php // Top E
- if ( is_active_sidebar( 'inner-top' ) ) : ?>
- <div class="inner-top">
- <?php dynamic_sidebar( 'inner-top' ); ?>
- </div>
- <?php endif; ?>
- </header>
- <div class="content clearfix">
- <div class="box-note" style="overflow:hidden; padding: 10px;">
- <span>Filter by first letter of the Last Name</span>
- <div class="terms-nav">
- <a class="term-letter" href="?letter=A">A</a> |
- <a class="term-letter" href="?letter=B">B</a> |
- <a class="term-letter" href="?letter=C">C</a> |
- <a class="term-letter" href="?letter=D">D</a> |
- <a class="term-letter" href="?letter=E">E</a> |
- <a class="term-letter" href="?letter=F">F</a> |
- <a class="term-letter" href="?letter=G">G</a> |
- <a class="term-letter" href="?letter=H">H</a> |
- <a class="term-letter" href="?letter=I">I</a> |
- <a class="term-letter" href="?letter=J">J</a> |
- <a class="term-letter" href="?letter=K">K</a> |
- <a class="term-letter" href="?letter=L">L</a> |
- <a class="term-letter" href="?letter=M">M</a> |
- <a class="term-letter" href="?letter=N">N</a> |
- <a class="term-letter" href="?letter=O">O</a> |
- <a class="term-letter" href="?letter=P">P</a> |
- <a class="term-letter" href="?letter=Q">Q</a> |
- <a class="term-letter" href="?letter=R">R</a> |
- <a class="term-letter" href="?letter=S">S</a> |
- <a class="term-letter" href="?letter=T">T</a> |
- <a class="term-letter" href="?letter=U">U</a> |
- <a class="term-letter" href="?letter=V">V</a> |
- <a class="term-letter" href="?letter=W">W</a> |
- <a class="term-letter" href="?letter=X">X</a> |
- <a class="term-letter" href="?letter=Y">Y</a> |
- <a class="term-letter" href="?letter=Z">Z</a>
- </div>
- <form action="?" method="GET">
- Search by Name
- <input style="font-size: 11px; " type="text" placeholder="Enter First or Last Name" name="search-name"/>
- <a href="?"><input type="button" class="button button-white" value="Show All"/></a>
- <input type="submit" class="button button-white" value="Search"/>
- </form>
- </div>
- <?php
- //echo $sql;
- $row_cnt = mysqli_num_rows($result);
- if($row_cnt <1){
- echo "<span style='color:red'>There are no matches for the name you entered. Please try a different name</span>";
- }
- while($row = mysqli_fetch_array($result)){ ?>
- <div class="team-profile" id="first-last">
- <div class="profile-left">
- <h2 class="profile-name"><img class="alignnone size-full" alt="" src="<?php echo $row['image'] ?>" /><br /><?php echo $row['first_name'] . " " . $row['last_name'] ?></h2>
- <h3 class="profile-title"><?php echo $row['title'] ?><span class="role"></span></h3>
- </div>
- <div class="profile-content">
- <?php
- if(strlen($row['bio']) >= 600 && $_GET['author_id'] == "" ){
- echo substr($row['bio'],0,600) . "...";
- echo "<div style='text-align:right'><a href='?author_id=" . $row['author_id'] . "' class='button-primary'>Read Full Bio</a></div>";
- }else{
- echo ($row['bio']);
- }
- echo "<br><br>";
- if($row['article_url'] != "")
- //echo "<a href='" . $row['articles_url'] . "' class='blue'>Read ". trim($row['first_name']) ."'s articles:</a><br>";
- if(substr_count($row['article_name'],'#') > 0){
- echo "<span class='blue'>Read ". trim($row['first_name']) ."'s Articles:</span><br>";
- }else{
- echo "<span class='blue'>Read ". trim($row['first_name']) ."'s Article:</span><br>";
- }
- ?>
- <ul class="guest-articles">
- <?php
- if(substr_count($row['article_name'],'#') > 0){
- $articles_list = explode('#',$row['article_name']);
- $url_list = explode('#',$row['article_url']);
- for( $i=0; $i < count($articles_list); $i++ ){
- echo "<li><a href='" . $url_list[$i] ."'>" . $articles_list[$i] . "</a></li>";
- }
- }else{
- echo "<li><a href='" . $row['article_url'] ."'>" . $row['article_name'] . "</a></li>";
- }
- ?>
- </ul>
- </div>
- </div>
- <?php } ?>
- <?php if(!isset($_GET['letter']) && !isset($_GET['author_id']) && !isset($_GET['search-name'])){ ?>
- <div class="float-left" style="margin-right: 10px">Page</div>
- <div class="float-left" style="margin-right: 10px"><a href="?author_page=1">1</a></div>
- <div class="float-left" style="margin-right: 10px"><a href="?author_page=2">2</a></div>
- <div class="float-left" style="margin-right: 10px"><a href="?author_page=3">3</a></div>
- <div class="float-left" style="margin-right: 10px"><a href="?author_page=4">4</a></div>
- <div class="float-left" style="margin-right: 10px"><a href="?author_page=5">5</a></div>
- <div class="float-left" style="margin-right: 10px"><a href="?author_page=6">6</a></div>
- <div class="float-left" style="margin-right: 10px"><a href="?author_page=7">7</a></div>
- <div class="float-left" style="margin-right: 10px"><a href="?author_page=8">8</a></div>
- <div class="float-left" style="margin-right: 10px"><a href="?author_page=9">9</a></div>
- <div class="float-left" style="margin-right: 10px"><a href="?author_page=10">10</a></div>
- <?php } ?>
- </div>
- <?php edit_post_link(__('Edit this post.', 'warp'), '<p class="edit">','</p>'); ?>
- </article>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php comments_template(); ?>
- </main><!-- #main -->
- </div><!-- #primary -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement