Search This Blog

Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

12 January 2024

JQuery Custom Rating

 <style>

.rating {

  font-size: 24px;

}


.star {

  cursor: pointer;

  color: gray;

}


.star:hover,

.star.active {

  color: rgb(255, 207, 0);

}

</style>

<div class="form-group">

                                            <p class="mg-b-10" id="leadRatingTxt">Lead Rating (<?= $lead_rating ? $lead_rating: 0 ?>)<span class="text-danger">*</span></p> 

                                            <div class="rating">

                                                <span class="star" data-value="1">&#9733;</span>

                                                <span class="star" data-value="2">&#9733;</span>

                                                <span class="star" data-value="3">&#9733;</span>

                                                <span class="star" data-value="4">&#9733;</span>

                                                <span class="star" data-value="5">&#9733;</span>

                                                <span class="star" data-value="6">&#9733;</span>

                                                <span class="star" data-value="7">&#9733;</span>

                                                <span class="star" data-value="8">&#9733;</span>

                                                <span class="star" data-value="9">&#9733;</span>

                                                <span class="star" data-value="10">&#9733;</span>

                                            </div>

                                            <input type="hidden" id="lead_rating"  name="lead_rating" value="" />

                                              @error('lead_rating')

                                            <span class="text-danger">{{ $message }}</span>

                                            @enderror

                                        </div>

                                    </div>

Script:

var selectedRating = 0;


<?php if(isset($lead_rating) && $lead_rating > 0){ ?>

    highlightStars('<?= $lead_rating ?>')

<?php } ?>



$('.star').on('mouseover', function() {

  var value = $(this).data('value');

  highlightStars(value);

});


$('.star').on('mouseout', function() {

  highlightStars(selectedRating);

});


$('.star').on('click', function() {

  selectedRating = $(this).data('value');

  $('#leadRatingTxt').text("Lead Rating ("+selectedRating+")");

  $('#lead_rating').val(selectedRating);

});


function highlightStars(count) {

  $('.star').removeClass('active');

  $('.star:lt(' + count + ')').addClass('active');

}

05 January 2023

Laravel Using Task Mangement and Track Time

 Create  Migration and Model 

Table Names:task,track_task

task:

id,title,description,assigned_to,comment,status,created_by,created_at

track_task:

id,task_id,start_time,end_time,user_id,created_by,created_at

Insert Task :

Route::get('/add-task',[TaskController::class,'addTask']);

public function storeTask(Request $request){

$input=$request->all();       

        $title=$input['summary'];
        $description=$input['description'];       
        $users=$input['users'];
        $status=$input['status'];
        $comment=$input['comment'];
        $userid=Auth::user()->id;
      
            $insertArr=array(
            "title"=>$summary,
            "task_description"=>$description,            
            "status"=>$status,
            "comment"=>$comment,
            "assigned_to"=>$users,
            "created_by"=>$userid,
            "updated_by"=>$userid,
        );
        $insert=Task::create($insertArr);

}


public function getTask($id){

     $task=Task::where('id',$id)->first();     
    return view('task.get-task',compact('task'));

  }

  public function startTask(Request $request){

            $task=new Track;

            $input=$request->all();

            $id=$input['id'];

            $userid=Auth::user()->id;

            $time=date('Y-m-d h:i:s');

            $task->task_id=$id;

            $task->user_id=$userid;

            $task->start_time=$time;

            $task->tracker_on="1";

            $task->save();

            DB::select("Update track set tracker_on='0' WHERE id NOT IN($task->id) AND task_id='$id' AND user_id='$userid'");


  }


  public function endTask(Request $request){

    $input=$request->all();

    $id=$input['id'];

    $task=Track::where('task_id',$id)

                    ->Where('tracker_on','1')->first();

    $task->end_time=date('Y-m-d h:i:s');

    $task->tracker_on='0';

    $task->save();

    $tsk=Track::where('id',$task->id)->first();

    if($tsk){

        $start=$tsk->start_time;

        $end=$tsk->end_time;

        $times=DB::select("SELECT SUM(TIMESTAMPDIFF(SECOND, '$start', '$end')) AS difference");

        if($times){

             $time=$this->convertSecondsToHMS($times[0]->difference);

            if (!$this->taskLog($id,"Tracked Time",$time,Auth::user()->id)) {

            }

        }


    }

}


public function convertSecondsToHMS($seconds) {

    if (!is_numeric($seconds)) {

        return "00:00:00";

    }

    $hours = floor($seconds / 3600);

    $minutes = floor(($seconds % 3600) / 60);

    $seconds = $seconds % 60;


    return sprintf("%02d:%02d:%02d", $hours, $minutes, $seconds);

}


View and start,stop Functionality

<table>
                     <thead>
                            <tr>
                                <th >Sno</th>
                                <th >Title</th>
                                <th >Description</th>                               
                                <th >Assigned</th>
                                <th >Status</th>
                                <th >Comments</th>
                                <th >Action</th>
                            </tr>
                        </thead>
 <tbody>
                            <?php if(isset($taskArr)){
                                $sts=array('','Todo','Allocated','Reallocated','WorkInProgress','Hold','Completed');
                                foreach($taskArr as $row){
                                ?>
                                <tr data-id="<?= $row['id'] ?>">
                                <td><?= $row['id']; ?></td>
                                <td><?= $row['title']; ?></td>
                                <td><?= $row['description']; ?></td>
                               
                                <td><?= isset($row['status']) ? $sts[$row['status']]:'' ?></td>
                                <td><?= $row['comment']; ?></td>
                                <td>
                                    <?php if(Auth::user()->id==$row['user']){ ?>
                                    <button id="on<?= $row['id'] ?>"
                                        style="<?php echo ($row['track']==1) ? 'display:none':'display:block'; ?>"
                                        type="button"
                                        onclick="startTask(<?= $row['id'] ?>,'<?= $row['times'] ?>');showbtn1(<?= $row['id'] ?>);"
                                        class="badge badge-success"><i class="fa fa-play"></i></button>
                                    <button id="off<?= $row['id'] ?>"
                                        style="<?php echo ($row['track']==1) ? 'display:block':'display:none'; ?>"
                                        type="button" onclick="endTask(<?= $row['id'] ?>);showbtn2(<?= $row['id'] ?>);"
                                        class="badge badge-danger"><i class="fa fa-stop"></i></button>

                                    <a href="/show-task/<?= $row['id']?>"><button type="button"
                                            onclick="editTask(<?= $row['id'] ?>);" class="badge badge-info"><i
                                                class="fa fa-edit"></i></button></a>
                                    <button type="button" onclick="deleteTask(<?= $row['id'] ?>);"
                                        class="badge badge-danger"><i class="fa fa-trash"></i></button>
                                    <?php } ?>
                                    <span id="tracking-time<?= $row['id'] ?>">
                                        <?php
                                            echo convertSecondsToHMS($row['times']);
                                            ?>
                                    </span>

                                </td>
                            </tr>

                            <?php } } ?>
                        </tbody>
</table>
<script>
function showbtn1(id) {
    $('#on' + id).hide();
    $('#off' + id).show();

}

function showbtn2(id) {
    $('#on' + id).show();
    $('#off' + id).hide();
}

function formatTime(time) {
    return time < 10 ? '0' + time : time;
}
<?php
if(isset($time_track)){
$from=$time_track->start_time;
$to=date('Y-m-d h:i:s');
$datetime1 = new DateTime($from);
$datetime2 = new DateTime($to);
$diff = $datetime2->diff($datetime1);
$seconds = $diff->s + ($diff->i * 60) + ($diff->h * 3600) + ($diff->days * 86400);
$taskid=$time_track->task_id; ?>
startTimer(0, 0, <?= $seconds ?>, <?= $taskid ?>);
$('#tracking-times').addClass("btn btn-success");
<?php }
?>



var timerInterval;

function startTimer(hours, minutes, seconds, id) {
    var tseconds = hours * 3600 + minutes * 60 + seconds;

    timerInterval = setTimeout(function() {
        var hours = formatTime(Math.floor(tseconds / 3600));
        var minutes = formatTime(Math.floor((tseconds % 3600) / 60));
        var seconds = formatTime(tseconds % 60);

        var timeString = hours + ':' + minutes + ':' + seconds;
        tseconds++;
        $('#tracking-times').text(timeString)
        startTimer(Math.floor(tseconds / 3600), Math.floor((tseconds % 3600) / 60), tseconds % 60);
    }, 1000);
}

function startTask(id, time) {
    $.ajax({
        type: "POST",
        url: "{{ route('task.start-task') }}",
        data: {
            id: id,
            _token: '{{csrf_token()}}'
        },
        success: function(data) {
            startTimer(0, 0, 1, id);
            $('#tracking-times').addClass("btn btn-success");
        },
        error: function(data, textStatus, errorThrown) {},
    });

}

function endTask(id) {
    $.ajax({
        type: "POST",
        url: "{{ route('task.end-task') }}",
        data: {
            id: id,
            _token: '{{csrf_token()}}'
        },
        success: function(data) {
            clearTimeout(timerInterval);
        },
        error: function(data, textStatus, errorThrown) {},
    });
}
</script>

  public function viewTask(){
    $time_track=Track::where('tracker_on','1')
                    ->Where('user_id',Auth::user()->id)
                    ->first();
    $task=Task::WHERE('assigned_to',Auth::user()->id)->get();
    $today=date('Y-m-d');
    $taskArr=array();
    foreach($task as $key=>$row){
        $users=DB::select("select GROUP_CONCAT(u.name) as names from users u WHERE id IN($row->assigned_to)");
        $times=DB::select("SELECT SUM(TIMESTAMPDIFF(SECOND, start_time, end_time)) AS difference,tracker_on FROM `track` WHERE task_id='$row->id'  GROUP BY task_id");
        $track=DB::select("SELECT tracker_on FROM `task_track` WHERE tracker_on='1' AND task_id='$row->id'");
        $taskArr[$key]['due_date']=date('d-m-Y',strtotime($row->due_date));
        if($row->due_date < $today && $row->status<4 ){
            $exp=1;
        }else{ $exp=0;}
        $taskArr[$key]['expired']=$exp;
        $taskArr[$key]['due']=$row->due_time;
        $taskArr[$key]['id']=$row->id;
        $taskArr[$key]['summary']=$row->task_summary;
        $taskArr[$key]['description']=$row->task_description;
        $taskArr[$key]['recurring']=$row->recurring;
        $taskArr[$key]['assigned']=isset($users) ? $users:'N/A';
        $taskArr[$key]['recurring_options']=$row->recurring_options;
        $taskArr[$key]['status']=$row->status;
        $taskArr[$key]['date_recurring']=$row->date_recurring;
        $taskArr[$key]['comment']=$row->comment;
        $taskArr[$key]['user']=$row->assigned_to;
        $taskArr[$key]['times']=isset($times[0]->difference) ? $times[0]->difference:"00:00:00";
        $taskArr[$key]['track']=isset($track[0]->tracker_on) ? $track[0]->tracker_on:0;
    }
    
    return view('task.view-task',compact('taskArr','time_track'));
  }

<style>
#track-btn {
    position: fixed;
    height: 38px;
    bottom: 40px;
    right: 218px;
    background-color: #0C9;
    font-weight: 600;
    border-radius: 6pxpx;
    text-align: center;
    box-shadow: 2px 2px 3px #999;
}
</style>






22 October 2021

PHP ARRAY

 GROUP BY ARRAY AND INCLUDE ROW VALUES TO THIS ARRAY

 public function getProducts($id='')

{

$this->db->select("pi.image as image,p.product_name,p.id as productId,p.product_code,p.price,p.product_size,c.c_name as category_name,p.status");
$this->db->from("products as p");
$this->db->join('product_images as pi','pi.product_id=p.id','left');
$this->db->join("category as c", "c.id=p.category_id", "left");
$this->db->where('p.status', 1);
    if(!empty($id)){
        $this->db->where('p.id',$id);
      }
$results = $this->db->get()->result();
$productArray = $imageArray = array();
        foreach($results as $key=> $row)
 
{
                 $productId = $row->productId;
                  if (!isset($productArray[$productId])) {
                 $productArray[$productId] = (array) $row;
                 $productArray[$productId]['images'] = [];
             }
           $productArray[$productId]['images'][] = $row->image;
}
return $productArray;
}


   OutPut :



GROUPBY ARRAY LIKE CATEGORY


foreach($permissions as $row)
{
   
    $name = $row['name'] ?? 'N/A';

    $categoryArray[$name][] = $row;

    if (!isset($
categoryArray[$name])) {
       $
categoryArray[$name] = [];
     }

}

Output : like 

Fruits:
    0->Apple
    1->orange
    2->mango
Flowers:
   0->jasmine
   1->sunflower


 

07 January 2019

Codeigniter Using CRUD

Codeigniter Using CRUD


Change The Configuration in Config File:

Open root folder/Application/Config-> Autoload.php 

$autoload['libraries'] = array('database','session');

Open root folder/Application/Config-> database.php


'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'Your DB Name',
'dbdriver' => 'mysqli',

Create  One  Controller File :

<?php
Class Crud extends CI_Controller
{
}  ?>

Create One Model File:

<?php
Class Crud extends CI_Model
{
}  ?>

Controller:

<?php
/**
 * 
 */
Class Crud extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->model('Crud_model');
$this->load->helper('url');
}
public function select(){
$result['data']=$this->Crud_model->select();
$this->load->view('select',$result);
}
public function insert(){
$this->load->view('index');
if($this->input->post('s')){
$name=$this->input->post('nme');
$gender=$this->input->post('gen');
$res=$this->input->post('res');
$config['upload_path']="./images";
$config['allowed_types']="png|jpg|gif";
$this->load->library('upload',$config);
$file="Image";
if($this->upload->do_upload($file)){
             $img=$this->upload->data('file_name');
$this->db->query("Insert into crud values(NULL,'$name','$gender','$res','$img')");
}else{
echo $this->upload->display_errors();
}
}
}


public function delete(){
$del=$this->input->get('del');
$this->Crud_model->delete($del);
redirect('/Crud/select');
}
public function show(){
$id=$this->input->get('up');
$data['result']=$this->Crud_model->show($id);
$this->load->view('show',$data);
if($this->input->post('sub')){
$name=$this->input->post('nme');
$gender=$this->input->post('gen');
$res=$this->input->post('res');
$config['upload_path']="images";
$config['allowed_types']="jpg|png|gif";
$this->load->library('upload'config);
$file="image";
if($this->upload->do_upload($file)){
$img=$this->upload->data('file_name');
$sql="update crud set name='$name',gender='$gender',result='$res',image='$img' where id='$id'";
$this->db->query($sql);
redirect('/Crud/select');
}
}
}



}



?>

Model File:

index.php

   <?php

   Class Crud_model extends CI_Model{

    public function select()
      {
$sql="select * from crud";
$query=$this->db->query($sql);
return $query->result();
    }

    public function delete($del){
   $sql="delete from crud where id='$del'";
$query=$this->db->query($sql);
   }

  public function show($id){
   $sql="select * from crud where id='$id'";
   $query=$this->db->query($sql);
   return $query->result();
  }

  }
  ?>

View File:

<!DOCTYPE html>
<html>
<head>
<title>Crud</title>
</head>
<body>
<table>

<form method="post" enctype="multipart/form-data">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();  ?>" value="<?php echo $this->security->get_csrf_hash(); ?>">
<tr>
<td>Name</td><td><input type="text" name="nme" autocomplete="off" ></td>
</tr>
<tr>
<td>gender</td><td><input type="radio" name="gen" value="Male" autocomplete="off" >Male
        <input type="radio" name="gen" value="Female" autocomplete="off" >Female
</td>

</tr>
<tr>
<td>Result</td><td><select name="res"><option>Select Result</option><option>Pass</option><option>Fail</option></select></td>
</tr>
<tr>
<td>Image</td><td><input type="file" name="Image" ></td>
</tr>
</table>
<input type="submit" name="s" value="Insert">
</form>

</body>
</html>

Select.php

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<table>
<tr><th>Name</th><th>gender</th><th>Result</th><th>Image</th></tr>
<?php foreach ($data as $row) { ?>
<tr>
<td><?php echo $row->name; ?></td>
<td><?php echo $row->gender; ?></td>
<td><?php echo $row->result; ?></td>
<td><img width="100px" height="100px" src="<?php echo base_url()."images/".$row->image; ?>"></td>
    <td><a href='<?php echo "show?up=".$row->id; ?>'>Update</a></td>
<td><a href='<?php echo "delete?del=".$row->id;  ?>'>delete</a></td>
</tr>
<?php } ?>
</table>
</body>
</html>

Update.php:

<!DOCTYPE html>
<html>
<head>
<title>Crud</title>
</head>
<body>
<table>

<form method="post" enctype="multipart/form-data">
<?php foreach ($result as $row) {
?>
<input type="hidden" value="<?php  echo $row->id; ?>">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>">
<tr>
<td>Name</td><td><input value="<?php echo $row->name ?>" type="text" name="nme" autocomplete="off" ></td>
</tr>
<tr>
<?php if($row->gender=="Male") {?>
<td>gender</td><td><input checked="true" type="radio" name="gen" value="Male" autocomplete="off" >Male
        <input type="radio" name="gen" value="Female" autocomplete="off" >Female
</td>
<?php }else{?>
<td>gender</td><td><input  type="radio" name="gen" value="Male" autocomplete="off" >Male
        <input type="radio" checked="true" name="gen" value="Female" autocomplete="off" >Female
</td>
<?php }?>
</tr><?php if($row->result=="Pass"){?>
<tr>
<td>Result</td><td><select name="res"><option>Select Result</option><option selected="true">Pass</option><option>Fail</option></select></td>
</tr><?php } else{ ?>
<tr>
<td>Result</td><td><select name="res"><option>Select Result</option><option>Pass</option><option selected="true">Fail</option></select></td>
<?php } ?>
<tr>
<td>Image</td><td><img width="200px" height="200px" src="<?php echo base_url().'images/'.$row->image;?>"></td>
</tr>
<tr>
<td>Select Image</td><td><input type="file" name="image"></td>
</tr>
</table>
<?php } ?>
<input type="submit" name="sub" value="Update">
</form>

</body>
</html>
---------------------------------------------------
Simple Steps:

$this->db->query($sql)->row //single record

// IF you Want to get More than Single Row use  (row)

single rows count 

$q=$this->db->query($sql)->row
count($q)

-----------------------------------------------------------------------

$this->db->query($sql)->rows // multiple records

// IF you Want to get More than Multiple Row use  (rows)

multiple rows Count

$q=$this->db->query($sql)->rows
$cnt=$q->num_rows();

Outputs:






27 July 2018

PHP using Shopping Cart

PHP Using Shopping Cart


Index.php:

  <!DOCTYPE html>
<html>
<head>
<style>
.overlay {
  background: #304352;
  opacity: 0.4;
  position: absolute;
 right: 0;
}
.overlay1 {
  background: #fff;
  opacity: 0.4;
  position: absolute;

  top: 0;
  left: 0;
  right: 0;

}
</style>
<title> Admin Panel </title>
</head>
<script src="js/jquery.js"> </script>
<link rel="stylesheet" type="text/css" href=" css/bootstrap.min.css">
<body>
<div class="container">
<div class="row">
<center> <h1> Shopping Cart </h1> </center>
<div class="col-md-12">
<ul type="none">
<?php $con=mysqli_connect("localhost","root","","test");
   $sql=" select * from product ";
   $res=$con->query($sql);
   while($row= mysqli_fetch_array($res)){
?>
<li >
<div class="col-md-3" >
<img width="100%" src="images/<?php echo $row['image']; ?>" >
<center>
<h4> <?php echo $row['pname']; ?> </h4>
<h4> <?php echo $row['pdesc']; ?> </h4>
<h4> <?php echo "$".$row['price']; ?> </h4>
<a href="index.php?id=<?php echo $row['id']; ?>" class="btn btn-danger"> Add cart </a>
</center>
</div>
</li><?php } ?>
</ul><br>
<h4><a href="show.php" target="_blank">Show cart</a></h4>
</div>
</div>
</div>
</body>
</html>
<?php
session_start();

if(empty($_SESSION['cart']))
$_SESSION['cart']=array();
if(isset($_GET['id'])){
array_push($_SESSION['cart'],@$_GET['id']);
}
?>

Show Product:
<?php
$con=mysqli_connect("localhost","root","","test");

if(!isset($_SESSION['cart']) or $_SESSION['cart']==NULL)
echo " No product";
else{
$id=implode(',',$_SESSION['cart']);
$sql=" select * from product where id in($id) ";
$res=$con->query($sql);
echo "<table class='table table-hover'><tr>
<th> Id </th> <th> name </th> <th> Description </th><th> Image </th> <th> Quantity </th> <th> price </th>
</tr>";
$price=0;
while($row=mysqli_fetch_array($res)){
$price+=$row['price']*$row['quantity'];
echo "

<tr>
<td> ".$row['id']." </td>
<td> ".$row['pname']." </td>
<td> ".$row['pdesc']." </td>
<td> <img  width='18%' src='images/".$row['image']."' </td>
<td> <input style='width:50px;' value='".$row['quantity']."' type='text' onkeyup='inc(".$row['id'].")' name='qty[]' id='qty".$row['id']."'></td>
<td id='s".$row['id']."'>".$row['price']*$row['quantity']." </td>
<td> <a href='?rm=".$row['id']."'> Remove </a> </td>
</tr>
";



}echo " <tr>
<td colspan='5'>
Total
</td>
<td> ".$price." </td>
</tr>

</table> <br>";

echo " <h4> <a href='?all'> remove all </a> </h4>";

}

Remove Product :


<?php     //Remove All
session_start();
if(isset($_GET['all'])){
unset($_SESSION['cart']);
}


else if (isset($_GET['rm'])){  //Remove Particular cart
foreach ($_SESSION['cart'] as $key => $pro) {
if($pro==$_GET['rm']){
unset($_SESSION['cart'][$key]);
}

}
}
?>

Increase Quantity:

<script type="text/javascript">
function inc(e){
var qty=document.getElementById('qty'+e).value;
$.post("inc.php",{id:e,qty:qty},function(data){
document.getElementById('s'+e).innerHTML=data;
});
}

</script>


<?php
session_start();
$con=mysqli_connect("localhost","root","","test");
if(isset($_POST['id'])){
$id=$_POST['id'];
$qty=$_POST['qty'];
$sql=" update product set quantity='$qty' where id='$id' ";
$con->query($sql);
$sql=" select * from product where id='$id' ";
$res=$con->query($sql);
while($row=mysqli_fetch_array($res)){
$price=$row['quantity']*$row['price'];
echo $_SESSION['price']=$price;
}
}

?>

# 3 Files 

1.index.php
2.show.php
3.inc.php


Output:
















05 May 2018

SIMPLE SEARCH ENGINE


SIMPLE SEARCH ENGINE



<?php header("Cache-Control: no-cache, must-revalidate"); ?>
<html>
<head></head>
<style>
.seo {
    width: 40%;
    height: 4%;
    border-radius: 4px;
}
.sub {
    height: 5%;
    width: 12%;
    border-radius: 6px;
    background-color: #4683ea;
    color: white;
}
.clear-margin {
    margin: 0;
  }
  .space-top {
    margin-top: 10px;
  }
  .space-right {
    margin-right: 10px;
  }
  .icon-left {
    margin-right: 5px;
  }
  .icon-right {
    margin-left: 5px;
  }
  .labels {
    word-spacing: 5px;
    line-height: 2;
  }
  .label-keyword {
    display: inline-block;
    background: #7eb0db;
    color: white;
    font-size: 0.9em;
    padding: 5px;
    border: 1px solid #357ebd;
  }
  .link-disguise {
    color: inherit;
  }
  .link-disguise:hover {
    color: inherit;
  }
  @media (max-width: 992px) {
    .clear-margin-sm {
      margin-bottom: 0;
    }
  }
  body {
    font-family: 'Lato', "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #f0f0f0;
    color: #333333;
    font-size: 16px;
  }
  .text-bolder {
    font-weight: bold;
  }
  @media only screen {
    .container {
      max-width: 50em;
    }
  }
  @media (max-width: 480px) {
    ul {
      padding-left: 25px;
    }
    /*
          .mobile-title {
              display: inline-block;
              margin-left: 5px;
              font-weight: bold;
              text-transform: uppercase;
              vertical-align: middle;
          }
  */
    .background-details {
      display: block;
    }
    .background-details .icon {
      max-width: inherit;
      min-width: inherit;
      text-align: left;
    }
    .background-details .icon,
    .background-details .info {
      display: block;
      padding: 10px 0;
    }
    .background-details .title {
      display: none;
    }
    .card-nested {
      padding: 5px 0;
    }
  }
  .profile-card {
    display: table;
    width: 100%;
  }
  .profile-pic {
    display: table-cell;
    vertical-align: top;
    padding: 1rem 4rem 0 0 ;
  }
  .profile-pic img {
    width: 100px;
    height: 100px;
  }
  .contact-details {
    display: table-cell;
  }
  .contact-details .detail {
    display: inline-flex;
    line-height: 2;
    margin-right: -1rem;
  }
  .contact-details .detail .icon {
    padding-right: 7px;
    color: #888;
  }
  .contact-details .detail .info {
    font-size: 0.8em;
  }
  .social-links {
    line-height: 2.5;
  }
  .social-link {
    display: block;
  }
  .social-link span {
    display: inline-block;
    vertical-align: middle;
  }
  .social-link:hover,
  .social-link:focus {
    text-decoration: none;
  }
  .social-link .fa {
    text-align: center;
    width: 2em;
  }
  .fa-github {
    color: #454545;
  }
  .fa-github:hover,
  .fa-github:focus {
    text-decoration: none;
    color: #2b2b2b;
  }
  .fa-twitter {
    color: #33ccff;
  }
  .fa-twitter:hover,
  .fa-twitter:focus {
    text-decoration: none;
    color: #00bfff;
  }
  .fa-rss {
    color: #f36f24;
  }
  .fa-rss:hover,
  .fa-rss:focus {
    text-decoration: none;
    color: #d8560c;
  }
  .fa-linkedin {
    color: #007bb6;
  }
  .fa-linkedin:hover,
  .fa-linkedin:focus {
    text-decoration: none;
    color: #005983;
  }
  .fa-skype {
    color: #12a5f4;
  }
  .fa-skype:hover,
  .fa-skype:focus {
    text-decoration: none;
    color: #0986ca;
  }
  .fa-stack-overflow {
    color: #8e8e92;
  }
  .fa-stack-overflow:hover,
  .fa-stack-overflow:focus {
    text-decoration: none;
    color: #747479;
  }
  .fa-soundcloud {
    color: #e8822d;
  }
  .fa-soundcloud:hover,
  .fa-soundcloud:focus {
    text-decoration: none;
    color: #cc6916;
  }
  .fa-pinterest {
    color: #bd091f;
  }
  .fa-pinterest:hover,
  .fa-pinterest:focus {
    text-decoration: none;
    color: #8c0717;
  }
  .fa-vimeo {
    color: #17b3e8;
  }
  .fa-vimeo:hover,
  .fa-vimeo:focus {
    text-decoration: none;
    color: #128fba;
  }
  .fa-behance {
    color: #2c98cf;
  }
  .fa-behance:hover,
  .fa-behance:focus {
    text-decoration: none;
    color: #2379a5;
  }
  .fa-codepen {
    color: #1c1c1c;
  }
  .fa-codepen:hover,
  .fa-codepen:focus {
    text-decoration: none;
    color: #020202;
  }
  

</style>
<body>
<center>
<form method="post" action="" >
<input class="seo" type="text" name="s1"  autocomplete="off"  ><br>
<input class="sub" type="submit" name="s" value="search" ><br>

<a href="https://accounts.google.com/signin">SIGN IN</a>
</form>
</center>
</body>
</html>

<?php
clearstatcache();
header("Cache-Control: no-cache, must-revalidate");
session_start();
if(isset($_POST['s'])){
$url=$_POST['s1'];
$_SESSION['url']=$url;
$_SESSION['gle']="http://www.bing.com/search?q=".$_SESSION['url'];

}
?>

<?php
error_reporting(0);
 echo '<iframe width="1250"  height="1200" src="'.$_SESSION['gle'].'" ></iframe>';
 ?>


OUTPUT:










Jquery or Javascript Start Exam Time

 <script> function startTimer() {      var date = "<?php echo $date ?>"; // dynamic date      var time = "<?...