pop up window not working - php
i'm using javascript and php for my pop up window. the plan is to pass the row id on the parent page to the pop up window.
it's working fine with this code:
<img src='images/buttons/edit.png' title='Edit Content'>
the pop up appears. but when i try to add ?textID=<?$row['textID']?>, which is the code i'm using to pass the row id that ends up like this:
<img src='images/buttons/edit.png' title='Edit Content'>
the pop up does not work. it appears to be just refreshing the page. thank you for your help.
here's my complete code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
include("global.php");
?>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>About | ILAM</title>
<!-- main css -->
<link href="style.css" rel="stylesheet" type="text/css">
<link href="styleAdmin.css" rel="stylesheet" type="text/css">
<script type= "text/javascript">
<!-- showHideDiv -->
function divHideShow(divToHideOrShow){
var div = document.getElementById(divToHideOrShow);
if (div.style.display == "block"){
div.style.display = "none";}
else{
div.style.display = "block";}
}
<!-- popUp -->
function PopupCenter(pageURL, title,w,h)
{
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>
</head>
<!-- Body -->
<body>
<div id="pagewrap">
<!-- Header -->
<div id="header">
<div class="floating-menu">
<div class="logo"><img src="images/static/ilamLogo.png"></div>
<div class="translator">
</div>
<ul>
<li>Join Us!</li>
<li><div class="indent"> </div></li>
<li>Contact</li>
<li>Career</li>
<li>Gallery</li>
<li>Facilities</li>
<li>Courses</li>
<li>About</li>
<li>Home</li>
<li>Admin</li>
</ul>
</div>
</div>
<!-- //Header -->
<!-- ContentBanner -->
<div id="contentBanner">
<div id="menuContentBanner" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><img src="images/buttons/edit.png" title="Edit Image"></li>
</ul>
</div>
</div>
<img src="images/headers/aboutHeader.jpg"></div> <!--BannerImage -->
<div class="textLeft">
<div id="menuContentBannerText" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><img src="images/buttons/edit.png" title="Edit Content"></li>
</ul>
</div>
</div>
<h3>As an Academic Institution.</h3><p> ILAM takes to heart its responsibilities, not only to its students, but also to its team, and community</p></div> <!-- BannerText -->
<!-- //ContentBanner -->
<!-- Content: Blue -->
<div id="content">
<!-- SidePost -->
<aside id="sidebar">
<section class="widget">
<ul>
<li><img src="images/buttons/factsbtn.png" onmouseover="this.src='images/buttons/factsbtnHover.png'" onmouseout="this.src='images/buttons/factsbtn.png'"></li>
<li><img src="images/buttons/testibtn.png" onmouseover="this.src='images/buttons/testibtnHover.png'" onmouseout="this.src='images/buttons/testibtn.png'"></li>
<li><img src="images/buttons/promosbtn.png" onmouseover="this.src='images/buttons/promosbtnHover.png'" onmouseout="this.src='images/buttons/promosbtn.png'"></li>
</ul>
</section>
</aside>
<!-- //SidePost -->
<!-- OpenerPost -->
<article class="openerPost">
<table>
<tr>
<div id="menuOpenPost" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><img src="images/buttons/edit.png" height="27" width="65"></li>
</ul>
</div>
</div>
</tr>
<tr>
<td><?php
$query="SELECT * from text_tb WHERE textID = '1'";
$result=mysql_query($query);
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);
echo $row[1]; // the email value
?>
</td>
</tr>
</table>
</article>
</div>
<!-- //OpenerPost -->
<!-- Content: White -->
<div id="content">
<article class="mainPost">
<table>
<tr>
<div id="menuMainPost" class="menuBarStyle">
<div class="addEditDelete">
<ul>
<li><img src="images/buttons/edit.png" title="Edit Content"></li>
</ul>
</div>
</div>
</tr>
<tr><td class="title">Our Mission</td></tr>
<tr>
<td><p>As an academic institution, ILAM takes to heart its responsibilities, not only to its students,
but also to its team, and community. We know that in addition to reaching our vision for the school, ILAM has
a role and certain duties that it has to carry out.</p></td>
</tr>
<tr>
<td class="subtitle">For the Students.</td>
</tr>
<tr>
<td><p>International Language Academy Manila (I.L.A.M.) is a premier language school in Makati
City, Philippines whose mission is to provide quality education to professionals and
non-professionals aiming to be proficient in English. The school takes pride in its ESL/EFL
courses such as: Functional Grammar, Conversation, Business Writing, Business English,
Pronunciation, IELTS review, TOEIC review, etc. which are all taught in a multidisciplinary
setting to ensure comprehensive skill development in the four areas of communication (listening,
speaking, reading, and writing). Apart from teaching English, the school also intends to inculcate strong intercultural
awareness among its students by integrating outdoor activities in its curriculum. </p></td>
</tr>
<tr>
<td class="subtitle">For the Community.</td>
</tr>
<tr>
<td><p>As an academic institution, ILAM takes heart to its responsibilities in promoting education and tourism in the country, which is the reason behind its partnership with the Bureau of Immigration and various multinational companies for English training. It aims to show its foreign students how much the
country has improved, and that the Philippines is a place where they can always find another
home. ILAM goes beyond the technicalities of language. It offers students the opportunity to
foster a deeper understanding of various cultures and thus, enables them to appreciate more the
beauty of language as they get to communicate and interact with different people.</p></td>
</tr>
<tr>
<td class="subtitle">For its Team.</td>
</tr>
<tr>
<td><p>As an academic institution, ILAM takes heart to its responsibilities in promoting education
and tourism in the country, which is the reason behind its partnership with the Bureau of Immigration and various
multinational companies for English training. It aims to show its foreign students how much the
country has improved, and that the Philippines is a place where they can always find another
home. ILAM goes beyond the technicalities of language. It offers students the opportunity to
foster a deeper understanding of various cultures and thus, enables them to appreciate more the
beauty of language as they get to communicate and interact with different people.</p></td>
</tr>
</table>
</article>
</div>
<footer id="footer">
<table>
<tr>
<td>
<div id="menuFooterLeft" class="menuBarStyle">
<img src="images/buttons/edit.png" title="Edit Content">
</div>
<h3>Let's Meet</h3>
<p>2/F Makati Creekside Mall Bldg. Amorsolo Cor. VA Rufino St. Legazpi Village, Makati City Philippines</p></td>
<td>
<div id="menuFooterMiddle" class="menuBarStyle">
<img src="images/buttons/edit.png" title="Edit Content">
</div>
<h3>Let's Talk</h3>
<p>Telephone: 632-8400285 / 519 9502<br>Cellphone: 0917-5324332</p></td>
<td>
<div id="menuFooterRight" class="menuBarStyle">
<img src="images/buttons/edit.png" title="Edit Content">
</div>
<h3>The Affiliates</h3>
<p>Accenture<br>
Asian Institute of Management<br>
ConveyThis<br>
The Little Web Directory<br></td>
</tr>
<tr>
<td class="copyright">Copyright © 2012 ILAM</td>
</tr>
</table>
</footer>
</div>
<!-- /#pagewrap -->
</body>
</html>
you need to use echo like:
<?php echo($row['textID']) ?>
Looks like it is PHP. To insert the PHP variable into your HTML, use echo, like this:
<a href="#"
onclick="PopupCenter('example.php?textID=<?php echo $row['textID'] ?>', 'myPop1',500,400); " class="add">
<img src='images/buttons/edit.png' title='Edit Content'>
</a>
if shorthand is allowed, this should work
<?=$row['textID']?>
Related
How to display data from selected table in the same database in the form of table, in php?
I am working on a website where I am getting input of semester number from the user and I want to display the subjects in the semester they entered accordingly. For this, I planned to create tables for each semester which would have the subjects in it. For now, I am successful to retrieve data from one table. But I am required to get subjects as per the entered semester by the student. Following is the code,which works perfectly for semester 5. Please suggest alterations as per the requirements asked above. <!DOCTYPE html> <html> <head> <title></title> <!-- very important --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="subject.css"> </head> <body> <h1 class="text-center text-capitalize font-weight-bold">Subject Information</h1> <div class="container"> <div> <br> <div> <form class="form-inline"> <!-- <div class="mx-auto" style="width: 200px;"> --> <div class="form-group"> <label for="Sem"> Semester: </label> <div> <input type="text" name="sem_no" placeholder="Enter current semester" id=sem class="form-control"> </div> <br> </div> </form> </div> </div> </div> <div> <!-- TABLE DISPLAYED WITH DATA FROM RESPECTIVE DATABASE --> <div class= "container"> <div class="col-lg-12 "> <br><br> <h2 class="text-center">Subjects</h2> <table class="table table-striped table-hover table-bordered"> <tr> <th>Subject code</th> <th>Subject Name</th> <th>Faculty name</th> </tr> <?php $con = mysqli_connect('localhost','root'); mysqli_select_db($con,'subjects'); $q= "select * from sem5"; $query = mysqli_query($con,$q); while($res = mysqli_fetch_array($query)) { ?> <tr> <td><?php echo $res['subject_no']; ?></td> <td><?php echo $res['subject_name']; ?></td> <td><?php echo $res['faculty_name']; ?></td> </tr> <?php } ?> </table> </div> </div> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script> </body> </html> Please suggest alterations. Will be highly obliged.
You need to do a HTTP GET request and use PHP to get the value. Then use PHP to make the SQL query. Here it is in its simplest form. I've added a submit button which submits the form and executes the HTTP GET with the parameters attached to the URL. You will see ?sem_no=x after it is submitted. That's the Query String. ... ... <div class="form-group"> <label for="Sem"> Semester: </label> <div> <input type="text" name="sem_no" placeholder="Enter current semester" id=sem class="form-control"> </div> <div> <input type="submit"/> </div> <br> ... ... ... ... //check the value was submitted and it is not blank <?php if(isset($_GET['sem_no']) && !empty($_GET['sem_no'])) { ?> <!-- TABLE DISPLAYED WITH DATA FROM RESPECTIVE DATABASE --> <div class= "container"> <div class="col-lg-12 "> <br><br> <h2 class="text-center">Subjects</h2> <table class="table table-striped table-hover table-bordered"> <tr> <th>Subject code</th> <th>Subject Name</th> <th>Faculty name</th> </tr> <?php $con = mysqli_connect('localhost','root'); mysqli_select_db($con,'subjects'); $q= 'select * from sem'.$_GET['sem_no']; $query = mysqli_query($con,$q); while($res = mysqli_fetch_array($query)) { ?> <tr> <td><?php echo $res['subject_no']; ?></td> <td><?php echo $res['subject_name']; ?></td> <td><?php echo $res['faculty_name']; ?></td> </tr> <?php } ?> </table> </div> </div> <?php //closing if } ?> ... ... As mentioned in the comments earlier, this database design is quite poor. I know you are learning though. Have you considered having a subjects table that has a Semester column? Then you could do a query like: SELECT * FROM subjects where semester_number = x There are even better ways to do it beyond that but this would be a good starting point for you.
While loop is repeating other elements in the page
Hello I have a query with while loop which is used for retrieving data but in here my query along my while loop is in top of page so its repeating other elements specifically my header. Here is the code: <?php require_once('../Admin Panel/db.php'); if(!empty($_POST['Province']) && !empty($_POST['District']) && !empty($_POST['radio'])) { $provincename=$_POST['Province']; $districtname=$_POST['District']; $propertystatus=$_POST['radio']; $query = "SELECT properties.PropertyID, properties.PropertyType, properties.PropertyDealType, properties.PropertyRegion, properties.PropostedPrice, properties.DealStatus, properties.CurrencyType, propertyimages.ImageID, propertyimages.ImagePath, propertyimages.ImageName, provinces.ProvinceName, districts.DistrictName, pds.PDName FROM properties, provinces, districts, pds, propertyimages WHERE provinces.ProvinceID=properties.ProvinceID AND districts.DistrictID=properties.DistrictID AND pds.PDID=properties.PDID AND properties.ImageID=propertyimages.ImageID AND properties.Status= 'Active' AND properties.propertyStatus = 'APPROVED' AND ProvinceName='".$provincename."' AND DistrictName='".$districtname."' AND PropertyDealType='".$propertystatus."' GROUP BY properties.PropertyID"; $queryrun= $connection->query($query); // The query run in here if( $connection->error ) exit( $connection->error ); // In here checks for the errors which may occure in our query while ($row= $queryrun->fetch_assoc()) // storing the value of the query into the variable of row { $count= $queryrun->num_rows; // Taking the number of queries returened by the result ?> <!DOCTYPE html> <html> <head> <LINK REL="SHORTCUT ICON" HREF="favico.ico"> <meta charset="utf-8" /> <meta http-equiv="Content-Type" content=" spdealers Onlince Dealing," /> <meta name="Keywords" content="spdealers.com - spdealers, Property spdealers, Property spdealers, real estate Afghanistan, Afghanistan property, Afghanistan properties, property in Afghanistan, property Afghanistan, Afghanistan real estate, apartments, properties for sale Afghanistan, office space, property, buy property, sell property, rent property, commercial real estate Afghanistan, Afghanistan properties, Afghanistan properties on sale, Afghanistan property portals, Afghanistan residential real estate, rental property, flats, apartments, studio apartments, property site,makaan, makan, spdealers.com, real estate properties, Afghanistan real estate, real estate Afghanistan, property Afghanistan, Afghanistan property portal, buy property, sell property, rent property online, flats, apartments, studio apartment, rental property, commercial real estate, search property, list property, post requirement, featured builders, dealers, property index, properties in Afghanistan, property by localityProperty, Properties, Property For Sale, Find a Property, Properties for sale, Real Estate, Buy real estate. R"> <Meta name="description" content="spdealers Online Property Dealing In Afghansitan, Property Search, buy, sell, rent, lease residential, commercial propertys only on spdealers.com."> <title>SPDealers</title> <link rel="stylesheet" type="text/css" href="style.css" media="all" /> </head> <body> <div id="wrapper"> <div id="header"> <div id="logo"> <img src="images/logo.png" alt="" /> </div> <ul> <li class="selected"><span>PROPERTY</span></li> <li>View Option</li> <li><span>HOME</span></li> </ul> </div> <div id="body"> <div class="header"> <div> <ul> <li></li> <li></li> <li></li> </ul> <div> <p>Do you want to earn money and have a good income? Do you want to receive money without working hours and putting pressure over your Mind, So Please contact with us and make yourself one of our valuable Remote Employee Click Here for more information.</p> </div> <div id="threeimages"> <img src="images/flags.png"> <img src="images/graph.png"> </div> </div> </div> <br> <div class="footer"> <div class="featured"> <div class="propertywrapperviewmore"> <div class="propertysingleimageviewmore"> <a href="property.php?ImageID=<?php echo $row['ImageID'] ?>"> <img src="../Admin Panel/Property_Insertion_Files/<?php echo $row['ImagePath'] ?>" width="227" height="147" alt="<?php echo $row['ImageName'] ?>" style="border-radius:8px;" ></a> </div> <div class="propertyIDviewmorelablevalue"> <div class="propertyIDL">Property ID:</div> <div class="propertyIDV"><?php echo $row['PropertyID']?></div> <div align="right" style=" width:310px; height:15px; font-size:20px; float:right; padding-bottom:5px; background-color:#000; color:#FFF; "><marquee behavior="scroll" scrollamount="2" onMouseover="this.scrollAmount=1" onMouseout="this.scrollAmount=6"><?php echo $row['PropertyDealType'] ?></marquee></div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Property Type:</div> <div class="propertyothersV"><?php echo $row['PropertyType']?></div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Address:</div> <div class="propertyothersV"><?php echo $row['PropertyRegion'].' / Nahya: '.$row['PDName'].' / District: '.$row['DistrictName'].' / '.$row['ProvinceName']?></div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Total Price:</div> <div class="propertyothersV"><?php $price = (isset($row['PropostedPrice']) && $row['PropostedPrice']!='')? number_format($row['PropostedPrice'], 2, '.', ','):''; echo $row['CurrencyType'].' '.$price?></div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Deal Status:</div> <div class="propertyothersV"><?php echo $row['DealStatus']?></div> </div> <br><br><br><br> <div class="propertysviewmoreDescription"> <div class="propertysviewmoreDescriptionL">Description:</div> <div class="propertysviewmoreDescriptionV"> To find out more this property, please click on the VIEW MORE button. You can contact us more specific information on this property. <label style="float:right;"><br>View More</label> <div> </div> </div> </div> </div> <?php } if($queryrun->num_rows == 0) { echo "<div style='margin-left:116px; line-height: 36px;'>".'Sorry there is no Record for Your search: '." ". "<br> Province: <b>".$provincename."</b> <br>District: <b>". $districtname."</b> <br> Property Status: <b>".$propertystatus."</b> <br> to search other provinces and cities <br> <a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a> </div>"; } } else { echo '<br><br>You Havent Selected The Following Properly:<br><br> <strong>(Province)</strong> <br> <strong>(District)</strong> <br> <strong>(Property Status)</strong>.<br><br>'; echo "Please <a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a> to go back"; } ?> </div> <div id="ads" style="margin-left:844px;"> <div id="adsone"></div> <div id="adsthree"></div> </div> </div> </div> <div id="footer"> <div id="bottomoptions">Home About Us Advertise With Us Terms&Condition Help&Support Privacy Policy FAQ Contact Us Report A Problem <div id="copyright"><p>All rights Reserved©2014 spdealers.com</p> </div> </div> </div> </div> </body> </html>
I am only guessing where your loop is supposed to be and where your breaks should be on if else conditions. They should hopefully be close...?? <?php require_once('../Admin Panel/db.php'); class ProvinceProp { protected $connection; public function __construct($connection) { $this->connection = $connection; } public $provincename; public $districtname; public $propertystatus; public $num_rows; public function ProcessPost() { if(!empty($_POST['Province']) && !empty($_POST['District']) && !empty($_POST['radio'])) { $this->provincename = $_POST['Province']; $this->districtname = $_POST['District']; $this->propertystatus = $_POST['radio']; $query = "SELECT properties.PropertyID, properties.PropertyType, properties.PropertyDealType, properties.PropertyRegion, properties.PropostedPrice, properties.DealStatus, properties.CurrencyType, propertyimages.ImageID, propertyimages.ImagePath, propertyimages.ImageName, provinces.ProvinceName, districts.DistrictName, pds.PDName FROM properties, provinces, districts, pds, propertyimages WHERE provinces.ProvinceID=properties.ProvinceID AND districts.DistrictID=properties.DistrictID AND pds.PDID=properties.PDID AND properties.ImageID=propertyimages.ImageID AND properties.Status= 'Active' AND properties.propertyStatus = 'APPROVED' AND ProvinceName='".$this->provincename."' AND DistrictName='".$this->districtname."' AND PropertyDealType='".$this->propertystatus."' GROUP BY properties.PropertyID"; // The query run in here $queryrun = $this->connection->query($query); // In here checks for the errors which may occure in our query if( $this->connection->error ) exit( $this->connection->error ); $this->num_rows = $queryrun->num_rows; // storing the value of the query into the variable of row while ($res = $queryrun->fetch_assoc()) { $array[] = $res; } // Return array or return 0 (false) return (isset($array))? $array: 0; } } } // Start instance, feed in database connection $_property = new ProvinceProp($connection); // See if there are rows returned (greater than or equal to 0) or empty // Empty signifies that criteria to generate the sql was not satisfied $array = $_property->ProcessPost(); ?><!DOCTYPE html> <html> <head> <LINK REL="SHORTCUT ICON" HREF="favico.ico"> <meta charset="utf-8" /> <meta http-equiv="Content-Type" content=" spdealers Onlince Dealing," /> <meta name="Keywords" content="spdealers.com - spdealers, Property spdealers, Property spdealers, real estate Afghanistan, Afghanistan property, Afghanistan properties, property in Afghanistan, property Afghanistan, Afghanistan real estate, apartments, properties for sale Afghanistan, office space, property, buy property, sell property, rent property, commercial real estate Afghanistan, Afghanistan properties, Afghanistan properties on sale, Afghanistan property portals, Afghanistan residential real estate, rental property, flats, apartments, studio apartments, property site,makaan, makan, spdealers.com, real estate properties, Afghanistan real estate, real estate Afghanistan, property Afghanistan, Afghanistan property portal, buy property, sell property, rent property online, flats, apartments, studio apartment, rental property, commercial real estate, search property, list property, post requirement, featured builders, dealers, property index, properties in Afghanistan, property by localityProperty, Properties, Property For Sale, Find a Property, Properties for sale, Real Estate, Buy real estate. R"> <Meta name="description" content="spdealers Online Property Dealing In Afghansitan, Property Search, buy, sell, rent, lease residential, commercial propertys only on spdealers.com."> <title>SPDealers</title> <link rel="stylesheet" type="text/css" href="style.css" media="all" /> </head> <body> <div id="wrapper"> <?php // I am only guessing where conditions are met so display required.... if(isset($_property->provincename)) { ?> <!--start header class --> <div id="header"> <div id="logo"><img src="images/logo.png" alt="" /></div> <ul> <li class="selected"><span>PROPERTY</span></li> <li>View Option</li> <li><span>HOME</span></li </ul> </div> <!--start body class --> <div id="body"> <div class="header"> <div> <ul> <li></li> <li></li> <li></li> </ul> <div> <p>Do you want to earn money and have a good income? Do you want to receive money without working hours and putting pressure over your Mind, So Please contact with us and make yourself one of our valuable Remote Employee Click Here for more information.</p> </div> <div id="threeimages"> <img src="images/flags.png"> <img src="images/graph.png"> </div> </div> </div> <div class="footer"> <div class="featured"><?php // If the array was returned (ie rows were returned from db) if(is_array($array)) { // Here is the start of the loop where I am guessing it would be...?? foreach($array as $row) { ?> <div class="propertywrapperviewmore"> <div class="propertysingleimageviewmore"> <a href="property.php?ImageID=<?php echo $row['ImageID'] ?>"> <img src="../Admin Panel/Property_Insertion_Files/<?php echo $row['ImagePath'] ?>" width="227" height="147" alt="<?php echo $row['ImageName'] ?>" style="border-radius:8px;" ></a> </div> <div class="propertyIDviewmorelablevalue"> <div class="propertyIDL">Property ID:</div> <div class="propertyIDV"><?php echo $row['PropertyID']?></div> <div align="right" style="width:310px; height:15px; font-size:20px; float:right; padding-bottom:5px; background-color:#000; color:#FFF;"> <marquee behavior="scroll" scrollamount="2" onMouseover="this.scrollAmount=1" onMouseout="this.scrollAmount=6"><?php echo $row['PropertyDealType'] ?></marquee> </div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Property Type:</div> <div class="propertyothersV"><?php echo $row['PropertyType']?></div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Address:</div> <div class="propertyothersV"><?php echo $row['PropertyRegion'].' / Nahya: '.$row['PDName'].' / District: '.$row['DistrictName'].' / '.$row['ProvinceName']?></div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Total Price:</div> <div class="propertyothersV"> <?php $price = (isset($row['PropostedPrice']) && $row['PropostedPrice']!='')? number_format($row['PropostedPrice'], 2, '.', ','):''; echo $row['CurrencyType'].' '.$price?></div> </div> <div class="propertysviewmoreotherlablevalue" style="margin-bottom: 60px;"> <div class="propertyothersL">Deal Status:</div> <div class="propertyothersV"><?php echo $row['DealStatus']?></div> </div> <div class="propertysviewmoreDescription"> <div class="propertysviewmoreDescriptionL">Description:</div> <div class="propertysviewmoreDescriptionV">To find out more this property, please click on the VIEW MORE button. You can contact us more specific information on this property. <label style="float:right;"><br>View More</label> <div> </div> </div> <?php } } ?> </div> </div> <?php } if(isset($_property->num_rows) && $_property->num_rows == 0) { ?> <div style='margin-left:116px; line-height: 36px;'>Sorry there is no Record for Your search: <br> Province: <b><?php echo $provincename; ?></b> <br>District: <b><?php echo $districtname; ?></b> <br> Property Status: <b><?php echo $propertystatus; ?></b> <br> to search other provinces and cities<br> <a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a> </div><?php } else { ?> <br><br>You Havent Selected The Following Properly:<br><br> <strong>(Province)</strong> <br> <strong>(District)</strong> <br> <strong>(Property Status)</strong>.<br><br> Please <a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a> to go back<?php } ?> </div> <div id="ads" style="margin-left:844px;"> <div id="adsone"></div> <div id="adsthree"></div> </div> </div> </div> <div id="footer"> <div id="bottomoptions">Home About Us Advertise With Us Terms&Condition Help&Support Privacy Policy FAQ Contact Us Report A Problem <div id="copyright"><p>All rights Reserved©2014 spdealers.com</p></div> </div> </div> </div> </body> </html>
Your code is written in while loop you have to add only those tag that you want to repeat to full HTML code. <HTML CODE> <?php code While loop { //php and html code combine } ?> <HTMl CODE>
Try this. my comments are in the capital letters so read them, Breif Explanation: I removed the header tag from your while posted it above while loop and leave the note how you can place it. According to your need. and some other code i also posted it above the while loop. But before reading the solution look the example how the while loop work while($condition) { //repeat the code. In short it will reapeat the code untill the condition is true. Thanks } Thats your answer <?php require_once('../Admin Panel/db.php'); if(!empty($_POST['Province']) && !empty($_POST['District']) && !empty($_POST['radio'])) { $provincename=$_POST['Province']; $districtname=$_POST['District']; $propertystatus=$_POST['radio']; $query = "SELECT properties.PropertyID, properties.PropertyType, properties.PropertyDealType, properties.PropertyRegion, properties.PropostedPrice, properties.DealStatus, properties.CurrencyType, propertyimages.ImageID, propertyimages.ImagePath, propertyimages.ImageName, provinces.ProvinceName, districts.DistrictName, pds.PDName FROM properties, provinces, districts, pds, propertyimages WHERE provinces.ProvinceID=properties.ProvinceID AND districts.DistrictID=properties.DistrictID AND pds.PDID=properties.PDID AND properties.ImageID=propertyimages.ImageID AND properties.Status= 'Active' AND properties.propertyStatus = 'APPROVED' AND ProvinceName='".$provincename."' AND DistrictName='".$districtname."' AND PropertyDealType='".$propertystatus."' GROUP BY properties.PropertyID"; $queryrun= $connection->query($query); // The query run in here if( $connection->error ) exit( $connection->error ); // In here checks for the errors which may occure in our query //PUT YOUR HTTML CODE HERE WHICH YOU DONT WANT TO GET REPEATED. //END THE PHP HERE ?> <!DOCTYPE html> <html> <head> <LINK REL="SHORTCUT ICON" HREF="favico.ico"> <meta charset="utf-8" /> <meta http-equiv="Content-Type" content=" spdealers Onlince Dealing," /> <meta name="Keywords" content="spdealers.com - spdealers, Property spdealers, Property spdealers, real estate Afghanistan, Afghanistan property, Afghanistan properties, property in Afghanistan, property Afghanistan, Afghanistan real estate, apartments, properties for sale Afghanistan, office space, property, buy property, sell property, rent property, commercial real estate Afghanistan, Afghanistan properties, Afghanistan properties on sale, Afghanistan property portals, Afghanistan residential real estate, rental property, flats, apartments, studio apartments, property site,makaan, makan, spdealers.com, real estate properties, Afghanistan real estate, real estate Afghanistan, property Afghanistan, Afghanistan property portal, buy property, sell property, rent property online, flats, apartments, studio apartment, rental property, commercial real estate, search property, list property, post requirement, featured builders, dealers, property index, properties in Afghanistan, property by localityProperty, Properties, Property For Sale, Find a Property, Properties for sale, Real Estate, Buy real estate. R"> <Meta name="description" content="spdealers Online Property Dealing In Afghansitan, Property Search, buy, sell, rent, lease residential, commercial propertys only on spdealers.com."> <title>SPDealers</title> <link rel="stylesheet" type="text/css" href="style.css" media="all" /> </head> <body> <div id="wrapper"> <div id="header"> <div id="logo"> <img src="images/logo.png" alt="" /> </div> <ul> <li class="selected"><span>PROPERTY</span></li> <!--ADDED THE HEADER HERE. YOU CAN PLACE IT WITH THE HELP OF YOUR CSS WHERE EVERY YOU WANT--> <div class="header"> <div> <ul> <li></li> <li></li> <li></li> </ul> <div> <p>Do you want to earn money and have a good income? Do you want to receive money without working hours and putting pressure over your Mind, So Please contact with us and make yourself one of our valuable Remote Employee Click Here for more information.</p> </div> <div id="threeimages"> <img src="images/flags.png"> <img src="images/graph.png"> </div> </div> </div> <?php //BEFORE WHILE LOOP START AGAIN YOUR PHP while ($row= $queryrun->fetch_assoc()) // storing the value of the query into the variable of row { $count= $queryrun->num_rows; // Taking the number of queries returened by the result ?> <li>View Option</li> <li><span>HOME</span></li> </ul> </div> <div id="body"> <br> <div class="footer"> <div class="featured"> <div class="propertywrapperviewmore"> <div class="propertysingleimageviewmore"> <a href="property.php?ImageID=<?php echo $row['ImageID'] ?>"> <img src="../Admin Panel/Property_Insertion_Files/<?php echo $row['ImagePath'] ?>" width="227" height="147" alt="<?php echo $row['ImageName'] ?>" style="border-radius:8px;" ></a> </div> <div class="propertyIDviewmorelablevalue"> <div class="propertyIDL">Property ID:</div> <div class="propertyIDV"><?php echo $row['PropertyID']?></div> <div align="right" style=" width:310px; height:15px; font-size:20px; float:right; padding-bottom:5px; background-color:#000; color:#FFF; "><marquee behavior="scroll" scrollamount="2" onMouseover="this.scrollAmount=1" onMouseout="this.scrollAmount=6"><?php echo $row['PropertyDealType'] ?></marquee></div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Property Type:</div> <div class="propertyothersV"><?php echo $row['PropertyType']?></div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Address:</div> <div class="propertyothersV"><?php echo $row['PropertyRegion'].' / Nahya: '.$row['PDName'].' / District: '.$row['DistrictName'].' / '.$row['ProvinceName']?></div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Total Price:</div> <div class="propertyothersV"><?php $price = (isset($row['PropostedPrice']) && $row['PropostedPrice']!='')? number_format($row['PropostedPrice'], 2, '.', ','):''; echo $row['CurrencyType'].' '.$price?></div> </div> <div class="propertysviewmoreotherlablevalue"> <div class="propertyothersL">Deal Status:</div> <div class="propertyothersV"><?php echo $row['DealStatus']?></div> </div> <br><br><br><br> <div class="propertysviewmoreDescription"> <div class="propertysviewmoreDescriptionL">Description:</div> <div class="propertysviewmoreDescriptionV"> To find out more this property, please click on the VIEW MORE button. You can contact us more specific information on this property. <label style="float:right;"><br>View More</label> <div> </div> </div> </div> </div> <?php } if($queryrun->num_rows == 0) { echo "<div style='margin-left:116px; line-height: 36px;'>".'Sorry there is no Record for Your search: '." ". "<br> Province: <b>".$provincename."</b> <br>District: <b>". $districtname."</b> <br> Property Status: <b>".$propertystatus."</b> <br> to search other provinces and cities <br> <a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a> </div>"; } } else { echo '<br><br>You Havent Selected The Following Properly:<br><br> <strong>(Province)</strong> <br> <strong>(District)</strong> <br> <strong>(Property Status)</strong>.<br><br>'; echo "Please <a href='../index.php' style='text-decoration:none; font-size: 16px; color:#2a4f5e;'>Click Here</a> to go back"; } ?> </div> <div id="ads" style="margin-left:844px;"> <div id="adsone"></div> <div id="adsthree"></div> </div> </div> </div> <div id="footer"> <div id="bottomoptions">Home About Us Advertise With Us Terms&Condition Help&Support Privacy Policy FAQ Contact Us Report A Problem <div id="copyright"><p>All rights Reserved©2014 spdealers.com</p> </div> </div> </div> </div> </body> </html>
How to give table white background color - Bootstrap, Yii
I've modified the general Yii Crud generated index.php to not display the side menu and instead display a table. I've done this by overriding the default layout and by creating a column3.php This view file looks like this <?php $this->beginContent('//layouts/main'); ?> <div class="row-fluid"> <div class="span3"> <table class="table table-bordered"> <form action="<?php echo Yii::app()->createUrl('recipient/processpayment', array('id'=>$id)) ?>" method="post" > <tr class="primary"><td> <h4>List Summary </h4> </td></tr> <tr ><td> <?php echo $numpeople; ?> Recipient(s) </td></tr> <tr ><td> Total Due: <?php echo $totaldue ?> Rwf </td></tr> </form> </table> </div><!-- sidebar span3 --> <div class="span9"> <div class="main"> <?php echo $content; ?> </div><!-- content --> </div> </div> <?php $this->endContent(); ?> Unfortunately the side of my screen is a grey color and I've realized that the table itself is simply composed of a couple of lines and text (meaning it is see-through). I'd like to change the background color of the table to be white - any suggestions would be greatly appreciated!
CSS .table, .table tr, .table td { background-color: white !important; }
white blank displayed on webpage occasionally when changing the select option value
I am building an online system where the users are instructors of a certain college institution. One of the main function of the system is for the users to be able to view their schedules via internet. I am currently building the page where the users view their schedule, and what I have done is create a select option in it that triggers a jquery function (that does an ajax request) when the value is changed. The requested page is then displayed on a div in the current page. The problem is, when I try to change the value of a select option, the page occasionally displays a huge white blank on top of my whole page. I don't know what triggers the bug since it only happens occasionally, not every time. When i reload the page, the white space disappears. I have been searching for answers everywhere and did not get one that fits my problem. This is the page before the white space shows up https://lh6.googleusercontent.com/-rb0XXjcpn6w/UPiwjIY92OI/AAAAAAAAABo/BmiDIbZWcxU/s640/before.jpg This is the page when the white space shows up https://lh3.googleusercontent.com/-RZxh2P3Bk0o/UPiwRv5oHHI/AAAAAAAAABc/VIB6LYvPBE4/s640/after.jpg I hope you guys can help me out... this is the code of the page.. <?php require_once("../includes/initialize.php"); $adminEmps = employee::find_by_cond("(department = 'ACADEMIC-TEACHING' or department = 'ACADEMIC-NON TEACHING') and emp_status='active' order by lastname asc"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Schedule</title> </head> <script type="text/javascript"> function selectEmp(){ $('#here').html("<img src=../Images/gif/loading14.gif' class='three columns centered'>"); $.post('viewSched.php','id='+$('#selector').val()+'&yr='+$('#yrselect').val(), function (response){ $('#here').html(response); }); } </script> <body> <?php include("AdminDropdown.php"); ?> <div class="row"> <div class="twelve columns"> <div class="row panel"> <h2><img src="../Images/Shedule.png" height="100px" width="100px" style="vertical-align:middle"/> Schedule </h2> <dl class="tabs pill"> <dd class="active">Academic</dd> <dd>Administrative</dd> <dd class="hide-for-small">OSAS</dd> </dl> </div> <ul class="tabs-content"> <li class="active" id="simple1Tab"> <div class="two columns"> Select Employee </div> <div class="three columns end"> <select id='selector' onchange="selectEmp()" > <option>--Select--</option> <?php foreach ($adminEmps as $key => $value) { echo "<option value={$value['emp_ID']}>{$value['lastName']}, {$value['firstName']} {$value['lastName']}</option>"; } ?> </select> </div> <div class='two columns'> </div> <div class='two columns' style='text-align:right;'> Select Year </div> <div class='three columns end'> <select id='yrselect' onchange="selectEmp()"> <option>-- Select --</option> <?php for ($i=2008; $i <= date('Y'); $i++) { $yr = $i + 1; echo "<option>{$i}-{$yr}</option>"; } ?> </select> </div> <br> <br> <div class="twelve columns "> <div class="nine columns centered"> <div id='here'> </div> </div> </div> </li> <li id="simple2Tab"></li> <li id="simple3Tab">This is simple tab 3s content.</li> </ul> </div> </div> <?php include("adminfooter.php"); ?> </body> </html> and this is the code of the requested page. <?php require_once('../includes/initialize.php'); $id = $_POST['id']; $yr = $_POST['yr']; $info = sched::find_scheds_by_id_yr($id,$yr); $display = "<table> <thead> <tr> <th>Day</th> <th>Time Start</th> <th>Time End</th> <th>Room</th> <th>Subject</th> </tr> </thead> <tbody> "; if($info){ foreach ($info as $key2 => $value2) { $display .= "<tr> <td>".$value2['day']."</td> <td> ".$value2['time_start']."</td> <td>{$value2['time_end']}</td> <td>{$value2['room']}</td> <td>{$value2['Subject_description']}</td> </tr>"; } } $display.="</tbody> </table>"; ?> <html> <head><title></title></head> <body> <?php echo $display; ?> </body> </html> By the way this only happens in google chrome.
Going by your source files, the only javascript visible changes the content of the #here div, to a loading image inside an img tag, or to the result of the AJAX call. Since nothing but this div seems to be changing, you should take a look at the css and see if its correctly handling a div with dynamic content (i.e, a div whose contents will be changing in size). Look for how it's being positioned/sized, and how you're handling the overflow property.
PHP display content based on day and timeframe
I need to display the ON AIR CONTENT every Friday at 9pm and then stop at 12am and revert back to the OFF AIR CONTENT. Below are the 2 sets of code that I manually change to make this possible. If I get the right code I can automate this. Can anyone help me? /* ON AIR CONTENT*/ function banner_rotator() { if (is_home()) { ?> <div id="rotator"><iframe width="630" height="386" src="http://www.ustream.tv/embed/8805257?v=3&wmode=direct?autoplay=true" scrolling="no" frameborder="0" style="border: 0px none transparent;"> </iframe> <?php if(function_exists('vslider')){ vslider('frontpage'); } ?></div> <div class="main"> <!-- FIFTH EXAMPLE --> <div class="view view-fifth"> <img src="../1.jpg" /> <div class="mask"> <h2>FULLY LOADED 2012</h2> <p>This event has been cancelled.</p> Details </div> </div> <div class="view view-fifth"> <img src="../2.jpg" /> <div class="mask"> <h2>KAFINAL - FALLING IN LOVE</h2> <p>"The feedback to Falling in Love has been tremendous all over. I am getting calls from people in Jamaica, the Caribbean and even in the States...</p> Read More </div> </div> </div> <?php } } add_action('thesis_hook_before_content', 'banner_rotator'); _____________________________________________________________________________________ /* OFF AIR CONTENT */ function banner_rotator() { if (is_home()) { ?> <div id="rotator"> <?php if(function_exists('vslider')){ vslider('frontpage'); } ?></div> <div class="main"> <!-- FIFTH EXAMPLE --> <div class="view view-fifth"> <img src="../1.jpg" alt="FULLY LOADED 2012" title="FULLY LOADED 2012" /> <div class="mask"> <h2>FULLY LOADED 2012</h2> <p>This event has been cancelled.</p> Details </div> </div> <div class="view view-fifth"> <img src="../2.jpg" alt="KAFINAL - FALLING IN LOVE" title="FULLY LOADED 2012" /> <div class="mask"> <h2>KAFINAL - FALLING IN LOVE</h2> <p>"The feedback to Falling in Love has been tremendous all over. I am getting calls from people in Jamaica, the Caribbean and even in the States...</p> Read More </div> </div> </div> <?php } } add_action('thesis_hook_before_content', 'banner_rotator');
The PHP date("G") function will give you the time in 24 hour format as a string. You may then test that and make whatever decisions you would like.