
<?php
include('connection.php');
//include('lock.php');
include('session.php');

?>
<!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 dept_pdf_upload() 
{
  //alert('hiii'); 
//var vname=document.getElementById('vname').value;

var srno=document.getElementById('srno').value;		
var dept_name1=document.getElementById('dept_name1').value;		
var sub_dept_name=document.getElementById('sub_dept_name').value;		

//alert (dept_name);

	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)
		 {

				var msg=xmlhttp.responseText;
				//alert(msg);
			//	document.getElementById('sub_dept_name').innerHTML=msg;
			if(msg!=0)
			{
				document.getElementById('dept').style.display='block';
				}
				document.getElementById('dept_name').innerHTML=msg;

					}
}

			var res ="?dept_name1="+dept_name1; 
//alert(res);
		xmlhttp.open("POST", "dept_upload_insert.php" + res, true); 
		xmlhttp.send(null); 
		//document.getElementById('submit').disabled=true;
					 
			// curr();	
}

function see()
{
//alert('hi');
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);
		//window.location.href="Update_EmpRecord_Design.php";
				var msg=xmlhttp.responseText;
				document.getElementById('search_res').innerHTML=msg;
		 }
	}
		xmlhttp.open("POST", "viewstory.php" , 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_story.php?srno="+i,boxid:'frameless',width:660,height:800,fixed:false,maskid:'bluemask',maskopacity:40,closejs:function(){closeJS()}});	
		
	
		
			}

 


</script>
<script>
(function($) {
    $.fn.checkFileType = function(options) {
        var defaults = {
            allowedExtensions: [],
            success: function() {},
            error: function() {}
        };
        options = $.extend(defaults, options);

        return this.each(function() {

            $(this).on('change', function() {
                var value = $(this).val(),
                    file = value.toLowerCase(),
                    extension = file.substring(file.lastIndexOf('.') + 1);

                if ($.inArray(extension, options.allowedExtensions) == -1) {
                    options.error();
                    $(this).focus();
                } else {
                    options.success();

                }

            });

        });
    };

})(jQuery);

$(function() {
    $('#file1').checkFileType({
        allowedExtensions: ['jpg', 'jpeg', 'pdf' ,'png'],
        success: function() {
        //    alert('Success');
        },
        error: function() {
            alert('File Format is not supported..!!!');
                    document.getElementById('file1').value='';
        }
    });

});

$(function() {
    $('#file2').checkFileType({
        allowedExtensions: ['jpg', 'jpeg','pdf'],
        success: function() {
         //   alert('Success');
        },
        error: function() {
            alert('File Format is not supported..!!!');
                    document.getElementById('file2').value='';
        }
    });

});

$(function() {
    $('#file3').checkFileType({
        allowedExtensions: ['jpg', 'jpeg','pdf'],
        success: function() {
           // alert('Success');

        },
        error: function() {
            alert('File Format is not supported..!!!');
        document.getElementById('file3').value='';
        }
    });

});

function view5(i)
{
	{  	
  	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("Inserted Successfully");
       window.location.reload();
		
  }
  	  
  }
  }
//var res="&srno="+srno+"&date="+date+"&option="+option;
	//alert(res);
  xmlhttp.open("GET","disable_story.php?srno="+i,true);
  xmlhttp.send(null); 
	 
}
}
</script>

</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
       <!--  <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button> -->
                 <?php include("menu22.php"); ?>
<!--             </div> -->
                                 <?php include("header.php"); ?> 
<!--         </nav> -->

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Success Stories</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                       Success Stories
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6">
                                
                                    <form role="form" action="success_stories_insert.php" method="post" id="yourElem"  enctype="multipart/form-data" class="contact_form">
                                      <div class="form-group">
                                             <label>Department Name:</label>
                                           <select  class="form-control" id="dept_name" name="dept_name" onchange="" > <option>---select--- </option>
																													            	<?php
                                              $dept="SELECT * FROM `main_dept_category`";
                                             	$res = mysqli_query($GLOBALS["___mysqli_ston"], "SET NAMES utf8");	
																																									$res=mysqli_query($GLOBALS["___mysqli_ston"], $dept) or die('Query Failed: 4' . mysqli_error($GLOBALS["___mysqli_ston"]));
																																										while($rw = mysqli_fetch_assoc($res))
																																									
																																											 {
																																											    	$ddept_id=$rw['dept_id'];
																																														 $dept_name=$rw['dept_name'];
																																															echo '<option value="'.$ddept_id.'">'.$dept_name.'</option>';	
																																																																													
																																												} 
																																												?> 											                                          
                                          </select>                                          
                                          </div>
                                           <div class="form-group">
                                         <label>Sub-department</label>   
                                         <select class="form-control" id="sub" name="sub"><option>---select---</option>
                                         <option value="विशेष कार्यक्रम / चालू घडामोडी / यशस्वी कथा">विशेष कार्यक्रम / चालू घडामोडी / यशस्वी कथा</option>
                                         </select>
                                      </div>
                                      <div class="form-group">
                                         <label>Description</label>   
                                         <textarea id="disc" name="disc" placeholder="Enter description" rows="4" class="form-control" required></textarea>
                                      </div>
                                           
                                     <div class="form-group">
                                           <label>Date</label> 
                                         <input id="dp1" class="span2 form-control" placeholder="Select date" name="dp1" type="text" required>
                                         </div>
                                         <div class="form-group"> 
                                        <label> Photo: </label><input class="form-control" accept="image/*" type="file" name="file1" id="file1"><b>NOTE:- Only jpg,jpeg,png file are allowed.<br>
                                          image file will not be accepted more than 1MB.</b><br>
                                   </div>
                                   <div class="form-group"> 
                                   <label> File: </label><input class="form-control" type="file" name="file2" id="file2" ><br><b>NOTE:- PDF file will not be accepted more than 1MB.</b></div>
                                        <div class="form-group">
                                            <label>Link</label>
                                            <input class="form-control" placeholder="Enter url1 for youtube" id="path1" name="path1" >
                                        </div>
                                      <input type="submit" value="submit"> 
                                       <button type="button" onclick="see();" class="submit">View</button>
                                <!-- /.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>
