<?php 
require_once('convert_marathi.php');
 session_start();
$username = $_SESSION['User_Name'];
include('dashboard_desk.php');
$id=$_REQUEST['id'];
?><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">
		
		<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">
								<?php
		##################################################### Query ###############################################
		$query11=mysql_query("SELECT * FROM direct_javak where 	javak_id='$id' ") 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];	
		$javak_dt = date('d-m-Y',strtotime($row['javak_dt']));
		?>
								<div id="divToPrint">
								
									<h4 class="widgettitle1">जावक बारनिशी</h4><br>
										<table>
											<tr>
												<td>जावक_क्र. : </td><td><?php echo $row['javak_no']; ?></td>
												<td>जावक दि : </td><td><?php echo $javak_dt; ?></td>
											</tr>
											<tr>
												
												<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>
 