Expanding a table using checkbox - php

<script type='text/javascript' src='http://code.jquery.com/jquery-1.4.2.js'></script>
<script type='text/javascript'>
$(window).load(function () {
$('.varx').click(function () {
$(".text").toggle(this.checked);
$(".text1").toggle(this.checked);
$(".text2").toggle(this.checked);
$(".text3").toggle(this.checked);
});
});
</script>
<table border='1'>
<?php for ($i=1; $i<=5; $i++){ ?>
<tr>
<td>
<input type='checkbox' class='varx' />
</td>
<td>aaa</td>
<td>bbb</td>
<td>ccc</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>ddd</td>
<td>eee</td>
<td>fff</td>
</tr>
<tr>
<td class='text3' colspan='4' style='display:none'></td>
<td class='text3' style='display:none'>aaa</td>
<td class='text2' style='display:none'>bbb</td>
<td class='text1' style='display:none'>ccc</td>
<td class='text' style='display:none'>ddd</td>
<td class='text3' colspan='3' style='display:none'></td>
</tr>
<?php } ?>
</table>
This is running code, actually it is not a for ($i=1; $i<=5; $i++) it is foreach($items as $i). I decided to make it a for loop so that you can test it w/o database. My problem is, when I check one checkbox, all of the rows will expand and that is not right. What I need is when I check one checkbox, only one row only will expand.
Thanks for all of your help.

You only specified a class selector for the toggle commands. So of course it will toggle all the elements of this class.
Try this instead
$('.varx').click(function () {
var $theNextRow = $(this).parents('tr').eq(0).next();
$theNextRow.find(".text").toggle(this.checked);
$theNextRow.find(".text1").toggle(this.checked);
$theNextRow.find(".text2").toggle(this.checked);
$theNextRow.find(".text3").toggle(this.checked);
});

I have done complete solution bin for above issue. please check demo link as below:
Demo: http://codebins.com/bin/4ldqp7q
HTML
<table class="table" cellspacing="0" cellpadding="0">
<tr>
<th>
Choice
</th>
<th>
Col-1
</th>
<th>
Col-2
</th>
<th>
Col-3
</th>
<th>
Col-4
</th>
<th>
Col-5
</th>
<th>
Remove
</th>
</tr>
<tr>
<td>
<input type="checkbox" class="varx"/>
</td>
<td>
data-1
</td>
<td>
data-2
</td>
<td>
data-3
</td>
<td>
data-4
</td>
<td>
data-5
</td>
<td>
</td>
</tr>
<tr>
<td>
<input type="checkbox" class="varx"/>
</td>
<td>
data-21
</td>
<td>
data-22
</td>
<td>
data-23
</td>
<td>
data-24
</td>
<td>
data-25
</td>
<td>
</td>
</tr>
<tr>
<td>
<input type="checkbox" class="varx"/>
</td>
<td>
data-31
</td>
<td>
data-32
</td>
<td>
data-33
</td>
<td>
data-34
</td>
<td>
data-35
</td>
<td>
</td>
</tr>
</table>
jQuery
$(function() {
$(".varx").change(expandRow);
});
function expandRow() {
if ($(this).is(":checked")) {
var TrClone = $(this).closest("tr").clone();
$(TrClone).find("td:last").html("<input type='checkbox' class='remove'/>");
$(TrClone).insertAfter($(this).closest("tr"));
$(TrClone).find(".varx").removeAttr("checked");
$(TrClone).find(".varx").bind('change', expandRow);
$(TrClone).find(".remove").bind('change', removeRow);
}
}
function removeRow() {
if ($(this).is(":checked")) {
$(this).closest("tr").remove();
if ($(".table").find(".remove").length <= 0) {
$(".varx").removeAttr("checked");
}
}
}
CSS
.table{
width:70%;
border:1px solid #555;
}
.table th{
background:#dcacaa;
border-bottom:1px solid #555;
}
.table td{
text-align:center;
background:#c3cafd;
}
Demo: http://codebins.com/bin/4ldqp7q

Related

Table griding HTML2PDF

I want to generate HTML table into PDF.
But I'm having trouble for gridding the table. I want to generate table like this:
I have this table from database:
Which is should fill this column:
and I have a second table from database like this:
which is should fill the rest of the columns except keterangan column.
I tried this code :
<table class="tbl" border="1" style="margin: 0 auto;">
<tr style="height: 50px;">
<th rowspan="2" style="width: 50%">Nomor</th>
<th colspan="4">Pemberian entertaiment dan sejenisnya</th>
<th colspan="4">Relasi usaha yang diberikan entertainment dan sejenisnya</th>
<th rowspan="2">Keterangan</th>
</tr>
<tr>
<th>Tanggal</th>
<th>Alamat</th>
<th>Jenis</th>
<th>Jumlah</th>
<th>Nama</th>
<th>Posisi</th>
<th>Nama Perusahaan</th>
<th>Jenis Usaha</th>
</tr>
<tr>
<td>
<?PHP echo $row->nomor?>
</td>
<td>
<?PHP echo $row->tanggal?>
</td>
<td>
<?php echo $row->alamat?>
</td>
<td>
<?PHP echo $row->jenis?>
</td>
<td>
<?PHP echo $row->jumlah?>
</td>
<?php
foreach ($list->result() as $data){
?>
<tr>
<td>
<?PHP echo $data->nama?>
</td>
<td>
<?PHP echo $data->posisi?>
</td>
<td>
<?PHP echo $data->nama_perusahan?>
</td>
<td>
<?PHP echo $data->jenis_usaha?>
</td>
</tr>
<?php
}
?>
<td>
<?PHP echo $row->keterangan?>
</td>
</tr>
but this is the result :
Try this:
<table class="tbl" border="1" style="margin: 0 auto;">
<tr style="height: 50px;">
<th rowspan="2" style="width: 50%">Nomor</th>
<th colspan="4">Pemberian entertaiment dan sejenisnya</th>
<th colspan="4">Relasi usaha yang diberikan entertainment dan sejenisnya</th>
<th rowspan="2">Keterangan</th>
</tr>
<tr>
<th>Tanggal</th>
<th>Alamat</th>
<th>Jenis</th>
<th>Jumlah</th>
<th>Nama</th>
<th>Posisi</th>
<th>Nama Perusahaan</th>
<th>Jenis Usaha</th>
</tr>
<tr>
<td>
<?PHP echo $row->nomor?>
</td>
<td>
<?PHP echo $row->tanggal?>
</td>
<td>
<?php echo $row->alamat?>
</td>
<td>
<?PHP echo $row->jenis?>
</td>
<td>
<?PHP echo $row->jumlah?>
</td>
<?php
foreach ($list->result() as $data){
?>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td>
<?PHP echo $data->nama?>
</td>
<td>
<?PHP echo $data->posisi?>
</td>
<td>
<?PHP echo $data->nama_perusahan?>
</td>
<td>
<?PHP echo $data->jenis_usaha?>
</td>
</tr>
<?php
}
?>
<td>
<?PHP echo $row->keterangan?>
</td>
</tr>
Note the extra columns are added inside the loop to enable it to line up with you headers.

Fixed the table header with a scrolling panel

I know this is a duplicate question and I've tried every possible solution but not succeeded. I am using a panel in which my excel data is showing and I wanna fix the column in other words header. Every css I've tried break the panel settings and I didn't succeed. I'm using bootstrap css & have more than 1000 rows that's why I need a fixed header.
This is my HTML
<div class="panel panel-primary">
<div class="panel-heading">Excel Sheet</div>
<div class="panel-body">
<?php
echo '<table class="table table-striped table-hover table-condensed">';
echo "<thead class='thead'>";
echo "<tr class='info'>";
for ($column = 'A'; $column < $lastcol; $column++) {
echo "<th>";
echo $worksheet->getCell($column . '1')->getFormattedValue();
echo "</th>";
}
echo "</tr>";
echo '</thead>';
echo '<tbody>';
for ($row = 2; $row <= $lastrow; $row++) {
echo "<tr>";
for ($column = 'A'; $column < $lastcol; $column++) {
echo "<td>";
echo $worksheet->getCell($column . $row)->getFormattedValue();
echo "</td>";
}
echo "</tr>";
}
echo '</tbody>';
echo "</table>";
?>
</div>
</div>
Here is column and row 1 are for loop, which will give the header. I have used integrated php-html. Other rows will appear in row for loop.
this is my css and commented code is last code i have tried.
.panel-heading{
font-size: 15px;
}
.panel-body{
overflow:auto;
height:400px;
}
tr{
border: 1px solid black;
}
th{
border: 1px solid black;
}
td{
border: 1px solid black;
}
example fiddle is Here
P.S : Please dont forget to place a comment in case of negative vote for helping me . Cheers !
Try adding the below CSS to your .panel-primary:
.panel-primary{
top: 0;
}
This should do it.
Hope it helps.
You can make this with Jquery. I check the width of each first td for define each th width.
$(document).ready(function(){
resized();
})
$(window).resize(function(){
resized()
})
function resized(){
var widthTd1 = $("td:eq(0)").width();
var widthTd2 = $("td:eq(1)").width();
var widthTd3 = $("td:eq(2)").width();
var TDPadding = 11; // = padding + border
var widthTH1 = widthTd1 + TDPadding;
var widthTH2 = widthTd2 + TDPadding;
var widthTH3 = widthTd3 + TDPadding;
$("th:eq(0)").css({width:widthTH1 })
$("th:eq(1)").css({width:widthTH2 })
$("th:eq(2)").css({width:widthTH3 })
}
$(".panel-body").on("scroll",function(){
$(".info").offset({top:58})
})
.panel-primary {
top: 0;
}
.panel-heading {
font-size: 15px;
}
.panel-body {
overflow: auto;
height: 400px;
padding:0 !important;
margin:15px
}
.info{
position:absolute;
left:-1px;
}
.table{
position:relative;
}
tbody::before {
content: "-";
display: block;
line-height: 2em;
}
th {
border: 1px solid black;
}
td {
border: 1px solid black;
}
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="panel panel-primary">
<div class="panel-heading">Excel Sheet</div>
<div class="panel-body">
<table class="table table-striped table-hover table-condensed">
<thead class='thead'>
<tr class='info'>
<th>
Qc Code
</th>
<th>
Sample ID
</th>
<th>
Date
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
<tr>
<td>
SE68
</td>
<td>
GC57052
</td>
<td>
1/2/15 17:24
</td>
</tr>
</tbody>
</table>
</div>
</div>

how to use sql query result in html table

I am trying to create a html table showing results from php sql query. it is a result page of students php code is as under
$r1=$_GET["r"];
$con=mysqli_connect(localhost,chumspai_tlss,Tls121,chumspai_tlsResult);
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM nursery_blue_ WHERE sr_='$r1'");
while($row = mysqli_fetch_array($result))
{
html code is
<pre>
<form name="frmResult" id="frmResult" action="" method="post" onsubmit="return checkEmpty();">
<table width="80%" cellpadding="5" cellspacing="5" border="0">
<tr>
<td class="heading noborder">Enter Your Roll Number:</td>
<td class="noborder"><input type="text" id="r" name="r" value="" /></td>
</tr>
<tr>
<!--
<td class="heading noborder">Enter Your Name:</td>
<td class="noborder"><input type="text" id="name" name="name" value="" /></td>
</tr>
<tr>
<td class="heading noborder">Search by</td>
<td class="noborder"><input type="radio" id="option" name="option" value="rno" checked="checked" />
Roll No
<input type="radio" id="option" name="option" value="name" />
Name </td>
</tr>
-->
<tr>
<td class="noborder"> </td>
<td class="noborder"><input type="submit" name="submit" value="Search" />
<input type="reset" name="reset" value="Clear" />
</td>
</tr>
<!--<tr>
<td colspan="2"> <embed src="images/wait.swf"></embed></td>
</tr> -->
</table>
</form>
<div style="border:1px solid #000000;">
<table width="100%" cellpadding="10" cellspacing="0" border="0">
<tr>
<td class="heading grey" width="30%">RNO</td>
<td><?php
Print $row['sr_'];
?>
</td>
</tr>
<tr>
<td class="heading grey">NAME</td>
<td class="shade"></td>
</tr>
<tr>
<td class="heading grey">FATHER</td>
<td></td>
</tr>
<tr>
<td class="heading grey">regno</td>
<td></td>
</tr>
</table>
<table width="100%" cellpadding="10" cellspacing="0" border="0">
<tr class="grey">
<td rowspan="2" class="heading">Sr.no </td>
<td rowspan="2" class="heading">Name of subject </td>
<td rowspan="2" class="heading">Maximum Marks</td>
<td colspan="7" class="heading">detail of marks Obtained</td>
<tr class="grey">
<td class="heading">PART ONE</td>
<td class="heading">Total</td>
</tr>
<tr>
<td>1</td>
<td>Urdu</td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr class="shade">
<td>2</td>
<td>English</td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr>
<td>3</td>
<td>Islamyat</td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr class="shade">
<td>4</td>
<td>pakstudies</td>
<td></td>
<td> </td>
<td></td>
</tr>
<tr class="shade">
<td>6</td>
<td></td>
<td></td>
<td></td>
<td>0</td>
</tr>
<tr>
<td>7</td>
<td></td>
<td></td>
<td></td>
<td>0</td>
</tr>
<tr class="shade">
<td>8</td>
<td></td>
<td></td>
<td></td>
<td>0</td>
</tr>
<tr class="shade">
<td>9</td>
<td></td>
<td></td>
<td></td>
<td>0</td>
</tr>
<tr class="grey">
<td colspan="2" class="heading">TOTAL</td>
<td class="heading">1100</td>
<td colspan="4" class="heading"></td>
</tr>
<tr class="grey">
<td colspan="3" class="heading">NOTIFICATION</td>
<td class="heading"></td>
<td class="heading"></td>
<td colspan="2" class="heading"></td>
</tr>
<tr>
<td colspan="7">(i) This provisional result intimation is issued as a notice only. Errors and omissions are excepted.</td>
</tr>
</table>
</pre>
please help me how to embed this php query with this html table and html form also.
you are not so far.
The variable $row is an array containing your data. Try this to see it's structure in your while call:
print_r($row);
Using this command you will see the name of each item of your array. Note it somewhere. Then you can do something like this:
...<td><?php echo $row['desired_column_name']; ?></td>...
If you receive data from your mysql query, this should do the trick.
Hope it helps,
Paul
Try This :
$result = mysql_query("select * from emp");
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td id=SrNo$cnt >".$row['eno']."</td>";
echo "<td id=ItemId$cnt >".$row['eId']."</td>";
echo "<td>". "<button name='Update' id='update' onclick='show(".$cnt.")'>UPDATE</button>"."</td>";
echo "<td>". "<button name='Report' id='show' onclick='Report(".$row['SrNo'].")'>REPORT</button>"."</td>";
echo "</tr>";
echo "<div id=show$cnt>";
echo "</div>";
$cnt++;
}

adding new rows in table using ajax

i'm trying to get next rows in my multiple table using ajax and php. my concept is that on changing my year and type selection, table has to re_appears.
if i change type as year third table hides and if semester third table appears. it works fine,. but if i change no of year table rows also have to added according to that.
for example if no of years 4 means then i have to get fou rows in each table.
i dono where i struck here?
my code:
<table>
<tr><td><label><span class="required">*</span>No of Year</label></td>
<td>
<select name="no_of_year" id="no_no_year" onchange="change_row()">
<option value="">--Year--</option>
<?php for($i=1;$i<=$year;$i++) { ?>
<option value="<?php echo $i; ?>" <?php if($_POST['no_of_year']==$i) { echo "selected"; } ?>><?php echo $i; ?></option>
<?php } ?>
</select> <span class="required"><?php echo $msg_year;?></span>
</td>
</tr>
<tr> <td><label><span class="required">*</span>Type</label> </td>
<td><select name="type" onchange="change_col(this.value);"><option value="">--Type--</option> <option value="2" <?php if($_POST['type']=='2') { echo "selected"; } ?>>Semester</option> <option value="1" <?php if($_POST['type']== '1') { echo "selected"; } ?>> Year </option> </select>
<span class="required"><?php echo $msg_type;?></span></td></tr>
<tr> <td><label><span class="required">*</span>Fees Per Year/Semester:</label> </td> </tr>
<tr>
<table class="fees_dets" border="1px solid" cellpadding="1" cellspacing="1">
<tr>
<td>
<table id="year_tab" cellpadding="1" cellspacing="1">
<tr style="height:37px;"> <th > Year </th> </tr>
<tr> <td align="center"> <input type="text" name="year1" value="1" /> </td> </tr>
</table>
</td>
<td>
<table id="sem1_tab" cellpadding="1" cellspacing="1">
<tr> <th colspan="2"> Semester-1 </th> </tr>
<tr> <th> Due date</th> <th > Fees</th> </tr>
<tr> <td > <input type="text" name="y1_fees1" /> </td><td> <input type="text" name="y1_due1" /> </td> </tr>
</table>
</td>
<td id="donshow">
<table id="sem2_tab" cellpadding="1" cellspacing="1">
<tr> <th colspan="2" > Semester-2</th> </tr>
<tr> <th> Due date</th> <th > Fees</th> </tr>
<tr> <td > <input type="text" name="y1_fees2" /> </td><td > <input type="text" name="y1_due2" /> </td> </tr>
</table>
</td>
</tr>
</table>
</tr>
</table>
script:
<script type="text/javascript">
function change_col(type)
{
if(type == 1 ) {
document.getElementById("donshow").style.display = 'none';
}
else if(type == 2 ) {
document.getElementById("donshow").style.display = 'block';
}
}
function change_row(year)
{
$.ajax({
type: 'POST',
url: 'ajax_redirect.php',
data:{
type : 'year_tab',
year : year
},
success: function(msg){
//alert(msg);
document.getElementByClassName('fees_dets').innerHTML = msg;
}
});
}
</script>
ajax_redirect.php
<?
$n= $_POST['year'];
if($_POST['type'] == 'year_tab')
{
for($i=2;$i<=$n;$i++)
{
?>
<table class="fees_dets" border="1px solid" cellpadding="1" cellspacing="1">
<tr>
<td>
<table id="year_tab" cellpadding="1" cellspacing="1">
<tr style="height:37px;"> <th > Year </th> </tr>
<tr> <td align="center"> <input type="text" name="year<?=$i?>" value="<?=$i?>" /> </td> </tr>
</table>
</td>
<td>
<table id="sem1_tab" cellpadding="1" cellspacing="1">
<tr> <th colspan="2"> Semester-1 </th> </tr>
<tr> <th> Due date</th> <th > Fees</th> </tr>
<tr> <td > <input type="text" name="y<?=$i?>_fees1" /> </td><td> <input type="text" name="y<?=$i?>_due1" /> </td> </tr>
</table>
</td>
<td id="donshow">
<table id="sem2_tab" cellpadding="1" cellspacing="1">
<tr> <th colspan="2" > Semester-2</th> </tr>
<tr> <th> Due date</th> <th > Fees</th> </tr>
<tr> <td > <input type="text" name="y<?=$i?>_fees2" /> </td><td > <input type="text" name="y<?=$i?>_due2" /> </td> </tr>
</table>
</td>
</tr>
</table>
<? }
}
?>
can anyone help?
You need to hit the ajax_redirect.php every time you change the 'no. of years', your ajax_redirect.php must execute the select query to associated table with changing where clause. Whatever HTML element you are using, must be replaced with new value(s) accordingly.
NOTE: Here I assume you are fetching data from DB thats why I have
asked you to use select query on asssociated table with changing where
clause.
UPDATE: Your Problem is with document.getElementByClassName('fees_dets') because there no such function as getElementByClassName... you should your table in a DIV with a attribute ID and use getElementById

Printing website correctly

I am trying to make a website that reads from a csv file and render the data on the screen in a printable format (it is for printing tickets). The page creates 2 tickets per row and loops threw until it runs out of data. It all works perfectly and looks just the way i want it but, when i print it the 3rd row down has one of the rows of text move up onto the line above it. My question is how can i make it print the way it is seen on the screen and why would it screw up only the 3rd row when all rows are made with the same code.
Thanks
EDIT:
while (!feof($file_handle)){`
$csvText = fgetcsv($file_handle, 1024);
$username = $csvText[1];
$password = $csvText[2];
$profile = $csvText[3];
$daysValid = $csvText[4];
$expiry = $csvText[5];
if($pos == 0)
{
if($count == 5){
echo "<p><br /></p>";
$count = 0;
}else{
$count++;
}
echo "<div class='itemRow'>";
echo "<div class='left'>";
$pos = 1;
?>
<h4 class="centre">Internet Access Voucher</h4>
<img class="image" src="./icon.jpg" />
<div class="info">
<table>
<tr>
<td>
Username
</td>
</tr>
<tr>
<td>
Password
</td>
</tr>
<tr>
<td>
Profile
</td>
</tr>
<tr>
<td>
Valid for
</td>
</tr>
<tr>
<td>
Expiry date
</td>
</tr>
</table>
</div>
<div class="uniqueInfo">
<table>
<tr>
<td>
<?php echo $username;?>
</td>
</tr>
<tr>
<td>
<?php echo $password;?>
</td>
</tr>
<tr>
<td>
<?php echo $profile;?>
</td>
</tr>
<tr>
<td>
<?php echo $daysValid;?>
</td>
</tr>
<tr>
<td>
<?php echo $expiry;?>
</td>
</tr>
</table>
</div>
<p class="centre"><br />Please remember to disconnect to stop each session.</p>
</div>
<br />
<?php
} else {
?>
<div class="right">
<h4 class="centre">Internet Access Voucher</h4>
<img class="imageRight" src="./icon.jpg" />
<div class="infoRight">
<table>
<tr>
<td>
Username
</td>
</tr>
<tr>
<td>
Password
</td>
</tr>
<tr>
<td>
Profile
</td>
</tr>
<tr>
<td>
Valid for
</td>
</tr>
<tr>
<td>
Expiry date
</td>
</tr>
</table>
</div>
<div class="uniqueInfoRight">
<table>
<tr>
<td>
<?php echo $username;?>
</td>
</tr>
<tr>
<td>
<?php echo $password;?>
</td>
</tr>
<tr>
<td>
<?php echo $profile;?>
</td>
</tr>
<tr>
<td>
<?php echo $daysValid;?>
</td>
</tr>
<tr>
<td>
<?php echo $expiry;?>
</td>
</tr>
</table>
</div>
<p class="centre"><br />Please remember to disconnect to stop each session.</p>
</div>
</div>
<?php
$pos = 0;
}
}
?>
CSS
.centre
{
text-align:center;
}
.itemRow
{
position:relative;
top:0px;
}
.left
{
width:500px;
position:relative;
font-family:Comic Sans, Comic sans MS, cursive;
/*border-style:solid;
border-width:1px;*/
}
.right
{
width:500px;
position:absolute;
left:600px;
top:-20px;
font-family:Comic Sans, Comic sans MS, cursive;
/*(border-style:solid;
border-width:1px;*/
}
.image
{
position:absolute;
top:70px;
}
.info
{
position:relative;
left:63px;
}
.uniqueInfo
{
position:absolute;
left:250px;
top:42px;
}
.infoRight
{
position:relative;
left:63px;
top:0px;
}
.uniqueInfoRight
{
position:absolute;
left:250px;
top:65px;
}
.imageRight
{
position:absolute;
top:90px;
}
I suspect this might be the problem:
if($count == 5){
echo "<p><br /></p>";
You have 2 per row, and increment $count after every ticket. So, $count = 5 would be after the fourth ticket, or when the third row starts. A sample HTML page would give me a better idea of what's going on exactly, but I'd suggest doing something like
<br style="clear: both;" />
between the rows to split them cleanly. So before ticket 3 and 5 ($count = 3 and $count = 5).

Categories