Hi,

I want to print many post cards with the click of a buttons with contents and addresses comming from the database using PHP. Can anybody have some ideo how to do that. My concerns is how can I print a number of post cards with any user interaction.

Thanks

Recommended Answers

All 2 Replies

Member Avatar for diafol

Post your code so far.

Hi This is a postcard page for one record.

<?
	session_start();
	
	include("../includes/static_con.php");
	include("../db_config.php");
	if(!$_SESSION['isadmin']==1)
	{
		header("location: login.php");
	}
//	

	$claimedCompanyName = "&lt;company_name&gt;";
	$claimId = "&lt;claim ID&gt;";
	$claimVerificationCode = "&lt;verification code&gt;";
	$claimedMemberName = "&lt;Customer Name&gt;";
	$claimedMemberAddress = "&lt;Street Address&gt;";
	$claimedMemberState = "&lt;State";
	$claimedMemberCountry = "Country&gt;";
	$claimedMemberPCode = "&lt;Pcode&gt;";
	
	if (isset($_REQUEST['pc'])) {
		
		$claimId = $_REQUEST['pc'];
		$claimedCompanySQL = "SELECT * FROM claims, transport WHERE claim_unique_id='$claimId' AND claimed_transporter_id=transport.memid";
		
		$claimedCompanyRS = mysql_query($claimedCompanySQL);
		
		if ($claimedCompanyRS && mysql_num_rows($claimedCompanyRS)>0) {
			
			$claimedCompanyName = mysql_result($claimedCompanyRS,0,'tname');
			$claimId =  $claimId;
			$claimVerificationCode =  mysql_result($claimedCompanyRS,0,'claim_verification_code');
			$claimedMemberName =  mysql_result($claimedCompanyRS,0,'contact_title')." ".mysql_result($claimedCompanyRS,0,'contact_first_name')." ".mysql_result($claimedCompanyRS,0,'contact_last_name');
			$claimedMemberAddress =  mysql_result($claimedCompanyRS,0,'taddress1');
			$claimedMemberState =  mysql_result($claimedCompanyRS,0,'tstate');
			$claimedMemberCountry =  mysql_result($claimedCompanyRS,0,'tcountry');
			$claimedMemberPCode =  mysql_result($claimedCompanyRS,0,'tcode');
		}
	}
	
	
?>

<style type="text/css">
	body {
		font-family: Helvetica, sans-serif;
	}
	#postcard_container {    
		position:absolute;
		display:block;
		width:1px;
		height:1px;
		left:50%;
		top:50%;
		border: 0px solid black;
	}
	#postcard {
	    position:absolute;
	    width:800px;
	    height:600px;
	    left:-400px;
	    top:-293px;
		border: 5px solid black;
	}
	#postcard_left {
		width:50%;
		height:100%;
		float:left;
		border: 1px solid black;
		font-size: 18px;
		padding: 25px 25px;
	}
	#postcard_right {
		width:100%;
		height:100%;
		border: 1px solid black;
	}
	#business_name {
		font-size:22px;
		padding-top: 10px;
		padding-bottom: 20px;
		font-weight: bold;
	}
	
	#stamp_area {
		width: 100%;
		height: 40%;
		padding: 15px 15px;
	}
	
	#address_area {
		width: 100%;
		height: 60%;
		padding-top: 20px;
		padding-left: 35px;
		font-size: 20px;
	}
	
	#stamp {
		width: 100px;
		height: 125px;
		border: 2px solid black;
		float: right;
		padding-top: 25px;
		text-align: center;
		font-size: 20px;
	}
</style>

<html>
<head>

</head>
<body>
<div id="postcard_container">
    <div id="postcard">
        <!--table border="1" width="100%" height="100%" valign="middle">
        <tr>
        	<td width="50%">
        	</td-->
        		<div id="postcard_left">
        			<div id="business_name">
        				DISCOUNT SHIPPINGS AND LOGISTICS NETWORK 
        			</div>
        			Dear DSSLN Member! <br><br>
        			We need to verify your postal address before approving your claim request for the company <? echo $claimedCompanyName; ?>. Once you recieve this card, please fill in the following details by visiting www.dssln.com/signup_claim_verification.php to approve your claim. Once your claims is approved you will be able to handle the listing of the company you claimed for.
        			<br>
        			Here is your claim approval informations:
        			<br><br>
        			Claim ID: <?php echo $claimId; ?><br>
        			Verification Code: <?php echo $claimVerificationCode; ?>
        			<br><br><br>
        			Best Regards,<br>
        			DSSLN Administration Department
        			
        		</div>
        	<!--td-->
        		<div id="postcard_right">
	        		<div id="stamp_area">
	        			<div id="stamp">Place Stamp Here</div>
	        		</div>
	        		<div id="address_area">
		        		<u><?php echo $claimedMemberName; ?></u><br><br>
		        		<u><?php echo $claimedMemberAddress; ?></u><br><br>
		        		<u><?php echo $claimedMemberState; ?>, <?php echo $claimedMemberCountry; ?></u><br><br>
		        		<u><?php echo $claimedMemberPCode; ?><br>
	        		</div>
        		</div>
        	<!--/td>
        </tr>
        </table-->   
    </div>
</div>
</body>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.