mPDF: A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support

mPDF is a PHP class which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF, with a number of enhancements.

http://www.mpdf1.com/mpdf/

Advertisements

HTML align Attribute


<table width="100%" border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td align="right">$100</td>
</tr>
</table>

 

source: http://www.w3schools.com/tags/att_td_align.asp

A simple site master and an index view in asp.net

Code for site master [site.master].


<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
 <asp:ContentPlaceHolder ID="head" runat="server">
 <title>Hello World</title>
 </asp:ContentPlaceHolder>
</head>
<body>
 <asp:ContentPlaceHolder ID="MainContent" runat="server">

 </asp:ContentPlaceHolder>
</body>
</html>

&nbsp;

 

Here is the code for view file [Views/Home/index.aspx]


<%@ Page Language="C#" MasterPageFile="~/site.master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:content id="Content1" ContentPlaceHolderID="MainContent" runat="server">
 <div>
 <%= Html.Encode(ViewData["Message"]) %>
 </div>
</asp:content>

&nbsp;

html – Limit file format when using ? – Stack Overflow

There is the accept attribute for the input tag. However, it is not reliable in any way. Browsers most likely treat it as a “suggestion”, meaning the user will, depending on the file manager as well, have a pre-selection that only displays the desired types. They can still choose “all files” and upload any file they want.

Keep in mind that it is only to be used as a “help” for the user to find the right fiels. every user can send any request he/she wants to your server. you always have to validated everything serverside.

So the answer is: no you cannot restrict, but you can set a pre-selection but you cannot rely on it.

Alternatively or additionally you can do something similar by checking the filename (value of the input field) with JavaScript, but this is nonsense because it provides no protection and also does not ease the selection for the user. It only potentially tricks a webmaster into thinking he/she is protected and opens a security hole. It can be a pain in the ass for users that have alternative file extensions (for example jpeg instead of jpg), uppercase, or no file extensions whatsoever (as is common on linux systems).

via html – Limit file format when using ? – Stack Overflow.

Show only one option for each select

<table>
	<tr>
		<td>
			Search By
		</td>
		<td>
			<select id="selection" onchange="show_field()">
				<option value='null'>Select One</option>
				<option value='emp'>Employment</option>
				<option value='post'>Posting Place</option>
				<option value='member'>Membership</option>
				<option value='branch'>Branch</option>
			</select>
		</td>
	</tr>
	<tr id='emp' class="selection_class" style="display:none">
		<td>
			Employment
		</td>
		<td>
			<select id="selection" >
				<option value='null'>Select One</option>
				<?php 
								foreach($employmentStatus as $branch)
								{
									echo "<option value='$branch->EmployementStatus'>$branch->EmployementStatus</option>";
								}
							?>
			</select>
		</td>
	</tr>
	<tr id='post' class="selection_class" style="display:none">
		<td>
			Posting Place
		</td>
		<td>
			<select id="selection" >
				<option value='null'>Select One</option>
				<?php 
								foreach($postingPlace as $branch)
								{
									echo "<option value='$branch->PostingPlace'>$branch->PostingPlace</option>";
								}
							?>
			</select>
		</td>
	</tr>
	<tr id='member' class="selection_class" style="display:none">
		<td>
			Membership
		</td>
		<td>
		<select name="CatagoryMembership">
							<option value='null'>Select one</option>
							<option value="life">Life Member </option>
							<option value="general">General Member </option>
						</select>
		</td>
	</tr>
	<tr id='branch' class="selection_class" style="display:none">
		<td>
			Branch
		</td>
		<td>
			<select name="Bracnhname">
							<option value='null'>Select one </option>
							<?php 
								foreach($result as $branch)
								{
									echo "<option value='$branch->branch_id'>$branch->branch_name</option>";
								}
							?>
						</select>
		</td>
	</tr>
	<tr id='sbmit' style="display:none">
		<td>
			
		</td>
		<td>
			<input type="submit" value="Run Report"/>
		</td>
	</tr>
</table>
<div>

<script>
	function show_field()
	{
		var field = $('#selection option:selected').val();
		if (field == 'null') return false;
		$('.selection_class').hide();
		$('#'+field).show();
		$('#sbmit').show();
	}
</script>

A pagination

<div>
<p>
Page <?php echo ($_GET['page'])? $_GET['page']:1  ?> of <?php echo $totalPage;?>
</p>

<ul>
<li>

<?php  if ($_GET['page'] !='1'){ ?>

<a href="index.php/component/swachip/?view=doctors" >Start</a>
<?php } else { ?>
<span >Start</span>
<?php } ?>
</li>
<li>
<?php  if ($_GET['page']){ ?>

<a href="index.php/component/swachip/?view=doctors&page=<?php echo intval($_GET['page'])-1; ?>" >Prev</a>
<?php } else { ?>
<span >Prev</span>
<?php } ?>
</li>
<?php
$temp = 1;
if (intval($_GET['page'])>5)
{
$temp = intval($_GET['page']) - 3;
}
for ($i=$temp;$i<=$totalPage;$i++){ ?>
<?php
if ($i >=  intval($_GET['page'])+3 && $i <=  $totalPage-5 )
{
// echo $i;
if ($flagCon == 0)
{

echo "...";
$flagCon =1;
}
continue;
}
if ($i == intval($_GET['page'])){ ?>
<li><span><?php echo $i ?></span></li>
<?php } else { ?>
<li><a href="index.php/component/swachip/?view=doctors&page=<?php echo  $i; ?>" title="<?php echo $i ?>"><?php echo $i ?></a></li>
<?php } ?>
<?php } ?>

<li>
<?php  if ($_GET['page'] != $totalPage){ ?>

<a href="index.php/component/swachip/?view=doctors&page=<?php echo intval($_GET['page'])+1; ?>" >Next</a>
<?php } else { ?>
<span >Next</span>
<?php } ?>
</li>
<li>
<?php  if ($_GET['page'] !=$totalPage){ ?>

<a href="index.php/component/swachip/?view=doctors&page=<?php echo $totalPage ?>" >Last</a>
<?php } else { ?>
<span >Last</span>
<?php } ?>
</li>
</ul>
</div>

 

List of Common HTML Error Codes

List of Common HTML Error Codes

via List of Common HTML Error Codes.

Make a simple tab based navigation using CSS (link)

A tab based navigation is a good thing for your web site!

 

Here is a tutorial link that can give you a head start of making your own tab based navigation system. But i should warn you, head start does not mean completed! 🙂

CLICK ME TO GO TO THE TUTORIAL

HTML Framework????

yap friends it is true.

Today i searched “HTML Framework” in the net and found some HTML Framework. I am currently exploring it so giving the links so that you can see it by your self.

a demo of html framework- http://htmlframework.com/demos/3b/
easy framework – http://easyframework.com/demo.php
thesis framework (not free 😦 ) http://diythemes.com/thesis/version-13-release/

well among them. i think easy framework is the best.

if you are looking for css framework, i will suggest blueprint framework. it is really good for css. initially it was favorite for rails but now you can use it anywhere.

CSS Overflow Link from w3schools

CSS Overflow little bit tricky and useful also.

Here is the link from w3school that can help you to understand CSS Overflow:- http://www.w3schools.com/cssref/pr_pos_overflow.asp