File "sign_up.php"

Full Path: /home/krishnamexports/public_html/panel/pages/signup/sign_up.php
File size: 3.79 KB
MIME-type: text/x-php; charset=utf-8
Charset: utf-8

<?php

		if(isset($_SESSION['Successmsg']))

		{

		?>

			<div class="alert alert-success alert-dismissible">

				<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

				<h4><i class="icon fa fa-check"></i> Alert!</h4>

				<?php echo $_SESSION['Successmsg'];?>

			</div><br />

		<?php

		unset($_SESSION['Successmsg']);	

		}

		?>

<div class="col-lg-12 grid-margin stretch-card">	

	<div class="card">      			

    	

        <div class="card-body">

          <h4 class="card-title">Sign Up List</h4>			

          <div class="table-responsive">

            <table class="table table-striped" id="example">

              <thead>

                <tr>

                  <th>S.No.</th>

                  <th>Name</th>

                  <th>Email</th>

                  <th>Mobile No.</th>

                  <th>Status</th>

                  <th>Action</th>

                </tr>

              </thead>

              <tbody>

              

                <?php

                $i = 1;						  

                $sqlEmployee = mysqli_query($cn, "SELECT * FROM `tbl_register` order by id DESC");

                while($sqlEmployeeData = mysqli_fetch_array($sqlEmployee)){ 						

                    $status      = "";

                    $statusCalss = "";

                    if($sqlEmployeeData['status']==0)

                    {

                        $statusCalss = "badge badge-info";

                        $status      = "Pending";	

                    }

                    else if($sqlEmployeeData['status']==1)

                    {

                        $statusCalss = "badge badge-success";

                        $status      = "Active";

                    }

                    else if($sqlEmployeeData['status']==2)

                    {

                        $statusCalss = "badge badge-danger";

                        $status      = "Inactive";

                    }	

                ?>

                    <tr>

                      <td><?php echo $i++;?></td>

                      <td><?php echo $sqlEmployeeData['name'];?></td>

                      <td><?php echo $sqlEmployeeData['email'];?></td>

                      <td><?php echo $sqlEmployeeData['mobile'];?></td>

                      <td><span class="<?php echo $statusCalss;?>"><?php echo $status;?></span></td> 

                      <td>

                            <div class="btn-group dropdown">

                                <button type="button" class="btn btn-success dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Manage</button>

                                <div class="dropdown-menu">

                                    <a class="dropdown-item" href="home.php?pages=sign_up&user_id=<?php echo $sqlEmployeeData['id'];?>&status=1"><i class="icon-eye"></i> Active</a>

                                    <a class="dropdown-item" href="home.php?pages=sign_up&user_id=<?php echo $sqlEmployeeData['id'];?>&status=2"><i class="icon-eye-blocked"></i> Inactive</a>                            

                                </div>

                            </div>                                                                             

                      </td>

                    </tr>

                <?php }?> 

              </tbody>

            </table>

          </div>

        </div>

	</div>

</div>

<?php

if(isset($_GET['status']))

{

	$user_id  = $_GET['user_id'];

	$sql         = mysqli_query($cn,"update `tbl_register` set `status`='".$_GET['status']."' where `id`='".$user_id."'")or die(mysqli_error($con));									

	$_SESSION['Successmsg'] = "Status Update Successfully.";

	header("location:home.php?pages=sign_up");

}

?>