6 Replies Latest reply on Feb 15, 2011 7:12 AM by deansy55

    highlight updated line in send email

    Level 1

      hi,

       

      is there anyway that i can highlight the changed value in when a record is updated and it sends the email?

       

      currently when a record is updated an email is sent with the every change in the recordset but i would like it to be able to highlight the particular elements of the form that were changed so it is clear to the user when they get the email what has been changed exactly?

       

      hope someone can help, i am guessing it will be some custom coding in the transaction but not sure where to start with it.

       

      many thanks

        • 1. Re: highlight updated line in send email
          w1n78 Level 2

          there are several ways you can do this. check difference of a file in the binary level, create a new record in the database instead of updating - that way you can compare between versions/updates. you can include in the email the record before it is updated and after it is updated for comparison. there are also builtin php functions you can use. you can start with strcmp() - http://us3.php.net/strcmp - it gets kind of complicated if you are new to php

          1 person found this helpful
          • 2. Re: highlight updated line in send email
            Level 1

            thanks for your reply.  yeah kind of new to php so not sure how i would do this.  i use addt.  is there anyway you or anyone could guide me with a way in addt or dreamweaver or with some basic coding?

             

            i thought of hidden fields and setting a session variable somehow or an update date and time column for each column in the database then some how using that as the trigger?

             

            hope someone can help at all.  not sure what you mean checing at binary level?

             

            thanks again

            • 3. Re: highlight updated line in send email
              ultrasuite Level 1

              Do you know which field has been updated and just want to know how to  highlight it in the email or do you also need to find out which field  has been updated?

               

              J.S.

              UltraSuite PHP Extensions

              • 4. Re: highlight updated line in send email
                Level 1

                hi,

                 

                thansk for helping.

                 

                basically i have an insert record form by addt on one page then an update form from wizard from addt with send email on another, when it updates i need to somehow highlight the fields in the email that were updated.

                 

                so either in a bold or blue colour to show what has been updated in the database rather than the whole list.

                 

                how can this be done?

                 

                 

                thanks again for your help.

                 

                p.s. i have just looked at your site and saw you have extensions listed.  will contact you about these from your site.

                • 5. Re: highlight updated line in send email
                  ultrasuite Level 1

                  I am sure the answer is quite simple but it would help to see the actual code to understand exactly what you want to highlight.  Of course, I could give you the conditional logic but to tell exactly where to apply that logic it would be easier after looking at the code.  That said, I got your mail and I have sent you a response.

                   

                  J.S.

                  UltraSuite Extensions

                  • 6. Re: highlight updated line in send email
                    Level 1

                    hi thanks for all your help.

                     

                    please see below update record and send email code.  i just want it to send the values that have been updated to the user.

                     

                    thank you all once again for your help:

                     

                    <?php require_once('Connections/cbank.php'); ?>
                    <?php
                    //MX Widgets3 include
                    require_once('includes/wdg/WDG.php');

                    // Load the common classes
                    require_once('includes/common/KT_common.php');

                    // Load the tNG classes
                    require_once('includes/tng/tNG.inc.php');

                    // Make a transaction dispatcher instance
                    $tNGs = new tNG_dispatcher("");

                    // Make unified connection variable
                    $conn_cbank = new KT_connection($cbank, $database_cbank);

                    //Start Restrict Access To Page
                    $restrict = new tNG_RestrictAccess($conn_cbank, "");
                    //Grand Levels: Level
                    $restrict->addLevel("1");
                    $restrict->Execute();
                    //End Restrict Access To Page

                    // Start trigger
                    $formValidation = new tNG_FormValidation();
                    $formValidation->addField("AgencyTradingAgreementSignedDate", true, "date", "date", "", "", "");
                    $formValidation->addField("DateReservationFormSentToProductProvider", false, "date", "date", "", "", "");
                    $formValidation->addField("DateResFeeSentToProductProvider", false, "date", "date", "", "", "");
                    $formValidation->addField("DateCertIDSentToPP", false, "date", "date", "", "", "");
                    $formValidation->addField("DateClientRecvdContract", false, "date", "date", "", "", "");
                    $formValidation->addField("DateDepositDue", false, "date", "date", "", "", "");
                    $formValidation->addField("DateContractReturnedToPP", false, "date", "date", "", "", "");
                    $formValidation->addField("DateDepositPaidToPP", false, "date", "date", "", "", "");
                    $formValidation->addField("CaseComplete", false, "date", "date", "", "", "");
                    $formValidation->addField("DateOfInvoice", false, "date", "date", "", "", "");
                    $formValidation->addField("DateInvoicePaid", false, "date", "date", "", "", "");
                    $formValidation->addField("DatePaidToAgent", false, "date", "date", "", "", "");
                    $tNGs->prepareValidation($formValidation);
                    // End trigger

                    //start Trigger_SendEmail trigger
                    //remove this line if you want to edit the code by hand
                    function Trigger_SendEmail(&$tNG) {
                      $emailObj = new tNG_Email($tNG);
                      $emailObj->setFrom("{KT_defaultSender}");
                      $emailObj->setTo("test@domain.com");
                      $emailObj->setCC("");
                      $emailObj->setBCC("");
                      $emailObj->setSubject("Update");
                      //WriteContent method
                      $emailObj->setContent("\n{Cash_Sale_ID}\n{clients_ClientID}\n{AgentID}\n{IFAID}\n{Regiona l_ID}\n{Area_ID}\n{Product_ProviderID}\n{ProductTypeID}\n{PropertyID}\n{AgencyTradingAgree mentSignedDate}\n{DateReservationFormSentToProductProvider}\n{DateResFeeSentToProductProvi der}\n{DateCertIDSentToPP}\n{DateClientRecvdContract}\n{DateDepositDue}\n{DateContractRetu rnedToPP}\n{DateDepositPaidToPP}\n{CaseComplete}\n{NPW}\n{GrossInvoice}\n{DateOfInvoice}\n {DateInvoicePaid}\n{AgentExpectedAmount}\n{MIPExpectedAmount}\n{AmountPaidToAgent}\n{DateP aidToAgent}\n{AmountRSMBonusPaid}\n{NetMIPAmount}\n");
                      $emailObj->setEncoding("ISO-8859-1");
                      $emailObj->setFormat("Text");
                      $emailObj->setImportance("Normal");
                      return $emailObj->Execute();
                    }
                    //end Trigger_SendEmail trigger

                    if (!function_exists("GetSQLValueString")) {
                    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
                    {
                      if (PHP_VERSION < 6) {
                        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
                      }

                      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

                      switch ($theType) {
                        case "text":
                          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
                          break;   
                        case "long":
                        case "int":
                          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
                          break;
                        case "double":
                          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
                          break;
                        case "date":
                          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
                          break;
                        case "defined":
                          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
                          break;
                      }
                      return $theValue;
                    }
                    }

                    mysql_select_db($database_cbank, $cbank);
                    $query_rsAgents = "SELECT * FROM users WHERE AccessLevel <= 5";
                    $rsAgents = mysql_query($query_rsAgents, $cbank) or die(mysql_error());
                    $row_rsAgents = mysql_fetch_assoc($rsAgents);
                    $totalRows_rsAgents = mysql_num_rows($rsAgents);

                    mysql_select_db($database_cbank, $cbank);
                    $query_rsIFA = "SELECT * FROM users WHERE AccessLevel = 7";
                    $rsIFA = mysql_query($query_rsIFA, $cbank) or die(mysql_error());
                    $row_rsIFA = mysql_fetch_assoc($rsIFA);
                    $totalRows_rsIFA = mysql_num_rows($rsIFA);

                    mysql_select_db($database_cbank, $cbank);
                    $query_rsRegional = "SELECT * FROM users WHERE AccessLevel = 2";
                    $rsRegional = mysql_query($query_rsRegional, $cbank) or die(mysql_error());
                    $row_rsRegional = mysql_fetch_assoc($rsRegional);
                    $totalRows_rsRegional = mysql_num_rows($rsRegional);

                    mysql_select_db($database_cbank, $cbank);
                    $query_rsArea = "SELECT * FROM users WHERE AccessLevel = 3";
                    $rsArea = mysql_query($query_rsArea, $cbank) or die(mysql_error());
                    $row_rsArea = mysql_fetch_assoc($rsArea);
                    $totalRows_rsArea = mysql_num_rows($rsArea);

                    mysql_select_db($database_cbank, $cbank);
                    $query_rsProductProvider = "SELECT * FROM product_provider";
                    $rsProductProvider = mysql_query($query_rsProductProvider, $cbank) or die(mysql_error());
                    $row_rsProductProvider = mysql_fetch_assoc($rsProductProvider);
                    $totalRows_rsProductProvider = mysql_num_rows($rsProductProvider);

                    mysql_select_db($database_cbank, $cbank);
                    $query_rsProductType = "SELECT * FROM producttype WHERE ProductTypeID <= 14";
                    $rsProductType = mysql_query($query_rsProductType, $cbank) or die(mysql_error());
                    $row_rsProductType = mysql_fetch_assoc($rsProductType);
                    $totalRows_rsProductType = mysql_num_rows($rsProductType);

                    mysql_select_db($database_cbank, $cbank);
                    $query_rsPropertyRef = "SELECT CONCAT(ifnull(PropertyRef, ''), ' ', ifnull(SaleType, ''), ' ',ifnull(UnitNo, ''), ' ', ifnull(PropertyType, ''), ' ',ifnull(ProductName, ''), ' ',ifnull(Development, ''), ' ', ifnull(Country, ''), ' ',ifnull(PriceofProperty, '')) AS PropertyRef, PropertyID, ProductTypeID FROM properties WHERE ProductTypeID <= 14";
                    $rsPropertyRef = mysql_query($query_rsPropertyRef, $cbank) or die(mysql_error());
                    $row_rsPropertyRef = mysql_fetch_assoc($rsPropertyRef);
                    $totalRows_rsPropertyRef = mysql_num_rows($rsPropertyRef);

                    $ParamCash_rsClientsCash = "-1";
                    if (isset($_GET['Cash_Sale_ID'])) {
                      $ParamCash_rsClientsCash = (get_magic_quotes_gpc()) ? $_GET['Cash_Sale_ID'] : addslashes($_GET['Cash_Sale_ID']);
                    }
                    mysql_select_db($database_cbank, $cbank);
                    $query_rsClientsCash = sprintf("SELECT clients.ClientID, cash_sale.clients_ClientID FROM clients join cash_sale on clients.ClientID = cash_sale.clients_ClientID WHERE cash_sale.Cash_Sale_ID = %s", GetSQLValueString($ParamCash_rsClientsCash, "int"));
                    $rsClientsCash = mysql_query($query_rsClientsCash, $cbank) or die(mysql_error());
                    $row_rsClientsCash = mysql_fetch_assoc($rsClientsCash);
                    $totalRows_rsClientsCash = mysql_num_rows($rsClientsCash);

                    // Make an update transaction instance
                    $upd_cash_sale = new tNG_update($conn_cbank);
                    $tNGs->addTransaction($upd_cash_sale);
                    // Register triggers
                    $upd_cash_sale->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
                    $upd_cash_sale->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
                    $upd_cash_sale->registerTrigger("END", "Trigger_Default_Redirect", 99, "clients_Detail.php?ClientID={rsClientsCash.ClientID}");
                    $upd_cash_sale->registerTrigger("AFTER", "Trigger_SendEmail", 98);
                    // Add columns
                    $upd_cash_sale->setTable("cash_sale");
                    $upd_cash_sale->addColumn("clients_ClientID", "NUMERIC_TYPE", "POST", "clients_ClientID");
                    $upd_cash_sale->addColumn("AgentID", "NUMERIC_TYPE", "POST", "AgentID");
                    $upd_cash_sale->addColumn("IFAID", "NUMERIC_TYPE", "POST", "IFAID");
                    $upd_cash_sale->addColumn("Regional_ID", "NUMERIC_TYPE", "POST", "Regional_ID");
                    $upd_cash_sale->addColumn("Area_ID", "NUMERIC_TYPE", "POST", "Area_ID");
                    $upd_cash_sale->addColumn("Product_ProviderID", "NUMERIC_TYPE", "POST", "Product_ProviderID");
                    $upd_cash_sale->addColumn("ProductTypeID", "NUMERIC_TYPE", "POST", "ProductTypeID");
                    $upd_cash_sale->addColumn("PropertyID", "NUMERIC_TYPE", "POST", "PropertyID");
                    $upd_cash_sale->addColumn("AgencyTradingAgreementSignedDate", "DATE_TYPE", "POST", "AgencyTradingAgreementSignedDate");
                    $upd_cash_sale->addColumn("DateReservationFormSentToProductProvider", "DATE_TYPE", "POST", "DateReservationFormSentToProductProvider");
                    $upd_cash_sale->addColumn("DateResFeeSentToProductProvider", "DATE_TYPE", "POST", "DateResFeeSentToProductProvider");
                    $upd_cash_sale->addColumn("DateCertIDSentToPP", "DATE_TYPE", "POST", "DateCertIDSentToPP");
                    $upd_cash_sale->addColumn("DateClientRecvdContract", "DATE_TYPE", "POST", "DateClientRecvdContract");
                    $upd_cash_sale->addColumn("DateDepositDue", "DATE_TYPE", "POST", "DateDepositDue");
                    $upd_cash_sale->addColumn("DateContractReturnedToPP", "DATE_TYPE", "POST", "DateContractReturnedToPP");
                    $upd_cash_sale->addColumn("DateDepositPaidToPP", "DATE_TYPE", "POST", "DateDepositPaidToPP");
                    $upd_cash_sale->addColumn("CaseComplete", "DATE_TYPE", "POST", "CaseComplete");
                    $upd_cash_sale->addColumn("NPW", "CHECKBOX_YN_TYPE", "POST", "NPW");
                    $upd_cash_sale->addColumn("GrossInvoice", "DOUBLE_TYPE", "POST", "GrossInvoice");
                    $upd_cash_sale->addColumn("DateOfInvoice", "DATE_TYPE", "POST", "DateOfInvoice");
                    $upd_cash_sale->addColumn("DateInvoicePaid", "DATE_TYPE", "POST", "DateInvoicePaid");
                    $upd_cash_sale->addColumn("AgentExpectedAmount", "DOUBLE_TYPE", "POST", "AgentExpectedAmount");
                    $upd_cash_sale->addColumn("MIPExpectedAmount", "DOUBLE_TYPE", "POST", "MIPExpectedAmount");
                    $upd_cash_sale->addColumn("AmountPaidToAgent", "DOUBLE_TYPE", "POST", "AmountPaidToAgent");
                    $upd_cash_sale->addColumn("DatePaidToAgent", "DATE_TYPE", "POST", "DatePaidToAgent");
                    $upd_cash_sale->addColumn("AmountRSMBonusPaid", "DOUBLE_TYPE", "POST", "AmountRSMBonusPaid");
                    $upd_cash_sale->addColumn("NetMIPAmount", "DOUBLE_TYPE", "POST", "NetMIPAmount");
                    $upd_cash_sale->setPrimaryKey("Cash_Sale_ID", "NUMERIC_TYPE", "GET", "Cash_Sale_ID");

                    // Execute all the registered transactions
                    $tNGs->executeTransactions();

                    // Get the transaction recordset
                    $rscash_sale = $tNGs->getRecordset("cash_sale");
                    $row_rscash_sale = mysql_fetch_assoc($rscash_sale);
                    $totalRows_rscash_sale = mysql_num_rows($rscash_sale);
                    ?>
                    <!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" xmlns:wdg="http://ns.adobe.com/addt">
                    <head>
                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                    <title>cash update</title>
                    <style type="text/css" media="all">
                    <!--
                    @import url("css/common.css");
                    -->
                    <!--
                    @import url("css/admin.css");
                    -->
                    </style>
                    <style type="text/css" media="print">
                    <!--
                    @import url("css/admin_print.css");
                    -->
                    </style>
                    <!--[if IE]>
                    <style type="text/css">
                    #outerWrapper #contentWrapper #content {
                      zoom: 1;
                    }
                    </style>
                    <![endif]-->
                    <!--[if IE 6]>
                    <style type="text/css" media="all">
                    @import url("../css/ie6.css");
                    </style>
                    <![endif]-->
                    <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
                    <script src="includes/common/js/base.js" type="text/javascript"></script>
                    <script src="includes/common/js/utility.js" type="text/javascript"></script>
                    <script src="includes/skins/style.js" type="text/javascript"></script>
                    <?php echo $tNGs->displayValidationRules();?>
                    <!--[if IE]><script type="text/javascript" src="dmx/lib/excanvas-compressed.js"></script><![endif]-->
                    <script type="text/javascript" src="ScriptLibrary/jquery-latest.pack.js"></script>
                    <script type="text/javascript" src="dmx/dmx.core.js"></script>
                    <script type="text/javascript" src="includes/common/js/sigslot_core.js"></script>
                    <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js"></script>
                    <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js.php"></script>
                    <script type="text/javascript" src="includes/wdg/classes/Calendar.js"></script>
                    <script type="text/javascript" src="includes/wdg/classes/SmartDate.js"></script>
                    <script type="text/javascript" src="includes/wdg/calendar/calendar_stripped.js"></script>
                    <script type="text/javascript" src="includes/wdg/calendar/calendar-setup_stripped.js"></script>
                    <script src="includes/resources/calendar.js"></script>
                    </head>

                    <body bgcolor="#FFFFFF">

                    <?php
                    echo $tNGs->getErrorMsg();
                    ?>
                    <form action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" method="post" target="_top" id="form1">
                      <table cellpadding="2" cellspacing="0" class="KT_tngtable" bgcolor="#FFFFFF">
                        <tr>
                          <td class="KT_th"><label for="AgentID">Agent:</label></td>
                          <td><select name="AgentID" id="AgentID">
                            <?php
                    do { 
                    ?>
                            <option value="<?php echo $row_rsAgents['UserID']?>"<?php if (!(strcmp($row_rsAgents['UserID'], $row_rscash_sale['AgentID']))) {echo "SELECTED";} ?>><?php echo $row_rsAgents['FullName']?></option>
                            <?php
                    } while ($row_rsAgents = mysql_fetch_assoc($rsAgents));
                      $rows = mysql_num_rows($rsAgents);
                      if($rows > 0) {
                          mysql_data_seek($rsAgents, 0);
                       $row_rsAgents = mysql_fetch_assoc($rsAgents);
                      }
                    ?>
                          </select>
                            <?php echo $tNGs->displayFieldError("cash_sale", "AgentID"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="IFAID">IFA:</label></td>
                          <td><select name="IFAID" id="IFAID">
                            <?php
                    do { 
                    ?>
                            <option value="<?php echo $row_rsIFA['UserID']?>"<?php if (!(strcmp($row_rsIFA['UserID'], $row_rscash_sale['IFAID']))) {echo "SELECTED";} ?>><?php echo $row_rsIFA['FullName']?></option>
                            <?php
                    } while ($row_rsIFA = mysql_fetch_assoc($rsIFA));
                      $rows = mysql_num_rows($rsIFA);
                      if($rows > 0) {
                          mysql_data_seek($rsIFA, 0);
                       $row_rsIFA = mysql_fetch_assoc($rsIFA);
                      }
                    ?>
                          </select>
                            <?php echo $tNGs->displayFieldError("cash_sale", "IFAID"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="Regional_ID">Regional Manager:</label></td>
                          <td><select name="Regional_ID" id="Regional_ID">
                            <?php
                    do { 
                    ?>
                            <option value="<?php echo $row_rsRegional['UserID']?>"<?php if (!(strcmp($row_rsRegional['UserID'], $row_rscash_sale['Regional_ID']))) {echo "SELECTED";} ?>><?php echo $row_rsRegional['FullName']?></option>
                            <?php
                    } while ($row_rsRegional = mysql_fetch_assoc($rsRegional));
                      $rows = mysql_num_rows($rsRegional);
                      if($rows > 0) {
                          mysql_data_seek($rsRegional, 0);
                       $row_rsRegional = mysql_fetch_assoc($rsRegional);
                      }
                    ?>
                          </select>
                            <?php echo $tNGs->displayFieldError("cash_sale", "Regional_ID"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="Area_ID">Area Manager:</label></td>
                          <td><select name="Area_ID" id="Area_ID">
                            <?php
                    do { 
                    ?>
                            <option value="<?php echo $row_rsArea['UserID']?>"<?php if (!(strcmp($row_rsArea['UserID'], $row_rscash_sale['Area_ID']))) {echo "SELECTED";} ?>><?php echo $row_rsArea['FullName']?></option>
                            <?php
                    } while ($row_rsArea = mysql_fetch_assoc($rsArea));
                      $rows = mysql_num_rows($rsArea);
                      if($rows > 0) {
                          mysql_data_seek($rsArea, 0);
                       $row_rsArea = mysql_fetch_assoc($rsArea);
                      }
                    ?>
                          </select>
                            <?php echo $tNGs->displayFieldError("cash_sale", "Area_ID"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="Product_ProviderID">Product Provider:</label></td>
                          <td><select name="Product_ProviderID" id="Product_ProviderID">
                            <?php
                    do { 
                    ?>
                            <option value="<?php echo $row_rsProductProvider['Product_ProviderID']?>"<?php if (!(strcmp($row_rsProductProvider['Product_ProviderID'], $row_rscash_sale['Product_ProviderID']))) {echo "SELECTED";} ?>><?php echo $row_rsProductProvider['ProductProvider']?></option>
                            <?php
                    } while ($row_rsProductProvider = mysql_fetch_assoc($rsProductProvider));
                      $rows = mysql_num_rows($rsProductProvider);
                      if($rows > 0) {
                          mysql_data_seek($rsProductProvider, 0);
                       $row_rsProductProvider = mysql_fetch_assoc($rsProductProvider);
                      }
                    ?>
                          </select>
                            <?php echo $tNGs->displayFieldError("cash_sale", "Product_ProviderID"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="ProductTypeID">Product Type:</label></td>
                          <td><select name="ProductTypeID" id="ProductTypeID">
                            <?php
                    do { 
                    ?>
                            <option value="<?php echo $row_rsProductType['ProductTypeID']?>"<?php if (!(strcmp($row_rsProductType['ProductTypeID'], $row_rscash_sale['ProductTypeID']))) {echo "SELECTED";} ?>><?php echo $row_rsProductType['ProductTypeName']?></option>
                            <?php
                    } while ($row_rsProductType = mysql_fetch_assoc($rsProductType));
                      $rows = mysql_num_rows($rsProductType);
                      if($rows > 0) {
                          mysql_data_seek($rsProductType, 0);
                       $row_rsProductType = mysql_fetch_assoc($rsProductType);
                      }
                    ?>
                          </select>
                            <?php echo $tNGs->displayFieldError("cash_sale", "ProductTypeID"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="PropertyID">Property Ref:</label></td>
                          <td><select name="PropertyID" id="PropertyID">
                            <?php
                    do { 
                    ?>
                            <option value="<?php echo $row_rsPropertyRef['PropertyID']?>"<?php if (!(strcmp($row_rsPropertyRef['PropertyID'], $row_rscash_sale['PropertyID']))) {echo "SELECTED";} ?>><?php echo $row_rsPropertyRef['PropertyRef']?></option>
                            <?php
                    } while ($row_rsPropertyRef = mysql_fetch_assoc($rsPropertyRef));
                      $rows = mysql_num_rows($rsPropertyRef);
                      if($rows > 0) {
                          mysql_data_seek($rsPropertyRef, 0);
                       $row_rsPropertyRef = mysql_fetch_assoc($rsPropertyRef);
                      }
                    ?>
                          </select>
                            <?php echo $tNGs->displayFieldError("cash_sale", "PropertyID"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="AgencyTradingAgreementSignedDate">Agency Trading Agreement Signed Date:</label></td>
                          <td><input name="AgencyTradingAgreementSignedDate" id="AgencyTradingAgreementSignedDate" value="<?php echo KT_formatDate($row_rscash_sale['AgencyTradingAgreementSignedDate']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("AgencyTradingAgreementSignedDate");?> <?php echo $tNGs->displayFieldError("cash_sale", "AgencyTradingAgreementSignedDate"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="DateReservationFormSentToProductProvider">Date Reservation Form Sent To Product Provider:</label></td>
                          <td><input name="DateReservationFormSentToProductProvider" id="DateReservationFormSentToProductProvider" value="<?php echo KT_formatDate($row_rscash_sale['DateReservationFormSentToProductProvider']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("DateReservationFormSentToProductProvider");?> <?php echo $tNGs->displayFieldError("cash_sale", "DateReservationFormSentToProductProvider"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="DateResFeeSentToProductProvider">Date Reservation Fee Sent To Product Provider:</label></td>
                          <td><input name="DateResFeeSentToProductProvider" id="DateResFeeSentToProductProvider" value="<?php echo KT_formatDate($row_rscash_sale['DateResFeeSentToProductProvider']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("DateResFeeSentToProductProvider");?> <?php echo $tNGs->displayFieldError("cash_sale", "DateResFeeSentToProductProvider"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="DateCertIDSentToPP">Date Certified ID Sent To Product Provider:</label></td>
                          <td><input name="DateCertIDSentToPP" id="DateCertIDSentToPP" value="<?php echo KT_formatDate($row_rscash_sale['DateCertIDSentToPP']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("DateCertIDSentToPP");?> <?php echo $tNGs->displayFieldError("cash_sale", "DateCertIDSentToPP"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="DateClientRecvdContract">Date Client Received Contract:</label></td>
                          <td><input name="DateClientRecvdContract" id="DateClientRecvdContract" value="<?php echo KT_formatDate($row_rscash_sale['DateClientRecvdContract']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("DateClientRecvdContract");?> <?php echo $tNGs->displayFieldError("cash_sale", "DateClientRecvdContract"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="DateDepositDue">Date Deposit Due:</label></td>
                          <td><input name="DateDepositDue" id="DateDepositDue" value="<?php echo KT_formatDate($row_rscash_sale['DateDepositDue']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("DateDepositDue");?> <?php echo $tNGs->displayFieldError("cash_sale", "DateDepositDue"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="DateContractReturnedToPP">Date Contract Returned To Product Provider:</label></td>
                          <td><input name="DateContractReturnedToPP" id="DateContractReturnedToPP" value="<?php echo KT_formatDate($row_rscash_sale['DateContractReturnedToPP']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("DateContractReturnedToPP");?> <?php echo $tNGs->displayFieldError("cash_sale", "DateContractReturnedToPP"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="DateDepositPaidToPP">Date Deposit Paid To Product Provider:</label></td>
                          <td><input name="DateDepositPaidToPP" id="DateDepositPaidToPP" value="<?php echo KT_formatDate($row_rscash_sale['DateDepositPaidToPP']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("DateDepositPaidToPP");?> <?php echo $tNGs->displayFieldError("cash_sale", "DateDepositPaidToPP"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="CaseComplete">Case Complete:</label></td>
                          <td><input name="CaseComplete" id="CaseComplete" value="<?php echo KT_formatDate($row_rscash_sale['CaseComplete']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("CaseComplete");?> <?php echo $tNGs->displayFieldError("cash_sale", "CaseComplete"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="NPW">NPW:</label></td>
                          <td><input  <?php if (!(strcmp(KT_escapeAttribute($row_rscash_sale['NPW']),"Y"))) {echo "checked";} ?> type="checkbox" name="NPW" id="NPW" value="Y" />
                            <?php echo $tNGs->displayFieldError("cash_sale", "NPW"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="GrossInvoice">Gross Invoice:</label></td>
                          <td><input type="text" name="GrossInvoice" id="GrossInvoice" value="<?php echo KT_escapeAttribute($row_rscash_sale['GrossInvoice']); ?>" size="32" />
                            <?php echo $tNGs->displayFieldHint("GrossInvoice");?> <?php echo $tNGs->displayFieldError("cash_sale", "GrossInvoice"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="DateOfInvoice">Date Of Invoice:</label></td>
                          <td><input name="DateOfInvoice" id="DateOfInvoice" value="<?php echo KT_formatDate($row_rscash_sale['DateOfInvoice']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("DateOfInvoice");?> <?php echo $tNGs->displayFieldError("cash_sale", "DateOfInvoice"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="DateInvoicePaid">Date Invoice Paid:</label></td>
                          <td><input name="DateInvoicePaid" id="DateInvoicePaid" value="<?php echo KT_formatDate($row_rscash_sale['DateInvoicePaid']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("DateInvoicePaid");?> <?php echo $tNGs->displayFieldError("cash_sale", "DateInvoicePaid"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="AgentExpectedAmount">Agent Expected Amount £:</label></td>
                          <td><input type="text" name="AgentExpectedAmount" id="AgentExpectedAmount" value="<?php echo KT_escapeAttribute($row_rscash_sale['AgentExpectedAmount']); ?>" size="32" />
                            <?php echo $tNGs->displayFieldHint("AgentExpectedAmount");?> <?php echo $tNGs->displayFieldError("cash_sale", "AgentExpectedAmount"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="MIPExpectedAmount">MIP Expected Amount £:</label></td>
                          <td><input type="text" name="MIPExpectedAmount" id="MIPExpectedAmount" value="<?php echo KT_escapeAttribute($row_rscash_sale['MIPExpectedAmount']); ?>" size="32" />
                            <?php echo $tNGs->displayFieldHint("MIPExpectedAmount");?> <?php echo $tNGs->displayFieldError("cash_sale", "MIPExpectedAmount"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="AmountPaidToAgent">Amount Paid To Agent £:</label></td>
                          <td><input type="text" name="AmountPaidToAgent" id="AmountPaidToAgent" value="<?php echo KT_escapeAttribute($row_rscash_sale['AmountPaidToAgent']); ?>" size="32" />
                            <?php echo $tNGs->displayFieldHint("AmountPaidToAgent");?> <?php echo $tNGs->displayFieldError("cash_sale", "AmountPaidToAgent"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="DatePaidToAgent">Date Paid To Agent:</label></td>
                          <td><input name="DatePaidToAgent" id="DatePaidToAgent" value="<?php echo KT_formatDate($row_rscash_sale['DatePaidToAgent']); ?>" size="32" wdg:mondayfirst="true" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="true" wdg:restricttomask="yes" />
                            <?php echo $tNGs->displayFieldHint("DatePaidToAgent");?> <?php echo $tNGs->displayFieldError("cash_sale", "DatePaidToAgent"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="AmountRSMBonusPaid">Amount RSM Bonus Paid £:</label></td>
                          <td><input type="text" name="AmountRSMBonusPaid" id="AmountRSMBonusPaid" value="<?php echo KT_escapeAttribute($row_rscash_sale['AmountRSMBonusPaid']); ?>" size="32" />
                            <?php echo $tNGs->displayFieldHint("AmountRSMBonusPaid");?> <?php echo $tNGs->displayFieldError("cash_sale", "AmountRSMBonusPaid"); ?></td>
                        </tr>
                        <tr>
                          <td class="KT_th"><label for="NetMIPAmount">Net MIP Amount £:</label></td>
                          <td><input type="text" name="NetMIPAmount" id="NetMIPAmount" value="<?php echo KT_escapeAttribute($row_rscash_sale['NetMIPAmount']); ?>" size="32" />
                            <?php echo $tNGs->displayFieldHint("NetMIPAmount");?> <?php echo $tNGs->displayFieldError("cash_sale", "NetMIPAmount"); ?></td>
                        </tr>
                        <tr class="KT_buttons">
                          <td colspan="2"><input type="submit" name="KT_Update1" id="KT_Update1" value="Update record" /></td>
                        </tr>
                      </table>
                      <input type="hidden" name="clients_ClientID" id="clients_ClientID" value="<?php echo KT_escapeAttribute($row_rscash_sale['clients_ClientID']); ?>" />
                    </form>

                    <p> </p>
                    </body>
                    </html>
                    <?php
                    mysql_free_result($rsAgents);

                    mysql_free_result($rsIFA);

                    mysql_free_result($rsRegional);

                    mysql_free_result($rsArea);

                    mysql_free_result($rsProductProvider);

                    mysql_free_result($rsProductType);

                    mysql_free_result($rsPropertyRef);

                    mysql_free_result($rsClientsCash);
                    ?>