I'm creating a PDF file with the TCPDF library. The function worked fine on the old server, but when I installed it on a new host, I received the following error. I searched extensively and discovered numerous topics claiming that the error was caused by XHTML syntax.
A PHP Error was encountered
Severity: Warning
Message: Undefined array key "thead"
Filename: tcpdf/tcpdf.php
Line Number: 16571
Backtrace:
File: C:\xampp\htdocs\townteam\application\libraries\tcpdf\tcpdf.php
Line: 16571 Function: _error_handler
File: C:\xampp\htdocs\townteam\application\libraries\tcpdf\tcpdf.php
Line: 17272 Function: getHtmlDomArray
File: C:\xampp\htdocs\townteam\application\libraries\tcpdf\tcpdf.php
Line: 5859 Function: writeHTML
File: C:\xampp\htdocs\townteam\application\libraries\tcpdf\tcpdf.php
Line: 17167 Function: MultiCell
File: C:\xampp\htdocs\townteam\application\views\pdfMachineCard_v.php
Line: 165 Function: writeHTMLCell
File:
C:\xampp\htdocs\townteam\application\controllers\MachineCards.php
Line: 307 Function: view
File: C:\xampp\htdocs\townteam\index.php Line: 315 Function:
require_once
Code
<?php
//============================================================+
// File name : example_005.php
// Begin : 2008-03-04
// Last Update : 2013-05-14
//
// Description : Example 005 for TCPDF class
// Multicell
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com LTD
// www.tecnick.com
// info#tecnick.com
//============================================================+
/**
* Creates an example PDF TEST document using TCPDF
* #package com.tecnick.tcpdf
* #abstract TCPDF - Example: Multicell
* #author Nicola Asuni
* #since 2008-03-04
*/
// Include the main TCPDF library (search for installation path).
//require_once('tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Mohamed Syam');
$pdf->SetTitle($user[0]['s_name']);
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
//PDF_HEADER_TITLE
$pdf->SetHeaderData($user[0]['s_logo'], '50', '', ''); // header of the file
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 005', PDF_HEADER_STRING); // header of the file
// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP+10, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (#file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('times', '', 10);
// add a page
$pdf->AddPage();
// set cell padding
$pdf->setCellPaddings(1, 1, 1, 1);
// set cell margins
$pdf->setCellMargins(1, 1, 1, 1);
// set color for background
$pdf->SetFillColor(255, 255, 127);
// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)
// set some text for example
// set some text for example starting from here syam
$transactionNo="Machine Card No(# ".$head[0]['mc_id'].")";
$desc=$head[0]['mp_name'];
//$title=<<<EOD
//<h6> </h6>
//EOD;
$pdf->writeHTMLCell(0,0,'','',$transactionNo,0,1,0,true,'C',true);
$pdf->writeHTMLCell(0,0,'','',$desc,0,1,0,true,'C',true);
$name ='<table style="padding: 6px; text-align: left;font-size: x-small ;width: auto ">';
$name.='<tr>
<th style="border:1px solid #000;width:100px;background-color:#CCCCCC">Category</th>
<th style="border:1px solid #000">'.strtoupper ($head[0]['mac_cat']).'</th>
</tr>
<tr>
<th style="border:1px solid #000;width:100px;background-color:#CCCCCC">Supplier</th>
<th style="border:1px solid #000">'.strtoupper ($head[0]['ms_name']).'</th>
</tr>
<tr>
<th style="border:1px solid #000;background-color:#CCCCCC">Class</th>
<th style="border:1px solid #000">'.strtoupper ($head[0]['mc_name']).'</th>
</tr>
<tr>
<th style="border:1px solid #000;background-color:#CCCCCC">Purpose</th>
<th style="border:1px solid #000">'.strtoupper ($head[0]['mp_name']).'</th>
</tr>
<tr>
<th style="border:1px solid #000;background-color:#CCCCCC">Delivery Date</th>
<th style="border:1px solid #000">'.strtoupper ($head[0]['mac_date']).'</th>
</tr>
<tr>
<th style="border:1px solid #000;background-color:#CCCCCC">Serial Number</th>
<th style="border:1px solid #000">'.strtoupper ($head[0]['a_code']).'</th>
</tr>
<tr>
<th style="border:1px solid #000;background-color:#CCCCCC">Factory Code</th>
<th style="border:1px solid #000">'.strtoupper ($head[0]['a_name']).'</th>
</tr>
<tr>
<th style="border:1px solid #000;background-color:#CCCCCC">Plant</th>
<th style="border:1px solid #000">'.strtoupper ($head[0]['loc_name']).'</th>
</tr>
<tr>
<th style="border:1px solid #000;background-color:#CCCCCC">Department</th>
<th style="border:1px solid #000">'.strtoupper ($head[0]['d_name']).'</th>
</tr> </table> <br><br>';
$table ='';
if(count($transactions) > 0){
$table.='<table style="border:1px solid #000;padding: 5px;"> <thead>';
$table.='<tr style="background-color:#CCCCCC">
<th style="border:1px solid #000;font-size: 10px">Date</th>
<th style="border:1px solid #000;font-size: 10px">Description</th>
<th style="border:1px solid #000;font-size: 10px">Installed Items [QTY]</th>
<th style="border:1px solid #000;font-size: 10px">Responsible</th>
</tr>';
$table.="</thead>";
}
foreach ($transactions as $row){
$table.='<tr>
<td style="border:1px solid #000;font-size: 10px">'.$row->mt_date.'</td>
<td style="border:1px solid #000;font-size: 10px">'.$row->mt_desc.'</td>
<td style="border:1px solid #000;font-size: 10px">'.$row->installed.'</td>
<td style="border:1px solid #000;font-size: 10px">'.$row->u_name.'</td>
</tr>';
}
$table .='</table>';
$pdf->writeHTMLCell(0,0,'','',$name,0,1,0,true,'L',true);
$pdf->writeHTMLCell(0,0,'','',$table,0,1,0,true,'C',true);
//c
// move pointer to last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
ob_clean();
//ob_end_clean();
$pdf->Output("MachineCard No#".$head[0]['a_code'].'.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
Thanks
Related
I'm currently a C# dotnet automation engineer. One of my tests results output is via email. My tests results output goes through powershell. I'm fairly new to email templates and HTML in general.
It's a simple HTML body with variables that I replace with $EmailBody= $EmailBody.Replace("PassedTests",$Passed) function etc
The whole premise: my script replaces Total tests/Passed/Failed/Skipped with data that I extract from a .trx file after the test run.
My extraction code:
$PassedTests = $testResultsXml.TestRun.ResultSummary.Counters.Passed
$FailedTests = $testResultsXml.TestRun.ResultSummary.Counters.Failed
$SkippedTests = $testResultsXml.TestRun.ResultSummary.Counters.Skipped
$OnlyFailed = $testResultsXml.TestRun.Results.UnitTestResult | Where-Object { $_.outcome -eq "Failed" }
$FailedTestsName = $OnlyFailed.TestName
I have the "Error list" table (picture below) that shows test names if there are any failed tests that in the HTML body
#</td>
</tr>
<!--end img-->
<tr>
<td height="15"></td>
</tr>
<!--title-->
<tr align="center">
<td align="center" style="font-family:
'Open Sans', Arial, sans-serif; font-size:16px;color:#3b3b3b;font-weight: bold;">**ERROR LIST**</td>
</tr>
<!--end title-->
<tr>
<td height="10"></td>
</tr>
<!--content-->
<tr align="center">
<td align="center" style="font-family: 'Open Sans', Arial, sans-serif; font-size:12px;color:#7f8c8d;line-height: 24px;">NoErrors</td>
</tr>
<!--end content-->
</table>
</td>
</tr>
<tr>
<td height="30"></td>
</tr>
</table>
Now the main question is: is it somehow possible to ONLY show the "Error list" table only IF there are any failed tests? If there are no failed tests it would be great for that table not to be shown at all.
Any kind of help would be greatly appreciated. Thanks!
$EmailBody= $EmailBody.Replace("PassedTests",$Passed)
$EmailBody= $EmailBody.Replace("FailedTests",$Failed)
$EmailBody= $EmailBody.Replace("SkippedTests",$Skipped)
$EmailBody= $EmailBody.Replace("ErrorList",$FailedTestsName)
$Emailattachment = "\TestResults.trx"
You are on the good path.
You just need to extend what you are doing.
Remove the thing that might or might not be in the email (The "errors list" section as it won't be there if there are no error)
Put the section your removed in its own variable
Add a placeholder in your main html template at the location where it is supposed to be (just like you do already so we can do a replace in the html template.
From there, the logic is :
If there are 0 errors, you replace the placeholder from the main template by an empty string (you don't want that placeholder to appear in the final email)
If there are 1 or more error, instead of replacing by your error list, you build a new variable that contain the section you want to append, then you replace its loop by the errors content and finally you replace the placeholder by that section (which contains the error loop)
That would look something like this.
$EmailBody = #'
</td>
</tr>
<!--end img-->
<tr>
<td height="15"></td>
</tr>
**ErrorsTable**
'#
$ErrorListBody = #'
<!--title-->
<tr align="center">
<td align="center" style="font-family:
'Open Sans', Arial, sans-serif; font-size:16px;color:#3b3b3b;font-weight: bold;">**ERROR LIST**</td>
</tr>
<!--end title-->
<tr>
<td height="10"></td>
</tr>
<!--content-->
<tr align="center">
<td align="center" style="font-family: 'Open Sans', Arial, sans-serif; font-size:12px;color:#7f8c8d;line-height: 24px;">NoErrors</td>
</tr>
<!--end content-->
</table>
</td>
</tr>
<tr>
<td height="30"></td>
</tr>
</table>
'#
if ($FailedTests.Count -gt 0) {
# inserting errors to the `$ErrorListBody` html segment
$ErrorsHtml = $ErrorListBody.Replace("ErrorList", $FailedTestsName)
# inserting the html segment into the main email
$EmailBody = $EmailBody.Replace("**ErrorsTable**", $ErrorsHtml)
} else {
# Removing the placeholder from the main template.
$EmailBody = $EmailBody.Replace("**ErrorsTable**", '')
}
Information
So what I am looking to do is scrape my local intranet where our HR team upload new starter information and be able to either hold that information in a usable format, or export it to a CSV to then be used by another script.
Currently our service desk team manually go looking at this intranet page, and create the users based on the information our HR team enter one by one.
Naturally, this is a very time consuming task that could be easily automated. Unfortunately, our HR team are not open for any changes to the process at the current time due to other work they are focusing on. Internal politics stuff, so sadly they can't be convinced.
Now, I have managed to use Invoke-WebRequest and get the content of the page but the formatting is awful. It returns as a load of HTML and I'm iterating through multiple steps of splitting and string replacing which just doesn't feel optimal to me and I feel like there is a better way to get the results I want.
Current Script
$webRequest = Invoke-WebRequest -Uri "http://intranet-site/HR/NewStarterList.php?action=ItToComp" -Headers #{"Header Info here"} -UseDefaultCredentials
$content = $webRequest.Content
$initialReplace = $content -replace '(?<=<).*?(?=>)', ' '
$split = $initialReplace -split "< >< >< >"
$split = $split -split "< >< >"
$split = $split -replace '< >',""
$split = $split[5..$($split.count)]
As you can see, this is not really ideal, and I'm wondering if there is a better way to grab just the information I need from the page.
The initial content returns as below (I have shortened and replaced any names to make it easy on the eye)
<html>
<head>
<title>New Starter List</title>
<link rel="STYLESHEET" type="text/css" href="/common/StyleSheet/Reports.css" /> <style> TD {font-family: Verdana; font-size: 8pt; border-left: solid 0px black; border-right: solid 0px black;} </style>
<script type="text/javascript" src="../../../cgi-bin/calendar/tableH.js"></script>
</head>
<body>
<img src="/common/images/logo.gif" border="0">
<br>
<br>
<b><span style="font-size: 12pt; font-variant: small-caps; ">New Starter List</span></b>
<br>Logged In As "UserName"<br>
<br>
<tableonMouseOver="javascript:trackTableHighlight(this.event,'FFFF66');"onMouseOut="javascript:highlightTableRow(0);" border="4" frame="border" width="80%" rules="none" cellspacing="6%" cellpadding="6%">
<th align="left">Date Started</th>
<th align="left">Name</th>
<th align="left">Initials</th>
<th align="left">Department</th>
<th align="left">Contact</th>
<th align="left">IT Completed?</th>
<th align="left">Supervisor Completed?</th>
<tr colspan="6"><td align="left">25 Sep 2019</td>
<td align="left">Joe Bloggs</td>
<td align="left">JXBL</td>
<td align="left">Team A</td>
<td align="left">Manager 1</td>
<td align="left">No</td>
<td align="left">Yes</td></tr>
<tr colspan="6"><td align="left">08 Jul 2019</td>
<td align="left">Harry Bloggs</td>
<td align="left">HXBL</td>
<td align="left">Team B</td>
<td align="left">Manager 2</td>
<td align="left">No</td>
<td align="left">Yes</td></tr>
<th align="left" colspan="7">72 starters</th>
</table>
</body>
</html>
After I run my splits and replaces, It looks like below (again, names changed)
25 Sep 2019
Joe Bloggs
JXBL
Team 1
Manager 1
No
Yes
08 Jul 2019
Harry Bloggs
HXBL
Team 2
Manager 2
No
Yes
72 starters
The idea is then to be able to run with this information to automate our on-boarding process.
I feel like I am missing something obvious, like there is a neater or more efficient way to do this, as this is the first time I'm using Invoke-WebRequest and finding it troublesome as it is anyway.
Expected Results
What I want is preferably an array of users with properties for each bit of info, like a CSV or a PSObject.
So when I call a variable holding the info, I want it to return something like the below:
Name : Joe Bloggs
Initials : JXBL
Department : Team 1
Manager : Manager 1
IT : No
Supervisor : No
StartDate : 08 Jul 2019
Name : Harry Smith
Initials : HXSM
Department : Team 2
Manager : Manager 2
IT : Yes
Supervisor : No
Similar Questions
I only saw one question that looked like it may cover what I wanted, but it ended up being about needing a "try-catch" loop.
Similar Question Link
Please let me know if you need any further information, or if you have any questions.
Thanks in advance for the help.
EDIT
Added in an expected results bit, as I realized this was missing.
The trick is to have something to denote the lines you want to keep.
In your sample above, the link stands out:
<a href="NewStarterInfo.php?id=3117">
So, if you import the page as a single array, you can parse that array finding only lines that contain "NewStarterInfo.php" for example.
$a = #"
<html>
<head>
<title>New Starter List</title>
<link rel="STYLESHEET" type="text/css" href="/common/StyleSheet/Reports.css" /> <style> TD {font-family: Verdana; font-size: 8pt; border-left: solid 0px black; border-right: solid 0px black;} </style>
<script type="text/javascript" src="../../../cgi-bin/calendar/tableH.js"></script>
</head>
<body>
<img src="/common/images/logo.gif" border="0">
<br>
<br>
<b><span style="font-size: 12pt; font-variant: small-caps; ">New Starter List</span></b>
<br>Logged In As "UserName"<br>
<br>
<tableonMouseOver="javascript:trackTableHighlight(this.event,'FFFF66');"onMouseOut="javascript:highlightTableRow(0);" border="4" frame="border" width="80%" rules="none" cellspacing="6%" cellpadding="6%">
<th align="left">Date Started</th>
<th align="left">Name</th>
<th align="left">Initials</th>
<th align="left">Department</th>
<th align="left">Contact</th>
<th align="left">IT Completed?</th>
<th align="left">Supervisor Completed?</th>
<tr colspan="6"><td align="left">25 Sep 2019</td>
<td align="left">Joe Bloggs</td>
<td align="left">JXBL</td>
<td align="left">Team A</td>
<td align="left">Manager 1</td>
<td align="left">No</td>
<td align="left">Yes</td></tr>
<tr colspan="6"><td align="left">08 Jul 2019</td>
<td align="left">Harry Bloggs</td>
<td align="left">HXBL</td>
<td align="left">Team B</td>
<td align="left">Manager 2</td>
<td align="left">No</td>
<td align="left">Yes</td></tr>
<th align="left" colspan="7">72 starters</th>
</table>
</body>
</html>
"#
With $a set to the content of the page, loop thru it.
foreach($x in $a.split("<")) # break it at the "<" that starts each line.
{
if ($x.contains("NewStarterInfo.php") -eq $true) { write-host $x.split(">")[1] }
}
This will take all of the lines in a single variable (not an array) and find the lines with a person's name, and display the name.
If you actually have an array, then you can omit the .split("<") from the foreach statement.
I'm trying to create a pricing recap at the end of a document I'm working on. I would like it to have a dotted line between the item on the left and the price on its right, very much like this :
However, this Index is generated with the createIndex function and I don't have the source HTML for this. And I've been trying since yesterday with differente HTML syntaxes to make it work but it is impossible. My best attempt so far is this one, but I can't automatically set the width of the dotted line :
<table style="width:100%;border-collapse: collapse;">
<tr>
<td style="width:40%;white-space:nowrap;">Item 1</td>
<td style="border-bottom:dotted 1px black;width:45%;"></td>
<td style="text-align:right;width:15%;white-space:nowrap;">Price 1€ HT</td>
</tr>
</table>
I really am stuck here, any advice would be welcome.
In this case you can use a little 'hack'. Unset the width of both texts (resolves to width: auto;) and set the width of the dotted line container to width: 99%;. For this to work you also need to set white-space: nowrap on the text elements, but you already did that.
<table style="width:100%;border-collapse: collapse;">
<tr>
<td style="white-space:nowrap;">Item 1</td>
<td style="border-bottom:dotted 1px black;width:99%"></td>
<td style="text-align:right;white-space:nowrap;">Price 1€ HT</td>
</tr>
</table>
I have created in data-table using bootstrap.
I have used data-table in ionic 3 website.
But problem was I use edit button in data-table
then first time it is working good .
After searching record it can not working click and not call method.
I'm get stuck please help me to solve this issue.
branch.html
<ion-content class="bgimg">
<ion-grid style="color: aliceblue">
<ion-row>
<ion-col col-8></ion-col>
<!--<ion-col col->-->
<!--</ion-col>-->
<ion-col col-2> <button float-end ion-button outline color="editcolor" style="color: white" (click)="addbranch()">Add</button></ion-col>
<ion-col col-1></ion-col>
</ion-row>
<ion-row>
<ion-col col-2></ion-col>
<ion-col col-8>
<div *ngIf="checkdatatable">
<table id="example12">
<thead>
<tr>
<th text-capitalize style="border: 1px solid rgba(255,255,255,1);" width="20%">Image</th>
<th style="border: 1px solid rgba(255,255,255,1);">name</th>
<th style="border: 1px solid rgba(255,255,255,1);">address</th>
<th style="border: 1px solid rgba(255,255,255,1);" >phone</th>
<th style="border: 1px solid rgba(255,255,255,1);" >pincode</th>
<th style="border: 1px solid rgba(255,255,255,1);" text-capitalize>Action</th>
</tr>
</thead>
<tfoot>
<tr >
<th text-capitalize style="border: 1px solid rgba(255,255,255,1);">Image</th>
<th style="border: 1px solid rgba(255,255,255,1);">name</th>
<th style="border: 1px solid rgba(255,255,255,1);" width="15%">address</th>
<th style="border: 1px solid rgba(255,255,255,1);" >phone</th>
<th style="border: 1px solid rgba(255,255,255,1);" >pincode</th>
<th style="border: 1px solid rgba(255,255,255,1);" text-capitalize width="20%">Action</th>
</tr>
</tfoot>
<tbody>
<tr style=" background:rgba(0,0,0,0.0); color: white;font-size: 16px" *ngFor="let item of branchlist" >
<td style="border: 1px solid rgba(255,255,255,0.5);">
<img src="{{item.image}}" height="100px">
</td>
<td style="border: 1px solid rgba(255,255,255,0.5);">{{item.name}}</td>
<td style="border: 1px solid rgba(255,255,255,0.5);">{{item.address}}</td>
<td style="border: 1px solid rgba(255,255,255,0.5);">{{item.phone}}</td>
<td style="border: 1px solid rgba(255,255,255,0.5);">{{item.pincode}}</td>
<td style="border: 1px solid rgba(255,255,255,0.5);">
<!--<input type="hidden" id="idmain" value="{{item._id}}">-->
<button color="editcolor" ion-button (click)="updatebranch(item._id)">Edit</button>
<button color="deletecolor" ion-button (click)="deletebranch(item._id)">Delete</button>
</td>
</tr>
</tbody>
</table>
</div>
</ion-col>
<ion-col col-2></ion-col>
</ion-row>
</ion-grid>
</ion-content>
branch.ts
import { Component } from '#angular/core';
import {
AlertController, IonicPage, LoadingController, NavController, NavParams, ToastController, ModalController,
App
} from 'ionic-angular';
import {WebserviceallProvider} from "../../providers/webserviceall/webserviceall";
import { Storage } from '#ionic/storage';
import {LoginPage} from "../login/login";
/**
* Generated class for the BranchesPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
#IonicPage()
#Component({
selector: 'page-branches',
templateUrl: 'branches.html',
})
export class BranchesPage {
resposnsdata:any;
branchlist:any;
checkdatatable:boolean=false;
branchname = {name:''};
branchupdatedata = {name:''};
constructor(private storage: Storage,private app:App,public modalCtrl: ModalController,private alertCtrl: AlertController,private calldata:WebserviceallProvider,public navCtrl: NavController, public navParams: NavParams,public loadingCtrl: LoadingController,private toastCtrl: ToastController)
{
storage.get('token').then((val) => {
console.log('Your Token is', val);
if(val === null || val === "non")
{
this.app.getRootNav().setRoot(LoginPage);
}
});
this.getshow();
}
ionViewEnter(){
this.getshow();
}
myFunction(name) {
document.getElementById("demo").innerHTML =
"Welcome " + name;
}
getshow(){
//this.presentLoading();
this.calldata.branchlist().then((result) => {
this.branchlist = [];
this.resposnsdata = result;
console.log(this.resposnsdata);
this.branchlist = this.resposnsdata.data;
$(document).ready(function () {
// alert("call aklsdaklsd");
$('#example12').DataTable();
});
this.checkdatatable=true;
//check user name
//console.log("print login Response >>"+this.resposnsdata);
if (this.resposnsdata.status === 200) {
}
else
{
this.presentToast(this.resposnsdata.message);
}
}, (err) => {
console.log("Error Block Call");
this.presentToast("Server Problem");
});
}
presentLoading() {
let loader = this.loadingCtrl.create({
content: "Please wait...",
duration: 2000
});
loader.present();
}
presentToast(msg) {
let toast = this.toastCtrl.create({
message: msg,
duration: 2000,
position: 'bottom'
});
toast.onDidDismiss(() => {
console.log('Dismissed toast');
});
toast.present();
}
ionViewDidLoad() {
console.log('ionViewDidLoad BranchesPage');
}
deletebranch(bid){
console.log(bid);
//this.presentLoading();
this.calldata.branchdelete(bid).then((result) => {
this.resposnsdata = result;
console.log(this.resposnsdata);
this.getshow();
//check user name
//console.log("print login Response >>"+this.resposnsdata);
if (this.resposnsdata.status === 200) {
}
else
{
this.presentToast(this.resposnsdata.message);
}
}, (err) => {
console.log("Error Block Call");
this.presentToast("Server Problem");
});
}
addbranch() {
var modalPage = this.modalCtrl.create('MAddbranchPage');
modalPage.present();
modalPage.onDidDismiss(data=>{
this.getshow();
});
}
updatebranch(id){
console.log("edit call");
var dataid = {
bid:id
};
var modalPage = this.modalCtrl.create('MEditbranchPage',{data:dataid});
modalPage.present();
modalPage.onDidDismiss(data=>{
this.getshow();
});
}
}
ion-button only support in cordova, in other words, you must enable cordova for browser or just simple remove ion-button
<button color="editcolor" (click)="updatebranch(item._id)">Edit</button>
<button color="deletecolor" (click)="deletebranch(item._id)">Delete</button>
I am creating an email template to use in Pardot. I have coded the email up. It works fine in OSX Mail, Outlook 07 +, Opera Mail, however GMail is being a real pain. It is adding some weird height or something to the tr or td in my table.
Any suggestions?
<table border="0" cellpadding="0" cellspacing="0" width="228">
<tbody>
<tr valign="bottom">
<td valign="bottom"><span pardot-region=""><img src="widget_top.jpg" alt="Placeholder"></span></td>
</tr>
<tr bgcolor="#ffd13f">
<td style="padding: 10px;">
<h2><span pardot-region="">Subheading span across one or two lines for best practice:</span></h2>
<span pardot-region=""><p><b>Date:</b> Thursday 29 November</p>
<p><b>Time:</b> 1.30pm (GMT)</p>
<p><b>Where:</b> Register online ></p>
<p><b>Topic:</b> Dynamic performance management</p>
<p><b>Presenters:</b> Octavius Black, CEO and Sebastian Bailey, President</p></span>
</td>
</tr>
<tr valign="top">
<td valign="top"><span pardot-region=""><img src="widget_bottom.jpg" alt="Placeholder"></span></td>
</tr>
</tbody>
</table>
(this table is inside a set of tested tables).
Screen shot can be found here: http://i45.tinypic.com/15wzda9.png
Cheers :)
On the images you have to put (inline)
style="display:block;"
:)
display:block; is definitely needed. You probably should zero out everything in all img tags, and set width and heights also.
<img style="margin: 0; border: 0; padding: 0; display: block;" src="" width="600" height="150"
alt="">
Also, you don't need the spans inside the table cells. If you want to keep them, make sure they have margin and padding zero'd out there too.