<head>
<link href="eportal/css/bootstrap.css" rel="stylesheet" media="all">
<link href="eportal/css/font-awesome.css" rel="stylesheet" type="text/css">
<link href="eportal/css/css-font.css" rel="stylesheet" type="text/css">
<link href="eportal/css/style.css" rel="stylesheet" type="text/css">
<link href="eportal/css/navigation.css" rel="stylesheet" type="text/css">
<link href="eportal/css/animate.min.css" rel="stylesheet" type="text/css">
<link href= "eportal/css/easy-responsive-tabs.css" rel="stylesheet" type="text/css">
<link type="text/css" rel="stylesheet" href="eportal/css/jquery.dropdown.min.css" />

<!--<link href="css/jquery-ui.css" rel="stylesheet" type="text/css">-->

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
  <script src="js/html5shiv.js"></script>
  <script src="js/respond.min.js"></script>
<![endif]-->
 <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="eportal/js/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="eportal/js/bootstrap.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->

<!--<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="js/jquery.jscrollpane.min.js"></script>
<script type="text/javascript" >
$.noConflict();
        $(function() {
            $('.scroll-pane').jScrollPane();
            $('fieldset').jScrollPane();
        });        

    </script>-->

<script type="text/javascript" src="eportal/js/jcarousellite_1.0.1.js"></script>
<script src="eportal/js/easyResponsiveTabs.js"></script>
<script type="text/javascript" src="eportal/js/jquery.dropdown.min.js"></script>

<script type="text/javascript" src="eportal/js/jquery2.js"></script>
<script type="text/javascript" src="eportal/js/jquery_002.js"></script>

<style type="text/css">
  .search {
  background-color: #ddd4d4;
  background-repeat: repeat-x;
  border: 1px solid #333333;
  font-size: 12px;
  font-weight: bold;
  padding-bottom: 3px;
  padding-top: 3px;
  text-align: center;
  width: 100px;
}
</style>
<!--<script>
    function init() {
        window.addEventListener('scroll', function(e){
            var distanceY = window.pageYOffset || document.documentElement.scrollTop,
                shrinkOn = 60,
                header = document.querySelector("header");
                epleft = document.querySelector("#ep-left");
            if (distanceY > shrinkOn) {
                classie.add(header,"smaller");
            } else {
                if (classie.has(header,"smaller")) {
                    classie.remove(header,"smaller");
                }
            }
        });
    }
    window.onload = init();
</script>-->


</head>
<?php 
if($_SERVER['HTTP_HOST']=='192.168.1.7' || $_SERVER['HTTP_HOST']=='192.168.15.4'){
  $hmis='http://'.$_SERVER['HTTP_HOST'].'/'.'svn/rajmedhmis/rajmedhmis/';
  $herp='http://'.$_SERVER['HTTP_HOST'].'/'.'svn/rajmedhmis/rajmedhmis/herp/';
  $eportal='http://'.$_SERVER['HTTP_HOST'].'/'.'svn/rajmedhmis/rajmedhmis/hr_payroles/bypass/eportal/';
}else if($_SERVER['HTTP_HOST']=='localhost'){
  $mm=explode("/",$_SERVER['REQUEST_URI']);
  if($mm[1]=='hmis')
  {
    $hmis='http://'.$_SERVER['HTTP_HOST'].'/'.'hmis/';
    $herp='http://'.$_SERVER['HTTP_HOST'].'/'.'hmis/herp/';
    $eportal='http://'.$_SERVER['HTTP_HOST'].'/'.'hmis/hr_payroles/bypass/eportal/';
  }else{
    $hmis='http://'.$_SERVER['HTTP_HOST'].'/'.'svn/rajmedhmis/rajmedhmis/';
    $herp='http://'.$_SERVER['HTTP_HOST'].'/'.'svn/rajmedhmis/rajmedhmis/herp/';
    $eportal='http://'.$_SERVER['HTTP_HOST'].'/'.'svn/rajmedhmis/rajmedhmis/hr_payroles/bypass/eportal/';
  }   
}else{
  $hmis='http://'.$_SERVER['HTTP_HOST'].'/'.'hmis/';
  $herp='http://'.$_SERVER['HTTP_HOST'].'/'.'hmis/herp/';
  $eportal='http://'.$_SERVER['HTTP_HOST'].'/'.'hmis/hr_payroles/bypass/eportal/';
}
 ?>
<script type="text/javascript">
function loadAdvance(){
  $.post("myadvance.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
}
function addloadAdvance(){
  $.post("addAdvance.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
}
function addloadloan(){
  $.post("loan_management.php",{'action':'addnew'},function(data){
    $('#dash').html(data);    
    });
}

  /*  Load TADA index form  */
  function loadMyTaDa(label){
    
    $.post("mytada.php",{'action':'addnew'},function(data){
      $("#dash_label").text(label);
      $('#dash').html(data);
    });
  }

  /* End TADA index Form */

 /* function tds(){
    alert();
  //$.post("<?php echo $hmis; ?>app/webroot/herp/eportal/tds",{'action':'addnew'},function(data){
    $.post("<?php echo $eportal; ?>tds",{'action':'addnew'},function(data){
      alert(data);
      $('#dash').html(data);
    });
}*/
  function tds(){
  $.ajax({
    url:"<?php echo $eportal; ?>tds&modid=15&frmid=434",
    type:"POST",
    data:{'action':'addnew'},
    success:function(result){
       alert(result);
      $('#dash').html(result);
    }
  });
    
}
 function tds_edit(tdsId){
  $.post("tds_edit.php",{'action':'addnew','tds_id':tdsId},function(data){
      $('#dash').html(data);
    });
}
  function show_inv_dec_index(){
  $.post("inv_dec_index.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
}


 function hpd_next(){
  $.post("house-property-declaration.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
}
 function hpd_next_edit(){
  $.post("house-property-declaration_edit.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
}
function hpd_edit(){
          var options = { 
          url:  'house-property-declaration_edit.php', 
          success:    function(result) { 
             alert('Record Update!');
            $('#dash').html(result);
          } 
      }; 
       
      // pass options to ajaxForm 
      jQuery('#preview_form_edit').ajaxForm(options);
}
function hpd(){
          var options = { 
          url:  'house-property-declaration.php', 
          success:    function(result) { 
             alert('Record Save!');
            $('#dash').html(result);
          } 
      }; 
       
      // pass options to ajaxForm 
      jQuery('#preview_form').ajaxForm(options);
}
function tds_delete(tds_id,emp_id){
      if(confirm("Do You want to Delete this?")){
        $.ajax({
                url:  'inv_dec_index.php',
                type:"POST",
                data:{"tds_id":tds_id,"emp_id":emp_id,"action":"delete_tds"},
                success:function(){
                  alert("You have Successfully Delete");
                  //$('#dash').html(result);
                  location.reload();
                }
        });
    }
}
function sum_rent(rentVal){
  var sum = 0;
  var totRentval=$( "input[id^='rent_']" ).length;
  for(var re=0; re<totRentval;re++){
    var valueRe=document.getElementById("rent_"+re).value;
        if (!isNaN(valueRe) && valueRe != 0) {
                 sum += parseFloat(valueRe);
             }
  }
      $("input[name='rent_total_amount']").val(sum.toFixed(2));
}
function sum_property(propertyVal){
  var sum = 0;
         var totRentval=$( "input[id^='property_']" ).length;
          for(var re=0; re<totRentval;re++){
            var valueRe=document.getElementById("property_"+re).value;
                if (!isNaN(valueRe) && valueRe != 0) {
                         sum += parseFloat(valueRe);
                     }
          }
         $("input[name='property_total_amount']").val(sum.toFixed(2));
}
function sum_medical(medicalVal){
  var sum = 0;
          var totRentval=$( "input[id^='medical_']" ).length;
          for(var re=0; re<totRentval;re++){
            var valueRe=document.getElementById("medical_"+re).value;
                if (!isNaN(valueRe) && valueRe != 0) {
                         sum += parseFloat(valueRe);
                     }
          }
         $("input[name='medical_total_amount']").val(sum.toFixed(2));
}
function sum_edu(eduVal){
  var sum = 0;
         var totRentval=$( "input[id^='edu_']" ).length;
          for(var re=0; re<totRentval;re++){
            var valueRe=document.getElementById("edu_"+re).value;
                if (!isNaN(valueRe) && valueRe != 0) {
                         sum += parseFloat(valueRe);
                     }
          }
         $("input[name='edu_total_amount']").val(sum.toFixed(2));
}
function sum_insurance(insuranceVal){
  var sum = 0;
            var totRentval=$( "input[id^='insurance_']" ).length;
          for(var re=0; re<totRentval;re++){
            var valueRe=document.getElementById("insurance_"+re).value;
                if (!isNaN(valueRe) && valueRe != 0) {
                         sum += parseFloat(valueRe);
                     }
          }
         $("input[name='insurance_total_amount']").val(sum.toFixed(2));
}
  function pre_cal_next(){
  $.post("premium-calculation.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
}
 function pre_cal_next_edit(){
  $.post("premium-calculation_edit.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
}
  function pre_cal(){

    var options = { 
          
          url:  'premium-calculation.php', 
          success:    function(result) { 
             alert('Record Save!');
            $('#dash').html(result);

             
          } 
      }; 
       
      // pass options to ajaxForm 
      jQuery('#housepr_form').ajaxForm(options);

}
function pre_cal_edit(){

    var options = { 
          
          url:  'premium-calculation_edit.php', 
          success:    function(result) { 
             alert('Record Update!');
            $('#dash').html(result);

             
          } 
      }; 
       
      // pass options to ajaxForm 
      jQuery('#housepr_form_edit').ajaxForm(options);

}

  function pre_cal_final(){  
    var options = { 
          
          url:  'premium-calculation.php', 
          success:    function(result) { 
             alert('Record Save!');
              $("input[name^='policy_no']").val("");
              $("input[name^='premium_amt']").val("");
              $("input[name^='payment_term']").val("");
              $("input[name^='due_date']").val("");
              $("input[name^='paid_on']").val("");
          } 
      }; 
       
      // pass options to ajaxForm 
      jQuery('#premium_form').ajaxForm(options);

}
  function pre_cal_final_edit(){  
    var options = { 
          
          url:  'premium-calculation_edit.php', 
          success:    function(result) { 
             alert('Record Update!');
          } 
      }; 
       
      // pass options to ajaxForm 
      jQuery('#premium_form_edit').ajaxForm(options);

}

  /* Create Add TADA Form */
  function addTaDa(){
    $.post("TA_DA_Claim_form.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
  }



/* End Create Add TADA Form */

/*   Approve  Expences  */
     function approveexpence(edit_id){ 
    $.post("ta_da_claim_approve.php",{'edittada':edit_id},function(data){
         $('#dash').html(data);
    });
    }
//ajax_expence.php

/*  End Expences */


  /* Delete TADA */
      function deleteTaDa(tadaid){
        
        $.post("ajax_file.php",{'deletetada':tadaid},function(data){
          
           if(data==1)
           {
            alert("Your details has been deleted ");
            window.location.reload();
           }
        });     
      }
  /* End Delete TADA*/

  /* Edit TADA Form Details  */
    
    function editTADA(edit_id){
       $.post("edit_TA_DA_Claim_form.php",{'edittada':edit_id},function(data){
        $('#dash').html(data);
    });
    }

  /* End Edit TADA Form Details  */

/****   News details***/
  
    function shownews(edit_id){
       $.post("ajax_details_news.php",{'edittada':edit_id},function(data){
        $('#dash').html(data);
    });
    }


/*  End of news   ***/

  function loadLeave(){
     $.noConflict();
    $.post("leave_index.php",{'action':'addnew'},function(data){

      $('#dash').html(data);
    });
  }    

  

function loadLeaveapprove(){
    $.post("LeaveApproval.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
  }    

   function loadLeaveapply(){
    $.post("leave_index.php",{'action':'addnew'},function(data){     
      $('#dash').html(data);
    });
  }    
  
  function loadLeaveapplyapproved(){    
    $.post("view_leave_request_new_approved.php",{'action':'addnew',"type":''},function(data){
      $('#dash').html(data);
    });
  }   
  function loadLeaveapplyunapproved(){
    $.post("view_leave_request_new_approved.php",{'action':'addnew',"type":''},function(data){
      $('#dash').html(data);
    });
  }   
  function loadLeaveapplypending(){
    $.post("view_leave_request_new_approved.php",{'action':'addnew',"type":'P'},function(data){
      $('#dash').html(data);
    });
  }   

  /* Display User Advance Adding Form */
  function addAdvance(){
    $.post("addAdvance.php",{'action':'addnew'},function(data){
      $('#dash').html(data);
    });
  }

  /* End Display User Advance Adding Form */

  /* Save User Advance Details */
  function saveAdvance(){
    var advance_date      = document.getElementById('advance_date').value;
    var advance_type      = document.getElementById('advance_type').value;
    var advance_amount    = document.getElementById('advance_amount').value;
    var deducation_month  = document.getElementById('deducation_month').value;
    var purpose           = document.getElementById('purpose').value;
    $.post("addAdvance.php",{'addadvance':'yes',"advance_date":advance_date,"advance_type":advance_type,"advance_amount":advance_amount,"deducation_month":deducation_month,"purpose":purpose},function(data){
     
        alert("Your advance details has been saved");
        loadAdvance();
      
    });
  }
/* End Save User Advance Details */
  
/*   Save loan Details*/

   function saveLoan(){
    
    var loan_date      = document.getElementById('loandate').value;
    
    var loan_type      = document.getElementById('loan_type').value;
    var loan_amount    = document.getElementById('loan_amount').value;
    var ded_mode          = document.getElementById('type').value;
    var installment_amount=document.getElementById('installment_amount').value;
    var percentage_val=document.getElementById("percentage_val").value;
    var no_ins            =document.getElementById('no_of_installment').value;
    var deducation_month  = document.getElementById('dedmonth').value;
   
      $.post("loan_management.php",{'addloan':'yes',"loan_date":loan_date,"loan_type":loan_type,"loan_amount":loan_amount,"deducation_month":deducation_month,"ded_mode":ded_mode,"installment_amount"
        :installment_amount,"percentage_val":percentage_val,"no_ins":no_ins},function(data){
        
          alert("Your advance details has been saved");
          loadAdvance();
        
      });
  }


/*   Update   loan detils  */

   function updateloan(advance_id){
    
     var loan_date      = document.getElementById('datepicker').value;
    var loan_type      = document.getElementById('loan_type').value;
    var loan_amount    = document.getElementById('loan_amount').value;
    var ded_mode          = document.getElementById('type').value;
    var installment_amount=document.getElementById('installment_amount').value;
    var percentage_val=document.getElementById("percentage_val").value;
    var no_ins            =document.getElementById('no_of_installment').value;
    var deducation_month  = document.getElementById('dedmonth').value;

    $.post("loan_management.php",{'updateadvance':'yes',"loan_date":loan_date,"loan_type":loan_type,"loan_amount":loan_amount,"deducation_month":deducation_month,"ded_mode":ded_mode,"installment_amount"
      :installment_amount,"percentage_val":percentage_val,"no_ins":no_ins,"advance_id":advance_id},function(data){

      if(data==0){
        alert("Your advance details has been updated");
        loadAdvance();
      }
    });

  }



  /*  Update Advance Details  */
  function updateAdvance(advance_id){
    
     var advance_date      = document.getElementById('advance_date').value;
    var advance_type      = document.getElementById('advance_type').value;
    var advance_amount    = document.getElementById('advance_amount').value;
    var deducation_month  = document.getElementById('deducation_month').value;
    var purpose           = document.getElementById('purpose').value;
    $.post("addAdvance.php",{'updateadvance':'yes',"advance_date":advance_date,"advance_type":advance_type,"advance_amount":advance_amount,"deducation_month":deducation_month,"purpose":purpose,"advance_id":advance_id},function(data){
      if(data==0){
        alert("Your advance details has been updated");
        loadAdvance();
      }
    });

  }

  /* End Update Advance Details  */

  

  /*  Display Update Advance Form */
  function editAdvance(advance_id,emp_id){
    if(advance_id!='' && emp_id!=''){
        

      $.post("addAdvance.php",{"advance_id":advance_id,"empid":emp_id,"editAdvance":"yes"},function(data){
         $('#dash').html(data);

      });
    }
  }


  /*  Display Update Loan Form  */

  function editloan(advance_id,emp_id){
    if(advance_id!='' && emp_id!=''){
        

      $.post("loan_management.php",{"advance_id":advance_id,"empid":emp_id,"editAdvance":"yes"},function(data){
         $('#dash').html(data);

      });
    }
  }

  /* End Display Update Advance Form */
  

  /* Display User Loan index Form */
  function loadLoan(){
      $.post("loanindex.php",{},function(data){
        $('#dash').html(data);
      });
  }
  /* End Display User Loan index Form */


  /* Display Apply Loan Form */

    function applyLoan(){
      $.post("applyLoan.php",{},function(data){
        $('#dash').html(data);
      });
    }


  /* End Apply Form Display*/



  /*  Add Loan Information */
  function addLoan(userid){

      var loan_date             = document.getElementById('loan_date').value;
      var loan_type             = document.getElementById('loan_type').value;
      var loan_amount           = document.getElementById('loan_amount').value;
      var deduction_mode        = document.getElementById('deduction_mode').value;
      var installment_amount    = document.getElementById('installment_amount').value;
      var no_of_installment     = document.getElementById('no_of_installment').value;
      var loan_deduction_month  = document.getElementById('loan_deduction_month').value;
      var percentage_val        = document.getElementById('percentage_val').value;

      
      $.post("applyLoan.php",{ "saveloandetails":"yes","loan_date":loan_date,"loan_type":loan_type,"loan_amount":loan_amount,"deduction_mode":deduction_mode,"installment_amount":installment_amount,"no_of_installment":no_of_installment,"loan_deduction_month":loan_deduction_month,"percentage_val":percentage_val,"emp_code":userid},function(data){
        if(data==0)
        {
          alert("Loan details has been submited successfully");
          loadLoan();
        }
      });



  }
  /* End  Add Loan Information */

  /* Open the Edit Loan Page  */
  
  function editLoan(id){
     $.post("applyLoan.php",{"editloaddetails":"yes","id":id},function(data){
        $('#dash').html(data);
      });
  }

  /* End the Edit Loan Page  */
  
  function popup1(url){
    window.open(url, "Details", "height=600,width=600");
  }
  function popup2(url){
    window.open(url, "Approval", "height=600,width=600");
  }

  
  function printPaySlip(url){
    //window.open(url, "Pay Slip", "height=600,width=600");
    window.open(url, "Pay Slip", "height=600,width=600");
  }
  
  /* Load Bday */
     function bday(type){
        window.open("bday.php?type="+type, "Birthday Details", "height=600,width=600");
    }
  /* End Load Bday*/
 

  /* Update the loan details  */
    
    function updateLoan(loan_id){
      if(loan_id){
            
            var loan_date             = document.getElementById('loan_date').value;
            var loan_type             = document.getElementById('loan_type').value;
            var loan_amount           = document.getElementById('loan_amount').value;
            var deduction_mode        = document.getElementById('deduction_mode').value;
            var installment_amount    = document.getElementById('installment_amount').value;
            var no_of_installment     = document.getElementById('no_of_installment').value;
            var loan_deduction_month  = document.getElementById('loan_deduction_month').value;
            var percentage_val        = document.getElementById('percentage_val').value;

            
            $.post("applyLoan.php",{ "updateloandetails":"yes","loan_date":loan_date,"loan_type":loan_type,"loan_amount":loan_amount,"deduction_mode":deduction_mode,"installment_amount":installment_amount,"no_of_installment":no_of_installment,"loan_deduction_month":loan_deduction_month,"percentage_val":percentage_val,"loan_id":loan_id},function(data){
              if(data==0)
              {
                alert("Loan details has been updated successfully");
                loadLoan();
              }
            });


      }
    }

  /* end Update */


  /*  Load Pay slip index */

  function loadPaySlip(userid){
    if(userid){
       $.post("master_payslip.php",{"userid":userid},function(data){
          $('#dash').html(data);
        });
     }
  }

/* End Load Pay slip index */

  function loadAttandance(){
    $.post("monthly_attendance.php",{},function(data){
          $('#dash').html(data);
        });
  }
  /* Load Attandance */


  /*  Load Monthy Leave  */

    function loadMonthlyLeave(){

        $.post("monthly_leave.php",{},function(data){
          $('#dash').html(data);
        });
    }

  /* End Monthly Leave */

  


  /* Load Monthly Sallary */

     function loadSallary(){

        $.post("monthly_sallary.php",{},function(data){
          $('#dash').html(data);
        });
    }


  /* ENd Load Monthly Sallary */


  /*  Load To Do Form */

  function displayToDo(){

       $.post("TODO.php",{},function(data){
          $('#dash').html(data);
        });
  }

function addMeetingsIndex()
{
   $.post("addmetting.php",{"eventreports":"yes"},function(data){
          $('#dash').html(data);
        });
}

function addCalander()
{
  $.post("ajax_calander.php",{"eventreports":"yes"},function(data){
          $('#dash').html(data);
        });
}
  /* End Load To Do Form */


  /* Submit To DO Form  */
  function submitToDo(){
    var selectedValues = [];    
    $("#leaduserid :selected").each(function(){
        selectedValues.push($(this).val()); 
    });

    var leadtodo        = document.getElementById('leadtodo').value;
    var todostatus      = document.getElementById('todostatus').value;
    var lead_priority   = document.getElementById('lead_priority').value;
    var tododue_date    = document.getElementById('tododue_date').value;
    var groupid         = document.getElementById('groupid').value;
    var timepicker1     = document.getElementById('timepicker1').value;
    var tododatetime    = document.getElementById('tododatetime').value;
    var description     = document.getElementById('description').value;

    $.post("TODO.php",{"submittodo":"yes","users":selectedValues.toString(),"leadtodo":leadtodo,"todostatus":todostatus,"lead_priority":lead_priority,"tododue_date":tododue_date,"groupid":groupid,"timepicker1":timepicker1,"tododatetime":tododatetime,"description":description},function(data){
       
        alert("To Do details has been submited successfully!");
        displayToDo();
       
    });




    //$.post("TODO.php",{})
    


  }
  /* Submit To DO Form  */


  /* Add Event */
  function addMeetings(){
     $.post("addEvent.php",{},function(data){
          $('#dash').html(data);
        });
  }

  /* End Meeting Form */

  /* Submit Event Form Data */

      function submitEvent(){
          var selectedValues = [];    
          $("#leaduserid :selected").each(function(){
              selectedValues.push($(this).val()); 
          });

          var event_type          = document.getElementById('event_type').value;
          var event_name          = document.getElementById('event_name').value;
          var event_location      = document.getElementById('event_location').value;
          var periority           = document.getElementById('periority').value;
          var event_status        = document.getElementById('event_status').value;
          var event_desc          = document.getElementById('event_desc').value;
          var groupid             = document.getElementById('groupid').value;
          //var send_notification     = 'yes';
          

          //var notification_matter = document.getElementById('notification_matter').value;
          var eventstart_time     = document.getElementById('evenstart_time').value;
          var eventstart_startdate = document.getElementById('calendar1').value;
          
          var eventend_time       = document.getElementById('eventendtime').value;
          var eventend_date       = document.getElementById('calendar2').value;

          $.post("addEvent.php",{"createEvent":"yes","userid":selectedValues.toString(),"event_type":event_type,"event_name":event_name,"event_location":event_location,"periority":periority,"event_status":event_status,"event_desc":event_desc,"groupid":groupid,"evenstart_time":eventstart_time,"eventstart_startdate":eventstart_startdate,"eventend_time":eventend_time,"eventend_date":eventend_date},function(data){
          
              alert("Meeting details has been submited successfully!");

              addMeetings();
          
          });
          

      }
  /* End Submut Event Form Data*/


  /*  Display Add Followups form*/
  function addFollowups(){
     $.post("addfollowups.php",{},function(data){
          $('#dash').html(data);
        });
        
  }

  /*  End Display Add Followups form*/

  /* Submit Followups form details */
  function submitFollowups(){
    var client          = document.getElementById('client').value;
    var followDate      = document.getElementById('followDate').value;
    var FollowType      = document.getElementById('FollowType').value;
    var nextfollowDate  = document.getElementById('nextfollowDate').value;
    var comments        = document.getElementById('comments').value;

     $.post("addfollowups.php",{"submit_data":"yes","client":client,"followDate":followDate,"FollowType":FollowType,"nextfollowDate":nextfollowDate,"comments":comments},function(data){    

    
          alert("Follow up details has been added successfully !");
          addFollowups();
      

     }) ;

  }
  /* End Form details*/


  /* Display Task form */
  
  function addTask(){
      $.post("task_assign.php",{},function(data){
          $('#dash').html(data);
        });
  }

 function addTaskstatus(){
      $.post("task_index.php",{},function(data){
          $('#dash').html(data);
        });
  }

  /* End Display Task form */


  /* Submit task details */
  function submitTask(){

      var start_date        = document.getElementById('start_date').value;
      var start_time        = document.getElementById('start_time').value;
      var end_date          = document.getElementById('end_date').value;
      var end_time          = document.getElementById('end_time').value;
      var user_id           = document.getElementById('user_id').value;
      var task_description  = document.getElementById('task_description').value;
      var assign_to         = document.getElementById('assign_to').value;
      if(user_id=='' )
      {
        alert("Select users First");
      }
      else if(task_description=='')
      {
        alert("Task description Required !")
      }
      else
      {
      $.post("task_assign.php",{"submit_task":"yes","start_date":start_date,"start_time":start_time,"end_date":end_date,"end_time":end_time,"user_id":user_id,"task_description":task_description,"assign_to":assign_to},function(data){
       
       
          alert("Task has been submited successfully");
          window.location.reload();
     
      });
    }

  }
  /* End Submit task details */


</script>

