edit template bootstrap to display 4 product image at row - php

I am developing my application with laravel5.2 .I have template with bootstrap and want to display 4 products with their pictures at each row.
this is my template
#extends('layouts.layout',[['subscribe'=>$subscribe]])
#section('content')
<section id="advertisement">
<div class="container">
<img src="{{asset('images/shop/advertisement.jpg')}}" alt="" />
</div>
</section>
<section>
<div class="container">
<div class="row">
<div class="col-sm-3">
<div class="left-sidebar">
#include('shared.sidebar',array('brands'=>$brands))
</div>
</div>
<div class="col-sm-9 padding-right">
<div class="features_items"><!--features_items-->
<h2 class="title text-center">Features Items</h2>
#foreach ($products as $product)
<div class="col-sm-3">
<div class="product-image-wrapper">
<div class="single-products">
<div class="productinfo text-center">
<img src="images/shop/{{$product->image}}" height="200" width="150" alt="">
<h2>{{$product->price}}</h2>
<h6><p>{{$product->name}}</p></h6>
<i class="fa fa-shopping-cart"></i>Add to cart
<i class="fa fa-info"></i>View Details
</div>
<div class="product-overlay">
<div class="overlay-content">
<h2>${{$product->price}}</h2>
<p>${{$product->name}}</p>
<form method="POST" action="{{url('cart')}}">
<input type="hidden" name="product_id" value="{{$product->id}}">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-fefault add-to-cart">
<i class="fa fa-shopping-cart"></i>
Add to cart
</button>
</form>
<i class="fa fa-info"></i>View Details
</div>
</div>
</div>
<div class="choose">
<ul class="nav nav-pills nav-justified">
<li><i class="fa fa-plus-square"></i>Add to wishlist</li>
<li><i class="fa fa-plus-square"></i>Add to compare</li>
</ul>
</div>
</div>
</div>
#endforeach
<ul class="pagination">
<li class="active">1</li>
<li>2</li>
<li>3</li>
<li>»</li>
</ul>
</div><!--features_items-->
</div>
</div>
</div>
</section>
#endsection
It is not disciplined.it display 4 at row in time and 2 in time .please help me to do it.

In order to have nested columns (4*x columns sm-3 inside the column sm-9) you need to wrap the 4 columns in a row so that it becomes
<div class="col-sm-9">
<div class="row">
#foreach ($products as $product)
<div class="col-sm-3">
...

Related

Second tab not showing in form boostrap

This my code
I have a form with bootstrap and 2 tabs, when I display the form shows the first tab, but when I click on the second tab nothing happens.
I dont know what I missing.......................................
...............................................................
<div class="container" style="margin-top:70px">
<div class ="card bg-light col-8">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs pull-left">
<li class="nav-item">
<a class="nav-link active" href="#contactos">Contactos</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#domicilio">Domicilio</a>
</li>
</ul>
</div>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"])."?opc=".$opc."&id=".$id;?>" method="post" id ="formulario" class="tab-content">
<div class="tab-pane fade show active" id="contactos">
<div class="form-row" > <!--linea1-->
<div class="col-3">
<div class="form-group">
<label for="text1">ID</label>
<input id="text1" name="text1" type="text" class="form-control" value="<?php echo $campo1?>" readonly>
</div>
</div>
</div> <!--linea1-->
</div> <!--tab contacto-->
<div class="tab-pane fade" id="domicilio">
<div class="form-row" > <!--linea5-->
<div class="col">
<div class="form-group">
<label for="text11">Calle</label>
<input id="text11" name="text11" type="text" class="form-control" value="<?php echo $campo11?>" required <?php if ($opc == 'C'){echo "readonly";}?>>
<span class="error"><?php echo $error_text11;?></span>
</div>
</div>
</div> <!--linea5-->
</div> <!--tab domicilio-->
<div class="form-row"> <!--linea9-->
<div class="col-6">
<div class="form-group">
Cancelar
<button name="submit" type="submit" class="btn btn-primary">Confirmar</button>
</div>
</div>
</div> <!--linea9-->
</form>
</div>
</div>
for bootstrap 5 as per docs you need to add data-bs-toggle="tab" data-bs-target="#{tabID}" type="button" role="tab" aria-controls="{tabID}" aria-selected="true" to the a tag with class nav-link
so your code should be
<div class="container" style="margin-top:70px">
<div class ="card bg-light col-8">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs pull-left">
<li class="nav-item">
<a class="nav-link active" href="#contactos" data-bs-toggle="tab" data-bs-target="#contactos" type="button" role="tab" aria-controls="contactos" aria-selected="true">Contactos</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#domicilio" data-bs-toggle="tab" data-bs-target="#domicilio" type="button" role="tab" aria-controls="domicilio" aria-selected="true">Domicilio</a>
</li>
</ul>
</div>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"])."?opc=".$opc."&id=".$id;?>" method="post" id ="formulario" class="tab-content">
<div class="tab-pane fade show active" id="contactos">
<div class="form-row" > <!--linea1-->
<div class="col-3">
<div class="form-group">
<label for="text1">ID</label>
<input id="text1" name="text1" type="text" class="form-control" value="<?php echo $campo1?>" readonly>
</div>
</div>
</div> <!--linea1-->
</div> <!--tab contacto-->
<div class="tab-pane fade" id="domicilio">
<div class="form-row" > <!--linea5-->
<div class="col">
<div class="form-group">
<label for="text11">Calle</label>
<input id="text11" name="text11" type="text" class="form-control" value="<?php echo $campo11?>" required <?php if ($opc == 'C'){echo "readonly";}?>>
<span class="error"><?php echo $error_text11;?></span>
</div>
</div>
</div> <!--linea5-->
</div> <!--tab domicilio-->
<div class="form-row"> <!--linea9-->
<div class="col-6">
<div class="form-group">
Cancelar
<button name="submit" type="submit" class="btn btn-primary">Confirmar</button>
</div>
</div>
</div> <!--linea9-->
</form>
</div>
</div>
working example JSfiddle
Edit:
if you are using bootstrap 4 just remove -bs from the data attributes so it would be data-toggle="tab" data-target="#{tabID}" type="button" role="tab" aria-controls="{tabID}" aria-selected="true"
<div class="container" style="margin-top:70px">
<div class ="card bg-light col-8">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs pull-left">
<li class="nav-item">
<a class="nav-link active" href="#contactos" data-toggle="tab" data-target="#contactos" type="button" role="tab" aria-controls="contactos" aria-selected="true">Contactos</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#domicilio" data-toggle="tab" data-target="#domicilio" type="button" role="tab" aria-controls="domicilio" aria-selected="true">Domicilio</a>
</li>
</ul>
</div>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"])."?opc=".$opc."&id=".$id;?>" method="post" id ="formulario" class="tab-content">
<div class="tab-pane fade show active" id="contactos">
<div class="form-row" > <!--linea1-->
<div class="col-3">
<div class="form-group">
<label for="text1">ID</label>
<input id="text1" name="text1" type="text" class="form-control" value="<?php echo $campo1?>" readonly>
</div>
</div>
</div> <!--linea1-->
</div> <!--tab contacto-->
<div class="tab-pane fade" id="domicilio">
<div class="form-row" > <!--linea5-->
<div class="col">
<div class="form-group">
<label for="text11">Calle</label>
<input id="text11" name="text11" type="text" class="form-control" value="<?php echo $campo11?>" required <?php if ($opc == 'C'){echo "readonly";}?>>
<span class="error"><?php echo $error_text11;?></span>
</div>
</div>
</div> <!--linea5-->
</div> <!--tab domicilio-->
<div class="form-row"> <!--linea9-->
<div class="col-6">
<div class="form-group">
Cancelar
<button name="submit" type="submit" class="btn btn-primary">Confirmar</button>
</div>
</div>
</div> <!--linea9-->
</form>
</div>
</div>
working fiddle for bootstrap 4

How do I dynamically populate modal from PHP server side product data?

I am retrieving some products from the database using PHP and MySQL. I am displaying these products in a carousel. When the user hovers, a "Show Quick Details" button will appear.
When the user clicks that button, a modal shows up displaying the product details.
Example:
Here is the modal when the user clicks.... (no, the products don't match right now, I am using a template the client gave me with example images ).
User Clicks Button:
My question is, how do I go about populating the modal with the correct product information? Do I have to create 10 modals dynamically in my PHP , or is there a better route? I am kinda stumped on how to approach this.
Here is the modal I am using, in case that is helpful for an answer:
<!--====== Quick View Part Start ======-->
<!-- Modal -->
<div class="modal fade " id="productQuickModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<i class="fal fa-times"></i>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="product-quick-view-image mt-30">
<div class="quick-view-image">
<div class="single-view-image">
<img src="images/product-17.jpg" alt="product">
</div>
<div class="single-view-image">
<img src="images/product-18.jpg" alt="product">
</div>
<div class="single-view-image">
<img src="images/product-19.jpg" alt="product">
</div>
<div class="single-view-image">
<img src="images/product-20.jpg" alt="product">
</div>
<div class="single-view-image">
<img src="images/product-21.jpg" alt="product">
</div>
</div>
<ul class="quick-view-thumb">
<li>
<div class="single-thumb">
<img src="images/product-17.jpg" alt="">
</div>
</li>
<li>
<div class="single-thumb">
<img src="images/product-18.jpg" alt="">
</div>
</li>
<li>
<div class="single-thumb">
<img src="images/product-19.jpg" alt="">
</div>
</li>
<li>
<div class="single-thumb">
<img src="images/product-20.jpg" alt="">
</div>
</li>
<li>
<div class="single-thumb">
<img src="images/product-21.jpg" alt="">
</div>
</li>
</ul>
</div> <!-- Modal Quick View Image -->
</div>
<div class="col-md-6">
<div class="product-quick-view-content mt-30">
<h3 class="product-title">Trans-Weight Hooded Wind and Water Resistant Shell</h3>
<p class="reference">Reference: demo_12</p>
<ul class="rating">
<li class="rating-on"><i class="fas fa-star"></i></li>
<li class="rating-on"><i class="fas fa-star"></i></li>
<li class="rating-on"><i class="fas fa-star"></i></li>
<li class="rating-on"><i class="fas fa-star"></i></li>
<li class="rating-on"><i class="fas fa-star"></i></li>
</ul>
<div class="product-prices">
<span class="sale-price"> €23.90</span>
<span class="regular-price">€21.03</span>
<span class="save">Save 12%</span>
</div>
<p class="product-description">Block out the haters with the fresh adidas® Originals Kaval Windbreaker Jacket. <br> Part of the Kaval Collection. <br> Regular fit is eased, but not sloppy, and perfect for any activity. <br> Plain-woven jacket specifically constructed for freedom of movement.</p>
<div class="product-size-color flex-wrap">
<div class="product-size">
<h5 class="title">Size</h5>
<select>
<option value="1">S</option>
<option value="2">M</option>
<option value="3">L</option>
<option value="4">XL</option>
</select>
</div>
<div class="product-color">
<h5 class="title">Color</h5>
<div class="color-input">
<div class="single-color color-1">
<input type="radio" id="radio-1" name="color">
<label for="radio-1"></label>
</div>
<div class="single-color color-2">
<input type="radio" id="radio-2" name="color">
<label for="radio-2"></label>
</div>
<div class="single-color color-3">
<input type="radio" id="radio-3" name="color">
<label for="radio-3"></label>
</div>
</div>
</div>
<div class="product-quantity">
<h5 class="title">Quantity</h5>
<div class="quantity d-flex">
<button type="button" id="sub" class="sub"><i class="fal fa-minus"></i></button>
<input type="text" value="1" />
<button type="button" id="add" class="add"><i class="fal fa-plus"></i></button>
</div>
</div>
</div>
<div class="product-add-cart">
<button><i class="icon ion-bag"></i> Add to cart</button>
</div>
<div class="product-wishlist-compare">
<ul class="d-flex flex-wrap">
<li><i class="fal fa-heart"></i> Add to wishlist</li>
<li><i class="fal fa-repeat"></i> Add to compare</li>
</ul>
</div>
<div class="product-share d-flex">
<p>Share</p>
<ul class="social media-body">
<li><i class="fab fa-facebook-f"></i></li>
<li><i class="fab fa-twitter"></i></li>
<li><i class="fab fa-google"></i></li>
<li><i class="fab fa-pinterest-p"></i></li>
</ul>
</div>
</div> <!-- Modal Quick View Content -->
</div>
</div> <!-- row -->
</div> <!-- Modal Body -->
</div> <!-- Modal content -->
</div> <!-- Modal dialog -->
</div> <!-- Modal -->
Any easier ways other than creating x number of modals?
Thank you

Portfolio Item Alignment

I wanna show the projects in an horizontal alignment, but as you can see in the image below they are vertically.
This my code:
<section class="bg-light" id="portfolio">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading text-uppercase">Projects</h2>
<h3 class="section-subheading text-muted">Projects elaborated throughout the years</h3>
</div>
</div>
#foreach (\App\Project::all()->take(6) as $project)
<div class="row">
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="#portfolioModal1">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fas fa-plus fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/portfolio/project.jpg" alt="">
</a>
<div class="portfolio-caption">
<h5>Project ID: {{ $project->id }}</h5>
<p class="text-muted">{{ $project->title }}</p>
</div>
</div>
#endforeach
</div>
</div>
What am i missing here?
You start row in loop after every col- item.
Try this
<section class="bg-light" id="portfolio">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading text-uppercase">Projects</h2>
<h3 class="section-subheading text-muted">Projects elaborated throughout the years</h3>
</div>
</div>
<div class="row">
#foreach (\App\Project::all()->take(6) as $project)
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="#portfolioModal1">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fas fa-plus fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/portfolio/project.jpg" alt="">
</a>
<div class="portfolio-caption">
<h5>Project ID: {{ $project->id }}</h5>
<p class="text-muted">{{ $project->title }}</p>
</div>
</div>
#endforeach
</div>
</div>
</section>

Why does not get_field() in WordPress work when I transfer the code to template part

I am getting mad
I had those variables
$wwa_section_title = get_field('wwa_section_title');
$wwa_section_description = get_field('wwa_section_description');
$wwa_section_body = get_field('wwa_section_body');
$wwa_section_image_1 = get_field('wwa_section_image_1');
$wwa_section_image_2 = get_field('wwa_section_image_2')
And this is the HTML section
<div class="container-fluid about-company">
<div class="container">
<div class="row">
<div class="col-xs-12 hero-title text-center">
<h2 class="text-capitalize">
<?php
echo $wwa_section_title;
?>
</h2>
<p class="hero-paragraph">
<?php
echo $wwa_section_body;
?>
</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-7">
<div class="row">
<div class="col-xs-4 col-xs-offset-4">
<img src="<?php echo $wwa_section_image_2['url'];?>" alt="" class="img-responsive">
</div>
<div class="col-xs-4">
<img src="<?php echo $wwa_section_image_1['url'];?>" alt="" class="img-responsive">
</div>
</div>
<div class="row">
<div class="col-xs-8 col-xs-offset-4">
<p class="about-paragraph small">
<?php
echo $wwa_section_description;
?>
</p>
</div>
</div>
<div class="row">
<div class="col-xs-4 col-xs-offset-4">
<ul class="about-us-list">
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Dummy text of the print</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Dummy text of the print</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
</ul>
</div>
<div class="col-xs-4">
<ul class="about-us-list">
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Dummy text of the print</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Dummy text of the print</div>
</li>
<li class="about-us-list-item">
<div class="about-list-item-check">
<i class="icofont icofont-checked"></i>
</div>
<div class="about-list-item-text">Ipsum is simply text of the stry simply</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
When I transfer this code into a template part and try to render it, the variables become empty.
Once I role back and return the whole code into the page template it wotks fine
I tried to use $post->ID and did not work
I tried to use the_field() instead and did not work
You don't explain at which place in your code you initialize your variables, so I can just guess what might be the problem.
The get_field function of ACF can be called with $post_id as second parameter. If you don't add that one, the get_field call should be inside The Loop.
Finally, I found the solution!!!
I did not use wp_reset_query() after the last while of the section that is before this section (about section which code in the question)
when I added
<? endwhile; wp_reset_query(); ?>
the problem resolved

display data added by user in sessions using leftjoin

i have managed to create a form whereby the user logs in using sessions and once the user is logged in ,he/she is able to post data into a different table named members.My problem is that I'm unable to retrieve the data added by the logged in user from the members table.I'm a newbie and i hope someone here will help me figure out this.below is my code
<!DOCTYPE html>
<?php
session_start();
if(!isset($_SESSION['phone'])){
header("location: login2.php");
}
else {
include ("../includes/db.php");
$sql = "select * FROM post";
$run = mysql_query($sql);
$total_post=mysql_num_rows($run);
$sql = "select * FROM gallary";
$run = mysql_query($sql);
$total_image=mysql_num_rows($run);
$sql = "select * FROM user";
$run = mysql_query($sql);
$total_user=mysql_num_rows($run);
$sql = "select * FROM course";
$run = mysql_query($sql);
$total_course=mysql_num_rows($run);
$sql = "select * FROM mails";
$run = mysql_query($sql);
$total_mails=mysql_num_rows($run);
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Dashboard</title>
<!-- Bootstrap Core CSS -->
<link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="../bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
<!-- Timeline CSS -->
<link href="../dist/css/timeline.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="../dist/css/sb-admin-2.css" rel="stylesheet">
<!-- Morris Charts CSS -->
<link href="../bower_components/morrisjs/morris.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">Dashboard</a>
</div>
<!-- /.navbar-header -->
<ul class="nav navbar-top-links navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><i class="fa fa-sign-out fa-fw"></i> Logout
</li>
</ul>
<!-- /.dropdown-user -->
</li>
<!-- /.dropdown -->
</ul>
<!-- /.navbar-top-links -->
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<ul class="nav" id="side-menu">
<li>
<i class="fa fa-dashboard fa-fw"></i> Dashboard
</li>
<!--
<li>
<i class="fa fa-edit fa-fw"></i> Create New Post
</li>
<li>
<i class="fa fa-table fa-fw"></i> View All Post
</li>
<li>
<i class="fa fa-edit fa-fw"></i> Create New Story
</li>
<li>
<i class="fa fa-table fa-fw"></i> View All Story
</li>
<li>
<i class="fa fa-edit fa-fw"></i> Upload Image
</li>
<li>
<i class="fa fa-photo fa-fw"></i> View All Image</span>
</li>
<li>
<i class="fa fa-photo fa-fw"></i> View All emails</span>
</li>
<li>
<i class="fa fa-edit fa-fw"></i> View All Joining members</span>
</li>
-->
</ul>
</div>
<!-- /.sidebar-collapse -->
</div>
<!-- /.navbar-static-side -->
</nav>
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Dashboard</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-3 col-md-6">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-list-ul fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
<div class="huge"><?php echo $total_post; ?></div>
<div>All Posts!</div>
</div>
</div>
</div>
<a href="index.php?view_post=view_post">
<div class="panel-footer">
<span class="pull-left">View Details</span>
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
<div class="clearfix"></div>
</div>
</a>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="panel panel-green">
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-photo fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
<div class="huge"><?php echo $total_image; ?></div>
<div>All Images!</div>
</div>
</div>
</div>
<a href="images.php">
<div class="panel-footer">
<span class="pull-left">View Details</span>
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
<div class="clearfix"></div>
</div>
</a>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="panel panel-yellow">
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-users fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
<div class="huge"><?php echo $total_user; ?></div>
<div>All Users!</div>
</div>
</div>
</div>
<a href="users.php">
<div class="panel-footer">
<span class="pull-left">View Details</span>
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
<div class="clearfix"></div>
</div>
</a>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="panel panel-red">
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-database fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
<div class="huge"><?php echo $total_course; ?></div>
<div>All Story!</div>
</div>
</div>
</div>
<a href="course.php">
<div class="panel-footer">
<span class="pull-left">View Details</span>
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
<div class="clearfix"></div>
</div>
</a>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="panel panel-yellow">
<div class="panel-heading">
<div class="row">
<div class="col-xs-3">
<i class="fa fa-database fa-5x"></i>
</div>
<div class="col-xs-9 text-right">
<div class="huge"><?php echo $total_mails; ?></div>
<div>All mails!</div>
</div>
</div>
</div>
<a href="mails.php">
<div class="panel-footer">
<span class="pull-left">View Details</span>
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
<div class="clearfix"></div>
</div>
</a>
</div>
</div>
</div>
<!--Post Section Open-->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-heading">
<h2>All users</h2>
</div>
<div class="panel-body">
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>S.No.</th>
<th>Id</th>
<th>First_name</th>
<th>Last NAme</th>
<th>Email</th>
<th>phone</th>
<th>created</th>
<th>modified</th>
<th>status</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<?php
include("../includes/db.php");
$i=1;
$query="SELECT members.user_id,members.name,members.phone,members.location, user.username,user.phone
FROM members
LEFT JOIN user
ON members.user_id=user.phone
ORDER BY members.user_id;"
?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Post Section Close-->
</div>
<!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="../bower_components/metisMenu/dist/metisMenu.min.js"></script>
<!-- Charts JavaScript -->
<script src="../bower_components/raphael/raphael-min.js"></script>
<script src="../bower_components/morrisjs/morris.min.js"></script>
<script src="../js/morris-data.js"></script>
<!-- Custom Theme JavaScript -->
<script src="../dist/js/sb-admin-2.js"></script>
</body>
</html>
You must join table with valid condition. I don't know your table structure for user table, as a guess i think this will help you.
$query="SELECT members.user_id,members.name,members.phone,members.location,
user.username,user.phone, user.id
FROM members
LEFT JOIN user
ON members.user_id=user.id
ORDER BY members.user_id;"

Categories