Annual Rent divided by square feet display with two decimal points. (i.e. 1,000.38) - divide

I am trying to get the Annual Rent displayed with two decimals and the rent/sq. ft. to have two decimals as well. I've already added the scripting to have these two fields automatically display dollar ammounts and commas.
Any help would be appreciated!
<body>
<table border="1" width="620" style="width: 620px; height: 58px">
<tr>
<td width="82" align="center" height="16"><font face="Arial" size="2">Sq.
Ft.</font></td>
<td width="90" align="center" height="16"><font face="Arial" size="2">Annual
Rent</font></td>
<td align="center" height="16" style="width: 104px"><font face="Arial" size="2">
Rent/Sq. Ft.</font></td>
</tr>
<tr>
<td width="82" align="center"><font face="Arial" size="2">
<input type="text" name="SF_Tenant1" id="sqft1" OnKeyUp="calcRentSQFTOne()"
size="10" value="Sq. Ft.:" tabindex="602" class="style4"></font></td>
<td width="90" align="center"><font face="Arial" size="2"><input type="text"
name="AnnualRent_Tenant1" id="annualrent1" OnKeyUp="calcRentSQFTOne()" size="11"
value="Annual Rent:" tabindex="604"></font></td>
<td align="center" style="width: 104px;"><font face="Arial" size="2">
<input type="text" name="RentSF_Tenant1" id="rentsqft1"
readonly="readonly" size="11" value="Rent/Sq. Ft.:" tabindex="605"></font></td>
</tr>
</table>
<input type="submit"
value="Save" name="Save" tabindex="999" style="font-family: Arial;
font-size: 10pt; width: 65px; height: 29px;"></font></p>
<script type="text/javascript">
//calculation script
function calcRentSQFTOne(){
SquareFeet1 = document.getElementById("sqft1").value;
AnnualRent1 = document.getElementById("annualrent1").value;
document.getElementById("rentsqft1").value =
(AnnualRent1 * 1)
/ (SquareFeet1 * 1);
}
//Dollar format
function formatNumber(number, digits, decimalPlaces, withCommas)
{
number = number.toString();
var simpleNumber = '';
// Strips out the dollar sign and commas.
for (var i = 0; i < number.length; ++i)
{
if ("0123456789.".indexOf(number.charAt(i)) >= 0)
simpleNumber += number.charAt(i);
}
number = parseFloat(simpleNumber);
if (isNaN(number)) number = 0;
if (withCommas == null) withCommas = false;
if (digits == 0) digits = 1;
var integerPart = (decimalPlaces > 0 ? Math.floor(number) : Math.round(number));
var string = "";
for (var i = 0; i < digits || integerPart > 0; ++i)
{
// Insert a comma every three digits.
if (withCommas && string.match(/^\d\d\d/))
string = "," + string;
string = (integerPart % 10) + string;
integerPart = Math.floor(integerPart / 10);
}
if (decimalPlaces > 0)
{
number -= Math.floor(number);
number *= Math.pow(10, decimalPlaces);
string += "." + formatNumber(number, decimalPlaces, 0);
}
return string;
}
</script>
</body>

Likely there is a better solution. A hacky solution to round to two decimal digits:
return Math.round(input*100)/100;
I.e. if you want to round 10.678 to two digits, then first multiply by 100: you get 1067.8, then call Math.round to get 1068 then divide by 100 to get 10.68, which is the desired answer.

Related

CommandStateChange event won't fire in HTA iframe

I have created an HTML-application to search through directories for a userdefined search term and return the results in a list. As part of this tool I gave the user the possibility to open the resulting folder directly inside an iframe in the application.
The tricky part now is to enable / disable the forward and backward-navigation buttons when the commandstate of the iframe changes.
I somehow can't add it to my iframe-element! Other events like BeforeNavigate2 otherwise work fine...
My code snippet:
<script>
var EmbededExplorer;
var EmbededExplorerObj;
var FSO = new ActiveXObject("Scripting.FileSystemObject");
function Body_OnLoad()
{
InitEmbededExplorer();
}
function InitEmbededExplorer()
{
var ExplorerDiv = document.getElementById("MyIFrameDiv");
EmbededExplorer = document.createElement("IFRAME");
EmbededExplorer.setAttribute("type", "text/html");
EmbededExplorer.setAttribute("style", "float:left;width:90%;height:100%;border:0px");
ExplorerDiv.insertBefore(EmbededExplorer, ExplorerDiv.children(2));
EmbededExplorer.setAttribute("src", "C:\");
EmbededExplorerNavigateTo("C:\SomeDirectory\HighlightedFile.txt");
}
function EmbededExplorerNavigateTo(Destination)
{
var E = null;
var Path;
Path = FSO.GetParentFolderName(Destination);
if (FSO.FolderExists(Destination))
{
Path = Destination;
}
else if (FSO.FileExists(Destination))
{
Path = FSO.GetParentFolderName(Destination);
}
else
{
alert("Unable to locate the file or directory.");
}
try
{
EmbededExplorer.setAttribute("src", Path);
}
catch (Excep)
{
E = Excep;
}
if (E != null)
{
alert("Could not open directory. Please refer to the administrator.");
}
else
{
//UpdateFolderAddressBar(document.getElementById('MyIFrameAddressBar'), Path);
setTimeout(function() { RegisterEmbededBrowserAfterLoading(Destination); }, 100);
}
}
function RegisterEmbededBrowserAfterLoading(SelectItem)
{
if (EmbededExplorer.contentWindow.document.readyState == "loading")
{
setTimeout(function() { RegisterEmbededBrowserAfterLoading(SelectItem); }, 100);
}
else
{
//EmbededExplorer.contentWindow.document.childNodes[0] contains the actual (shell-)explorer-component of the iframe (a WebBrowser2 class component)
EmbededExplorer.contentWindow.document.childNodes[0].RegisterAsBrowser = true;
EmbededExplorerObj = EmbededExplorer.contentWindow.document.childNodes[0];
//All my attempts to add the CommandStateChange-Event
EmbededExplorer.attachEvent("CommandStateChange", EmbededExplorerObj_CommandStateChange);
EmbededExplorerObj.attachEvent("CommandStateChange", EmbededExplorerObj_CommandStateChange);
EmbededExplorer.CommandStateChange = function(a, b) {alert("CommandStateChange fired!!");};
EmbededExplorerObj.CommandStateChange = function(a, b) {alert("CommandStateChange fired!!");};
//The following event works fine...
EmbededExplorerObj.attachEvent("BeforeNavigate2", EmbededExplorerObj_BeforeNavigate2);
if (SelectItem)
{
EmbededExplorerObj.Document.SelectItem(SelectItem.replace(/\//g, "\\"), 16 + 8 + 1);
}
}
}
function EmbededExplorerObj_CommandStateChange(Command, Enable)
{
alert("CommandStateChange fired!!");
//Code to enable / disable my forward / backward navigation buttons
}
function EmbededExplorerObj_BeforeNavigate2(Obj, URL)
{
alert("BeforeNavigate2 fired!!");
//UpdateFolderAddressBar(document.getElementById('MyIFrameAddressBar'), URL);
}
</script>
Documentation of the required event: https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa768328%28v%3dvs.85%29
For validation purpose, I rebuilt the event in VBA and it works just fine.
Private WithEvents Win As WebBrowser
Sub SetWin()
Dim WinShell 'As New Shell32.Shell
Set WinShell = CreateObject("Shell.Application")
Set Win = WinShell.Windows(1)
End Sub
Private Sub Win_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean)
Stop 'fires 3x after every navigation, each time containing my desired state-information in the 'Command' parameter
End Sub
EDIT:
As requested I will add the structure of my application below:
<BODY Onload="Initialisieren()" OnContextMenu="return false;" OnClick="VerbergeContextMenus()" OnKeyPress="Body_OnKeyPress()" OnFocus="document.getElementById('ModNr').focus()" OnBeforeUnload="TempLeeren();">
<TABLE Style="Width: 100%; Height: 100vh" border="0">
<TR Style="Height:auto">
<TD Style="Width: 50%; Vertical-Align: text-top">
<LABEL For="ModNr" Class="Überschrift" OnSelectStart="return false;">Suchbegriff:</LABEL><INPUT ID="ModNr" Type="Text" UseContextMenuId="CopyPasteContextMenu" onContextMenu="ZeigeContextMenu(this, event);return false;">
</TD>
<TD Style="Width: 50%; Vertical-Align: text-top">
<DIV Class="Überschrift" OnSelectStart="return false;">Zuletzt geöffnet:</DIV>
</TD>
</TR>
<TR Style="Height:auto">
<TD>
<DIV Class="Bereich" ID="Auswahl" OnSelectStart="return false;">
<TABLE Style="Width: 100%" ID="AuswahlTabelle">
<TR></TR>
<TR Style="Height: 30px">
<TD ColSpan="99" Style="Vertical-Align: Bottom"><INPUT ID="SuchKnopf" Type="Button" Value="Suche"></TD>
</TR>
</TABLE>
</DIV>
<DIV Class="Bereich" ID="DatenBankAuswahl" OnSelectStart="return false;">
<TABLE Style="Width: 100%; Margin: 0px; Padding: 0px" ID="DatenBankAuswahlTabelle">
<TR></TR>
</TABLE>
</DIV>
</TD>
<TD Style="Vertical-Align: Top" rowSpan="99">
<DIV Class="ListenBereich" Name="Historie" ID="Historie" Type="Radio" size="20" OnSelectStart="return false;">
</DIV>
</TD>
</TR>
<TR Style="Height:auto">
<TD>
<DIV Class="Überschrift" OnSelectStart="return false;" Id="Überschrift">Suchergebnisse:</DIV>
</TD>
</TR>
<TR>
<TD>
<DIV Class="ListenBereich" Name="Ergebnisse" ID="Ergebnisse" OnSelectStart="return false;">
</DIV>
<DIV Class="Bereich" Name="MyIFrameDiv" ID="MyIFrameDiv" style="display:none">
<BUTTON ID="ExplorerCloseBtn" Title="Schließen" Style="float:right;min-width:1px;width:5%;height:100%;border-radius:0px 8px 8px 0px;margin:0px;padding:0px" OnClick="SuchergebnisseAnzeigen();"><div style="position:relative;font-family:'wingdings 2';font-Size:20px">T</DIV></BUTTON>
<DIV Style="float:left;min-width:1px;width:5%;height:100%;margin:0px;padding:0px">
<BUTTON disabled="true" ID="ExplorerNavigateRootBtn" Title="Zum übergeordneten Verzeichnis" Style="float:left;min-width:1px;width:100%;height:33%;border-radius:8px 0px 0px 0px;margin:0px;padding:0px" OnClick="ExplorerNavToRoot();"><div style="position:relative;font-family:'wingdings 3';font-Size:20px">Í</DIV></BUTTON>
<BUTTON disabled="false" ID="ExplorerNavigateGoBack" Title="Einen Schritt zurück" Style="float:left;min-width:1px;width:100%;height:34%;border-radius:0px 0px 0px 0px;margin:0px;padding:0px" OnClick="try{ EmbededExplorerObj.goBack(); } catch(Excep) { }"><div style="position:relative;font-family:'wingdings 3';font-Size:20px">§</DIV></BUTTON>
<BUTTON disabled="false" ID="ExplorerNavigateGoForward" Title="Einen Schritt vor" Style="float:left;min-width:1px;width:100%;height:33%;border-radius:0px 0px 0px 8px;margin:0px;padding:0px" OnClick="try{ EmbededExplorerObj.goForward(); } catch(Excep) { }"><div style="position:relative;font-family:'wingdings 3';font-Size:20px">¨</DIV></BUTTON>
</DIV>
</DIV>
</TD>
</TR>
</TABLE>
</BODY>

Dynamic javascript form with thymeleaf and Spring-boot

I have a thymeleaf page which successfully uses javascript to generate a form. However I do not know how to make this dynamic form work with spring. Below is my HTML, the form part is down the bottom
HTML
var h1 = document.getElementsByTagName('h1')[0],
start = document.getElementById('start'),
stop = document.getElementById('stop'),
clear = document.getElementById('clear'),
seconds = 0, minutes = 0, hours = 0,
t;
function add() {
seconds++;
if (seconds >= 60) {
seconds = 0;
minutes++;
if (minutes >= 60) {
minutes = 0;
hours++;
}
}
h1.textContent = (hours ? (hours > 9 ? hours : "0" + hours) : "00") + ":" + (minutes ? (minutes > 9 ? minutes : "0" + minutes) : "00") + ":" + (seconds > 9 ? seconds : "0" + seconds);
timer();
}
function timer() {
clearTimeout(t);
t = setTimeout(add, 1000);
}
/* Start button */
start.onclick = timer;
/* Stop button */
stop.onclick = function() {
clearTimeout(t);
}
/* Clear button */
clear.onclick = function() {
h1.textContent = "00:00:00";
seconds = 0; minutes = 0; hours = 0;
}
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
var count =0;
function addFields(type){
count = count + 1;
var container = document.getElementById("container");
container.appendChild(document.createTextNode("Type"));
var input = document.createElement("input");
input.type = "text";
input.value = type;
container.appendChild(input);
container.appendChild(document.createTextNode(" Timestamp "));
var input = document.createElement("input");
input.type = "text";
input.value = document.getElementById("time").textContent;
container.appendChild(input);
container.appendChild(document.createTextNode(" Details(optional)"));
var input = document.createElement("input");
input.type = "text";
container.appendChild(input);
container.appendChild(document.createElement("br"));
}
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Match</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" th:href="#{/webjars/bootstrap/3.3.7/css/bootstrap.min.css}"/>
<link rel="stylesheet" type="text/css" th:href="#{/css/main.css}"/>
</head>
<body>
<p th:text="'Match of ' + ${part1} + ' and ' + ${part2}"/>
<p id="demo"></p>
<table>
<tr>
<th>
<p th:text="${part1}"/>
</th>
<th>
<h1 id="time"><time >00:00:00</time></h1>
<button id="start">start</button>
<button id="stop">stop</button>
<button id="clear">clear</button>
</th>
<th>
<p th:text="${part2}"/>
</th>
</tr>
<tr>
<td>
<button onclick="addFields('Ippon')" >Ippon!</button>
</td>
<td>
</td>
<td>
<button onclick="addFields('Ippon')">Ippon!</button>
</td>
</tr>
<tr>
<td>
<button onclick="addFields('Wazari')" >Wazari</button>
</td>
<td>
</td>
<td>
<button onclick="addFields('Wazari')">Wazari</button>
</td>
</tr>
<tr>
<td>
<button onclick="addFields('Shido')" >Shido</button>
</td>
<td>
</td>
<td>
<button onclick="addFields('Shido')">Shido</button>
</td>
</tr>
<tr>
<td>
<button onclick="addFields(' ')" >Event</button>
</td>
<td>
</td>
<td>
<button onclick="addFields(' ')" >Event</button>
</td>
</tr>
</table>
<br/>
Add event
<form action="#" th:action="#{/competition/save}" th:object="${match}" method="post">
<div id="container"></div>
<input type="submit" value="Submit">
</form>
</body>
</html>
Controller
#PostMapping("/competition/save")
public String matchPost(#Valid #RequestBody Match match) {
return "match2";
}
When I hit submit I get "There was an unexpected error (type=Unsupported Media Type, status=415). Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported"

How to sort only the displayed items in table with vue

I have two questions regarding the following code.
1st problem: say I have four items in the array with ids of [1,2,4,5,7]
If I click on the sort and i have 2 items per page chosen then it will show me entries with id's of 1&2 or 5&7 as I toggle the reverse order.
So how can I get the table to just sort the items that are displayed in the paginated view?
2nd problem:
We are using a mixture of vue and some jquery from an admin template we purchased, But where it has <div class="checkbox checkbox-styled"> written in the code the check boxes will not render unless I put the Vue code in a setTimeout with an interval val of '100' or more.
And it generally just doesn't render stuff in jquery well if the item that relies on jquery is in a vue for loop.
Has anyone got an explanation for this?
Please note I've deleted as much out of this to keep the question as small as possible.
<div class="section-body">
<!-- BEGIN DATA TABLE START -->
<form class="form" role="form">
<div class="row">
<div class="col-lg-12">
<div id="" class="dataTables_wrapper no-footer">
<div class="table-responsive">
<table style="width: 100%" cellpadding="3">
<tr>
<td>
<div class="dataTables_length" id="entries_per_page">
<label>
<select name="entries_per_page" aria-controls="datatable" v-model="itemsPerPage">
<option value='2'>2</option>
<option value='20'>20</option>
<option value='30'>30</option>
</select>
entries per page
</label>
</div>
</td>
</tr>
</table>
<table class="table table-striped table-hover dataTable">
<thead>
<tr>
<th>
<div class="checkbox checkbox-styled">
<label>
<input type="checkbox" v-model="selectAll" :checked="allSelected" #click="selectAllCheckboxes">
</label>
</div>
</th>
<th v-bind:class="{'sorting': col.key !== sortKey, 'sorting_desc': col.key == sortKey && !isReversed, 'sorting_asc': col.key == sortKey && isReversed}" v-for="col in columns" #click.prevent="sort(col.key)">
<a href="#" v-cloak>${ col.label | capitalize}</a>
</th>
<th class="text-right">Actions</th>
</tr>
</thead>
<tbody>
<tr v-for="item in items | paginate | filterBy search">
<td width="57">
<div class="checkbox checkbox-styled">
<label>
<input type="checkbox" value="${ item.id }" v-model="cbIds" :checked="cbIds.indexOf(item.id) >= 0" />
</label>
</div>
</td>
<!-- !ENTITY_NAME TABLE COLUMNS START -->
<td v-cloak>${ item.id }</td>
<td v-cloak>${ item.title }</td>
<!-- !ENTITY_NAME TABLE COLUMNS END -->
<td class="text-right">
<button type="button" class="btn btn-icon-toggle" data-toggle="tooltip" data-placement="top" data-original-title="Edit row" #click="editItem(item)">
<i class="fa fa-pencil"></i></button>
<button type="button" class="btn btn-icon-toggle" data-toggle="tooltip" data-placement="top" data-original-title="Delete row" #click="deleteModalOpened(item)">
<i class="fa fa-trash-o"></i>
</button>
</td>
</tr>
</tbody>
</table>
<!-- PAGINATION START -->
<div class="dataTables_info" role="status" aria-live="polite" v-if="resultCount > 0" v-cloak>
Showing ${ currentCountFrom } to ${ currentCountTo } of ${ resultCount } entries
</div>
<div class="dataTables_paginate paging_simple_numbers" id="datatable_paginate" v-if="resultCount > 0">
<a class="paginate_button previous disabled" #click="previousPage()" v-if="currentPage==0">
<i class="fa fa-angle-left"></i>
</a>
<a class="paginate_button previous" #click="previousPage()" v-else>
<i class="fa fa-angle-left"></i>
</a>
<span v-for="pageNumber in totalPages">
<a class="paginate_button current" #click="setPage(pageNumber)" v-show="pageNumber == currentPage" v-cloak>${ pageNumber + 1 }</a>
<a class="paginate_button" #click="setPage(pageNumber)" v-show="pageNumber != currentPage" v-cloak>${ pageNumber + 1 }</a>
</span>
<a class="paginate_button next disabled" #click="nextPage()" v-if="currentPage == (totalPages - 1)">
<i class="fa fa-angle-right"></i>
</a>
<a class="paginate_button previous" #click="nextPage()" v-else>
<i class="fa fa-angle-right"></i>
</a>
</div>
<!-- PAGINATION END -->
</div>
</div>
</div>
</div>
</form>
<!-- BEGIN DATA TABLE END -->
</div>
<script>
Vue.config.delimiters = ['${', '}'];
new Vue({
el: '#app',
data: {
items: [],
columns: [
{
key: 'id' ,
label: 'id' ,
},
{
key: 'title' ,
label: 'title' ,
},
],
// ALL PAGINATION VARS
currentPage: 0,
itemsPerPage: 20,
resultCount: 0,
totalPages: 0,
currentCountFrom: 0,
currentCountTo: 0,
allSelected: false,
cbIds: [],
sortKey: '',
isReversed: false
},
computed: {
totalPages: function() {
return Math.ceil(this.resultCount / this.itemsPerPage);
},
currentCountFrom: function () {
return this.itemsPerPage * this.currentPage + 1;
},
currentCountTo: function () {
var to = (this.itemsPerPage * this.currentPage) + this.itemsPerPage;
return to > this.resultCount ? this.resultCount : to;
}
},
ready: function() {
this.pageUrl = '{{ path('items_ajax_list') }}';
this.getVueItems();
},
filters: {
paginate: function(list) {
this.resultCount = this.items.length;
if (this.currentPage >= this.totalPages) {
this.currentPage = Math.max(0, this.totalPages - 1);
}
var index = this.currentPage * this.itemsPerPage;
return this.items.slice(index, index + this.itemsPerPage);
}
},
methods : {
sort: function (column) {
if (column !== this.sortKey) {
this.sortKey = column;
this.items.sort(this.sortAlphaNum);
this.isReversed = false;
return;
}
this.reverse();
if (this.isReversed) {
this.isReversed = false;
}
else {
this.isReversed = true;
}
},
reverse: function () {this.items.reverse()},
sortAlphaNum: function (a, b) {
if (a[this.sortKey] === undefined) return;
if (b[this.sortKey] === undefined) return;
var cva = a[this.sortKey].toString().toLowerCase();
var cvb = b[this.sortKey].toString().toLowerCase();
var reA = /[^a-zA-Z]/g;
var reN = /[^0-9]/g;
var aA = cva.replace(reA, "");
var bA = cvb.replace(reA, "");
if(aA === bA) {
var aN = parseInt(cva.replace(reN, ""), 10);
var bN = parseInt(cvb.replace(reN, ""), 10);
return aN === bN ? 0 : aN > bN ? 1 : -1;
}
return aA > bA ? 1 : -1;
},
setPage: function(pageNumber) {this.currentPage = pageNumber},
nextPage: function () {
if (this.pageNumber + 1 >= this.currentPage) return;
this.setPage(this.currentPage + 1);
},
previousPage: function () {
if (this.currentPage == 0) return;
this.setPage(this.currentPage - 1);
},
getVueItems: function(page){
this.$http.get(this.pageUrl)
.then((response) => {
var res = JSON.parse(response.data);
this.$set('items', res);
});
},
}
});
</script>
Regarding your first problem, You can break the bigger array in smaller arrays, than show those on paginated way and sort the smaller array, I have created a fiddle to demo it here.
Following is code to break it in smaller arrays:
computed: {
chunks () {
var size = 2, smallarray = [];
for (var i= 0; i<this.data.length; i+=size) {
smallarray.push(this.data.slice(i,i+size))
}
return smallarray
}
}
Regarding your second problem, if the issue is that items is not getting properly populated after this.$http.get call, it can be due to wrong scope of this variable as well, which can be corrected like following:
getVueItems: function(page){
var self = this
this.$http.get(this.pageUrl)
.then((response) => {
var res = JSON.parse(response.data);
self.items = res;
});
},

Getting error in jmeter while executing script "special character and alpha..."

I am getting below error. Script has been attached in screenshot.
Please let me know the solution step by step.
<span class="left tooltip_link"><i class="fa fa-question-circle"></i></span>
</td>
</tr>
<tr>
<td class="text-right" width="200">
<label for="ContentPlaceHolder1_txtDescription" id="ContentPlaceHolder1_lblDescription">Description : </label>
</td>
<td>
<input name="ctl00$ContentPlaceHolder1$txtDescription" type="text" value="290802016 " maxlength="200" id="ContentPlaceHolder1_txtDescription" title="Enter Description" class="left" style="width:150px;" />
<span class="left tooltip_link"><i class="fa fa-question-circle"></i></span>
</td>
</tr>
</table>
</div>
<div class="clear">
<span id="ContentPlaceHolder1_rfvFileName" class="FontClass" style="display:none;"></span>
<span id="ContentPlaceHolder1_rfvValidFileName" class="FontClass" style="display:none;"></span>
<span id="ContentPlaceHolder1_rfvDesc" class="FontClass" style="display:none;"></span>
<span id="ContentPlaceHolder1_rfvValidDescription" class="FontClass" style="display:none;"></span>
</div>
</div>
</div>
<div class="mar-bot-10 clear">
<input type="submit" name="ctl00$ContentPlaceHolder1$btnAdd" value="Save" onclick="DataTool.ValidateAndToggleVisiblity(Page_ClientValidate('valForSchedule'));WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$btnAdd", "", true, "valForSchedule", "", false, false))" id="ContentPlaceHolder1_btnAdd" title="Click to add new schedule" class="btn-clear" />
<input type="submit" name="ctl00$ContentPlaceHolder1$btnReset" value="Reset" id="ContentPlaceHolder1_btnReset" class="btn-clear" />
</div>
|0|hiddenField|__EVENTTARGET||0|hiddenField|__EVENTARGUMENT||452|hiddenField|__VIEWSTATE|/wEPBbgCSDRzSUFBQUFBQUFFQVB2UHlNL0thV2x1YW1CbWJHUm96cDhpeHBRR0lwZ1lnYVJBR3I4WWt4eG5abDVlYWxGR1NXNE9xNWROY1VsUmZsNjZuWDlBaUdkd3ZHTktibWFlalQ1VVRLRkd3U1pSSWFNb05jMVdYVmxkSVQ4dk9TY3pPZHRXM1NjLzNiKzBSRVBUV3QwT3lGUUFzbTMwRSsxU21KaEJock9BMUxQS1pwU1VGRmpwNjJjbUp4YVZGaGNVNk9VWGxHUVdKeFlVRk9zbDUrZW1NQW1CbExLSFpSWm5KdVdrWnFRd0NRUDU4a3pwS1V4eU1JWUNqS0VJWTZoQ3ZRRzJKU1Mxb29SVnhMa29OYkVrVmNIVktUaElJVGc1SXpXbE5DYzFKUVVBY3dqaFdRSUJBQUE9ZBpxCDqRIEungR80i/4HRMqKquCH|8|hiddenField|__VIEWSTATEGENERATOR|29933832|0|asyncPostBackControlIDs|||0|postBackControlIDs|||72|updatePanelIDs||tctl00$ContentPlaceHolder1$UpdatePanel1,ContentPlaceHolder1_UpdatePanel1|0|childUpdatePanelIDs|||71|panelsToRefreshIDs||ctl00$ContentPlaceHolder1$UpdatePanel1,ContentPlaceHolder1_UpdatePanel1|4|asyncPostBackTimeout||3600|18|formAction||./AddSchedule.aspx|12|pageTitle||Add Schedule|57|arrayDeclaration|Page_ValidationSummaries|document.getElementById("ContentPlaceHolder1_vldSummary")|58|arrayDeclaration|Page_Validators|document.getElementById("ContentPlaceHolder1_rfvFileName")|63|arrayDeclaration|Page_Validators|document.getElementById("ContentPlaceHolder1_rfvValidFileName")|54|arrayDeclaration|Page_Validators|document.getElementById("ContentPlaceHolder1_rfvDesc")|66|arrayDeclaration|Page_Validators|document.getElementById("ContentPlaceHolder1_rfvValidDescription")|194|scriptBlock|ScriptPath|/data/ScriptResource.axd?d=PIkWxDViaZE5PI1d5VC9u3oaIGXTi2MiwQcE00IlXrZtNMOjZbsuJ0QIWWw4HReSlnuBaIUBUZZbJyN_wtr3SycmM_LR-6SrO9qBExQmsX44PlsjganwUlmgp8zJhCIB2B9n40PUePHmOsGPVqSntMHbDWA1&t=1c6690ce|267|scriptStartupBlock|ScriptContentNoTags|
(function(id) {
var e = document.getElementById(id);
if (e) {
e.dispose = function() {
Array.remove(Page_ValidationSummaries, document.getElementById(id));
}
e = null;
}
})('ContentPlaceHolder1_vldSummary');
|281|scriptStartupBlock|ScriptContentNoTags|
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
ValidatorOnLoad();
}
function ValidatorOnSubmit() {
if (Page_ValidationActive) {
return ValidatorCommonOnSubmit();
}
else {
return true;
}
}
|184|scriptStartupBlock|ScriptContentNoTags|
document.getElementById('ContentPlaceHolder1_rfvFileName').dispose = function() {
Array.remove(Page_Validators, document.getElementById('ContentPlaceHolder1_rfvFileName'));
}
|194|scriptStartupBlock|ScriptContentNoTags|
document.getElementById('ContentPlaceHolder1_rfvValidFileName').dispose = function() {
Array.remove(Page_Validators, document.getElementById('ContentPlaceHolder1_rfvValidFileName'));
}
|176|scriptStartupBlock|ScriptContentNoTags|
document.getElementById('ContentPlaceHolder1_rfvDesc').dispose = function() {
Array.remove(Page_Validators, document.getElementById('ContentPlaceHolder1_rfvDesc'));
}
|200|scriptStartupBlock|ScriptContentNoTags|
document.getElementById('ContentPlaceHolder1_rfvValidDescription').dispose = function() {
Array.remove(Page_Validators, document.getElementById('ContentPlaceHolder1_rfvValidDescription'));
}
|90|onSubmit||if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;|6|expando|document.getElementById('ContentPlaceHolder1_vldSummary')['displaymode']|"List"|16|expando|document.getElementById('ContentPlaceHolder1_vldSummary')['validationGroup']|"valForSchedule"|37|expando|document.getElementById('ContentPlaceHolder1_rfvFileName')['controltovalidate']|"ContentPlaceHolder1_txtScheduleName"|3|expando|document.getElementById('ContentPlaceHolder1_rfvFileName')['focusOnError']|"t"|27|expando|document.getElementById('ContentPlaceHolder1_rfvFileName')['errormessage']|"Schedule name is required"|6|expando|document.getElementById('ContentPlaceHolder1_rfvFileName')['display']|"None"|16|expando|document.getElementById('ContentPlaceHolder1_rfvFileName')['validationGroup']|"valForSchedule"|39|expando|document.getElementById('ContentPlaceHolder1_rfvFileName')['evaluationfunction']|"RequiredFieldValidatorEvaluateIsValid"|2|expando|document.getElementById('ContentPlaceHolder1_rfvFileName')['initialvalue']|""|37|expando|document.getElementById('ContentPlaceHolder1_rfvValidFileName')['controltovalidate']|"ContentPlaceHolder1_txtScheduleName"|3|expando|document.getElementById('ContentPlaceHolder1_rfvValidFileName')['focusOnError']|"t"|129|expando|document.getElementById('ContentPlaceHolder1_rfvValidFileName')['errormessage']|"Schedule name should only contain \u0027_\u0027 as special character and alpha numeric values with max lenght of 50 characters."|6|expando|document.getElementById('ContentPlaceHolder1_rfvValidFileName')['display']|"None"|16|expando|document.getElementById('ContentPlaceHolder1_rfvValidFileName')['validationGroup']|"valForSchedule"|43|expando|document.getElementById('ContentPlaceHolder1_rfvValidFileName')['evaluationfunction']|"RegularExpressionValidatorEvaluateIsValid"|23|expando|document.getElementById('ContentPlaceHolder1_rfvValidFileName')['validationexpression']|"^[A-Za-z0-9 _]{1,50}$"|36|expando|document.getElementById('ContentPlaceHolder1_rfvDesc')['controltovalidate']|"ContentPlaceHolder1_txtDescription"|3|expando|document.getElementById('ContentPlaceHolder1_rfvDesc')['focusOnError']|"t"|25|expando|document.getElementById('ContentPlaceHolder1_rfvDesc')['errormessage']|"Description is required"|6|expando|document.getElementById('ContentPlaceHolder1_rfvDesc')['display']|"None"|16|expando|document.getElementById('ContentPlaceHolder1_rfvDesc')['validationGroup']|"valForSchedule"|39|expando|document.getElementById('ContentPlaceHolder1_rfvDesc')['evaluationfunction']|"RequiredFieldValidatorEvaluateIsValid"|2|expando|document.getElementById('ContentPlaceHolder1_rfvDesc')['initialvalue']|""|36|expando|document.getElementById('ContentPlaceHolder1_rfvValidDescription')['controltovalidate']|"ContentPlaceHolder1_txtDescription"|3|expando|document.getElementById('ContentPlaceHolder1_rfvValidDescription')['focusOnError']|"t"|128|expando|document.getElementById('ContentPlaceHolder1_rfvValidDescription')['errormessage']|"Description should only contain \u0027_\u0027 as special character and alpha numeric values with max lenght of 200 characters."|6|expando|document.getElementById('ContentPlaceHolder1_rfvValidDescription')['display']|"None"|16|expando|document.getElementById('ContentPlaceHolder1_rfvValidDescription')['validationGroup']|"valForSchedule"|43|expando|document.getElementById('ContentPlaceHolder1_rfvValidDescription')['evaluationfunction']|"RegularExpressionValidatorEvaluateIsValid"|24|expando|document.getElementById('ContentPlaceHolder1_rfvValidDescription')['validationexpression']|"^[A-Za-z0-9 _]{1,200}$"|
You need to correlate at least __VIEWSTATE and __VIEWSTATEGENERATOR values with i.e. Regular Expression Extractor like you use timestamps for "ScheduleName" and "Description".
Search the web for "JMeter Correlation"- there is a plenty of information on the topic.
For .NET applications specifics you might also want to check out ASP.NET Login Testing with JMeter guide

FPDF chinese encode

I am using FPDF to generate order invoice to customer, so far everything is working fine, except of some of our item name are mixed with Chinese text, and the output is somehow becoming alien's wording, as attached screenshot:
Script to generate PDF invoice:
<?php
require('fpdf.php');
//function hex2dec
//returns an associative array (keys: R,G,B) from a hex html code (e.g. #3FE5AA)
function hex2dec($couleur = "#000000"){
$R = substr($couleur, 1, 2);
$rouge = hexdec($R);
$V = substr($couleur, 3, 2);
$vert = hexdec($V);
$B = substr($couleur, 5, 2);
$bleu = hexdec($B);
$tbl_couleur = array();
$tbl_couleur['R']=$rouge;
$tbl_couleur['G']=$vert;
$tbl_couleur['B']=$bleu;
return $tbl_couleur;
}
//conversion pixel -> millimeter in 72 dpi
function px2mm($px){
return $px*25.4/72;
}
function txtentities($html){
$trans = get_html_translation_table(HTML_ENTITIES);
$trans = array_flip($trans);
return strtr($html, $trans);
}
class PDF extends FPDF
{
//variables of html parser
protected $B;
protected $I;
protected $U;
protected $HREF;
protected $fontList;
protected $issetfont;
protected $issetcolor;
function __construct($orientation='P', $unit='mm', $format='A4')
{
//Call parent constructor
parent::__construct($orientation,$unit,$format);
//Initialization
$this->B=0;
$this->I=0;
$this->U=0;
$this->HREF='';
$this->tableborder=0;
$this->tdbegin=false;
$this->tdwidth=0;
$this->tdheight=0;
$this->tdalign="L";
$this->tdbgcolor=false;
$this->oldx=0;
$this->oldy=0;
$this->fontlist=array("arial","times","courier","helvetica","symbol");
$this->issetfont=false;
$this->issetcolor=false;
}
//////////////////////////////////////
//html parser
function WriteHTML($html)
{
$html=strip_tags($html,"<b><u><i><a><img><p><br><strong><em><font><tr><blockquote><hr><td><tr><table><sup>"); //remove all unsupported tags
$html=str_replace("\n",'',$html); //replace carriage returns with spaces
$html=str_replace("\t",'',$html); //replace carriage returns with spaces
$a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE); //explode the string
foreach($a as $i=>$e)
{
if($i%2==0)
{
//Text
if($this->HREF)
$this->PutLink($this->HREF,$e);
elseif($this->tdbegin) {
if(trim($e)!='' && $e!=" ") {
$this->Cell($this->tdwidth,$this->tdheight,$e,$this->tableborder,'',$this->tdalign,$this->tdbgcolor);
}
elseif($e==" ") {
$this->Cell($this->tdwidth,$this->tdheight,'',$this->tableborder,'',$this->tdalign,$this->tdbgcolor);
}
}
else
$this->Write(5,stripslashes(txtentities($e)));
}
else
{
//Tag
if($e[0]=='/')
$this->CloseTag(strtoupper(substr($e,1)));
else
{
//Extract attributes
$a2=explode(' ',$e);
$tag=strtoupper(array_shift($a2));
$attr=array();
foreach($a2 as $v)
{
if(preg_match('/([^=]*)=["\']?([^"\']*)/',$v,$a3))
$attr[strtoupper($a3[1])]=$a3[2];
}
$this->OpenTag($tag,$attr);
}
}
}
}
function OpenTag($tag, $attr)
{
//Opening tag
switch($tag){
case 'SUP':
if( !empty($attr['SUP']) ) {
//Set current font to 6pt
$this->SetFont('','',6);
//Start 125cm plus width of cell to the right of left margin
//Superscript "1"
$this->Cell(2,2,$attr['SUP'],0,0,'L');
}
break;
case 'TABLE': // TABLE-BEGIN
if( !empty($attr['BORDER']) ) $this->tableborder=$attr['BORDER'];
else $this->tableborder=0;
break;
case 'TR': //TR-BEGIN
break;
case 'TD': // TD-BEGIN
if( !empty($attr['WIDTH']) ) $this->tdwidth=($attr['WIDTH']/4);
else $this->tdwidth=40; // Set to your own width if you need bigger fixed cells
if( !empty($attr['HEIGHT']) ) $this->tdheight=($attr['HEIGHT']/6);
else $this->tdheight=6; // Set to your own height if you need bigger fixed cells
if( !empty($attr['ALIGN']) ) {
$align=$attr['ALIGN'];
if($align=='LEFT') $this->tdalign='L';
if($align=='CENTER') $this->tdalign='C';
if($align=='RIGHT') $this->tdalign='R';
}
else $this->tdalign='R'; // Set to your own
if( !empty($attr['BGCOLOR']) ) {
$coul=hex2dec($attr['BGCOLOR']);
$this->SetFillColor($coul['R'],$coul['G'],$coul['B']);
$this->tdbgcolor=true;
}
$this->tdbegin=true;
break;
case 'HR':
if( !empty($attr['WIDTH']) )
$Width = $attr['WIDTH'];
else
$Width = $this->w - $this->lMargin-$this->rMargin;
$x = $this->GetX();
$y = $this->GetY();
$this->SetLineWidth(0.2);
$this->Line($x,$y,$x+$Width,$y);
$this->SetLineWidth(0.2);
$this->Ln(1);
break;
case 'STRONG':
$this->SetStyle('B',true);
break;
case 'EM':
$this->SetStyle('I',true);
break;
case 'B':
case 'I':
case 'U':
$this->SetStyle($tag,true);
break;
case 'A':
$this->HREF=$attr['HREF'];
break;
case 'IMG':
if(isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) {
if(!isset($attr['WIDTH']))
$attr['WIDTH'] = 0;
if(!isset($attr['HEIGHT']))
$attr['HEIGHT'] = 0;
$this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT']));
}
break;
case 'BLOCKQUOTE':
case 'BR':
$this->Ln(5);
break;
case 'P':
$this->Ln(10);
break;
case 'FONT':
if (isset($attr['COLOR']) && $attr['COLOR']!='') {
$coul=hex2dec($attr['COLOR']);
$this->SetTextColor($coul['R'],$coul['G'],$coul['B']);
$this->issetcolor=true;
}
if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) {
$this->SetFont(strtolower($attr['FACE']));
$this->issetfont=true;
}
if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist) && isset($attr['SIZE']) && $attr['SIZE']!='') {
$this->SetFont(strtolower($attr['FACE']),'',$attr['SIZE']);
$this->issetfont=true;
}
break;
}
}
function CloseTag($tag)
{
//Closing tag
if($tag=='SUP') {
}
if($tag=='TD') { // TD-END
$this->tdbegin=false;
$this->tdwidth=0;
$this->tdheight=0;
$this->tdalign="L";
$this->tdbgcolor=false;
}
if($tag=='TR') { // TR-END
$this->Ln();
}
if($tag=='TABLE') { // TABLE-END
$this->tableborder=0;
}
if($tag=='STRONG')
$tag='B';
if($tag=='EM')
$tag='I';
if($tag=='B' || $tag=='I' || $tag=='U')
$this->SetStyle($tag,false);
if($tag=='A')
$this->HREF='';
if($tag=='FONT'){
if ($this->issetcolor==true) {
$this->SetTextColor(0);
}
if ($this->issetfont) {
$this->SetFont('arial');
$this->issetfont=false;
}
}
}
function SetStyle($tag, $enable)
{
//Modify style and select corresponding font
$this->$tag+=($enable ? 1 : -1);
$style='';
foreach(array('B','I','U') as $s) {
if($this->$s>0)
$style.=$s;
}
$this->SetFont('',$style);
}
function PutLink($URL, $txt)
{
//Put a hyperlink
$this->SetTextColor(0,0,255);
$this->SetStyle('U',true);
$this->Write(5,$txt,$URL);
$this->SetStyle('U',false);
$this->SetTextColor(0);
}
// Page header
function Header()
{
// Logo
$this->Image(logo-mono.jpg',10,10,30);
$this->SetFont('Arial','B',15);
$this->Cell(138);
$this->Cell(70,5,'TAX INVOICE',0,0,'C');
$this->Ln(12);
// Company Header
$this->SetFont('Arial','B',9);
$this->Cell(0,5,'ABC COMPANY (1063511-D)',0,0,'L');
$this->Ln(0);
// Line break
$this->Ln(15);
}
// Page footer
function Footer()
{
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Arial italic 8
$this->SetFont('Arial','I',8);
// Page number
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
//Fetching specific order data and prepare an invoice
$invoice = $buyer->get_completed_transaction(
filter_var('1466404785-0J2XQR',FILTER_SANITIZE_STRING),
filter_var('T108869482600',FILTER_SANITIZE_STRING),
filter_var('LG6j3DYQbnylAFdaSdzcx5J0SYo=',FILTER_SANITIZE_STRING),
$mysqli
);
if($invoice !== FALSE){
//Checkout with BRP+CASH or CASH only, 2=BRP+CASH.
$checkout_method = $invoice->checkout_method;
//GENERATE INVOICE
$shipping_addr_1 = $invoice->shipping_address.',';
$shipping_addr_2 = $invoice->shipping_postcode.' '.$invoice->shipping_city.',';
$shipping_addr_3 = $invoice->shipping_province.' '.$invoice->shipping_country.'.';
// Instanciation of inherited class
$pdf = new PDF('P', 'mm', 'A4');
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Arial','B',9);
$pdf->setFillColor(230,230,230);
$pdf->Cell(50,5,'BILL TO',1,0,'L',1);
$pdf->Ln(3);
//
$pdf->SetFont('Arial','',9);
$pdf->Cell(0,15,strtoupper($invoice->recipient_name),0,0,'L');
$pdf->SetFont('Arial','B',8);
$pdf->Text(146,58,'DATE:');
$pdf->Text(146,63,'INVOICE #');
$pdf->Text(146,68,'CUSTOMER ID');
$pdf->SetFont('Arial','',8);
$pdf->Text(170,58,date('d/m/Y'));
$pdf->Text(170,63,$invoice->order_num);
$pdf->Ln(5);
$pdf->SetFont('Arial','',8);
$pdf->Cell(0,15,ucwords(strtolower($shipping_addr_1)),0,0,'L');
$pdf->Ln(5);
$pdf->Cell(0,15,ucwords(strtolower($shipping_addr_2)),0,0,'L');
$pdf->Ln(5);
$pdf->Cell(0,15,ucwords(strtolower($shipping_addr_3)),0,0,'L');
//
/*
$pdf->Ln(5);
$pdf->SetFont('Arial','B',8);
$pdf->Cell(10,25,'Tel:');
$pdf->SetFont('Arial','',8);
$pdf->Cell(0,25,$invoice->phone);
//
$pdf->Ln(5);
$pdf->SetFont('Arial','B',8);
$pdf->Cell(10,25,'Email:');
$pdf->SetFont('Arial','',8);
$pdf->Cell(118,25,$invoice->email);
*/
//
$pdf->Ln(14);
$pdf->SetFont('Arial','',8);
$html = '
<table border="1">
<tr>
<td width="30" height="30" bgcolor="#dddddd" align="left">No</td>
<td width="90" height="30" bgcolor="#dddddd" align="left">Item Code</td>
<td width="380" height="30" bgcolor="#dddddd" align="left">Descriptions</td>
<td width="40" height="30" bgcolor="#dddddd">Qty</td>
<td width="100" height="30" bgcolor="#dddddd">Price/Unit</td>
<td width="120" height="30" bgcolor="#dddddd">Amount</td>
</tr>';
$i = 1;
$shipping_rate = SHIPPING_RATE_ALL;
$total_payment = 0;
//Loop order items
$items = unserialize($invoice->cart_item);
foreach($items as $item){
//$keys = array_keys($item);
//$matches = preg_grep('~^p_alt\-variation\-\d+~i', $keys);
$unit_price = ($checkout_method == 2) ? ($item['p_price']/2) : $item['p_price'];
$subtotal = ($checkout_method == 2) ? (($item['p_price']/2) * $item['p_qty']) : ($item['p_price'] * $item['p_qty']);
$html .= '
<tr>
<td width="30" height="30" align="left">'.$i.'</td>
<td width="90" height="30" align="left">'.$item['p_code'].'</td>
<td width="380" height="30" align="left">'.$item['p_name'].'</td>
<td width="40" height="30">'.$item['p_qty'].'</td>
<td width="100" height="30">'.number_format($unit_price, 2, '.', ',').'</td>
<td width="120" height="30">'.number_format($subtotal, 2, '.', ',').'</td>
</tr>';
$i++;
$gross_payment += $subtotal;
}
//End Loop
$html .= '
<tr>
<td width="30" height="30"> </td>
<td width="90" height="30"> </td>
<td width="380" height="30"> </td>
<td width="40" height="30"> </td>
<td width="100" height="30"> </td>
<td width="120" height="30"> </td>
</tr>
<tr>
<td width="30" height="30"> </td>
<td width="90" height="30"> </td>
<td width="380" height="30"> </td>
<td width="40" height="30"> </td>
<td width="100" height="30"> </td>
<td width="120" height="30"> </td>
</tr>
</table>';
$pdf->WriteHTML($html);
//
$pdf->Ln(2);
$pdf->SetFont('Arial','',8);
$pdf->Cell(156,5,'Subtotal',0,0,'R');
$pdf->Cell(8,5,'$',0,0,'R');
$pdf->Cell(0,5,number_format($gross_payment,2,'.',','),0,1,'R');
$pdf->Cell(0,5,'Thank you for your business',0,0,'L');
$pdf->Cell(-34,5,'Shipping Cost',0,0,'R');
$pdf->Cell(8,5,'$',0,0,'R');
$pdf->Cell(0,5,number_format($shipping_rate,2,'.',','),0,1,'R');
if($checkout_method == 2){
$pdf->Cell(156,5,'BRP Consume',0,0,'R');
$pdf->Cell(8,5,'-',0,0,'R');
$pdf->Cell(0,5,number_format($invoice->total_points_consume,0,'.',','),0,1,'R');
}
$pdf->Ln(1);
$pdf->Cell(125,0,'',0,0,'R');
$pdf->Cell(65,0,'',1,0,'R');
$pdf->Ln(1);
$pdf->SetFont('Arial','B',8);
$pdf->Cell(156,10,'Total Including GST',0,0,'R');
$pdf->Cell(8,10,'$',0,0,'R',1);
$pdf->Cell(0,10,number_format($gst+$gross_payment+$shipping_rate,2,'.',','),0,1,'R',1);
$pdf->Ln(1);
//GST calculation
$gst = round((($gross_payment+$shipping_rate)*6.00)/100, 1);
$pdf->SetFont('Arial','',8);
$pdf->SetTextColor('88','88','88');
$pdf->Cell(156,5,'GST 6%',0,0,'R');
$pdf->Cell(8,5,'$',0,0,'R');
$pdf->Cell(0,5,number_format($gst,2,'.',','),0,1,'R');
$pdf->Ln(1);
//
$pdf->Ln(10);
//$pdf->WriteHTML('<HR>');
$pdf->SetFont('Arial','B',8);
$pdf->Cell(90,5,'ABC COMPANY',0,0,'L',0);
$pdf->Ln(20);
$pdf->Cell(50,0,'',1,1,'L',0);
$pdf->Ln(1);
$pdf->SetFont('Arial','BI',8);
$pdf->Cell(90,5,'Authorised Signature',0,0,'L',0);
$path = '/invoice/';
$file = $invoice->order_num.'.pdf';
$pdf->Output();
}
?>
I've been look for the solution around and tried with tFPDF, I get error with
Fatal error: Call to undefined method tFPDF::WriteHTML() in C:\pathto\create_invoice_test.php on line 448
I have no idea of how to implement it into current scripts, I need workaround to solve this issue.

Resources