<?php 
require_once('convert_marathi.php');
 session_start();
$username = $_SESSION['User_Name'];
$flag=$_REQUEST['flag'];
if($flag=='')
{
$user=$_REQUEST['user'];
$no=$_REQUEST['ltrid'];// fetch desk_ltr_id
if($user==1)
{
include('dashboard_department.php');
?><html> 
<head>
<script type="text/javascript" src="js/adduser.js"></script> 
<script type="text/javascript">     
function PrintDiv() {    
var divToPrint = document.getElementById('divToPrint');
var popupWin = window.open('', '_blank', 'width=600,height=600');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
<script type="text/javascript">     
function PrintDivs() {    
var divToPrint = document.getElementById('divToPrints');
var popupWin = window.open('', '_blank', 'width=600,height=600');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
<style>
td{
height:20px;
width:190px;
}
</style>
</head>
<body>
   <div class="rightpanel">
		<?php
			##################################################### Query ###############################################
			$query11=mysql_query("SELECT * FROM incoming_letters_transaction WHERE incoming_letters_transaction.ltr_id='$no' AND incoming_letters_transaction.dept_id=(Select dept_id from login where login_id='$username') AND status!='approve' ORDER BY ltr_id DESC") or die("".mysql_error());
			$row=mysql_fetch_array($query11);
			if($row['first_flag']=='Y')
			{
			$inwardpath=$row['document'];
			}
			else if($row['first_flag']=='N')
			{
			$inwardpath=$row['desk_doument'];
			}
			//$desk_doument=$row['desk_doument'];
			//fetch inward image
			$str2 = substr($inwardpath, 3);
			###################### seperate file name from path for inward file ##########################
			$file1 = basename($inwardpath);       

			##############code to retrive extension of file for inward file #########################	
			$filename=$file1;
			$ext = end(explode('.', $filename));	
			$ext = substr(strrchr($filename, '.'), 1);
			$ext = substr($filename, strrpos($filename, '.') + 1);
			$ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $filename);
			$exts = split("[/\\.]", $filename);
			$n    = count($exts)-1;
			$inext  = $exts[$n];	
			$dpt_date 		= date('d-m-Y',strtotime($row['receive_dt']));	
		?>
		<ul class="breadcrumbs">
            <li><a href="dashboard_department.php"><i class="iconfa-home"></i></a> <span class="separator"></span></li>
            <li><a href="dashboard_department.php"></a> <span class="separator"></span></li>
            <li>आवक बारनिशी व जावक बारनिशी</li>
        </ul>
        <div class="pageheader"> 
            <div class="pageicon"><span class="iconfa-pencil"></span></div>
				<div class="pagetitle">
					<h5>Forms</h5>
					<h1>आवक बारनिशी व जावक बारनिशी</h1>
				</div>
		</div><!--pageheader-->
			<div class="maincontent">
				<div class="maincontentinner">
				<!------------------------------- Tab Desigining -------------------------------------->
					<div class="tabbedwidget tab-primary"><ul></ul></div>
						<div class="tabbedwidget tab-primary ui-tabs ui-widget ui-widget-content ui-corner-all">
                            <ul role="tablist" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
                                <li aria-selected="true" aria-labelledby="ui-id-4" aria-controls="a-1" tabindex="0" role="tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a id="ui-id-4" tabindex="-1" role="presentation" class="ui-tabs-anchor" href="#a-1" style="font-size:14px;">आवक बारनिशी</a></li>
                            </ul>
							<!------------------------- avak Barnishi ------------------------------------------>
                            <div aria-hidden="false" aria-expanded="true" role="tabpanel" class="ui-tabs-panel ui-widget-content ui-corner-bottom" aria-labelledby="ui-id-4" id="a-1">
								<div id="divToPrint">
									<h4 class="widgettitle1">आवक बारनिशी</h4><br>
										<table>
											<tr>
												<td>आ_क्र : </td><td><?php echo $row['ltr_inword_no']; ?></td>
												<td>आ_दि : </td><td><?php echo $dpt_date; ?></td>
											</tr>
											<tr>
												<td>कोणाकडून प्राप्त : </td><td><?php echo $row['sender_name']; ?></td>
												<td>विषय : </td><td><?php echo $row['subject']; ?></td>
											</tr>
										</table><br>
										<?php if($inext=='bmp' || $inext=='gif'|| $inext== 'jpg'|| $inext== 'png' ||$inext=='BMP' ||$inext=='GIF' ||$inext=='JPG' ||$inext=='PNG' ||$inext=='JPEG' || $inext=='jpeg')
												{
												?>
												<!------------------- image fetching ------------------------->
												<img src="<?php echo $str2;?>" height="400px" width="100%" align='centre' border="2" style="border-color: #ff0000;">
													</div>	<!--print div-->
													<p>	
													<center><input type="submit" value=" Print Page " onclick="PrintDiv();" class="btn btn-primary"	/>
													</p>
										
												<!------------------- pdf fetching ------------------------->
												<?php }
												else if($inext=='pdf' || $inext=='PDF')
												{?>
												<iframe  name="myiframe" id="myiframe"  width="100%" height="500px;" src="<?php echo $str2;?>"></iframe>
												<?php
												}
												?>
								</div>
							</div>
			                <?php include_once('footer.php'); ?>
        </div><!--maincontentinner-->
    </div><!--rightpanel-->
</body>
</html>
 <?php 
 }
else if($user==2)
{
include('dashboard_desk.php');
?><html> 
<head>
<script type="text/javascript" src="js/adduser.js"></script> 
<script type="text/javascript">     
function PrintDiv() {    
var divToPrint = document.getElementById('divToPrint');
var popupWin = window.open('', '_blank', 'width=600,height=600');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
<script type="text/javascript">     
function PrintDivs() {    
var divToPrint = document.getElementById('divToPrints');
var popupWin = window.open('', '_blank', 'width=600,height=600');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
<style>
td{
height:20px;
width:190px;
}
</style>
</head>
<body>
   <div class="rightpanel">
	<?php
		##################################################### Query ###############################################
		$query11=mysql_query("SELECT * FROM incoming_letters_transaction,tapal_to_dpt_transaction WHERE incoming_letters_transaction.ltr_id='$no' AND tapal_to_dpt_transaction.desk_id=(Select desk_id from login where login_id='$username') AND tapal_to_dpt_transaction.desk_approval='pending' AND (tapal_to_dpt_transaction.desk_ltr_inword_no='0' OR tapal_to_dpt_transaction.desk_ltr_inword_no='') AND  tapal_to_dpt_transaction.ltr_id=incoming_letters_transaction.ltr_id ORDER BY incoming_letters_transaction.ltr_id DESC") or die("".mysql_error());
		$row=mysql_fetch_array($query11);
		if($row['first_flag']=='Y')
			{
			$inwardpath=$row['document'];
			}
			else if($row['first_flag']=='N')
			{
			$inwardpath=$row['desk_doument'];
			}
		//fetch inward image
		$str2 = substr($inwardpath, 3);
		###################### seperate file name from path for inward file ##########################
		$file1 = basename($inwardpath);       
		##############code to retrive extension of file for inward file #########################	
		$filename=$file1;
		$ext = end(explode('.', $filename));	
		$ext = substr(strrchr($filename, '.'), 1);
		$ext = substr($filename, strrpos($filename, '.') + 1);
		$ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $filename);
		$exts = split("[/\\.]", $filename);
		$n    = count($exts)-1;
		$inext = $exts[$n];	
		$dpt_date = date('d-m-Y',strtotime($row['receive_dt']));
		?>
		<ul class="breadcrumbs">
            <li><a href="dashboard_desk.php"><i class="iconfa-home"></i></a> <span class="separator"></span></li>
            <li><a href="dashboard_desk.php"></a> <span class="separator"></span></li>
            <li>आवक बारनिशी व जावक बारनिशी</li>
        </ul>
        <div class="pageheader"> 
            <div class="pageicon"><span class="iconfa-pencil"></span></div>
				<div class="pagetitle">
					<h5>Forms</h5>
					<h1>आवक बारनिशी व जावक बारनिशी</h1>
				</div>
		</div><!--pageheader-->
			<div class="maincontent">
				<div class="maincontentinner">
				<!------------------------------- Tab Desigining -------------------------------------->
					<div class="tabbedwidget tab-primary"><ul></ul></div>
						<div class="tabbedwidget tab-primary ui-tabs ui-widget ui-widget-content ui-corner-all">
                            <ul role="tablist" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
                                <li aria-selected="true" aria-labelledby="ui-id-4" aria-controls="a-1" tabindex="0" role="tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a id="ui-id-4" tabindex="-1" role="presentation" class="ui-tabs-anchor" href="#a-1" style="font-size:14px;">आवक बारनिशी</a></li>
                            </ul>
							<!------------------------- avak Barnishi ------------------------------------------>
                            <div aria-hidden="false" aria-expanded="true" role="tabpanel" class="ui-tabs-panel ui-widget-content ui-corner-bottom" aria-labelledby="ui-id-4" id="a-1">
									<div id="divToPrint">
										<h4 class="widgettitle1">आवक बारनिशी</h4><br>
										<table>
											<tr>
												<td>आ_क्र : </td><td><?php echo $row['ltr_inword_no']; ?></td>
												<td>आ_दि : </td><td><?php echo $dpt_date; ?></td>
											</tr>
											<tr>
												<td>कोणाकडून प्राप्त : </td><td><?php echo $row['sender_name']; ?></td>
												<td>विषय : </td><td><?php echo $row['subject']; ?></td>
											</tr>
										</table><br>
										<?php if($inext=='bmp' || $inext=='gif'|| $inext== 'jpg'|| $inext== 'png' ||$inext=='BMP' ||$inext=='GIF' ||$inext=='JPG' ||$inext=='PNG' ||$inext=='JPEG' || $inext=='jpeg')
										{
											?>
											<!------------------- image fetching ------------------------->
											<img src="<?php echo $str2;?>" height="400px" width="100%" align='centre' border="2" style="border-color: #ff0000;">
											</div>	<!--print div-->
											<p>	
											<center><input type="submit" value=" Print Page " onclick="PrintDiv();" class="btn btn-primary"	/>
											</p>
										
											<!------------------- pdf fetching ------------------------->
								<?php 	}
										else if($inext=='pdf' || $inext=='PDF')
											{?>
												<iframe  name="myiframe" id="myiframe"  width="100%" height="500px;" src="<?php echo $str2;?>"></iframe>
												<?php
											}
											?>
							</div>	
						</div>
			  <?php include_once('footer.php'); ?>       
        </div><!--maincontentinner-->
    </div><!--rightpanel-->
</body>
</html>
<?php 
	}
	else if($user==3)
{
include('dashboard_tapal.php');
?><html> 
<head>
<script type="text/javascript" src="js/adduser.js"></script> 
<script type="text/javascript">     
function PrintDiv() {    
var divToPrint = document.getElementById('divToPrint');
var popupWin = window.open('', '_blank', 'width=600,height=600');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
<script type="text/javascript">     
function PrintDivs() {    
var divToPrint = document.getElementById('divToPrints');
var popupWin = window.open('', '_blank', 'width=600,height=600');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
<style>
td{
height:20px;
width:190px;
}
</style>
</head>
<body>
   <div class="rightpanel">
		<?php
			##################################################### Query ###############################################
			$query11=mysql_query("SELECT * FROM incoming_letters_transaction WHERE incoming_letters_transaction.ltr_id='$no' AND incoming_letters_transaction.dept_id=(Select dept_id from login where login_id='$username') AND status!='approve' ORDER BY ltr_id DESC") or die("".mysql_error());
			$row=mysql_fetch_array($query11);
			$inwardpath=$row['document'];
			/*if($row['first_flag']=='Y')
			{
			$inwardpath=$row['document'];
			}
			else if($row['first_flag']=='N')
			{
			$inwardpath=$row['desk_doument'];
			}*/
			//fetch inward image
			$str2 = substr($inwardpath, 3);
			###################### seperate file name from path for inward file ##########################
			$file1 = basename($inwardpath);       

			##############code to retrive extension of file for inward file #########################	
			$filename=$file1;
			$ext = end(explode('.', $filename));	
			$ext = substr(strrchr($filename, '.'), 1);
			$ext = substr($filename, strrpos($filename, '.') + 1);
			$ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $filename);
			$exts = split("[/\\.]", $filename);
			$n    = count($exts)-1;
			$inext  = $exts[$n];	
			$dpt_date 		= date('d-m-Y',strtotime($row['receive_dt']));	
		?>
		<ul class="breadcrumbs">
            <li><a href="dashboard_department.php"><i class="iconfa-home"></i></a> <span class="separator"></span></li>
            <li><a href="dashboard_department.php"></a> <span class="separator"></span></li>
            <li>आवक बारनिशी व जावक बारनिशी</li>
        </ul>
        <div class="pageheader"> 
            <div class="pageicon"><span class="iconfa-pencil"></span></div>
				<div class="pagetitle">
					<h5>Forms</h5>
					<h1>आवक बारनिशी व जावक बारनिशी</h1>
				</div>
		</div><!--pageheader-->
			<div class="maincontent">
				<div class="maincontentinner">
				<!------------------------------- Tab Desigining -------------------------------------->
					<div class="tabbedwidget tab-primary"><ul></ul></div>
						<div class="tabbedwidget tab-primary ui-tabs ui-widget ui-widget-content ui-corner-all">
                            <ul role="tablist" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
                                <li aria-selected="true" aria-labelledby="ui-id-4" aria-controls="a-1" tabindex="0" role="tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a id="ui-id-4" tabindex="-1" role="presentation" class="ui-tabs-anchor" href="#a-1" style="font-size:14px;">आवक बारनिशी</a></li>
                            </ul>
							<!------------------------- avak Barnishi ------------------------------------------>
                            <div aria-hidden="false" aria-expanded="true" role="tabpanel" class="ui-tabs-panel ui-widget-content ui-corner-bottom" aria-labelledby="ui-id-4" id="a-1">
								<div id="divToPrint">
									<h4 class="widgettitle1">आवक बारनिशी</h4><br>
										<table>
											<tr>
												<td>आ_क्र : </td><td><?php echo $row['ltr_inword_no']; ?></td>
												<td>आ_दि : </td><td><?php echo $dpt_date; ?></td>
											</tr>
											<tr>
												<td>कोणाकडून प्राप्त : </td><td><?php echo $row['sender_name']; ?></td>
												<td>विषय : </td><td><?php echo $row['subject']; ?></td>
											</tr>
										</table><br>
										<?php if($inext=='bmp' || $inext=='gif'|| $inext== 'jpg'|| $inext== 'png' ||$inext=='BMP' ||$inext=='GIF' ||$inext=='JPG' ||$inext=='PNG' ||$inext=='JPEG' || $inext=='jpeg')
												{
												?>
												<!------------------- image fetching ------------------------->
												<img src="<?php echo $str2;?>" height="400px" width="100%" align='centre' border="2" style="border-color: #ff0000;">
													</div>	<!--print div-->
													<p>	
													<center><input type="submit" value=" Print Page " onclick="PrintDiv();" class="btn btn-primary"	/>
													</p>
										
												<!------------------- pdf fetching ------------------------->
												<?php }
												else if($inext=='pdf' || $inext=='PDF')
												{?>
												<iframe  name="myiframe" id="myiframe"  width="100%" height="500px;" src="<?php echo $str2;?>"></iframe>
												<?php
												}
												?>
								</div>
							</div>
			                <?php include_once('footer.php'); ?>
        </div><!--maincontentinner-->
    </div><!--rightpanel-->
</body>
</html>
 <?php 
 }
} //if ($flag=='')

else if($flag=='n')	
{
$user=$_REQUEST['user'];
$no=$_REQUEST['ltrid'];// fetch ltr_id

if($user==1)
{
include('new_dashboard_department.php');
?><html> 
<head>
<script type="text/javascript" src="js/adduser.js"></script> 

<script type="text/javascript">     
	function PrintDiv() {    
		var divToPrint = document.getElementById('divToPrint');
		var popupWin = window.open('', '_blank', 'width=600,height=600');
		popupWin.document.open();
		popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
		popupWin.document.close();
	}
</script>

<script type="text/javascript">     
	function PrintDivs() {    
		var divToPrint = document.getElementById('divToPrints');
		var popupWin = window.open('', '_blank', 'width=600,height=600');
		popupWin.document.open();
		popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
		popupWin.document.close();
	}
</script>
<style>
	td{
		height:20px;
		width:190px;
	}
</style>
</head>
<body>
   <div class="rightpanel">
		<?php
			##################################################### Query ##############################################
			$query11=mysql_query("SELECT * FROM incoming_letters_transaction WHERE incoming_letters_transaction.ltr_id='$no' AND incoming_letters_transaction.dept_id=(Select dept_id from login where login_id='$username') AND status!='approve' ORDER BY ltr_id DESC") or die("".mysql_error());
			$row=mysql_fetch_array($query11);
			if($row['first_flag']=='Y')
			{
			$inwardpath=$row['document'];
			}
			else if($row['first_flag']=='N')
			{
			$inwardpath=$row['desk_doument'];
			}
			//fetch inward image
			$str2 = substr($inwardpath, 3);
			###################### seperate file name from path for inward file ##########################
			$file1 = basename($inwardpath);       

			############## code to retrive extension of file for inward file #########################	
			$filename=$file1;
			$ext = end(explode('.', $filename));	
			$ext = substr(strrchr($filename, '.'), 1);
			$ext = substr($filename, strrpos($filename, '.') + 1);
			$ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $filename);
			$exts = split("[/\\.]", $filename);
			$n    = count($exts)-1;
			$inext  = $exts[$n];	
			$dpt_date 		= date('d-m-Y',strtotime($row['receive_dt']));	
		?>
		<ul class="breadcrumbs">
            <li><a href="new_dashboard_department.php"><i class="iconfa-home"></i></a> <span class="separator"></span></li>
            <li><a href="new_dashboard_department.php"></a> <span class="separator"></span></li>
            <li>आवक बारनिशी व जावक बारनिशी</li>
        </ul>
        <div class="pageheader"> 
            <div class="pageicon"><span class="iconfa-pencil"></span></div>
				<div class="pagetitle">
					<h5>Forms</h5>
					<h1>आवक बारनिशी व जावक बारनिशी</h1>
				</div>
		</div><!--pageheader-->
			<div class="maincontent">
				<div class="maincontentinner">
				<!------------------------------- Tab Desigining -------------------------------------->
					<div class="tabbedwidget tab-primary"><ul></ul></div>
						<div class="tabbedwidget tab-primary ui-tabs ui-widget ui-widget-content ui-corner-all">
                            <ul role="tablist" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
                                <li aria-selected="true" aria-labelledby="ui-id-4" aria-controls="a-1" tabindex="0" role="tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a id="ui-id-4" tabindex="-1" role="presentation" class="ui-tabs-anchor" href="#a-1" style="font-size:14px;">आवक बारनिशी</a></li>
                            </ul>
							<!------------------------- avak Barnishi ------------------------------------------>
                            <div aria-hidden="false" aria-expanded="true" role="tabpanel" class="ui-tabs-panel ui-widget-content ui-corner-bottom" aria-labelledby="ui-id-4" id="a-1">
								<div id="divToPrint">
									<h4 class="widgettitle1">आवक बारनिशी</h4><br>
										<table>
											<tr>
												<td>आ_क्र : </td><td><?php echo $row['ltr_inword_no']; ?></td>
												<td>आ_दि : </td><td><?php echo $dpt_date; ?></td>
											</tr>
											<tr>
												<td>कोणाकडून प्राप्त : </td><td><?php echo $row['sender_name']; ?></td>
												<td>विषय : </td><td><?php echo $row['subject']; ?></td>
											</tr>
										</table><br>
										<?php if($inext=='bmp' || $inext=='gif'|| $inext== 'jpg'|| $inext== 'png' ||$inext=='BMP' ||$inext=='GIF' ||$inext=='JPG' ||$inext=='PNG' ||$inext=='JPEG' || $inext=='jpeg')
												{
												?>
												<!------------------- image fetching ------------------------->
												<img src="<?php echo $str2;?>" height="400px" width="100%" align='centre' border="2" style="border-color: #ff0000;">
													</div>	<!--print div-->
													<p>	
													<center><input type="submit" value=" Print Page " onclick="PrintDiv();" class="btn btn-primary"	/>
													</p>
										
												<!------------------- pdf fetching ------------------------->
												<?php }
												else if($inext=='pdf' || $inext=='PDF')
												{?>
												<iframe  name="myiframe" id="myiframe"  width="100%" height="500px;" src="<?php echo $str2;?>"></iframe>
												<?php
												}
												?>
								</div>
							</div>
			                <?php include_once('footer.php'); ?>
        </div><!--maincontentinner-->
    </div><!--rightpanel-->
</body>
</html>
 <?php 
 }
/*else if($user==2)
{
include('dashboard_desk.php');
?><html> 
<head>
<script type="text/javascript" src="js/adduser.js"></script> 
<script type="text/javascript">     
function PrintDiv() {    
var divToPrint = document.getElementById('divToPrint');
var popupWin = window.open('', '_blank', 'width=600,height=600');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
<script type="text/javascript">     
function PrintDivs() {    
var divToPrint = document.getElementById('divToPrints');
var popupWin = window.open('', '_blank', 'width=600,height=600');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
<style>
td{
height:20px;
width:190px;
}
</style>
</head>
<body>
   <div class="rightpanel">
	<?php
		##################################################### Query ###############################################
		$query11=mysql_query("SELECT * FROM incoming_letters_transaction,tapal_to_dpt_transaction WHERE incoming_letters_transaction.ltr_id='$no' AND tapal_to_dpt_transaction.desk_id=(Select desk_id from login where login_id='$username') AND tapal_to_dpt_transaction.desk_approval='pending' AND (tapal_to_dpt_transaction.desk_ltr_inword_no='0' OR tapal_to_dpt_transaction.desk_ltr_inword_no='') AND  tapal_to_dpt_transaction.ltr_id=incoming_letters_transaction.ltr_id ORDER BY incoming_letters_transaction.ltr_id DESC") or die("".mysql_error());
		$row=mysql_fetch_array($query11);
		$inwardpath=$row['document'];
		//fetch inward image
		$str2 = substr($inwardpath, 3);
		###################### seperate file name from path for inward file ##########################
		$file1 = basename($inwardpath);       
		##############code to retrive extension of file for inward file #########################	
		$filename=$file1;
		$ext = end(explode('.', $filename));	
		$ext = substr(strrchr($filename, '.'), 1);
		$ext = substr($filename, strrpos($filename, '.') + 1);
		$ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $filename);
		$exts = split("[/\\.]", $filename);
		$n    = count($exts)-1;
		$inext = $exts[$n];	
		$dpt_date = date('d-m-Y',strtotime($row['receive_dt']));
		?>
		<ul class="breadcrumbs">
            <li><a href="dashboard_desk.php"><i class="iconfa-home"></i></a> <span class="separator"></span></li>
            <li><a href="dashboard_desk.php"></a> <span class="separator"></span></li>
            <li>आवक बारनिशी व जावक बारनिशी</li>
        </ul>
        <div class="pageheader"> 
            <div class="pageicon"><span class="iconfa-pencil"></span></div>
				<div class="pagetitle">
					<h5>Forms</h5>
					<h1>आवक बारनिशी व जावक बारनिशी</h1>
				</div>
		</div><!--pageheader-->
			<div class="maincontent">
				<div class="maincontentinner">
				<!------------------------------- Tab Desigining -------------------------------------->
					<div class="tabbedwidget tab-primary"><ul></ul></div>
						<div class="tabbedwidget tab-primary ui-tabs ui-widget ui-widget-content ui-corner-all">
                            <ul role="tablist" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
                                <li aria-selected="true" aria-labelledby="ui-id-4" aria-controls="a-1" tabindex="0" role="tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a id="ui-id-4" tabindex="-1" role="presentation" class="ui-tabs-anchor" href="#a-1" style="font-size:14px;">आवक बारनिशी</a></li>
                            </ul>
							<!------------------------- avak Barnishi ------------------------------------------>
                            <div aria-hidden="false" aria-expanded="true" role="tabpanel" class="ui-tabs-panel ui-widget-content ui-corner-bottom" aria-labelledby="ui-id-4" id="a-1">
									<div id="divToPrint">
										<h4 class="widgettitle1">आवक बारनिशी</h4><br>
										<table>
											<tr>
												<td>आ_क्र : </td><td><?php echo $row['ltr_inword_no']; ?></td>
												<td>आ_दि : </td><td><?php echo $dpt_date; ?></td>
											</tr>
											<tr>
												<td>कोणाकडून प्राप्त : </td><td><?php echo $row['sender_name']; ?></td>
												<td>विषय : </td><td><?php echo $row['subject']; ?></td>
											</tr>
										</table><br>
										<?php if($inext=='bmp' || $inext=='gif'|| $inext== 'jpg'|| $inext== 'png' ||$inext=='BMP' ||$inext=='GIF' ||$inext=='JPG' ||$inext=='PNG' ||$inext=='JPEG' || $inext=='jpeg')
										{
											?>
											<!------------------- image fetching ------------------------->
											<img src="<?php echo $str2;?>" height="400px" width="100%" align='centre' border="2" style="border-color: #ff0000;">
											</div>	<!--print div-->
											<p>	
											<center><input type="submit" value=" Print Page " onclick="PrintDiv();" class="btn btn-primary"	/>
											</p>
										
											<!------------------- pdf fetching ------------------------->
								<?php 	}
										else if($inext=='pdf' || $inext=='PDF')
											{?>
												<iframe  name="myiframe" id="myiframe"  width="100%" height="500px;" src="<?php echo $str2;?>"></iframe>
												<?php
											}
											?>
							</div>	
						</div>
			  <?php include_once('footer.php'); ?>       
        </div><!--maincontentinner-->
    </div><!--rightpanel-->
</body>
</html>
<?php 
	}*/
} //end of else if($flag=='n')
?>