<?php require "_header.php";
include "Numbers/Words.php"; ?>
<script language="javascript" type="text/javascript">
	//document.getElementById("main-content").style.display = 'none';
</script>

<div id="main-report" align="center">

	<?php
	$height = 300;
	$nw = new Numbers_Words();
	if ($_SESSION["cCompany_id"] != "" && isset($_SESSION["cCompany_id"])) {


		$agencyid = $_SESSION["cCompany_id"];

		$headerflag = $_REQUEST['headerflag'];

		$invoice_no = Escape($_REQUEST["invoice_no"]);
		$qry = " SELECT * FROM lms_customerquotation
					where invoice_no = " . $invoice_no . "  ";

		//$ObjagencymasterMgmt = new agencymasterMgmt(); ".$_REQUEST['nro_no']. "
	
		$rs = dbQuery($qry);
		$rs1 = dbQuery($qry);
		$count = dbRows($rs);
		$j = 0;
		$custome_height = 240;
		///extract($row);
		ob_start();

		$i = 0;
		$sno = 1;
		$net_amount = 0;
		if ($count > 0) {
			$row = dbArray($rs);


			?>

			<table cellpadding="0" cellspacing="0" border="0" width="90%" frame="box" border="0" cellpadding="0" cellspacing="0"
				style="border: 3px solid black; border-style: solid;">
				<tr>
					<td width="5%"><img border="0" height="100" width="100"
							src="http://auminfosys.com/erp/images/aumlogo1.png" /></td>
					<td width="55%">
						<div style="font-family: Arial Black,Arial Bold,Gadget,sans-serif;">
							<font size="6px">
								<center>Aum Imagineering Pvt.Ltd</center>
							</font>
						</div>
						<div>
							<center>
								<font size="1px">602-603 A, Shapath- 1 Opp.Rajpath Club, S.G.High Way , Ahmedabad -380015
								</font>
							</center>
						</div>
						<div>
							<center>
								<font size="1px">E-mail : jatin@auminfosys.com, URL : http://www.auminfosys.com</font>
							</center>
						</div>
						<div>
							<center>
								<font size="1px"> Phone :(79) 40054004, 26870704 Mobile: 91 98258 47773, 7600001219</font>
							</center>
						</div>
					</td>
				</tr>

				<tr>
					<td colspan="4">
						<hr style="color: #000000; height: 2px; margin-bottom: -5px;">
						<hr style="color: #000000; height: 2px; margin-top: -3px;">
					</td>
				</tr>

				<tr>
					<td align="right" colspan="2">
						<font size="2">Date:<?php print date("d/m/Y", strtotime($row['billdate'])); ?></font>
						&nbsp;&nbsp;&nbsp;&nbsp;
					</td>
				</tr>

				<tr>
					<td colspan="2">
						<center>
							<h4>QUOTATION</h4>
						</center><br />
					</td>
				</tr>
				<tr>
					<td colspan="2" align="left"><b>
							<font size="2">&nbsp;&nbsp;To,<font>
						</b></td>
				</tr>
				<tr>
					<td colspan="2" align="left" width="6%"></td>&nbsp;
				</tr>

				<tr>
					<td align="left" colspan="2">
						<font size="2">&nbsp;&nbsp;<?php print $row['quotation_to']; ?></font>
					</td>
				</tr>
				<tr>
					<td align="left" colspan="2">
						<font size="2">&nbsp;&nbsp;<?php print $row['address']; ?>
							<font></b>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>

				<tr>
					<td style="padding-left:155px;" colspan="2">
						<font size="2"><b>Subject : </b><?php print $row['remark']; ?></font>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>

				<tr>
					<td style="padding-left:155px;" colspan="2">
						<font size="2"><b>Your Ref No :</b></font>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td style="padding-left:50px;" colspan="2">
						<font size="2>" <b>We have received inquiry for above mentioned subject. Details of our product and
							Terms are as follows. </b>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</font>
					</td>
				</tr>





				<tr>
					<td align="center" colspan="2">
						<table width="80%" cellpadding="0" cellspacing="0" class="report" frame="box" border="0" cellpadding="0"
							cellspacing="0" style="border: 4px solid black; border-style: outset;">
							<tr style="font-weight:bold">

								<td align="center" width="12%">Product Name</td>
								<td align="center" width="6%">Qty</td>

								<td align="center" width="6%">Cost</td>
								<td align="center" width="6%">GST(%)</td>
								<td align="center" width="6%">Total</td>

							</tr>

							<?php
							$sno = 1;
							$net_amount = 0;
							while ($row1 = dbArray($rs1)) { ?>
								<tr>

									<td style="text-align:left;" width="40%">
										<?php echo $row1['product_name']; ?>
									</td>
									<td style="text-align:center;" width="10%">
										<?php echo $row1['qty'] ?>
									</td>
									<td style="text-align:center;" width="15%">
										<?php
										if ($row1['discount'] != 0)
											$tamount = $row1['rate'] * $row1['discount'] / 100;
										else
											$tamount = $row1['rate'];
										echo $tamount ?>
									</td>


									<td style="text-align:center;" width="7%">
										<?php echo $row1['vat'] ?>
									</td>

									<td style="text-align:center;" width="22%">
										<?php
										echo $row1['tamount'] ?>
									</td>


								</tr>
								<?php
								$height = $height - 25;
								$sno++;
								$net_amount = $net_amount + $row1['tamount'];
							}

							?>
							<tr style="height:<?php echo $height . "px" ?>">
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
							</tr>


					</td>
				</tr>
				<tr style="height:35px;vertical-align:middle">

					<td align="left" width="71%" colspan="3">
						<b> In Words : </b><br />
						<?php echo strtoupper($nw->toWords($net_amount) . " Rupees Only"); ?>
					</td>
					<td align="left" colspan="3">
						<b>Total :</b>
						<?php echo ' Rs. ' . number_format(round($net_amount), 2); ?>
					</td>
				</tr>
			</table>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr height="30">
				<td colspan="2">
					<font size="2">&nbsp;&nbsp;Thanking You...</font>
				</td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>


			<tr height="30">
				<td colspan="2">
					<font size="2">&nbsp;&nbsp;For, Aum Imagineering Pvt.Ltd. </font>

				</td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr height="30">
				<td colspan="2">
					<font size="2">&nbsp;&nbsp;Authorized Signatory</font>
					</br>
					</br>

				</td>
			</tr>
			<tr>

				<td colspan="2">&nbsp;&nbsp;
					<u> <b>
							<font size="2">Terms & Condition:</font>
						</b> </u></br></br>
					<div width="100%" style="vertical-align:top;font-size:13px" align="left">



						&nbsp;&nbsp;01. 100% Payment against delivery by Cheque/Draft in Aum Imagineering Pvt.
						&nbsp;&nbsp;Ltd.,Ahmedabad.<br>
						&nbsp;&nbsp;02. Goods once sold will not be taken back or exchange in any case.<br>
						&nbsp;&nbsp;03. One Year Warranty.<br>
						<br>

					</div>
			</tr>






			</table>

		<?php
		}




		?>



		<?php
		$HtmlCode = ob_get_contents();
		ob_end_flush();
		$HtmlUrl = "customerbill-report-" . $_SESSION["eAgencyId"] . ".html";
		$HtmlPath = "report/" . $HtmlUrl;
		createHTMLReportPage($header_row_string, $HtmlUrl, $HtmlPath, $HtmlCode, true);
		?>
		<br />
		<br /><br />
		<form name="frm" id="frm" action="" method="post">
			<input type="hidden" name="txtFile" id="txtFile" value="<?php echo $HtmlUrl; ?>" />
			<input type="button" name="btnPdf" id="btnPdf" value="Print" onClick="SetPageAction('PRINT');" />
			<input type="button" name="btnPdf" id="btnPdf" value="Create PDF" onClick="SetPageAction('PDF');" />
			<input type="button" name="btnHtml" id="btnHtml" value="Create HTML" onClick="SetPageAction('HTML');" />
			<input type="button" name="btnWord" id="btnWord" value="Create WORD" onClick="SetPageAction('WORD');" />
			<input type="button" name="btnExcel" id="btnExcel" value="Create EXCEL" onClick="SetPageAction('Excel');" />
		</form>
		<script language="javascript" type="text/javascript">
			function SetPageAction(varAction) {

				if (varAction == "PRINT") {
					document.frm.action = "print/create-print.php";
					document.frm.target = "_blank";
					document.frm.submit();
				}
				else if (varAction == "PDF") {
					document.frm.action = "convertpdf/create-pdf.php";
					document.frm.target = "_blank";
					document.frm.submit();
				}
				else if (varAction == "HTML") {
					document.frm.action = "<?php echo $HtmlPath; ?>";
					document.frm.target = "_blank";
					document.frm.submit();
				}
				else if (varAction == "WORD") {
					document.frm.action = "convertword/create-word.php";
					document.frm.target = "_blank";
					document.frm.submit();
				}
				else if (varAction == "Excel") {
					document.frm.action = "convertword/create-excel.php";
					document.frm.target = "_blank";
					document.frm.submit();
				}
			}
		</script>
	<?php } ?>
</div>
<?php require "_footer.php"; ?>