<?php
require '../../connect.php';
session_start();
$type=$_SESSION['title'];
?>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        /* Style for the card */
    .card {
        border: 1px solid #dee2e6; /* Add border */
        border-radius: .25rem; /* Add border radius */
        margin: 20px auto; /* Center the card horizontally */
        max-width: 800px; /* Limit maximum width */
    }

    /* Style for the card header */
    .card-header {
        background-color: deepPink; /* Pink background color */
        color: white; /* White text color */
        padding: 10px; /* Add some padding */
        display: flex; /* Use flexbox for layout */
        justify-content: space-between; /* Space items evenly */
        align-items: center; /* Center items vertically */
		
    }

    /* Style for the back button */
    .btn-back {
        color: white; /* White text color */
        background-color: black; /* Black background color */
        padding: 5px 10px; /* Add padding */
        border: none; /* Remove border */
        cursor: pointer; /* Show pointer cursor */
        text-decoration: none; /* Remove default underline */
    }

    /* Style for the h3 inside card header */
    .card-header h3 {
        font-size: 24px; /* Set font size */
        margin: 0; /* Remove default margin */
    }

    /* Style for the form */
    .form-horizontal {
        margin-top: 20px; /* Add some top margin */
        padding: 20px; /* Add padding */
    }
	.btn.btn-success
	{
		border: none;
    background: pink;
    border-radius: 6px;
    height: 30px;
    width: 100px;
    font-size: 18px;
	}
	.btn.btn-success:hover
	{
		 background:deepPink;
		 color:white;
	}
	
	.backbtn
	{
		 color: white; /* White text color */
        background-color: gray; /* Gray background color */
        padding: 5px 10px; /* Add padding */
        border: none; /* Remove border */
        cursor: pointer; /* Show pointer cursor */
        text-decoration: none; /* Remove default underline */
	}
	.backbtn:hover {
        background-color: black; /* Black hover background color */
    }
	.form-control
	{
		width:100% !important;
	}
    </style>
</head>
<body>
    <div class="card card-pink" style="width:140vh;">
        <div class="card-header">
            <h3 class="card-title"><font size="5"><b>Add New Karoke & Lyrics</b></font></h3>
            <div class="backbtn">
            <a onclick="return back()" style="float: right;color:white" data-toggle="modal" class="btn btn-dark"><b>Back</b></a>
			</div>
        </div>

        <form action='#' name="song_addd" id="song_addd" class="form-horizontal" method="POST" enctype="multipart/form-data">
            <div class="form-group">
                <label for="title1">Song Name:</label><br>
                <input type="text" class="form-control" name="title1" id="title1" autocomplete="off" placeholder="Enter Song Name">
            </div>

            <div class="form-group">
                <label for="music_director_id1">Music Director:</label><br>
                <select class="form-control" name="music_director_id1" id="music_director_id1">
                    <option value="">---Select---</option>
                    <?php
                    $sql=$con->query("SELECT * FROM music_directors where singer_id='1'");
                    $i=1;
                    while($cmp = $sql->fetch(PDO::FETCH_ASSOC))
                    {
                    ?>
                    <option value="<?php echo $cmp['id'];?>"><?php echo $cmp['music_director_name'];?></option>
                    <?php
                    }
                    ?>
                </select>
            </div>

            <div class="form-group">
                <label for="language_id1">Language:</label><br>
                <select class="form-control" name="language_id1" id="language_id1">
                    <option value="">---Select---</option>
                    <?php
                    $sql=$con->query("SELECT * FROM languages");
                    $i=1;
                    while($cmp = $sql->fetch(PDO::FETCH_ASSOC))
                    {
                    ?>
                    <option value="<?php echo $cmp['id'];?>"><?php echo $cmp['language_name'];?></option>
                    <?php
                    }
                    ?>
                </select>
            </div>

            <div class="form-group">
                <label for="song_file1">Select Song:</label><br>
                <input type="file" name="song_file1" id="song_file1">
            </div><br>

            <div class="form-group">
                <label for="lyrics_file1">Upload Lyrics:</label><br>
                <input type="file" name="lyrics_file1" id="lyrics_file1">
            </div>
<br>
            <div class="form-group" >
                <label for="status">Status:</label><br>
                <select id="status" name="status" class="form-control">
                    <option value="nd">-- Status --</option>
                    <option value="active">Active</option>
                    <option value="inactive">In Active</option>
                </select>
            </div>
			<br>

            <div class="card-footer">
                <input type="submit" class="btn btn-success" name="save" value="Submit">
            </div>
        </form>
    </div>

    <!-- Your footer content and scripts -->
</body>
</html>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
function back(){
    var rightcontent=$("#rightcontent").hide();

    $.ajax({
    type:"POST",
      url:"professional_singer/music/music_view.php",
    success:function(data){
      $("#centerconteid").css("marginLeft", "450px");
               
               $("#centerconteid").html(data);
	
    }
    })
  }
</script>


<SCRIPT src="http://code.jquery.com/jquery-2.1.1.js"></SCRIPT>
				<script>  
 $(document).ready(function(){  
     
	  $("form[name='song_addd']").on("submit", function(ev) {
		 ev.preventDefault();
var formData = new FormData(this);	  
           $.ajax({  
                 url:"professional_singer/music/songs_submit.php", 
                method:"POST",  
                data:formData, 
				cache: false,
				contentType: false,
    processData: false,
                success:function(data)  
                {  
                    console.log("hii");
                    alert('Songs Added Successfully'); 
                    window.location.href = "/rythm/homee.php";
					//songs()
                     //$('#add_name')[0].reset();  
                }  
           });  
      });  
 });  
 </script>
 
 
<script>
/* function insert_songs()
    {
    var id=0;
	//alert(id);
    var data = $('form').serialize();
	//alert(data);
    $.ajax({
    type:'GET',
    data:"id="+id, data,
    url:'neha/songs/songs_submit.php',
	
    success:function(data)
    {
      
      //alert("Karoke Entry Successfully Submitted");
//songs()
      
      
    }       
    });
    } */
</script>