PDA

View Full Version : Lost in php


JoeH
11-22-2016, 09:19 AM
Hi,

Hope you can help please. I inherited some great PHP scripts that work on a website. I've recently given the site and make over and now i have 'issues' - which i need some advice on please.

Here -you will see that with some very clever PHP database work. It lists links to various product data sheets by brands. On this page the brands listed down the left hand side look higher than all the others.

Here - provis the brands on the page look better - all level - but I've lost some. For example no Addlestone, Bosch, FLIR and GJD.

I guess that the php files in the background are working fine as it's showing most of the brand name and the links work. So what have i done to make solve the appearance issue but lose some of the brand names. Hope you experts can help please.

Many thanks.

Joe.
--

edbr
11-22-2016, 01:48 PM
i deleted the links as they dont help. if the php file are different or the databsses then thats what needs to be addressed. so if you need help,you shpuld look or post the differing files

JoeH
11-22-2016, 03:29 PM
Hi, many thanks for your reply - is this what you mean/need? This is the script that shows all the brand - but the left hand
ones do not sit correctly.


<div class="container">
<div class="page-header">
<h1>Pro-Vision brands</h1>
<div class="headerdivider">
</div>
</div>
<div class="row">
<div class="col-md-12">
<p>To access manufacturers data sheets<br/><br/>click on the logo below or the company name</p>
</div>

<div class="container">
<?php
$man = DB_DataObject::factory('Manufacturers');
$man->enable = 1;
$man->orderBy('name');
$man->find();
while($man->fetch())
{

?>
<table class="table table-bordered"><table width="950">
<tr>
<th width="170" scope="col">&nbsp;</th>
<th width="20" scope="col">&nbsp;</th>
<th width="170" scope="col">&nbsp;</th>
<th width="20" scope="col">&nbsp;</th>
<th width="170" scope="col">&nbsp;</th>
<th width="20" scope="col">&nbsp;</th>
<th width="170" scope="col">&nbsp;</th>
<th width="20" scope="col">&nbsp;</th>
<th width="170" scope="col">&nbsp;</th>
<th width="20" scope="col">&nbsp;</th>
</tr>
<tr>
<td height="159">
<?php echo "<a href='pdfList.php?mid=$man->id'>";
echo "<img src='image.php?tbl=manufacturers&id=$man->id' border='0' width='110'>";
echo "</a>";
?>
<br/>
<?php
echo "<a href='pdfList.php?mid=$man->id'>";
echo stripSlashes($man->name);

echo "</a>";
?></td>
<td>&nbsp;</td>
<td>
<?php
if($man->fetch()){
?>
<br/>
<?php echo "<a href='pdfList.php?mid=$man->id'>";
echo "<img src='image.php?tbl=manufacturers&id=$man->id' border='0' width='110'>";
echo "</a>";
?>
<br/>
<?php
echo "<a href='pdfList.php?mid=$man->id'>";
echo stripSlashes($man->name);


echo "</a>";
?><br/>
<?php
}
?> </td>
<td>&nbsp;</td>
<td><?php
if($man->fetch()){
?>
<br/>
<?php echo "<a href='pdfList.php?mid=$man->id'>";
echo "<img src='image.php?tbl=manufacturers&id=$man->id' border='0' width='110'>";
echo "</a>";
?>
<br/>
<?php
echo "<a href='pdfList.php?mid=$man->id'>";
echo stripSlashes($man->name);


echo "</a>";
?><br/>
<?php
}
?> </td>
<td>&nbsp;</td>
<td><?php
if($man->fetch()){
?>
<br/>
<?php echo "<a href='pdfList.php?mid=$man->id'>";
echo "<img src='image.php?tbl=manufacturers&id=$man->id' border='0' width='110'>";
echo "</a>";
?>
<br/>
<?php
echo "<a href='pdfList.php?mid=$man->id'>";
echo stripSlashes($man->name);


echo "</a>";
?><br/>
<?php
}
?> </td>
<td>&nbsp;</td>
<td><?php
if($man->fetch()){
?>
<br/>
<?php echo "<a href='pdfList.php?mid=$man->id'>";
echo "<img src='image.php?tbl=manufacturers&id=$man->id' border='0' width='110'>";
echo "</a>";
?>
<br/>
<?php
echo "<a href='pdfList.php?mid=$man->id'>";
echo stripSlashes($man->name);


echo "</a>";
?><br/>
<?php
}
?> </td>
<td>&nbsp;</td>
</tr>
<tr>
<td><br/></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<?php
}
?>
<br/><br/>


</div>
</div>
</div>


This is the script that sits better - but does not 'find' all the brands. There is a difference with the script after the table widths
it includes this extra coding - but i don't know what it means or if this is the element that is causing the problem:-

The extra script reads:

<?php
if($man->fetch()){
?>
<br/>
________

<div class="container">
<div class="page-header">
<h1>Pro-Vision brands</h1>
<div class="headerdivider">
</div>
</div>
<div class="row">
<div class="col-md-12">
<p>To access manufacturers data sheets<br/><br/>click on the logo below or the company name</p>
</div>

<div class="container">
<?php
$man = DB_DataObject::factory('Manufacturers');
$man->enable = 1;
$man->orderBy('name');
$man->find();
while($man->fetch())
{

?>
<table class="table table-bordered"><table width="950">
<tr>
<th width="170" scope="col">&nbsp;</th>
<th width="20" scope="col">&nbsp;</th>
<th width="170" scope="col">&nbsp;</th>
<th width="20" scope="col">&nbsp;</th>
<th width="170" scope="col">&nbsp;</th>
<th width="20" scope="col">&nbsp;</th>
<th width="170" scope="col">&nbsp;</th>
<th width="20" scope="col">&nbsp;</th>
<th width="170" scope="col">&nbsp;</th>
<th width="20" scope="col">&nbsp;</th>
</tr>
<tr>
<td height="159"><?php
if($man->fetch()){
?>
<br/>
<?php echo "<a href='pdfList.php?mid=$man->id'>";
echo "<img src='image.php?tbl=manufacturers&id=$man->id' border='0' width='110'>";
echo "</a>";
?>
<br/>
<?php
echo "<a href='pdfList.php?mid=$man->id'>";
echo stripSlashes($man->name);

echo "</a>";
?></td>
<td>&nbsp;</td>
<td>
<?php
if($man->fetch()){
?>
<br/>
<?php echo "<a href='pdfList.php?mid=$man->id'>";
echo "<img src='image.php?tbl=manufacturers&id=$man->id' border='0' width='110'>";
echo "</a>";
?>
<br/>
<?php
echo "<a href='pdfList.php?mid=$man->id'>";
echo stripSlashes($man->name);


echo "</a>";
?><br/>
<?php
}
?> </td>
<td>&nbsp;</td>
<td><?php
if($man->fetch()){
?>
<br/>
<?php echo "<a href='pdfList.php?mid=$man->id'>";
echo "<img src='image.php?tbl=manufacturers&id=$man->id' border='0' width='110'>";
echo "</a>";
?>
<br/>
<?php
echo "<a href='pdfList.php?mid=$man->id'>";
echo stripSlashes($man->name);


echo "</a>";
?><br/>
<?php
}
?> </td>
<td>&nbsp;</td>
<td><?php
if($man->fetch()){
?>
<br/>
<?php echo "<a href='pdfList.php?mid=$man->id'>";
echo "<img src='image.php?tbl=manufacturers&id=$man->id' border='0' width='110'>";
echo "</a>";
?>
<br/>
<?php
echo "<a href='pdfList.php?mid=$man->id'>";
echo stripSlashes($man->name);


echo "</a>";
?><br/>
<?php
}
?> </td>
<td>&nbsp;</td>
<td><?php
if($man->fetch()){
?>
<br/>
<?php echo "<a href='pdfList.php?mid=$man->id'>";
echo "<img src='image.php?tbl=manufacturers&id=$man->id' border='0' width='110'>";
echo "</a>";
?>
<br/>
<?php
echo "<a href='pdfList.php?mid=$man->id'>";
echo stripSlashes($man->name);


echo "</a>";
?><br/>
<?php
}
?> </td>
<td>&nbsp;</td>
</tr>
<tr>
<td><br/></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<?php
}
?>
<?php
}
?>
<br/><br/>


</div>
</div>
</div>

Thanks.


Joe.
--

edbr
11-22-2016, 03:43 PM
im not very familiar with PEAR framework but ill have a loom when im at a desktop tomorrow

edbr
11-23-2016, 02:32 AM
It looks you are selecting from table manufacturers with conditions by id matching $man so all i can suggest is checking your database as per ID are correct or try selecting without a condition.
PEAR is definitely not for me sorry best i can do.

This is odd to me, not sure why $man is specified as 1, might be some kind of PEAR magic though
$man->enable = 1;


also you have to check the object which i assume is the select statement
$man = DB_DataObject::factory('Manufacturers');

https://pear.php.net/manual/en/package.database.db-dataobject.intro-purpose.php

edbr
11-23-2016, 02:49 AM
another thing i would try, re table dimensions is just to eco the reults in a table without any sizes , you can then if all is good style the tables ( <tr><td> ) in a css class




[/CODE]

JoeH
11-23-2016, 02:43 PM
Excellent - many thanks for your time.

I'll take your advice and look into the elements you've identified.

Again, many thanks.

Joe.

edbr
11-24-2016, 01:56 AM
welcome , i would be interested to know how this develops. Even though i have avoided PEAR (except for trying the mail function ) it is interesting.