Jump to content

[SOLVED] Align not working , can anyone see my error?


Recommended Posts

Here is the main page code.

<?php
require('library/dbconfig.php');
require('library/byrndb_funcs.php');
$byrndb = new byrndb();
$page_title = "B.A.D.S. - Edit job record";
?>

<!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><?php echo $page_title; ?></title>

<link href="library/config.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="main">
  <div id="menu"><?php include('menu.php') ?></div>
  <div id="content-main">
    <div id="title"><?php include('title.php') ?></div>
    <div id="content">
    <form method="post">
    <table class="standard" width="770" border="0" align="center">
      <caption class="style1"><?php echo str_replace("B.A.D.S. - ","",strtoupper($page_title)); ?></caption>
      <tr>
        <td colspan="3" class="row_title"><div align="left">Fields marked with <span class="required_text">*</span> are required.</div></td>
        <td class="row_title"><div align="right"><a href="addjob.php" >ADD NEW JOB RECORD</a></div></td>
      </tr>
      <tr>
        <td colspan="4" class="row_title"><div align="center">Select a job from the list below</div></td>
      </tr>
      <tr>
        <td colspan="4" class="row_title"><div align="center">
          <?php
              if(!isset($_POST['load']) && !isset($_GET['job_id'])) {
                  $byrndb->job_list(2,$job);
              } elseif(isset($_POST['load'])) {
                  $job=$_POST['job'];
                  $byrndb->job_list(2,$job);
              } elseif(isset($_GET['job_id'])) {
                  $job=$_GET['job_id'];
                  $byrndb->job_list(2,$job);
              }
          ?>
        </div></td>
      </tr>
      <tr>
        <td colspan="4" class="row_title"><div align="center"><input name='load' type='submit' value='Load record' /></div></td>
      </tr>
      <tr>
        <td width="113"> </td>
        <td width="200" colspan="2" class="column_headers"><div align="center">Data to be edited</div></td>
        <td width="457" class="column_headers"><div align="center">Current data in the database record</div></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Job number<span class="required_text">*</span></div></td>
        <td align="left" colspan="2"><input name="job_number" type="text" tabindex="1" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,job_number); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Client<span class="required_text">*</span></div></td>
        <td align="left" colspan="3"><?php $byrndb->client_list(2,$client); ?></td>
      </tr>
      <tr>
        <td class="row_description" align="right" colspan="3">^Current client data-></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,client); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>County</div></td>
        <td align="left" colspan="2"><?php $byrndb->county_list(3); ?></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,county); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Job description</div></td>
        <td align="left" colspan="2"><input name="job_desc" type="text" tabindex="4" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,job_desc); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Job location</div></td>
        <td align="left" colspan="2"><input name="job_loc" type="text" tabindex="5" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,job_loc); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Survey 1</div></td>
        <td align="left" colspan="3"><?php $byrndb->survey_list(6,survey_id_1); ?></td>
      </tr>
      <tr>
        <td class="row_description" align="right" colspan="3">^Current survey_id_1 data-></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,survey_1); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Survey 2</div></td>
        <td align="left" colspan="3"><?php $byrndb->survey_list(6,survey_id_2); ?></td>
      </tr>
      <tr>
        <td class="row_description" align="right" colspan="3">^Current survey_id_2 data-></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,survey_2); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Survey 3</div></td>
        <td align="left" colspan="3"><?php $byrndb->survey_list(6,survey_id_3); ?></td>
      </tr>
      <tr>
        <td class="row_description" align="right" colspan="3">^Current survey_id_3 data-></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,survey_3); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Subdivision</div></td>
        <td align="left" colspan="3"><?php $byrndb->subdivision_list(9); ?></td>
      </tr>
      <tr>
        <td class="row_description" align="right" colspan="3">^Current subdivision data-></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,subdivision); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Section</div></td>
        <td align="left" colspan="2"><input name="section" type="text" tabindex="10" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,section); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Lot block</div></td>
        <td align="left" colspan="2"><input name="lot_blk" type="text" tabindex="11" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,lot_blk); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Field book and page</div></td>
        <td align="left" colspan="2"><input name="fb_pg" type="text" tabindex="12" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,fb_pg); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Field note date</div></td>
        <td align="left" colspan="2"><input name="fnd_date" type="text" tabindex="13" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,fnd_date); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Acerage</div></td>
        <td align="left" colspan="2"><input name="acerage" type="text" tabindex="14" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,acerage); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Type 1</div></td>
        <td align="left" colspan="3"><?php $byrndb->survey_list(15,type_id_1); ?></td>
      </tr>
      <tr>
        <td class="row_description" align="right" colspan="3">^Current type_id_1 data-></td>
        <td class="row_description" bgcolor=#ECC69F align=left"><?php $byrndb->current_job($job,type_1); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Type 2</div></td>
        <td align="left" colspan="3"><?php $byrndb->survey_list(16,type_id_2); ?></td>
      </tr>
      <tr>
        <td class="row_description" align="right" colspan="3">^Current type_id_2 data-></td>
        <td class="row_description" bgcolor=#ECC69F align=left"><?php $byrndb->current_job($job,type_2); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Type 3</div></td>
        <td align="left" colspan="3"><?php $byrndb->survey_list(17,type_id_3); ?></td>
      </tr>
      <tr>
        <td class="row_description" align="right" colspan="3">^Current type_id_3 data-></td>
        <td class="row_description" bgcolor=#ECC69F align=left"><?php $byrndb->current_job($job,type_3); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Memo info</div></td>
        <td align="left" colspan="2"><input name="memo_info" type="text" tabindex="18" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,memo_info); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Employee</div></td>
        <td align="left" colspan="2"><?php $byrndb->employee_list(19,$employee); ?></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,employee); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Volume and page</div></td>
        <td align="left" colspan="2"><input name="vol_pg" type="text" tabindex="20" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,vol_pg); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Estimate</div></td>
        <td align="left" colspan="2"><input name="estimate" type="text" tabindex="21" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,estimate); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Amount</div></td>
        <td align="left" colspan="2"><input name="amount" type="text" tabindex="22" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,amount); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Assignment date</div></td>
        <td align="left" colspan="2"><input name="assign_date" type="text" tabindex="23" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,assign_date); ?></td>
      </tr>
      <tr>
        <td class="row_title" align="right"><div>Completion date</div></td>
        <td align="left" colspan="2"><input name="completion_date" type="text" tabindex="24" /></td>
        <td class="row_description" bgcolor="#ECC69F" align="left"><?php $byrndb->current_job($job,completion_date); ?></td>
      </tr>
      <tr>
        <td align="center"> </td>
        <td align="center" colspan="2"><input name='editjob' type='submit' id='editjob' value='Submit new data' /></td>
        <td align="center"> </td>
      </tr>
      <tr>
        <td class="row_title" colspan="3" align="right">Function Status =></td>
        <td class="row_title" align="left">
          <?php
            if(isset($_POST['editjob'])) {
                include 'library/dbconfig.php';
                include 'library/opendb.php';
                
                //handling textboxes
                foreach (array('job_number','job_desc','job_loc','section','lot_blk','fb_pg','fnd_date','acerage','memo_info','vol_pg','estimate','amount','assign_date','completion_date') as $field1) {
                    if ($_POST[$field1]) {
                        $data[]=$field1. "=" ."'{$_POST[$field1]}'";
                    }
                }
                //handling dropdown lists
/*                foreach (array('client_id','county_id','survey_id_1','survey_id_2','survey_id_3','subdivision_id','type_id_1','type_id_2','type_id_3','employee_id') as $field2) {
                    if ($_POST[$field2]!="---Select---") {
                        $data[]=$field2. "=" ."'{$_POST[$field2]}'";
                    }
                }*/
                //insert data into table
                foreach ($data as $value) {
                    $updatedata="UPDATE byrnjobdb.jobs SET $value WHERE job_id=" .$job;
//                    mysql_query($updatedata) or die(mysql_error() .": $updatedata");
                }
                echo $updatedata;
//                echo "Job " .$_POST[job_number]. " UPDATED to jobs table...";
            
                include 'library/closedb.php';
            }
        ?>
      </tr>
    </table>
    </form>
    </div>
  </div>
</div>
</body>
</html>

 

Here is the code for the part that isn't being aligned correctly.

function current_job($job_id,$field) {
            include 'library/dbconfig.php';
            include 'library/opendb.php';
            
            if($job_id==NULL) {
                echo " ";
            } elseif($field=="client") {
                $query="SELECT clients.client_id, clients.last_name, clients.first_name, clients.company_name
                        FROM byrnjobdb.jobs
                        INNER JOIN byrnjobdb.clients
                        ON byrnjobdb.jobs.client_id = byrnjobdb.clients.client_id
                        WHERE byrnjobdb.jobs.job_id = $job_id";
                $result=mysql_query($query);
                $value=mysql_fetch_array($result);
                if(empty($value['company_name'])) {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: <a href='editclient.php?client_id=" .$value['client_id']. "' >" .$value['last_name']. ", " .$value['first_name']. "</a>";
                } else {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: <a href='editclient.php?client_id=" .$value['client_id']. "' >" .$value['last_name']. ", " .$value['first_name']. " of " .$value['company_name']. "</a>";
                }
            } elseif($field=="county") {
                $query="SELECT counties.county
                        FROM byrnjobdb.jobs
                        INNER JOIN byrnjobdb.counties
                        ON byrnjobdb.jobs.county_id = byrnjobdb.counties.county_id
                        WHERE byrnjobdb.jobs.job_id = $job_id";
                $result=mysql_query($query);
                $value=mysql_fetch_array($result);
                if(empty($value['county'])) {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: ";
                } else {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: " .$value['county'];
                }
            } elseif($field=="survey_1" || $field=="survey_2" || $field=="survey_3") {
                if($field=="survey_1") {
                    $fields = "survey_id_1";
                } elseif($field=="survey_2") {
                    $fields = "survey_id_2";
                } elseif($field=="survey_3") {
                    $fields = "survey_id_3";
                }
                $query="SELECT surveys.survey, counties.county
                        FROM byrnjobdb.jobs
                        INNER JOIN byrnjobdb.surveys
                        ON byrnjobdb.jobs.$fields = byrnjobdb.surveys.survey_id
                        INNER JOIN byrnjobdb.counties
                        ON byrnjobdb.surveys.county_id = byrnjobdb.counties.county_id
                        WHERE byrnjobdb.jobs.job_id = $job_id";
                $result=mysql_query($query);
                $value=mysql_fetch_array($result);
                if(empty($value['survey'])) {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: ";
                } elseif(empty($value['county'])) {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: " .$value['survey'];
                } else {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: " .$value['survey']. " in " .$value['county']. " county";
                }
            } elseif($field=="subdivision") {
                $query="SELECT subdivisions.subdivision
                        FROM byrnjobdb.jobs
                        INNER JOIN byrnjobdb.subdivisions
                        ON byrnjobdb.jobs.subdivision_id = byrnjobdb.subdivisions.subdivision_id
                        WHERE byrnjobdb.jobs.job_id = $job_id";
                $result=mysql_query($query);
                $value=mysql_fetch_array($result);
                if(empty($value['subdivision'])) {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: ";
                } else {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: " .$value['subdivision'];
                }
            } elseif($field=="type_1" || $field=="type_2" || $field=="type_3") {
                if($field=="type_1") {
                    $fields = "type_id_1";
                } elseif($field=="type_2") {
                    $fields = "type_id_2";
                } elseif($field=="type_3") {
                    $fields = "type_id_3";
                }
                $query="SELECT types.type
                        FROM byrnjobdb.jobs
                        INNER JOIN byrnjobdb.types
                        ON byrnjobdb.jobs.$fields = byrnjobdb.types.type_id
                        WHERE byrnjobdb.jobs.job_id = $job_id";
                $result=mysql_query($query);
                $value=mysql_fetch_array($result);
                if(empty($value['type'])) {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: ";
                } else {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: " .$value['type'];
                }
            } elseif($field=="employee") {
                $query="SELECT employees.first_name, employees.last_name
                        FROM byrnjobdb.jobs
                        INNER JOIN byrnjobdb.employees
                        ON byrnjobdb.jobs.employee_id = byrnjobdb.employees.employee_id
                        WHERE byrnjobdb.jobs.job_id = $job_id";
                $result=mysql_query($query);
                $value=mysql_fetch_array($result);
                if(empty($value['first_name']) && empty($value['last_name'])) {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: ";
                } else {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: " .$value['last_name']. ", " .$value['first_name'];
                } 
            } else {
                $query="SELECT $field
                        FROM byrnjobdb.jobs
                        WHERE job_id = $job_id";
                $result=mysql_query($query);
                $value=mysql_fetch_array($result);
                if(!isset($job_id) || !isset($field)) {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: ";
                } else {
                    echo "<strong>" .ucfirst(str_replace("_"," ",$field)). "</strong>: " .$value[$field];
                }
            }
            
            include 'library/closedb.php';
        }

 

When the first page is rendered the cell that is after the cell with the text "^Current type_id_3 data->" won't align to the left. It always aligns to the center. Can anyone tell why?

 

Thanks!

<td class="row_description" bgcolor=#ECC69F align=left"><?php $byrndb->current_job($job,type_3); ?></td>

 

Should read:

 

<td class="row_description" bgcolor=#ECC69F align="left"><?php $byrndb->current_job($job,type_3); ?></td>

 

(Missing a " before the left section).

 

If that doesn't work, you probably are defining it in your CSS file...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.