<?php
if(isset($_POST['search'])){
$search = $_POST['tag'];
if($search == " "){
header('Location:index.php');
}
$flag=1;
}else{
$flag=1;
$search = $_REQUEST['tag'];
if($search == " "){
header('Location:index.php');
}
}
include('header.html');
?>
<div class="container">
<div class="row">
<img src="./img/bc_addphones.gif" alt="" style="width:100%;height:50px">
</div>
</div>
<br>
<div class="container">
<div class="row">
<div class="box " style="background-color: white;">
<div class="col-md-12">
<h3>Select Handset</h3><br><br>
</div>
<div class="row">
<?php
if($flag==1){
include("mysqlconnect.php");
$res = mysql_query("select * from product where deviceName like '%$search%'");
$cnt = mysql_num_rows($res);
if($cnt>0){
while($row= mysql_fetch_array($res)){
$name = $row['deviceName'];
$image= $row['image'];
$price = "$".$row['price'];
$pid = $row['productId'];
?>
<div class="col-md-3">
<div class="row">
<div class="col-md-5">
<img src="<?= $image ?>" alt="Demo" class="img-polaroid" width="110px" height="150px;"/><br><br>
<p><a href="searchmobile.php?pid=<?php echo $pid ?>"><button class="btn btn-danger" style="margin-left:28px;">Select</button></a></p>
</div>
<div class="col-md-7">
<a href="#"><?= $name ?><br> i9060<br><?= $price ?></a>
</div>
</div>
</div>
<?php
}
}else{
?>
<div class="row">
<div class="col-md-6">
<h4 style="padding-left:50px;">No device Found</h4>
</div>
</div>
<?php
}
}else{
include("mysqlconnect.php");
$res = mysql_query("select * from product ");
$cnt = mysql_num_rows($res);
if($cnt>0){
while($row= mysql_fetch_array($res)){
$name = $row['deviceName'];
$image= $row['image'];
$price = "$".$row['price'];
?>
<div class="col-md-3">
<div class="row">
<div class="col-md-5">
<a href="#">
<img src="<?= $image ?>" alt="Demo" class="img-polaroid" width="110px" height="150px;"/></a><br><br>
<p><button class="btn btn-danger" style="margin-left:28px;">Select</button></p>
</div>
<div class="col-md-7">
<a href="#"><?= $name ?><br> i9060<br><?= $price ?></a>
</div>
</div>
</div>
<?php
}
}
}
?>
</div>
</div>
<br>
</div>
</div>
<!-- /.container -->
<?PHP
include('footer.html');
?>