PK

ADDRLIN : /home/anibklip/pcfcindia.com/bkp2025-26/accounts/
FLL :
Current File : /home/anibklip/pcfcindia.com/bkp2025-26/accounts/cancel_invoice.php

<?php
	session_start();
	require_once '../common/common.php';
	require_once '../common/secure.php';
	include("connection.php");
	include ("../head_account.php");
	
	$branch_get=$_SESSION['city'];
	
	if($_GET['action']=='reason')
	{
		$sql_edit="SELECT * FROM invoices WHERE branch='$branch_get' AND invid='".$_GET['invid']."'";
		$result_edit=mysql_query($sql_edit) or die('error in fetch');
		$row_edit=mysql_fetch_array($result_edit);
	}
	elseif($_GET['action']=='canceled')
	{
		$sql_edit="SELECT * FROM invoices WHERE branch='$branch_get' AND invid='".$_GET['inv_id']."'";
		$result_edit=mysql_query($sql_edit) or die('error in fetch');
		$row_edit=mysql_fetch_array($result_edit);
		
		$sql_cert="SELECT * FROM certificate WHERE certificateno='".$row_edit['certid']."'";
		$result_cert=mysql_query($sql_cert);
		$row_result=mysql_fetch_array($result_cert);
		
	}
?>
	<script type="text/javascript">
		function empty_field()
		{
			var can_reason=document.getElementById("can_reason");

			if(can_reason.value=='')
			{
				alert("Please Fill the Reason of Cancel Invoice or Certificate");
				can_reason.focus();
				return false;
			}		
		}
	</script>
	<div align="left" style="float:left;"><!-- <a href="tax_report.php">Back</a> --></div> 
	 
	<div align='center'>
		<form action="modify_action.php" method="post" >
			<table width="550px" border="0px">
				<tr>
					<th colspan="3">
					<?php 
						if($_GET['action']=='canceled')
						{
							echo 'Detail of cancel invoice or certificate';
						}
						else
						{
							echo 'Please Give the reason of cancel invoice or certificate';	
						}
					?>	
					</th>
				</tr>
				<tr>
					<td>Invoice No</td>
					<td>:</td>
					<td><strong><?php echo $inv_no=$row_edit['invid']; ?></strong></td>
				</tr>
				<tr>
					<td>Certificate No</td>
					<td>:</td>
					<td><strong><?php echo $cert_no=$row_edit['certid']; ?></strong></td>
				</tr>
				<tr>
					<td valign="top">Reason</td>
					<td valign="top">:</td>
					<td>
					<?php 
						if($_GET['action']=='canceled')
						{
							echo "<textarea name='can_reason' id='can_reason'  cols='20' rows='5' >".$row_result["cancel_reason"]."</textarea>";
						}
						else
						{
							echo "<textarea name='can_reason' id='can_reason'  cols='20' rows='5'></textarea>";
						}
					?>
					</td>
				</tr>
				<tr>
					<td colspan="3" align="center">
						<input type="hidden" name="action_id" value="<?php echo $invid=$row_edit['certid']; ?>"/>
						<input type="hidden" name="action" value="reason" />
						<?php 
							if($_GET['action']=='canceled')
							{
								echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="button" value="Back" onClick="history.go(-1);"><input type="submit" value="Save" onclick="return empty_field()"/>';
							}
							else
							{
								echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<input type="button" value="Back" onClick="history.go(-1);"><input type="submit" value="Save" onclick="return empty_field()"/>';
							}
						?>	
					</td>
				</tr>
			</table>
		</form>
	</div>
<?php
	include ("../foot.php");
?>


PK 99