<?php
include('session.php');
include('connection.php');
$b=$_GET['srno'];
//echo $b;
mysqli_query($GLOBALS["___mysqli_ston"], "SET NAMES utf8");
	$my="SELECT * FROM `press_release` where srno='$b'";
		
//echo $my;
$n=mysqli_query($GLOBALS["___mysqli_ston"], $my) or die ("Query Fail:".mysqli_error($GLOBALS["___mysqli_ston"]));
if(mysqli_num_rows($n)>0)
{
while($rw=mysqli_fetch_assoc($n)) 
{
					$srno=$rw['srno'];
		//		echo $srno;
					$head=$rw['Header'];
					$head1=$rw['Header_marathi'];
					//echo $head1;
$info=$rw['News'];
$info1=$rw['News_marathi'];
$dp1=$rw['Date'];
$path=$rw['url'];
//echo $path;
$file1=$rw['Photos&videos'];
//$photo=$rw['Photo'];
//$video=$rw['Video'];
$status=$rw['Status'];
$lastm=$rw['LastModified'];
}
}
?>

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="samarth10" >

    <title>SB Admin 2 - Bootstrap Admin Theme</title>
 
    <!-- Bootstrap Core CSS -->
            
    <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    
    <!-- MetisMenu CSS -->
    <link href="bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
 
    <!-- Custom CSS -->
     <link href="dist/css/sb-admin-2.css" rel="stylesheet">
 
    <!-- Custom Fonts -->
    <link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> 
   
 
 <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
 
<script src="dist/js/jquery-1.7.1.min.js"></script>
 
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<link rel="stylesheet" href="dist/css/bootstrap-datepicker.css">

<link rel="stylesheet" href="tinybox/style_tiny.css" />
<script type="text/javascript" src="tinybox/tinybox.js"></script>

<script src="dist/js/bootstrap-datepicker.js"></script>
<script src="dist/js/bootstrap-datepicker.min.js"></script>

        <script type="text/javascript" >

$(function()
{
$('#dp1').datepicker();	
	
	});
</script>

<script type="text/javascript" >
        
        
        
 function newsub()
{
//	alert('hjhgj');
		var srno=document.getElementById('srno').value;
		var head=document.getElementById('head').value;
		var head1=document.getElementById('head1').value;
	//alert(sno);
	var info=document.getElementById('info').value;
	var info1=document.getElementById('info1').value;
//alert(info);
var dp1=document.getElementById('dp1').value;

//alert(date1);
var file1=document.getElementById('file1').value;
//alert(photo);
//var video=document.getElementById('video').value;
//alert(video);

/*if(srno==''||head==''||head1==''||info==''||info1==''||dp1=='')
{
alert('Please enter all details..?');
	}
	else*/
	{  	
  	if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
	xmlhttp.onreadystatechange=function()
	{

    if (xmlhttp.readyState==4) 
	{
    // alert(xmlhttp.responseText);
      if(xmlhttp.responseText==1)	   {

	   alert("Updated Successfully");
       window.location.reload();
		
  }
  	  
  }
  }
var  res="&srno="+srno+"&head="+head+"&head1="+head1+"&info="+info+"&info1="+info1+"&dp1="+dp1;
//	alert(res);
  xmlhttp.open("POST","updatefile.php?"+res,true);
  xmlhttp.send(null); 
	 
}
}



function update_company(i)
		{
	//	alert(i)
			var Sr=i;
	//		alert(Sr);
														//	var xr=document.getElementById('x'+i).value;
															//alert(xr);
		TINY.box.show({iframe:"updation.php?srno="+i,boxid:'frameless',width:660,height:800,fixed:false,maskid:'bluemask',maskopacity:40,closejs:function(){closeJS()}});	
		
	
		
			}



</script>

</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            
                    <!-- /.dropdown-tasks -->
                
                <!-- /.dropdown -->
              

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header"></h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Current updates
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6">
                                   <form role="form" action="updatefile_press.php" method="post"  enctype="multipart/form-data" class="contact_form">
                                       
                                        <div class="form-group" >
                                            <label>srno</label>
                                            <input class="form-control" placeholder="Enter Number" id="srno" name="srno" value="<?php echo $b;?>" readonly>
                                        </div>
                                          <div class="form-group">
                                            <label>Header</label>
                                            <input class="form-control" placeholder="Enter text" id="head" name="head" value="<?php echo $head;?>">
                                        </div>
                                         <div class="form-group">
                                            <label>Header(marathi)</label>
                                            <input class="form-control" placeholder="Enter text" id="head1" name="head1" value="<?php echo $head1;?>">
                                        </div>
                                  <div class="form-group">
                                            <label>News</label>
                                            <textarea class="form-control" placeholder="Enter text" id="info" name="info" rows="3" ><?php echo $info; ?></textarea>
                                        </div>
                                        
                                          <div class="form-group">
                                            <label>News(marathi)</label>
                                            <textarea class="form-control" placeholder="Enter text" id="info1" name="info1" rows="3"><?php echo $info1; ?></textarea>
                                        </div>
                                        <div class="form-group">
                                           <label>Date</label> 
                                            
                                        <input id="dp1" class="span2" placeholder="Select date" name="dp1" type="text" value="<?php echo $dp1;?>">
                                        </div>
                                                                                    
                                              <input type="submit"  name="submit" value="submit" /> 
                               
                                     
                                     </form>
                                      <!--     <?php $_SERVER['PHP_SELF'];?> -->
                                </div>
                                <!-- /.col-lg-6 (nested) -->
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                      <div id="search_res" style="width:100%;" >                    
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="../bower_components/jquery/dist/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="../bower_components/metisMenu/dist/metisMenu.min.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="../dist/js/sb-admin-2.js"></script>

</body>

</html>
