<?php 
require_once('convert_marathi.php');
session_start();
$username = $_SESSION['User_Name'];
$flag=$_REQUEST['flag'];
if($flag=='')
{
	include_once('dashboard_desk.php');
 ################################################## Form TO Select Jatan Prakar And to Write Performed Action #################
	 $no=$_GET['no'];
		?>
<html> 
<head>  
<script type="text/javascript" src="js/adduser.js"></script> 
<style type="text/css">
.box123{
    display: none;
    border: 0px solid #000;
    }
</style>
<script type="text/javascript" src="jquery/jq.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
		
  /*      $('input[type="radio"]').click(function(){
            if($(this).attr("value")=="current"){
                $(".box123").hide();
                $(".current").show();
            }
            if($(this).attr("value")=="new"){
                $(".box123").hide();`
                $(".new").show();
            }
         });
		 
		$("#act1").change(function(){  
			//if($("#act1").val()=="other"){
			//	$("#act").show();
			alert("sdasd");
			
		});*/
		
		$("#act1").change(function(){ 
			if($("#act1").val()=="other"){
				$("#act").show();
				}
		});
    });
	
</script>
</head>
<body>
    <div class="rightpanel" style="right-margin:auto;">
        <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">Forms</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">
				<div class="widget">
					<h4 class="widgettitle">कार्यवाही करा</h4>
					<div class="widgetcontent">
						<?php echo "<form class='stdform' action='desk_action_perform_edit.php?num=$no' method='post' name='performaction' >";?>
						<table>
							<?php
							convert_marathi();
							$qry11=("SELECT * FROM desk_transaction LEFT OUTER JOIN ltr_rejection ON desk_transaction.ltr_rej_id=ltr_rejection.ltr_rej_id, incoming_letters_transaction, tapal_to_dpt_transaction WHERE desk_transaction.desk_id_from=(select desk_id from  login where login_id='$username') AND tapal_to_dpt_transaction.ltr_id=incoming_letters_transaction.ltr_id AND tapal_to_dpt_transaction.dpt_ltr_id=desk_transaction.dpt_ltr_id AND desk_transaction.desk_ltr_id='$no'");
							$result11=mysql_query($qry11) or die("".mysql_error());
							while($row11=mysql_fetch_array($result11))
							{
								?>
								<tr>
									<td><label>डेस्कचा आवक क्र:  : </label></td>
									<td><input type="text" name="ltrinwardno" class="input-small" value="<?php echo $row11['desk_ltr_inword_no'];?>" readonly /></td>
									<td><label> डेस्कची स्वीकृत दि. :</label></td>
									<td><input type="text" name="deskappdt" class="input-small" value= "<?php $deskappdt=strtotime($row11['desk_apprv_dt']);
									$deskappdte = date('d-m-Y', $deskappdt);
									echo $deskappdte;?>" readonly />
									<small class="desc"></small>
									</td>
									<td><label>डेस्कला प्राप्त दि.   : </label></td>
									<td><input type="text" name="deskappdt" class="input-small" value= "<?php $deskrecdt=strtotime($row11['desk_ltr_rec_dt']);
									$deskrecdte = date('d-m-Y', $deskrecdt);
									echo $deskrecdte;?>" readonly />
									</td>
								</tr>	
								<tr>
									<td><label>विभागीय आवक क्र. : </label></td>
									<td><input type="text" name="dptinwardno" class="input-medium" value=<?php echo $row11['dpt_inword_no'];?> readonly /></td>
									<td><label style="width:120px;">विभागीय स्वीकृत दि.   :</label></td>
									<td><input type="text" name="deskinwardno" class="input-small" value="<?php $dptappdt= strtotime($row11['dpt_ltr_aprv_dt']);
									$dptappdte = date('d-m-Y', $dptappdt);
									echo $dptappdte;?>" readonly />
									</td>
									<td><label>विभागीय आवक दि.: </label></td>
									<td> <input type="text" name="deskappdt" class="input-small" value= "<?php $dptrecdt=strtotime($row11['dpt_ltr_rec_dt']);
									$dptrecdte = date('d-m-Y', $dptrecdt);
									echo $dptrecdte;?>" readonly />
									</td>
								</tr>
								<tr>
									<td><label>आवक क्र. : </label></td>
									<td><input type="text" name="dptinwardno" class="input-medium" value=<?php echo $row11['ltr_inword_no'];?> readonly /></td>
									<td><label>आवक दिं.  :</label></td>
									<td><input type="text" name="deskinwardno" class="input-small" value="<?php $recdt=strtotime($row11['receive_dt']);
									$recdte=date('d-m-Y', $recdt);
									echo $recdte;?>" readonly /></td>
									<!--<td><label>केलेली कार्यवाही :</label></td>
									<td><textarea class="unicode" lang="mr" name="oldactiontake" readonly><?php echo $row11['action_taken']; ?></textarea></td>-->
								</tr>
								<tr>
									<td><label>संदर्भ क्र. : </label></td>
									<td> <input  type="text" name="refno" class="input-small" value=<?php echo $row11['ref_no'];?> readonly /></td>
									<td><label>संदर्भ दिं. : </label></td>
									<td> <input  type="text" name="refdate" class="input-small" value=<?php  $refdt= strtotime($row11['ref_dt']);
									$refdte = date('d-m-Y', $refdt);
									echo $refdte;?> readonly />
									</td>
								<!--	<td style=""><label>जतन प्रकार</label></td>
									<td> <input  type="text" name="oldjatan" class="input-small" value=<?php echo $row11['vargawari'];?> readonly /></td>-->
								</tr>
								<tr>
									<td><label>थोडक्यात विषय : </label></td>
									<td><textarea class="unicode" lang="mr" name="sub" style="width:180px;" readonly><?php echo $row11['subject'];?></textarea></td>
									<td><label>&nbsp;केलेली कार्यवाही :</label></td>
							<!--	<td><textarea class="unicode" lang="mr" name="actiontake"></textarea></td> -->
									<td><select id="act1" class="unicode1" lang="mr" name="actiontake1">
										<option value='SELECT'>SELECT</option>
									<?php 
										$q=mysql_query("SELECT * from action_master ");
										while($r=mysql_fetch_array($q))
										{	
											$action=$r['action_nm'];
											echo "<option value='".$action."'>".$action."</option>";
										}
										
									?>
									</select></td>
									
									<td colspan="2"><div id="act" hidden><textarea  class="unicode" lang="mr" name="actiontake" placeholder="केलेली कार्यवाही टाका " hidden ></textarea></div></td>
									
									<!--<td><font color="red"><label style="color:red;">Reason : </label></td>
									<td><label style="color:red;"><?php echo $row11['reason']; ?></label></font></td>-->
								</tr>
								<tr>
									<td><label>जतन प्रकार निवडा   : </label></td>
									<td><select id="category_faq" name="ltrtype">
										<option value="">जतन प्रकार </option>    
										<option value="अ">अ</option>
										<option value="ब">ब</option>
										<option value="क">क</option>
										<option value="क१">क१</option>
										<option value="ड">ड</option>
										<option value="ड">0</option>
										</select>
									</td>
									<td style="visibility:hidden"><label>rtn </label>
									<input  type="text" name="rejid" class="input-small" value=<?php echo $row11['ltr_rej_id'];?> readonly /></td>
								</tr> 
						
						</table>		
							<?php  if($row11['reason']!='')
										{ 
											?>		
											<p class="stdformbutton">
											<center> <input type="submit" class="btn btn-primary" name="rejdispatch" value="पाठवा " onclick="return validateperformaction()">
											</p></center></div>
								<?php 	}
									else
										{
										?>
											<p class="stdformbutton">
											<center> <input type="submit" class="btn btn-primary" name="update" value="अद्यावत करा " onclick="return validateperformaction1()">
											<input type="submit" class="btn btn-primary" name="dispatch" value="पाठवा" onclick="return validateperformaction()">
											<input type="reset" class="btn" value="रद्द करा ">
											</p></center></div>
								<?php 	}
							}
						?>
						</form>
					</div>
				
            <?php include_once('footer.php'); ?>
            </div>
        </div><!--footer-->
    </div><!--maincontentinner-->
 </div><!--maincontent-->
</div><!--rightpanel--> 
</div><!--mainwrapper-->
</body>
</html>
<?php
} //if($flag=='')


else if($flag=='n')
{
	include_once('new_dashboard_department.php');
 ################################################## Form TO Select Jatan Prakar And to Write Performed Action #################
	 $no=$_GET['no'];
		?>
<html> 
<head>  
<script type="text/javascript" src="js/adduser.js"></script> 
<style type="text/css">
.box123{
    display: none;
    border: 0px solid #000;
    }
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        /*      $('input[type="radio"]').click(function(){
            if($(this).attr("value")=="current"){
                $(".box123").hide();
                $(".current").show();
            }
            if($(this).attr("value")=="new"){
                $(".box123").hide();`
                $(".new").show();
            }
         });
		 
		$("#act1").change(function(){  
			//if($("#act1").val()=="other"){
			//	$("#act").show();
			alert("sdasd");
			
		});*/
		$("#act1").change(function(){ 
			if($("#act1").val()=="other"){
				$("#act").show();
				}
		});
    });
	
</script>
</head>
<body>
    <div class="rightpanel" style="right-margin:auto;">
        <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">Forms</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">
				<div class="widget">
					<h4 class="widgettitle">कार्यवाही करा</h4>
					<div class="widgetcontent">
						<?php echo "<form class='stdform' action='desk_action_perform_edit.php?flag=n&num=$no' method='post' name='performaction' >";?>
						<table>
							<?php
							convert_marathi();
							/*$qry11=("SELECT * FROM desk_transaction LEFT OUTER JOIN ltr_rejection ON desk_transaction.ltr_rej_id=ltr_rejection.ltr_rej_id, incoming_letters_transaction, tapal_to_dpt_transaction WHERE desk_transaction.desk_id_from=(select desk_id from  login where login_id='$username') AND tapal_to_dpt_transaction.ltr_id=incoming_letters_transaction.ltr_id AND tapal_to_dpt_transaction.dpt_ltr_id=desk_transaction.dpt_ltr_id AND desk_transaction.desk_ltr_id='$no'");*/
							$result11=mysql_query("SELECT *
												FROM incoming_letters_transaction i, tapal_to_dpt_transaction t
												WHERE t.dept_id_from = (
																			SELECT dept_id
																			FROM login
																			WHERE login_id = '$username' )
												AND t.ltr_id = i.ltr_id
												AND t.dpt_ltr_id = '$no'") or die("".mysql_error());
							
							while($row11=mysql_fetch_array($result11))
							{
								?>
							<!-- <tr>
									<td><label>डेस्कचा आवक क्र:  : </label></td>
									<td><input type="text" name="ltrinwardno" class="input-small" value="<?php echo $row11['desk_ltr_inword_no'];?>" readonly /></td>
									<td><label> डेस्कची स्वीकृत दि. :</label></td>
									<td><input type="text" name="deskappdt" class="input-small" value= "<?php $deskappdt=strtotime($row11['desk_apprv_dt']);
									$deskappdte = date('d-m-Y', $deskappdt);
									echo $deskappdte;?>" readonly />
									<small class="desc"></small>
									</td>
									<td><label>डेस्कला प्राप्त दि.   : </label></td>
									<td><input type="text" name="deskappdt" class="input-small" value= "<?php $deskrecdt=strtotime($row11['desk_ltr_rec_dt']);
									$deskrecdte = date('d-m-Y', $deskrecdt);
									echo $deskrecdte;?>" readonly />
									</td>
								</tr>	-->
								<tr>
									<td><label>विभागीय आवक क्र. : </label></td>
									<td><input type="text" name="dptinwardno" class="input-medium" value=<?php echo $row11['dpt_inword_no'];?> readonly /></td>
									<td><label style="width:120px;">विभागीय स्वीकृत दि.   :</label></td>
									<td><input type="text" name="deskinwardno" class="input-small" value="<?php $dptappdt= strtotime($row11['dpt_ltr_aprv_dt']);
									$dptappdte = date('d-m-Y', $dptappdt);
									echo $dptappdte;?>" readonly />
									</td>
									<td><label>विभागीय आवक दि.: </label></td>
									<td> <input type="text" name="deskappdt" class="input-small" value= "<?php $dptrecdt=strtotime($row11['dpt_ltr_rec_dt']);
									$dptrecdte = date('d-m-Y', $dptrecdt);
									echo $dptrecdte;?>" readonly />
									</td>
								</tr>
								<tr>
									<td><label>आवक क्र. : </label></td>
									<td><input type="text" name="dptinwardno" class="input-medium" value=<?php echo $row11['ltr_inword_no'];?> readonly /></td>
									<td><label>आवक दिं.  :</label></td>
									<td><input type="text" name="deskinwardno" class="input-small" value="<?php $recdt=strtotime($row11['receive_dt']);
									$recdte=date('d-m-Y', $recdt);
									echo $recdte;?>" readonly /></td>
									<!--<td><label>केलेली कार्यवाही :</label></td>
									<td><textarea class="unicode" lang="mr" name="oldactiontake" readonly><?php echo $row11['action_taken']; ?></textarea></td>-->
								</tr>
								<tr>
									<td><label>संदर्भ क्र. : </label></td>
									<td> <input  type="text" name="refno" class="input-small" value=<?php echo $row11['ref_no'];?> readonly /></td>
									<td><label>संदर्भ दिं. : </label></td>
									<td> <input  type="text" name="refdate" class="input-small" value=<?php  $refdt= strtotime($row11['ref_dt']);
									$refdte = date('d-m-Y', $refdt);
									echo $refdte;?> readonly />
									</td>
								<!--	<td style=""><label>जतन प्रकार</label></td>
									<td> <input  type="text" name="oldjatan" class="input-small" value=<?php echo $row11['vargawari'];?> readonly /></td>-->
								</tr>
								<tr>
									<td><label>थोडक्यात विषय : </label></td>
									<td><textarea class="unicode" lang="mr" name="sub" style="width:180px;" readonly><?php echo $row11['subject'];?></textarea></td>
									<td><label>&nbsp;केलेली कार्यवाही :</label></td>
							<!--	<td><textarea class="unicode" lang="mr" name="actiontake"></textarea></td> -->
									<td><select id="act1" class="unicode1" lang="mr" name="actiontake1">
										<option value='SELECT'>SELECT</option>
									<?php 
										$q=mysql_query("SELECT * from action_master ");
										while($r=mysql_fetch_array($q))
										{	
											$action=$r['action_nm'];
											echo "<option value='".$action."'>".$action."</option>";
										}
										
									?>
									</select></td>
									
									<td colspan="2"><div id="act" hidden><textarea  class="unicode" lang="mr" name="actiontake" placeholder="केलेली कार्यवाही टाका " hidden ></textarea></div></td>
									
									<!--<td><font color="red"><label style="color:red;">Reason : </label></td>
									<td><label style="color:red;"><?php echo $row11['reason']; ?></label></font></td>-->
								</tr>
								<tr>
									<td><label>जतन प्रकार निवडा   : </label></td>
									<td><select id="category_faq" name="ltrtype">
										<option value="">जतन प्रकार </option>    
										<option value="अ">अ</option>
										<option value="ब">ब</option>
										<option value="क">क</option>
										<option value="क१">क१</option>
										<option value="ड">ड</option>
										<option value="0">0</option>
										</select>
									</td>
									<td style="visibility:hidden"><label>rtn </label>
									<input  type="text" name="rejid" class="input-small" value=<?php echo $row11['ltr_rej_id'];?> readonly /></td> 
								</tr>
						
						</table>		
							<?php /* if($row11['reason']!='')
										{ 
											?>		
											<p class="stdformbutton">
											<center> <input type="submit" class="btn btn-primary" name="rejdispatch" value="पाठवा " onclick="return validateperformaction()">
											</p></center></div>
								<?php 	}*/
								/*	else
										{*/
										?>
											<p class="stdformbutton">
											<center> <input type="submit" class="btn btn-primary" name="update" value="अद्यावत करा " onclick="return validateperformaction1()">
											<input type="submit" class="btn btn-primary" name="dispatch" value="पाठवा" onclick="return validateperformaction()">
											<input type="reset" class="btn" value="रद्द करा ">
											</p></center></div>
								<?php 	//}
							}
						?>
						</form>
					</div>
				
            <?php include_once('footer.php'); ?>
            </div>
        </div><!--footer-->
    </div><!--maincontentinner-->
 </div><!--maincontent-->
</div><!--rightpanel--> 
</div><!--mainwrapper-->
</body>
</html>
<?php
} //else if($flag=='n')
?>
