All pastes #816344 Raw Edit

Something

public text v1 · immutable
·published 2007-12-14 19:33 UTC
rendered paste body
Main File wo.php

<?php
   define('TITLE1', 'My Ops System Work Order Page');
   define('TITLE2', 'My Ops System');
   require('./functions/scr_temp.php');
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title><?php echo TITLE1; ?></title>
</head>
<?php
   echo $disp_top;
   echo TITLE2;
   echo $disp_mid;
   include('wo-cm.php');
   echo $disp_bot;
?>

Screen Setup File scr_temp.php

<?php
   require('men_l.php');
   require('men_t.php');
   require('men_b.php');
   require('men_r.php');
   $disp_top ='<BODY bgcolor=#ffffff><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 '.
              'WIDTH=85% height=500 align=center bgcolor=#333388><! Row ONE ><TR>'.
              '<! Column One ><td rowspan=2 width=150>&nbsp;</td><! Column Two >'.
              '<td height=50 align=center valign=middle><font face=Arial size=6 '.
              'color=#ffff55><b>';
   $disp_mid ='</b></font></td><! Column Three ><TD rowspan=4 width=20></tr><! '.
              'Row TWO ><tr><td height=35>'.$t_men.'</td></tr><! Row '.
              'THREE ><tr height=200><td valign=top align=center rowspan=2 width='.
              '150>'.$l_men.'</td><td bgcolor="#ffffaa" align=center>';
   $disp_bot ='</td><td valign=top align=center rowspan=2 width=5>'.
              $r_men.'</td></tr><! Row FOUR ><tr height=10><td align=center>'.
              $b_men.'</td></tr></table></body></html>';
?>

Left Menu File men_l.php (Current is static, but have DB driven version)

<?php
   $l_men = "<table width=150 align=center border=0>
               <tr>
               <td height=25 align=center><a href='./index.php'>Start</a></td>
               </tr>

               <tr>
               <td height=25 align=center><a href='./est.php'>Estimate</a></td>
               </tr>

               <tr>
               <td height=25 align=center><a href='./co.php'>COrder</a></td>
               </tr>

               <tr>
               <td height=25 align=center><a href='./ro.php'>ROrder</a></td>
               </tr>

               <tr>
               <td height=25 align=center><a href='./wo.php'>WOrder</a></td>
               </tr>

               <tr>
               <td height=25 align=center><a href='./ds.php'>Dispatch</a></td>
               </tr>

               <tr>
               <td height=25 align=center><a href='./inv.php'>Invoice</a></td>
               </tr>

               <tr>
               <td height=25 align=center><a href='./bill.php'>Billing</a></td>
               </tr>

               <tr>
               <td height=25 align=center><a href='./tool.php'>Tools</a></td>
               </tr>

               <tr>
               <td height=25 align=center><a href='./set.php'>Setup</a></td>
               </tr>

               <tr>
               <td align=center><?php include(GoogleSearch.html); ?></td>
               </tr>
            </table>";
?>

Left Top File men_t.php (Current is static, but have DB driven version)

<?php
   $t_men = "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=500 align=center>
              <TR VALIGN=top height=25>
              <TD align=center width=20%>
                  <a href='./index.php'>Start</a></td>
              </td>

              <td align=center><font size=2 color=#ffffff>&nbsp;|&nbsp;</font></td>

              <TD align=center width=15%>
                  <a href='./est.php'>Estimate</a>
              </td>

              <td align=center><font size=2 color=#ffffff>&nbsp;|&nbsp;</font></td>

              <TD align=center width=15%>
                  <a href='./co.php'>COrder</a>
              </td>

              <td align=center><font size=2 color=#ffffff>&nbsp;|&nbsp;</font></td>

              <TD align=center width=15%>
                  <a href='./ro.php'>ROrder</a>
              </td>

              <td align=center><font size=2 color=#ffffff>&nbsp;|&nbsp;</font></td>

              <TD align=center width=15%>
                  <a href='./wo.php'>WOrder</a>
              </td>

              <td align=center><font size=2 color=#ffffff>&nbsp;|&nbsp;</font></td>

              <TD align=center width=15%>
                  <a href='./ds.php'>Dispatch</a>
              </td>


              <td align=center><font size=2 color=#ffffff>&nbsp;|&nbsp;</font></td>

              <TD align=center width=15%>
                  <a href='./inv.php'>Invoice</a>
              </td>

              <td align=center><font size=2 color=#ffffff>&nbsp;|&nbsp;</font></td>

              <TD align=center width=15%>
                  <a class='cm' href='./bill.php'>Billing</a>
              </td>

              <td align=center><font size=2 color=#ffffff>&nbsp;|&nbsp;</font></td>

              <TD align=center width=15%>
                  <a class='cm' href='./tool.php'>Tools</a>
              </td>

              <td align=center><font size=2 color=#ffffff>&nbsp;|&nbsp;</font></td>

              <TD align=center width=15%>
                  <a class='cm' href='./set.php'>Setup</a>
              </td>
              </tr>
           </table>";
?>

Left Right File men_r.php (Current is blank)

<?php
?>

Left Bottom File men_b.php

<?php
   $b_men = "<b><FONT color=#ffffff size=3>Designed and
            <font color=#FFFFFF size=3 face=Verdana>©</font>
            by <A HREF='http://www.davisoftaec.com' TARGET=_blank>
            <b><FONT color=#ffffff size=3>Davisoft-Aec</font></b></a>
            2005. All rights reserved</FONT></b>";
?>

Content File wo-cm.php  (Call to processing etc come from here)

<?php
   require('./functions/db_connect.php');
   require('./functions/cmp-dis.php');
   require('wo-det.php');
//   require('./functions/functions.php');
   define('TITLE1', 'MyOps System - Work Order');
   define('TITLE2', 'Company Selection Screen');
   define('TITLE3', 'Detail Entry Screen');
   $dis_act = addslashes($_SERVER['PHP_SELF']);
   $dis_hdr = '<html><head><title>'.TITLE1.'</title></head>';
   $dis_bdf = '<BODY BGCOLOR="#ffFFdd"><FORM name="ops" METHOD="POST" '.
              'ACTION="'.$dis_act.'"><TABLE BORDER=2 CELLPADDING=5 WIDTH=100% '.
              'height=400 align=center BGCOLOR="#F0F8FF"><TR><TD>'.
              '<TABLE BORDER=0 CELLPADDING=5 WIDTH=95% align=center '.
              'BGCOLOR="#F0F8FF" class=bd><TR><TD colspan=11 ALIGN=center '.
              'VALIGN=bottom><H1>'.TITLE1.'</H1><b>';
   $dis_ebd = '</b></td></tr>';
   $dis_ftr = '<tr><td align=center colspan=11>'.
              '<INPUT TYPE="submit" NAME="nextpg" VALUE="Submit">'.
              '</td></tr></TABLE><input type="hidden" name="process" '.
              'value=""></td></TR></TABLE></FORM></BODY></HTML>';
//phpinfo();
   if (!isset($HTTP_POST_VARS['nextpg'])) {
      $dis_var = $dis_hdr . $dis_bdf . TITLE2 . $dis_ebd . $frm_disp . $dis_ftr;
   } else {
      $dis_var = $dis_hdr . $dis_bdf . TITLE3 . $dis_ebd . $det_disp;
   }
   echo $dis_var;
?>

Conpany Selection File cmp-dis.php

<?php
   $cur_cnt = "001";
   $cur_dat = date("m/d/y");
   $sql = "SELECT inv_no, inv_rep FROM invoice WHERE inv_dat=$cur_dat;";
   $result = mysql_query($sql);
   while ($row = mysql_fetch_assoc($result)) {
      $rct = $row['inv_no'];
      $rep = $row['inv_rep'];
   }
   if (isset($rct)) {
      $cur_cnt = $rct + 1;
   }
   $cur_yrr = date("y");
   $cur_day = date("d");
   $cur_mnt = date("m");
   $cur_pre = $cur_yrr."-".$cur_mnt."-".$cur_day;
   $cur_inv = $cur_pre.$cur_cnt;
   $sql = "SELECT cli_no, cli_cnm FROM client ORDER BY cli_cnm;";
   $result = mysql_query($sql);
   $comp_list="";
   $select = (isset($HTTP_POST_VARS['inv_cmp']) ? $HTTP_POST_VARS['inv_cmp'] : '');
   while ($row = mysql_fetch_assoc($result)) {
      $cn = $row['cli_no'];
      $vl = $row['cli_cnm'];
      if ($select==$row['cli_no']) {
         $comp_list = "<option value=$cn selected>$vl</option>";
      } else {
         $comp_list .= "<option value=$cn>$vl</option>";
      }
   }
   $frm_date = "<INPUT TYPE='text' SIZE=25 NAME='inv_dat' VALUE=$cur_dat>";
   $frm_cont = "<INPUT TYPE='text' SIZE=25 NAME='inv_ctt'>";
   $frm_invn = "<INPUT TYPE='text' SIZE=25 NAME='inv_num' VALUE=$cur_inv>";
   $frm_emal = "<INPUT TYPE='text' SIZE=25 NAME='inv_eml'>";
   $frm_ordr = "<INPUT TYPE='text' SIZE=25 NAME='inv_ord'>";
   $frm_addr = "<INPUT TYPE='text' SIZE=25 NAME='inv_adr'>";
   $frm_rpnm = "<INPUT TYPE='text' SIZE=15 NAME='inv_rep'>";
   $frm_fobf = "<INPUT TYPE='text' SIZE=8  NAME='inv_fob'>";
   $frm_city = "<INPUT TYPE='text' SIZE=25 NAME='inv_cty'>";
   $frm_stat = "<INPUT TYPE='text' SIZE=2  NAME='inv_stt'>";
   $frm_zipc = "<INPUT TYPE='text' SIZE=9  NAME='inv_zip'>";
   $frm_phon = "<INPUT TYPE='text' SIZE=25 NAME='inv_phn'>";
   $frm_faxn = "<INPUT TYPE='text' SIZE=25 NAME='inv_fax'>";

   if (isset($HTTP_POST_VARS['process'])) {
      $sql = "SELECT * FROM client WHERE cli_no=$select;";
      $result = mysql_query($sql);
      $rowcnt = mysql_num_rows($result);
      while ($row = mysql_fetch_assoc($result)) {
         $row_cont = $row['cli_ctt'];
         $row_emal = $row['cli_eml'];
         $row_addr = addslashes($row['cli_ad1']);
         $row_add1 = $row['cli_ad2'];
         $row_add2 = $row['cli_ad3'];
         if (!isset($row_add1)) {
            $row_addr .= ", ".addslashes($row_add1);
         }
         if (!isset($row_add2)) {
            $row_addr .= ", ".addslashes($row_add2);
         }
         $row_city = $row['cli_cty'];
         $row_stat = $row['cli_st'];
         $row_zipc = addslashes($row['cli_zip']);
         $row_phon = addslashes($row['cli_ph']);
         $row_faxn = $row['cli_fax'];
         $frm_date = "<INPUT TYPE='text' SIZE=25 NAME='inv_dat' VALUE=$cur_dat>";
         $frm_cont = "<INPUT TYPE='text' SIZE=25 NAME='inv_ctt' VALUE=$row_cont>";
         $frm_invn = "<INPUT TYPE='text' SIZE=25 NAME='inv_num' VALUE=$cur_inv>";
         $frm_emal = "<INPUT TYPE='text' SIZE=25 NAME='inv_eml' VALUE=$row_emal>";
         $frm_addr = "<INPUT TYPE='text' SIZE=25 NAME='inv_adr' VALUE='".$row_addr."'>";
         $frm_rpnm = "<INPUT TYPE='text' SIZE=15 NAME='inv_rep' VALUE=$rep>";
         $frm_city = "<INPUT TYPE='text' SIZE=25 NAME='inv_cty' VALUE=$row_city>";
         $frm_stat = "<INPUT TYPE='text' SIZE=2  NAME='inv_stt' VALUE=$row_stat>";
         $frm_zipc = "<INPUT TYPE='text' SIZE=9  NAME='inv_zip' VALUE=$row_zipc>";
         $frm_phon = "<INPUT TYPE='text' SIZE=25 NAME='inv_phn' VALUE=$row_phon>";
         $frm_faxn = "<INPUT TYPE='text' SIZE=25 NAME='inv_fax' VALUE=$row_faxn>";
      }
   }
   $frm_disp = '<tr><td width=50 align=right>Company:</td>'.
               '<td width=150 align=left><SELECT NAME="inv_cmp" '.
               'onchange="document.forms[\'ops\'].submit();">'.$comp_list.
               '</SELECT></td><td width=70 align=right>Date:</td>'.
               '<td align=left width=250 colspan=7>'.$frm_date.'</td></tr>'.

               '<tr><td align=right>Contact:</td><td align=left>'.
               $frm_cont.'</td><td align=right>Invoice:</td>'.
               '<td align=left colspan=7>'.$frm_invn.'</td></tr>'.

               '<tr><td align=right>EMail:</td><td align=left>'.
               $frm_emal.'</td><td align=right>Order No:</td>'.
               '<td align=left colspan=7>'.$frm_ordr.'</td></tr>'.

               '<tr><td align=right>Address:</td><td align=left>'.
               $frm_addr.'</td><td align=right>Rep:</td><td align=left '.
               'colspan=3>'.$frm_rpnm.'</td><td align=right>FOB:</td>'.
               '<td align=left colspan=3>'.$frm_fobf.'</td></tr>'.

               '<tr><td align=right>City:</td><td align=left>'.$frm_city.
               '</td><td align=right>State:</td><td align=left>'.$frm_stat.
               '</td><td align=right>Zip:</td><td align=left colspan=4>'.$frm_zipc.
               '</td></tr>'.

               '<tr><td align=right>Phone:</td><td align=left>'.
               $frm_phon.'</td><td align=right>Fax:</td><td align=left colspan=7>'.
               $frm_faxn.'</td></tr>';
?>