PK

ADDRLIN : /home/anibklip/vpgldh.com/2019-20bk/webmanager/
FLL :
Current File : /home/anibklip/vpgldh.com/2019-20bk/webmanager/certificate-invoicebill.php

<?php 
include "templatic/head.php"; 
include "templatic/header.php";

//echo "<pre>".$_SESSION['form_data']; print_r($_POST);echo "</pre>";
?>
<div class="box">
	<h2>Certificate Complete</h2>
	<div style="padding:0px 10px;">
		<?php
		// getting ready with some final elements
		if(isset($_POST['sub_c']) && $_POST['sub_c'] == 'yes'){
			$sub_c = "1";
		}else{
			$sub_c = "0";
		}
		// a few more..
		if(isset($_POST['addition']) && $_POST['addition']=='on'){
			$deckl= $_POST['deck'];
		}else{
			$deckl="";
		}

		// last one
		$din=date('D, d M Y + H:i:s a');

		// Alright, lets checklist few things and create certificate now!
		// checking if the form is a certificate or sub-certificate
		//print "subc_id= ".$_POST['subc_id'];
		if($_POST['subc_id']==0){
			$certype = "main";
		}else{
			$certype = "sub";
		}
		// Insert data only, if form is submitted once.. and not on refresh, reload or other ways.
		if($_SESSION['form_data']=='good2go'){
			// first, lets do things, if it is a new certificate.
			//echo "certype: $certype";
			if($certype=="main"){ 
				//print "CERTIFIED";
				// Inserting Main Certificate

				$formno = $_POST['formno'];
				//print $formno;

				include "certificate_insert.php";
			}
			// yeah, now for subcertificate.
			else{ //print "SUB WAY";
				// Inserting Sub Certificate
				//include "subcertificate_insert.php";
			}
			// In the end, discharge the form data to avoid resubmission.
			$_SESSION['form_data']='gone';
		}
		// Certificate, sub certificate and invoice created! Mission Completed!
		?>

		<!-- Lets display some kewl stuff now -->
		<table align="center" width="100%" border="0">
			<tr>
				<td colspan='3' align="center">
					<br/>
					<b>New Entry Sucessfully Entered<br/><br/><a href="create-certificate.php"><img src="./img/Back-Home-icon.png"><br/>+ click here to add another certificate + </a></b>
					<br/>
					<br/>
				</td>
			</tr>
			<tr>
				<td align="center">
					<form action="./print/form_print.php" method="get" target="_blank">
						<input type="hidden" name="id" value="<?php echo $certificateno ; ?>">
						<input type="submit" value="Print Certificate">
					</form>
				</td>
				<td align=center><a href=certificates.php><b><img src="./img/go-back-icon.png"><br/>click here to go back Home</a></b>
				</td>
				<td align='center'>
					<form action="./print/invoice_print.php" method="get" target="_blank">
					<input type="hidden" name="id" value="<?php echo $invno;?>">
					<?php
					if($_POST['amount']!=""){
						?>
						<input type="submit" value="Print Invoice">
						<? 
					}
					?>
					</form>
				</td>
			</tr>
			<tr>
				<td colspan='3' align='center'><a href="./print/cretid_report.php?id=<?=$certificateno;?>" target="_blank">View Fumigation Record</a></td>
			</tr>
		</table>
		<!-- Lets display some kewl stuff now -->
	</div>
</div>
<?php
include "templatic/footer.php";
?>


PK 99