2013-02-21 1 views
0

로 변경되었습니다. 내게 정말 귀찮은 "오류"가 발생했습니다 ... 내 페이지의 헤더, 왼쪽 세로 막대 및 바닥 글이 있습니다. 양식을 제출 한 후에는 꼬리말이 페이지 중앙에있는 것을 제외하고는 모든 것이 정말 좋습니다! 내가 아는 모든 것을 시도하고 검색했지만 여전히 해결할 수는 없습니다. 전양식을 제출 한 후 내 바닥 글 위치가 PHP MYSQL

적절한 장소에 바닥 글과 함께 제출 : http://i48.tinypic.com/ly1dl.jpg
후 페이지의 중간에 바닥 글과 함께 제출 :

헤더 : 여기 http://i47.tinypic.com/168a3uq.jpg

는 코드

<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<link href="stylesheets/stylesheet.css" type="text/css" rel="stylesheet" /> 
<title>Wilson Electric & Alarm Company</title> 
</head> 
<body> 
<div id="header"> 
<h1 id="toptitle"> Wilson Electric & Alarm Company </h1> 
</div> 
<div id="navigation_top"> 
</div> 
<div id="column_left"> 
<ul id="left_menu"> 
<li> <a href="testing2.php"> Insert Page </a> </li> 
<li> <a href="search.php"> Search Page </a> </li> 
<li> <a href=""> Menu 4 </a> </li> 
<li> <a href=""> Menu 5 </a> </li> 
<li> <a href=""> Menu 6 </a> </li> 
<li> <a href="user.php"> User </a> </li> 
<li> <a href="admin.php"> Admin </a> </li> 
<li> <a href="login.php"> Login </a> </li> 
<li> <a href="create_username.php"> Create Username </a> </li> 
</ul> 
</div> 
<div id="content"> 

바닥 글 :

</div> 
<div id="footer"> 
This is a Footer. 
</div> 
</body> 
</html> 

스타일 시트 : (내 스타일 시트의 기본 리셋이 #container 전에도있다) 여기

#container { 
width:100%; 
height:100%; 
} 
#header { 
width: 100%; 
height:120px; 
} 
#column_left { 
float:left; 
width:15%; 
height:100%; 
border-right: 3px solid #06F; 
border-left: 3px solid #06F;  
} 
#content { 
width:100%; 
height:100%; 
} 

#footer { 

width:100%; 
height: 30px; 
border-top:3px solid #06F; 
} 
#navigation_top { 
width:100%; 
height:15px; 
border-bottom:3PX solid #06F; 
} 
#toptitle { 
padding:30px; 
font-size:300%; 
font-weight:700; 
} 
.formtitle { 
font-weight:800; 
font-size:150%; 
} 
#form { 
margin-left:230px; 
padding-top:30px; 
} 
table,th, td { 
border: 1px solid black; 
} 
table { 
width:1024px; 
} 
th { 
font-weight:800; 
background-color:#0FF; 
} 

그리고 나에게 그 문제를주고 페이지 코드입니다!

<?php require_once("includes/connection.php"); ?> 
<?php require_once("includes/functions.php"); ?> 
<?php 

if (isset($_POST['search'])) { 

$date1 = mysql_prep($_POST['date1']); 
$date2 = mysql_prep($_POST['date2']); 
$latte = mysql_prep($_POST['latte']); 
$coffee = mysql_prep($_POST['paid']); 

$query = "SELECT * 
      FROM payroll 
      WHERE (day BETWEEN '{$date1}' AND '{$date2}') 
      AND (company = '{$latte}') 
      AND (paid = '{$coffee}') 
      ORDER BY day ASC "; 

$result = mysql_query($query, $connection);  

$woof = "SELECT SUM(p.hours) AS sum_hours 
, COUNT(DISTINCT p.day) AS cnt_days 
FROM PAYROLL p 
WHERE p.day BETWEEN '{$date1}' AND '{$date2}' 
AND company = '{$latte}' 
AND paid = '{$coffee}' "; 

$raw = mysql_query($woof, $connection); 
if(!$raw) { die(mysql_error());} 
$meow = mysql_result($raw, 0, 0); 
$days = mysql_result($raw, 0, 1); 



if(!$result) { 
    echo "FAIL"; 
    } else { 

    $message = "<table> 
<tr> 
<th> Date </th> 
<th> Hours </th>  
<th> Job Title </th> 
<th> Job Description </th> 
<th> For </th> 
<th> Paid </th> 
</tr>"; 

while($row = mysql_fetch_array($result)) { 


$company = $row['company']; 

if($company == 0) { 
$company = "Wilson Electric"; 
} if($company == 1) { 
    $company = "Wilson Rental"; 
    } if ($company == 2) { 
     $company = "Church of Christ"; 
     } 

$paid = $row['paid']; 
    if($paid == 0) { 
     $paid = "Yes"; 
     } else { 
      $paid = "<form action=\"update.php\" method=\"post\" ><input type=\"checkbox\" name=\"paid\" value=\"0\"> NO "; 
      } 


$message .= "<tr>"; 
$message .= "<td class=\"center\">" . $row['day'] . "</td>"; 
$message .= "<td class=\"center\">" . $row['hours'] . "</td>"; 
$message .= "<td style=\"padding:5px;\">" . $row['job_title'] . "</td>"; 
$message .= "<td style=\"padding:5px;\">" . $row['job_description'] . "</td>"; 
$message .= "<td style=\"padding:5px;\">" . $company . "</td>"; 
$message .= "<td class=\"center\">" . $paid . "</td>"; 

$message .= "</tr>"; 
} 
$message .= "<tr>"; 
$message .= "<td class=\"center\"> Total Days: " . $days . "</td>"; 
$message .= "<td class=\"center\"> Total Hours: " . $meow . "</td>"; 
$message .= "<td class=\"center\"> &nbsp; </td>"; 
$message .= "<td class=\"center\"> &nbsp; </td>"; 
$message .= "<td class=\"center\"> &nbsp; </td>"; 
$message .= "<td class=\"center\"> <input type=\"submit\" name=\"gamind\" value=\"Update\"> </form> </td>"; 
$message .= "</tr>"; 
} 
} 


?> 
<?php include("includes/header.php"); ?> 
<form action="" method="post" id="form"> 
<h1 class="formtitle"> Search </h1> 
<br /> 

<table id="table1"> 
<th> From </th> 
<th> To </th> 
<th> For </th> 
<th> Paid </th> 
<tr> 
<td> 
<input type="date" name="date1" value="" > 
</td> 
<td> 
<input type="date" name="date2" value="" > 
</td> 
<td> 
<select name="latte" > 
<option value="0"> Wilson Electric </option> 
<option value="1"> Wilson Rental </option> 
<option value="2"> Church of Christ</option> 
</select> 
</td> 
<td> 
<input type="radio" name="paid" value="0"> Yes <br /> 
<input type="radio" name="paid" value="1"> No <br /> 
</tr> 
<tr> 
<td colspan="4" align="right"> <input type="submit" name="search" value="Search"> 
</td> 
</tr> 
</table> 

<br /> 
<br /> 
<p> 
<?php 
    if(!empty($message)) { 
     echo "<h1 class=\"formtitle\"> Payroll Result </h1>"; 
     echo $message; 
     } 
    ?> 
</p> 
</form> 
<?php include("includes/footer.php"); ?> 
    <?php mysql_close($connection); ?> 

죄송합니다. 누군가가 내 문제에 대한 해결책을 알고 있기를 바랍니다!

감사합니다. :)

+0

렌더링 된 마크 업의 유효성을 검사합니까? –

+0

@Waleed Khan : 그게 무슨 뜻인지 설명해 주시겠습니까? –

+1

Prob은 W3C html 유효성 검사기를 의미합니다. http://validator.w3.org/ 생성 된 html 코드를 확인하는 방법은 W3C 규칙에 따라 유효합니다. – Bridgey

답변

0

거기에 걸릴 여기에 코드를 많이하지만 나는 당신의 $ 메시지가 <TR>의 빌드 생각 ,하지만 당신은 $ 메시지를 에코 때 테이블 요소 내에 아니에요 ..?

+0

이미 테이블 안에 있습니다. $ 메시지는 모든 것을 함께 유지하기 위해 =.을 사용하여 만든 루옹 문자열입니다. $ message의 첫 번째 점은

입니다. 테이블이 잘 어울립니다. 바닥 글이 잘못된 곳에서 일어나는 것입니다. –

+0

오, 그래 - 방금

본 ...
tho를 볼 수 없습니까? – Bridgey

+0

OMG! 나는 어리 석다는 것을 믿을 수 없다 :(loong 포스트에 대해 유감스럽게 생각한다. 당신의 도움을 위해 정말로 고맙다 !! 단지를 추가했다. 그리고 모든 것은 멋지다! !! –

관련 문제