<?php include("parent/callMe.php"); ?>
<?php  include("sessioncheck.php"); ?>
<?php


 
     ?>


<!DOCTYPE html>
<html lang="en">
  <head>
    
    <title>Add MEETING | EduPortal</title>

    <?php include('RootMe/css_links.php');?>
  
<script type="text/javascript">

function getSubCat(id){
  //alert(id);

    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 && xmlhttp.status==200) {

        document.getElementById("subcatgory").innerHTML=xmlhttp.responseText;
       //alert(xmlhttp.responseText);

      }

    }
    xmlhttp.open("GET","get_exp_subcategory.php?id="+id,true);
    xmlhttp.send();
  }
</script> 

  </head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
 
<!-- <script>
$(document).ready(function(){
  
    $("#div1").fadeOut();
    $("#div2").fadeOut("slow");
    $("#div3").fadeOut(3000);
 
});
</script> -->
  <style>
#snackbar {
  visibility: hidden;
  min-width: 250px;
  margin-left: -125px;
  background-color: #1E90FF;
  color: #fff;
  text-align: right;
  border-radius: 2px;
  padding: 16px;
  position: fixed;
  z-index: 1;
  left: 80%;
  bottom: 30px;
  font-size: 17px;
}

#snackbar.show {
  visibility: visible;
  -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
  animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
  from {bottom: 0; opacity: 0;} 
  to {bottom: 30px; opacity: 1;}
}

@keyframes fadein {
  from {bottom: 0; opacity: 0;}
  to {bottom: 30px; opacity: 1;}
}

@-webkit-keyframes fadeout {
  from {bottom: 30px; opacity: 1;} 
  to {bottom: 0; opacity: 0;}
}

@keyframes fadeout {
  from {bottom: 30px; opacity: 1;}
  to {bottom: 0; opacity: 0;}
}

</style>

<body class="nav-md">


<div class="container body">

<div class="main_container">

<div class="col-md-3 left_col">

<?php include('RootMe/sidebar.php');?>

<?php include('RootMe/header.php');?>


<!-- page content -->

<div class="right_col" role="main">

<div class="row" style="background-color: white;">


<section class="add_sub_agent" id="table_sub_agent">

<div class="container">

<div class="" style="margin-top:10px;">

<!-- page content -->

<div class="">

<div class="page-title">

<div class="title_left">
            
       <a href="<?php echo $_SESSION['dashboard'];?>">Dashboard </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 
              
            Assign Employe

            <br><br>
   

</div>
</div>

<div class="clearfix"></div>

<h3 style="margin-left: 15px;">Add Assign Work to Employee</h3>


<div class="row">

<div class="col-md-12 col-sm-12 col-xs-12">

<div class="x_panel">

<div class="x_content">


<form action="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php"
 method="post"

  enctype="multipart/form-data" class="form-horizontal form-label-left" >

<?php

$month;

if(!isset($_GET['sID'])){?>

<input type="hidden" name="action" value="add_signwork" />

<?php $month=date("m");}else {

$query="select * from eduportal_assignwork_employe where id =".$_GET['sID'];

$cvdata = $m->query($query);

$month=$cvdata[0]['month'];

?>

<input type="hidden" name="action" value="update_signwork" />

<input type="hidden" name="id"  value="<?php echo $_GET['sID'];?>">

<?php } ?>        





<?php


if($cvdata[0]['expense_date']!="" && $cvdata[0]['expense_date']!=NULL ) {
$dates=date("Y-m-d",strtotime($cvdata[0]['due_date']));  //apply_date

}else {
$dates=date("Y-m-d");  
}


?>


<div class="col-xl-3 col-lg-4 col-12 form-group">

<label>Title *</label>

<input type="text" name="title" placeholder="Enter Your Title" class="form-control" >

</div>

<div class="col-xl-3 col-lg-4 col-12 form-group">

<label>Due Date <span class="required">*</span></label>

<input type="date" id="owner_email" name="Applydate" required class="form-control col-md-4 col-xs-12" value="<?php echo $dates; ?>">
</div>

<div class="col-xl-4 col-lg-4 col-12 form-group">

<label>Employe's Name <span class="required">*</span></label>
<br>
<select name="employe[]" class="selectpicker" multiple data-live-search="true">


        <option value="All">All</option>
  

  <?php
  $branchID=$_SESSION['branch'];
$query="select * from edu_user_config where branch_id='$branchID' and status='0'";
$WorkAssignList = $m->query($query);
foreach($WorkAssignList as $WorkAssignListVal)
{ ?>

   <option <?php if($_REQUEST['designation']==$WorkAssignListVal['user_id']){echo "selected";} ?>  value="<?php echo $WorkAssignListVal['user_id']; ?>"><?php echo $WorkAssignListVal['user_fname']; ?></option>


<?php } ?>

</select>

</div>

<br>

<div class="item form-group">

<div class="col-md-12 col-sm-12 col-xs-12">

<label class="required"> Discription</label>

<textarea id="textarea" required="required" name="discription" class="ckeditor"> <?php echo $cvdata[0]['discription']; ?></textarea>
</div>
</div>



<?php if(!isset($_GET['sID'])){?>        

<div class="item form-group">
<label class="control-label" for="name">Upload File  <span class="required">*</span>
</label> <br><br>
<div class="col-md-6 col-sm-6 col-xs-12">
<input class="form-control col-md-7 col-xs-12" name="img_file" autocomplete="off" type="file" value="<?php echo $expdata[0]['expense_amount']; ?>">

</div>
</div>
<?php } else { ?>

<div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Upload File  <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input class=" col-md-7 col-xs-12" name="img_file" autocomplete="off" type="file" value="<?php echo $expdata[0]['expense_amount']; ?>">

</div>
</div>

<?php } ?>


<div class="ln_solid" style="border-top:none;"></div>

<div class="form-group">

<div class="col-md-6 col-sm-12">

<button id="send" type="submit" name="submit" class="btn btn-primary" style="margin-top: 2%" >Submit</button>

</div>
</div>


<br><br>

</form>




</div>
</div>
</div>
</div>


</div>
</div>
</div>

<div class="clearfix"></div>

</section>



</div>
</div>

</div>
</div>
</div>

<!-- /page content -->

<?php include('RootMe/js_linksscript.php');?>


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/css/bootstrap-select.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/js/bootstrap-select.min.js"></script>


<script src="autosearch_select/select2.min.js"></script>
<script src="https://cdn.ckeditor.com/4.12.1/standard/ckeditor.js"></script>

<script>

$('select').selectpicker();
  
</script>

</body>

</html>

<script>



function toastFunction() {

  var x = document.getElementById("snackbar");

  x.className = "show";

  setTimeout(function(){ x.className = x.className.replace("show", "");

   }, 3000);

}

$(document).ready(function () {
  $("#test").CreateMultiCheckBox({ width: '230px',
    defaultText : 'Select Below', height:'250px' });
});

</script>