<?php 

	session_start();
	include("../all_query.php");
	include '../db.php';

 

  if(!isset($_SESSION['call_evaluation_email']))
  {
	  
	  header('Location: evaluator_login.php');
	  
  }
  
  
  
  
  
  
   $email=$_SESSION['call_evaluation_email'];
   
   $evaluatorQ =mysqli_query($conn,"select * from evaluator where email='$email'  ");
   
   $evaluatorData = mysqli_fetch_assoc($evaluatorQ);
   
   
  $channel_partner_ids = $evaluatorData['channel_partner_ids'];
							
  
  
  function getPercentage($total,$used)
	{
		
			$count1 = $used / $total;
		   $count2 = $count1 * 100;
		   $count = number_format($count2, 0);
		   
		   return $count;  
		
	}
  


?>
<!-- beautify ignore:start -->
<html lang="en" class="light-style  customizer-hide" dir="ltr" data-theme="theme-bordered" data-assets-path="../assets/" data-template="vertical-menu-template-bordered">

   
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />

    <title>Call Evaluation</title>
    
    <meta name="description" content="Start your development with a Dashboard for Bootstrap 5" />
    <meta name="keywords" content="dashboard, bootstrap 5 dashboard, bootstrap 5 design, bootstrap 5">
    <!-- Canonical SEO -->
    <link rel="canonical" href="https://1.envato.market/frest_admin">
    
    <!-- Favicon -->
    <link rel="icon" type="image/x-icon" href="https://pixinvent.com/demo/frest-clean-bootstrap-admin-dashboard-template/assets/img/favicon/favicon.ico" />

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com/">
    <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&amp;family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&amp;display=swap" rel="stylesheet">

    <!-- Icons -->
    <link rel="stylesheet" href="../assets/vendor/fonts/boxicons.css" />
    <link rel="stylesheet" href="../assets/vendor/fonts/fontawesome.css" />
    <link rel="stylesheet" href="../assets/vendor/fonts/flag-icons.css" />

    <!-- Core CSS -->
    <link rel="stylesheet" href="../assets/vendor/css/rtl/core.css" class="template-customizer-core-css" />
    <link rel="stylesheet" href="../assets/vendor/css/rtl/theme-bordered.css" class="template-customizer-theme-css" />
    <link rel="stylesheet" href="../assets/css/demo.css" />

    <!-- Vendors CSS -->
    <link rel="stylesheet" href="../assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css" />
    <link rel="stylesheet" href="../assets/vendor/libs/typeahead-js/typeahead.css" />
    <!-- Vendor -->
<link rel="stylesheet" href="../assets/vendor/libs/bs-stepper/bs-stepper.css" />
<link rel="stylesheet" href="../assets/vendor/libs/bootstrap-select/bootstrap-select.css" />
<link rel="stylesheet" href="../assets/vendor/libs/select2/select2.css" />
<link rel="stylesheet" href="../assets/vendor/libs/formvalidation/dist/css/formValidation.min.css" />


  <link rel="stylesheet" href="../assets/vendor/libs/apex-charts/apex-charts.css" />


    <!-- Page CSS -->
	
	   
  <link rel="stylesheet" href="../assets/vendor/libs/select2/select2.css" />


	
	 <link rel="stylesheet" href="../assets/vendor/libs/toastr/toastr.css" />
	 <link rel="stylesheet" href="../assets/vendor/libs/animate-css/animate.css" />
<link rel="stylesheet" href="../assets/vendor/libs/sweetalert2/sweetalert2.css" />




 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
   
	 
	  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.2.2/jquery.form.min.js" integrity="sha384-FzT3vTVGXqf7wRfy8k4BiyzvbNfeYjK+frTVqZeNDFl8woCbF0CYG6g2fMEFFo/i" crossorigin="anonymous"></script>
   <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-JAW99MJVpJBGcbzEuXk4Az05s/XyDdBomFqNlM3ic+I=" crossorigin="anonymous"></script>
	
	
	
	
	
	 <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
	 
	 
	
    
<!-- Page -->
<link rel="stylesheet" href="../assets/vendor/css/pages/page-auth.css">
    <!-- Helpers -->
    <script src="../assets/vendor/js/helpers.js"></script>

    <!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
    <!--? Template customizer: To hide customizer set displayCustomizer value false in config.js.  -->
    <script src="../assets/vendor/js/template-customizer.js"></script>
    <!--? Config:  Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file.  -->
    <script src="../assets/js/config.js"></script>
    
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async="async" src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
    <script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
      dataLayer.push(arguments);
    }
    gtag('js', new Date());
    gtag('config', 'GA_MEASUREMENT_ID');
    </script>
    <!-- Custom notification for demo -->
    <!-- beautify ignore:end -->

</head>

<body>

  <!-- Content -->



 <script>
 
 
 
  function submitEvaluation(obj)
  {   
	  obj.disabled = true;
	  
	  
	   $.ajax({
            type: 'post',
            url: 'save_call_evaluation_ajax.php',
            data: $('form').serialize(),
            success: function (data) {
				
             // alert(data);
			  
			  
				 Swal.fire({
				icon: 'info',
				html: data,
				type:'success',
				showCloseButton: true,
				showCancelButton: false,
				focusConfirm: false,
				confirmButtonText: '<i class="fa fa-thumbs-up"></i> Ok!',
				confirmButtonAriaLabel: 'Thumbs up, OK!',
				cancelButtonText: '<i class="fa fa-thumbs-down"></i>',
				cancelButtonAriaLabel: 'Thumbs down',
				customClass: {
				  confirmButton: 'btn btn-primary me-3',
				  cancelButton: 'btn btn-label-secondary'
				},
				buttonsStyling: false
			  }).then(function() {
				window.location = "";
			});
 
 
 
 
			   obj.disabled = false;
			  
            }
          });

       
		
	  
  }
 
 
 
 
 
 
 
    
    </script>


<script>

 function getTelecallerEmployeeId(name)
 {
	 
	  
	   $.ajax({
            type: 'post',
            url: 'get_evaluator_data_ajax.php',
            data: ({name:name}),
            success: function (data) {
				
				 var info = JSON.parse(data);
				
				document.getElementById('telecaller_employee_id').value = info.EmpId;
				
			}
			
	   });
			
			
			
	 
 }

</script>





 <script>
   
   	 $(function () {
  const select2 = $('.select2');

  // Select2 Country
  if (select2.length) {
    select2.each(function () {
      var $this = $(this);
      $this.wrap('<div class="position-relative"></div>').select2({
        dropdownParent: $this.parent()
      });
    });
  }
});


</script>






  <script>
  
  function changeFatal(type)
  {
	  
	  if(type == 'show')
	  {
		  document.getElementById('question_section').style.display = 'block';
	  }
	  
	  else
	  {
		    document.getElementById('question_section').style.display = 'none';
	  }
  }
  
  </script>



<div class="authentication-wrapper authentication-cover">
  <div class="authentication-inner row m-0">

    <!-- Left Text -->
	
	 

	 
	
	
	
	
	
    <div class="d-none d-lg-flex col-md-5 pe-0"  style="padding:20px;">
	
	
	 <div class="card" style="width: 100%;">
      <div class="card-body text-center">
	  
	  
	  
	  
	  
	  
	  <?php
	
	$month_year = date('Y-m');
	
	if(isset($_REQUEST['month_year']))
	{
		$month_year = $_REQUEST['month_year'];
	}
	
	$month = date('M',strtotime($month_year));


	?>
	<form action="">
	 <input onchange="this.form.submit();" class="form-control" type="month" name="month_year" id="month_year" value="<?php echo $month_year; ?>" />
	</form>
	
	
	
	  
	  
	  
	  
	  
	  
		
	
	<?php 
	
	$email = $evaluatorData['email'];
	$target = $evaluatorData['target'];
	
	$tevQ = mysqli_query($conn,"select *from `call_evaluation` where email = '$email' and month='$month' ");
    $total_ev_done = mysqli_num_rows($tevQ);
	
	$total_ev_done_per = getPercentage($target,$total_ev_done);



	?>
	
	
	<script>
	$( document ).ready(function() {
		
	 var  cardColor = 'white';
	 var   headingColor = 'red';
    var  axisColor = 'pink';
    var borderColor = 'white';
    var shadeColor = 'dark';
	
	
	  const growthRadialChartEl = document.querySelector('#growthRadialChart'),
    growthRadialChartConfig = {
      chart: {
        height: 300,
        width: 500,
        fontFamily: 'IBM Plex Sans',
        type: 'radialBar',
        sparkline: {
          show: true
        }
      },
      grid: {
        show: false,
        padding: {
          top: -25
        }
      },
      plotOptions: {
        radialBar: {
          size: 100,
          startAngle: -135,
          endAngle: 135,
          offsetY: 10,
          hollow: {
            size: '55%'
          },
          track: {
            strokeWidth: '4%',
            background: cardColor
          },
          dataLabels: {
            value: {
              offsetY: -15,
              color: headingColor,
              fontFamily: 'Rubik',
              fontWeight: 500,
              fontSize: '26px'
            },
            name: {
              fontSize: '15px',
              color: config.colors.secondary,
              offsetY: 24
            }
          }
        }
      },
      colors: [config.colors.danger],
      fill: {
        type: 'gradient',
        gradient: {
          shade: 'dark',
          type: 'horizontal',
          shadeIntensity: 0.5,
          gradientToColors: [config.colors.primary],
          inverseColors: true,
          opacityFrom: 1,
          opacityTo: 1,
          stops: [0, 100]
        }
      },
      stroke: {
        dashArray: 3
      },
      series: [<?php echo $total_ev_done_per; ?>],
      labels: ['Completed']
    };
	
	 

  if (typeof growthRadialChartEl !== undefined && growthRadialChartEl !== null) {
    const growthRadialChart = new ApexCharts(growthRadialChartEl, growthRadialChartConfig);
    growthRadialChart.render();
  }
  
  
  });
  
	
	</script>
	  
	  
        
       <center> <div id="growthRadialChart"></div></center>
        <h6 class="mb-0 mt-5"><?php echo $total_ev_done_per; ?>% Evaluation Completed in <?php echo $month; ?></h6>
		
		
		<br/>
		
		<table class="table table-borderd table-stripped text-nowrap " style="zoom:80%;">
		
		<thead class="table-dark">
		<tr>
		<th>Sr.no</th>
		<th>Caller Name</th>
		<th>Quality Score</th>
		<th>Category</th>
		</tr>
		
		</thead>
		
		
		<tbody>
		<?php
		
		$callerInfoArray = array();
		

		$allcallerQ = mysqli_query($conn,"select *from  `evaluator`  where evaluator_type_id in (select id from evaluator_type where name='Agency Telecaller') and  channel_partner_ids in ($channel_partner_ids)  ");
		
	
		while($callerData = mysqli_fetch_assoc($allcallerQ))
		{
		
			
			$name_of_the_telecaller = $callerData['name'];
			
			$average_score = 0;
			
			
			
			$totalScoreQ = mysqli_query($conn,"select sum(CAST(score as UNSIGNED)) as `total_score` , count(*) as `total_ev` from `call_evaluation` where name_of_the_telecaller = '$name_of_the_telecaller'  and month='$month' ");
			
			$totalScoreData = mysqli_fetch_assoc($totalScoreQ);
			$total_score = $totalScoreData['total_score'];
			$total_ev = $totalScoreData['total_ev'];
			
			if($total_ev > 0)
			{
			$average_score = round($total_score/$total_ev);
			}
			
			$scoreBandQ = mysqli_query($conn,"select *from `score_band` where CAST(score_from as UNSIGNED) <= $average_score and CAST(score_to as UNSIGNED) >= $average_score   ");
			$scoreBandData = mysqli_fetch_assoc($scoreBandQ);
			$band = $scoreBandData['name'];
			
			
			
			$rowArray  = array();
			$rowArray['name'] = $callerData['name'];
			$rowArray['average_score'] = $average_score;
			$rowArray['band'] = $band;
			$callerInfoArray[] = $rowArray;
			
		}
		
		
			 usort($callerInfoArray, function($a, $b) {
    return $a['average_score'] <=> $b['average_score'];});
	
	krsort($callerInfoArray);

			
				$i=0;
			foreach($callerInfoArray as $info_row)
			{
					$i++;
		  ?>
		  
		<tr>
		<td><?php echo $i; ?></td>
		<td><?php echo $info_row['name']; ?></td>
		<td><?php echo $info_row['average_score']; ?></td>
		<td><?php echo $info_row['band']; ?></td>
		</tr>
		
		<?php } ?>
		
		</tbody>
		
		</table>
		
		
		
		
		<Br/>
		
	

   
    
	<?php
	
	   // parameter wise defect
	   
	   $defectArray = array();
	   
	   for($q_no = 2;$q_no<=12;$q_no++)
	   {
	   
	    $parameterDefectQ = mysqli_query($conn,"select *from `call_evaluation` where email = '$email' and  `question_$q_no` = 'No' and month='$month'  ");
		
		$defectArray[] = mysqli_num_rows($parameterDefectQ); 
	   
	   
	   
	   
	   }
	   
	   
	   
	   
	   
	
	?>


   <script>
   
   $( document ).ready(function() {
	   
	   var dataSet1 = [
    [ 'Call Opening', <?php echo $defectArray[0]; ?> ],
    [ 'RFD and Probing', <?php echo $defectArray[1]; ?> ],
    [ 'Call Recording', <?php echo $defectArray[2]; ?> ],
    [ 'Negotion Hierarchy', <?php echo $defectArray[3]; ?> ],
    [ 'Obejection Handling', <?php echo $defectArray[4]; ?> ],
    [ 'Appropriate Offering', <?php echo $defectArray[5]; ?> ],
    [ 'Cibil Impact', <?php echo $defectArray[6]; ?> ],
    [ 'Appropriate Articulation', <?php echo $defectArray[7]; ?> ],
    [ 'Active Listening', <?php echo $defectArray[8]; ?> ],
    [ 'Tone/Energy/Enthu', <?php echo $defectArray[9]; ?> ],
    [ 'Closing Script', <?php echo $defectArray[10]; ?> ]
    ];

var dataTitle = [ 'Parameterwise Defect', 'Defect', 'Cumm%' ];



   
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
	
	
	
	function paretorize() {
  // Sort the dataSet array usung column 2
  dataSet1.sort( function(a,b) {
    return b[1] - a[1];
  });

  // Calculate the total of column 2
  var sum = 0;
  for(row=0; row<dataSet1.length; row++) {
    sum += dataSet1[row][1];
  }

  // Calculate the accumulating percentages
  // and add them into a new column in each row
  var accum = 0;
  for(row=0; row<dataSet1.length; row++) {
    dataSet1[row].push( Math.round( accum+100*dataSet1[row][1]/sum ) );
    accum = dataSet1[row][2];
  }

  // Add the title row at the beginning of dataSet
  // ('unshift' is not supported in IE8 and earlier)
  dataSet1.unshift( dataTitle );
}

paretorize();


	
function drawChart() {
  var data = google.visualization.arrayToDataTable( dataSet1 );

  var options = {
    title:  'Parameterwise Defect in <?php echo $month; ?>',
    legend: { position: 'none' },         // no legend
    // Create two vertical axes taking its titles from the first row
    vAxes:[
       { title: dataSet1[0][1], minValue: 0 }, 
       { title: dataSet1[0][2], minValue: 0, maxValue: 100 }
     ],
    hAxis:  { title: dataSet1[0][0] },
    backgroundColor: {strokeWidth: 2 },   // to get a nice box
    seriesType: "bars",                   // the standard chart type
    // the second data column should be of type 'line' and should be associated with the second vertical axis
    series: {1: {type: "line", targetAxisIndex: 1 }},  
    };

  // Note: this calls a ComboChart !!!
  var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
  chart.draw(data, options);
}
		
		
	
	  });
   
   </script>





		<center><div id="chart_div" style="width:100%; height: 300px;"></div></center>

	 
	 
	 <br/>
	 
	 
	 
	 
	 
	 
	 	<?php
	
	   // parameter wise defect
	   
	   $typeEvArray = array('Agency Quality Analyst','Agency Supervisor','Agency Manager');
	   $typeEvScore = array();
	    
		foreach($typeEvArray as $ev_type)
		{
	        $totalScoreQ = mysqli_query($conn,"select sum(CAST(score as UNSIGNED)) as `total_score` , count(*) as `total_ev` from `call_evaluation` where type_of_evaluator = '$ev_type' and  channel_partner_name in (select name from channel_partner where id in ($channel_partner_ids)  )     and month='$month'    ");
			
			$totalScoreData = mysqli_fetch_assoc($totalScoreQ);
			$total_score = $totalScoreData['total_score'];
			$total_ev = $totalScoreData['total_ev'];
			
			
			$average_score = 0;
			if($total_ev > 0)
			{
			$average_score = round($total_score/$total_ev);
			}
			
			$typeEvScore[] = $average_score;
			
			
		}
		
		$typeEvScore[] = $typeEvScore[0] + $typeEvScore[1] + $typeEvScore[2];
	   
	   
	   
	   
	   
	
	?>


   <script>
   
   $( document ).ready(function() {
	   
	   var dataSet2 = [
    [ 'Quality Analyst', <?php echo $typeEvScore[0]; ?> ],
    [ 'Supervisor', <?php echo $typeEvScore[1]; ?> ],
    [ 'Zest Manager', <?php echo $typeEvScore[2]; ?> ],
    [ 'Agency', <?php echo $typeEvScore[3]; ?> ] 
    ];

var dataTitle2 = [ 'Overall Quality Score', 'Score', 'Score%' ];



   
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart2);
	
	
	
	function paretorize2() {
  // Sort the dataSet array usung column 2
  dataSet2.sort( function(a,b) {
    return b[1] - a[1];
  });

  // Calculate the total of column 2
  var sum = 0;
  for(row=0; row<dataSet2.length; row++) {
    sum += dataSet2[row][1];
  }

  // Calculate the accumulating percentages
  // and add them into a new column in each row
  var accum = 0;
  for(row=0; row<dataSet2.length; row++) {
    dataSet2[row].push(  Math.round( accum+100*dataSet2[row][1]/sum ) );
    accum = dataSet2[row][2];
  }

  // Add the title row at the beginning of dataSet
  // ('unshift' is not supported in IE8 and earlier)
  dataSet2.unshift( dataTitle2 );
}

paretorize2();


	
function drawChart2() {
  var data = google.visualization.arrayToDataTable( dataSet2 );

  var options = {
    title:  'Overall Quality Score <?php echo $month; ?> ',
    legend: { position: 'none' },         // no legend
    // Create two vertical axes taking its titles from the first row
    vAxes:[
       { title: dataSet2[0][1], minValue: 0 }, 
       { title: dataSet2[0][2], minValue: 0, maxValue: 100 }
     ],
    hAxis:  { title: dataSet2[0][0] },
    backgroundColor: {strokeWidth: 2 },   // to get a nice box
    seriesType: "bars",                   // the standard chart type
    // the second data column should be of type 'line' and should be associated with the second vertical axis
    series: {1: {type: "line", targetAxisIndex: 1 }},  
    };

  // Note: this calls a ComboChart !!!
  var chart = new google.visualization.ComboChart(document.getElementById('chart_div_2'));
  chart.draw(data, options);
}
		
		
	
	  });
   
   </script>





		<center><div id="chart_div_2" style="width:100%; height: 300px;"></div></center>

	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
		
		
		
		
		
      </div>
	  
	  
	  
	  
	  
	  
	  
	  
	  
	  
    </div>
      
    </div>
    <!-- /Left Text -->
	
	
	
	
	
	

    <!--  Multi Steps Registration -->
    <div class="d-flex col-md-7"  style="padding:20px;">
      <div class="d-flex flex-column ">
      <h4>Call Evaluation</h4>
                   
        <div class=" ">
          <div id="multiStepsValidation" class="bs-stepper shadow-none">
		  
           <div class="bs-stepper-header">
		   
              <div class="step active" data-target="#accountDetailsValidation">
                <button type="button" class="step-trigger">
                  <span class="bs-stepper-circle">
                    <i class="bx bx-home"></i>
                  </span>
                  <span class="bs-stepper-label">
                    <span class="bs-stepper-title">Call Audit</span>
                    <span class="bs-stepper-subtitle">Details of Call audit</span>
                  </span>
                </button>
              </div>
			  
              <div class="line"></div>
              <div class="step" data-target="#personalInfoValidation">
                <button type="button" class="step-trigger">
                  <span class="bs-stepper-circle">
                    <i class="bx bx-user"></i>
                  </span>
                  <span class="bs-stepper-label">
                    <span class="bs-stepper-title">Call Summary</span>
                    <span class="bs-stepper-subtitle">Call Summary</span>
                  </span>
                </button>
              </div>
              <div class="line"></div>
              <div class="step" data-target="#billingLinksValidation">
                <button type="button" class="step-trigger">
                  <span class="bs-stepper-circle">
                    <i class="bx bx-detail"></i>
                  </span>
                  <span class="bs-stepper-label">
                    <span class="bs-stepper-title">Questions</span>
                    <span class="bs-stepper-subtitle">10 quick questions</span>
                  </span>
                </button>
              </div>
            </div>
			
			
            <div class="bs-stepper-content pt-4">
			
			
              <form id="multiStepsForm" action="" onSubmit="return false">
			  
                <!-- Account Details -->
                <div id="accountDetailsValidation" class="content active">
				
				 
                  <div class="row g-3">
				  
				  
				  <?php $evaluator_type_id= $evaluatorData['evaluator_type_id']; 
				  
				  $evaluator_typeQ = mysqli_query($conn,"select *from `evaluator_type` where id = $evaluator_type_id ");
				  $evaluatorTypeData = mysqli_fetch_assoc($evaluator_typeQ);
				  
				  $evaluator_type = $evaluatorTypeData['name'];


				  ?>
				  
				   <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Email</label>
                      <input type="email" name="email" id="email" class="form-control" value="<?php echo $evaluatorData['email']; ?>" readonly  />
                    </div>
					
					
                    <div class="col-sm-6">
                      <label class="form-label" for="type_of_evaluator">Type of Evaluator</label>
                      <input type="text" name="type_of_evaluator" id="type_of_evaluator" class="form-control" placeholder="Type Of Evaluator" value="<?php echo $evaluatorTypeData['name']; ?>" readonly />
                    </div>
					
					
                      <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Channel Partner Name</label>
                      <input type="text" name="channel_partner_name" id="channel_partner_name" class="form-control" value="<?php echo $evaluatorData['agency_name']; ?>" readonly  />
                    </div>
					
					
					
					  <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Zest Reporting Manager/Client *</label>
                      <input type="text" name="channel_partner_name" id="channel_partner_name" class="form-control" value="<?php echo $evaluatorData['reporting_manager']; ?>" readonly  />
                    </div>
					
					
					
					
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Name of the Evaluator *</label>
                      <input type="text" name="name_of_the_evaluator" id="name_of_the_evaluator" class="form-control" value="<?php echo $evaluatorData['name']; ?>" readonly  />
                    </div>
					
					
					<?php if($evaluator_type == 'Agency Telecaller') {  ?>
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Name of the Telecaller*</label>
                      <input type="text" name="name_of_the_telecaller" id="name_of_the_telecaller" class="form-control" placeholder="Enter Name of Telecaller"  value="<?php echo $evaluatorData['name']; ?>" readonly required  />
                    </div>
					
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Tele-caller employee id *</label>
                      <input type="text" name="telecaller_employee_id" id="telecaller_employee_id" class="form-control" placeholder="Enter tele-caller employee id"  value="<?php echo $evaluatorData['EmpId']; ?>"  readonly required  />
                    </div>
					
					<?php } 
					
					else {

					?>
						 <div class="col-sm-6">
						  <label class="form-label" for="multiStepsEmail">Name of the Telecaller*</label>
						  <select onchange="getTelecallerEmployeeId(this.value);" id="name_of_the_telecaller" name="name_of_the_telecaller" class="form-control select2" >
						  <option value=" ">None</option>
						  
						    <?php 
							
							  $channel_partner_ids = $evaluatorData['channel_partner_ids'];
							
							$telecallerQ = mysqli_query($conn,"select *from  `evaluator`  where evaluator_type_id in (select id from evaluator_type where name='Agency Telecaller') and  channel_partner_ids in ($channel_partner_ids)  ");
					  
							while($telecallerData = mysqli_fetch_assoc($telecallerQ))
							  {

							  ?>
							  
							  <option value="<?php echo $telecallerData['name']; ?>"><?php echo $telecallerData['name']; ?></option>
							  
							<?php } ?>
					 
					 </select>
                    </div>
					
					
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Tele-caller employee id *</label>
                      <input type="text" name="telecaller_employee_id" id="telecaller_employee_id" class="form-control" placeholder="Enter tele-caller employee id"     readonly required  />
                    </div>
					
					
					<?php } ?>
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Evaluation Date*</label>
                      <input type="date" name="evaluation_date" value="<?php echo date('Y-m-d'); ?>" id="evaluation_date" class="form-control"  required  />
                     </div>
					 
					 <div class="col-sm-6">
					  <small class="text-light fw-semibold">Portfolio: *</small>
					  
					  <?php $portfolioQ = mysqli_query($conn,"select *from  `portfolio` ");
					  
					  while($portfolioData = mysqli_fetch_assoc($portfolioQ))
					  {

					  ?>
					  <div class="form-check mt-3">
					 <input name="portfolio" class="form-check-input" type="radio" value="<?php echo $portfolioData['name']; ?>" id="portfolio_<?php echo $portfolioData['id']; ?>" checked >
						<label class="form-check-label" for="portfolio_<?php echo $portfolioData['id']; ?>">
						 <?php echo $portfolioData['name']; ?>
					   </label>
					  </div>
					 
					  <?php } ?>
					  
					  
					</div>
					
					
					
					
					 <div class="col-sm-4">
					  <small class="text-light fw-semibold">Product: *</small>
					  
					  <?php $productQ = mysqli_query($conn,"select *from  `product` ");
					  
					  while($productData = mysqli_fetch_assoc($productQ))
					  {

					  ?>
					  <div class="form-check mt-3">
					 <input name="product" class="form-check-input" type="radio" value="<?php echo $productData['name']; ?>" id="product_<?php echo $productData['id']; ?>" checked >
						<label class="form-check-label" for="product_<?php echo $productData['id']; ?>">
						 <?php echo $productData['name']; ?>
					   </label>
					  </div>
					 
					  <?php } ?>
					   </div>
					
					
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Recording id *</label>
                      <input type="text" name="recording_id" id="recording_id" class="form-control" placeholder="Enter Recording id"  required  />
                    </div>
					
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Call Date*</label>
                      <input type="date" name="call_date" id="call_date" class="form-control"  required  />
                     </div>
					 
					
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Loan id *</label>
                      <input type="text" name="loan_id" id="loan_id" class="form-control" placeholder="Enter Loan id"  required  />
                    </div>
					
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Language used for the call: *</label>
                      <select id="language" name="language" class="form-control select2" >
					  <option value=" ">None</option>
					 <option value="English">English</option>
					 <option value="Hindi">Hindi</option>
					 <option value="Religion">Religion</option>
					 
					 </select>
                    </div>
					
					
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Customer Type *</label>
                      <select id="customer_type" name="customer_type" class="form-control select2" >
					  <option value=" ">None</option>
					 <option value="Customer short of time">Customer short of time</option>
					 <option value="Customer spoke at leisure">Customer spoke at leisure</option>
					 </select>
                    </div>
					
					
					 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Call Disposition *</label>
                      <select id="call_disposion" name="call_disposion" class="form-control select2" >
					   <option value=" ">None</option>
					   <?php $dispositionQ = mysqli_query($conn,"select *from  `disposition` ");
					  
					  while($dispositionData = mysqli_fetch_assoc($dispositionQ))
					  {

					  ?>
					  
					  <option value="<?php echo $dispositionData['disposition_title']; ?>"><?php echo $dispositionData['disposition_title']; ?></option>
					  
					  <?php } ?>
					 
					 </select>
                    </div>
					
					
						 <div class="col-sm-6">
                      <label class="form-label" for="multiStepsEmail">Feedback Date*</label>
                      <input type="date" name="feedback_date" id="feedback_date" class="form-control"  value="<?php echo date('Y-m-d'); ?>"  required  />
                     </div>
					 
					 
					<div class="col-12 d-flex justify-content-between mt-4">
                      <button class="btn btn-label-secondary btn-prev" disabled=""> <i class="bx bx-chevron-left bx-sm ms-sm-n2"></i>
                        <span class="d-sm-inline-block d-none">Previous</span>
                      </button>
                      <button class="btn btn-primary btn-next"> <span class="d-sm-inline-block d-none me-sm-1 me-0">Next</span> <i class="bx bx-chevron-right bx-sm me-sm-n2"></i></button>
                    </div>
                  
					 
					
                  </div>
				  
                </div>
				
				
				
				
				
				 <div id="personalInfoValidation" class="content">
				
				 
                  <div class="row g-3">
				  
				  
					
                    <div class="col-sm-6">
                      <label class="form-label" for="type_of_evaluator">Call Summary*</label>
                      <textarea rows="3" type="text" name="call_summary" id="call_summary" class="form-control" placeholder="Enter Call Summary"  required ></textarea>
                    </div>
					
					
					 <div class="col-sm-6">
                      <label class="form-label" for="type_of_evaluator">Positives*</label>
                      <textarea rows="3" type="text" name="positives" id="positives" class="form-control" placeholder="Enter Positives"    required ></textarea>
                    </div>
					
					 <div class="col-sm-6">
                      <label class="form-label" for="type_of_evaluator">Area Of improvement *</label>
                      <textarea rows="3" type="text" name="area_of_improvement" id="area_of_improvement" class="form-control" placeholder="Area Of improvement "    required ></textarea>
                    </div>
					
					
					 
					 
					<div class="col-12 d-flex justify-content-between mt-4">
                      <button class="btn btn-label-info btn-prev"   <i class="bx bx-chevron-left bx-sm ms-sm-n2"></i>
                        <span class="d-sm-inline-block d-none">< Previous</span>
                      </button>
                      <button class="btn btn-primary btn-next"> <span class="d-sm-inline-block d-none me-sm-1 me-0">Next</span> <i class="bx bx-chevron-right bx-sm me-sm-n2"></i></button>
                    </div>
                  
					 
					
                  </div>
				  
                </div>
				
				
				
				 <div id="billingLinksValidation" class="content">
                 
                  <!-- Custom plan options -->
                  <div class="row g-3">
                    
					
                    <div class="col-sm-12" style="    padding-bottom: 20px; border-bottom: 1px solid black !important;">
					  
					  <div class="row"><div class="col-md-10"><h5>Fatal * </h5></div> <div class="col-md-2"><label>0 Points</label></div></div>
					  
				      <div class="form-check mt-3">
					 <input name="fatal" class="form-check-input" onchange="changeFatal('hide');" type="radio" value="Miscommunication by agent" id="fatal_1" >
						<label class="form-check-label" for="fatal_1">
						Miscommunication by agent
					   </label>
					 </div>
					 
					   <div class="form-check mt-3">
					 <input name="fatal" class="form-check-input" type="radio" onchange="changeFatal('hide');" value="Agents displayed Rude behavior/sarcasm/harassment on call" id="fatal_2"  >
						<label class="form-check-label" for="fatal_2">
						Agents displayed Rude behavior/sarcasm/harassment on call
					   </label>
					 </div>
					 
					 
					  <div class="form-check mt-3">
					 <input name="fatal" class="form-check-input" type="radio" onchange="changeFatal('hide');" value="Trail on Sales force" id="fatal_3" >
						<label class="form-check-label" for="fatal_3">
						Trail on Sales force
					   </label>
					 </div>
					 
					 
					  
					  <div class="form-check mt-3">
					 <input name="fatal" class="form-check-input" type="radio"  onchange="changeFatal('show');" value="No fatal parameter identified" id="fatal_4" >
						<label class="form-check-label" for="fatal_4">
						No fatal parameter identified
					   </label>
					 </div>
					   
					   
					   
					   <div class="line"></div>
					   
					    
				      </div>
					
					
					<div id="question_section" style="display:none;" >
					
					
					<?php
					
					$questionsArray = array('Call Opening, Greetings, Self Introduction, Brand Introduction/Lender name done?',
					'Did agent check the Reason for Delinquency (RFD) and probed?','Did agent Call recording status informed?',
					'Did agent follow the negotiation hierarchy for BKT 30-90 (Norm/RB/Stab)? This applies for Bucket X EMI negotiation also.',
					'Did agent handled objection effectively and displayed ownership on call?',
					'Did agent offer appropriate programmed as per given guidelines. (LPF/Knock off/settlement)?',
					'Did agent use effective articulation of Whats in it for me? - CIBIL Impact and Zest relationship',
					'Appropriate codes marked (RFD/NCD/ Disposition Code) Crisp and articulate documentation (Post call notes)',
					'Active listening (Fail to listen actively or Making the customer repeat the information)',
					'Appropriate Acknowledgement/Responses/Tone/Energy/Enthusiasm(Rate of speech and tone modulation) used on call?',
					'Did agent close the call appropriately as per the call closing script? '
					
					);
					
					$pointArray  = array(10,10,10,10,10,10,10,10,5,10,5);
					
					$question_no  = 1;
					foreach($questionsArray as $question)
					{
						$question_no++;

					?>
					
					
                      <div class="col-sm-12" style="    padding-bottom: 20px; border-bottom: 1px solid black !important;">
					  
					  
					  <div class="row"><div class="col-md-10"><label style="font-weight: 600;font-size:16px;"><?php echo $question; ?>*</label></div> <div class="col-md-2"><label><?php echo $pointArray[$question_no - 2]; ?> Points</label></div></div>
					  
				      <div class="form-check mt-3">
					 <input name="question_<?php echo $question_no; ?>" class="form-check-input" type="radio" value="Yes" id="question_<?php echo $question_no; ?>_1" >
						<label class="form-check-label" for="question_<?php echo $question_no; ?>_1">
						Yes
					   </label>
					 </div>
					 
					   <div class="form-check mt-3">
					 <input name="question_<?php echo $question_no; ?>" class="form-check-input" type="radio" value="No" id="question_<?php echo $question_no; ?>_2" >
						<label class="form-check-label" for="question_<?php echo $question_no; ?>_2">
						No
					   </label>
					 </div>
					 
					 
					   <div class="form-check mt-3">
					 <input name="question_<?php echo $question_no; ?>" class="form-check-input" type="radio" value="Not Applicable" id="question_<?php echo $question_no; ?>_3" >
						<label class="form-check-label" for="question_<?php echo $question_no; ?>_3">
						Not Applicable
					   </label>
					 </div>
					  
					   
					  
					   <div class="line"></div>
					   
					    
				      </div>
					
					
					<?php } ?>
					
					
					
					
					</div>
					
					
					
					
					
					
					
					
					
					
					
					
                    <div class="col-12 d-flex justify-content-between mt-4">
                      <button class="btn btn-primary btn-prev"> <i class="bx bx-chevron-left bx-sm ms-sm-n2"></i>
                        <span class="d-sm-inline-block d-none">Previous</span>
                      </button>
                      <button  onclick="submitEvaluation(this);" type="submit" name="submit_evaluation" class="btn btn-success btn-next btn-submit">Submit</button>
                    </div>
					
					
					
                  </div>
                  <!--/ Credit Card Details -->
                </div>
           
				
				
				
                  </form>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- / Multi Steps Registration -->
  </div>
</div>
 
<!-- / Content -->
 
  

  <!-- Core JS -->
  <!-- build:js assets/vendor/js/core.js -->
  <script src="../assets/vendor/libs/jquery/jquery.js"></script>
  <script src="../assets/vendor/libs/popper/popper.js"></script>
  <script src="../assets/vendor/js/bootstrap.js"></script>
  <script src="../assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
  <script src="../assets/vendor/libs/hammer/hammer.js"></script>
  <script src="../assets/vendor/libs/i18n/i18n.js"></script>
  <script src="../assets/vendor/libs/typeahead-js/typeahead.js"></script>
  
  <script src="../assets/vendor/js/menu.js"></script>
  <script src="../assets/vendor/libs/select2/select2.js"></script>
  
  

    <script src="../assets/vendor/libs/toastr/toastr.js"></script>
	
	
         <script src="../assets/js/ui-toasts.js"></script>
	 
	   <script src="../assets/vendor/libs/sweetalert2/sweetalert2.js"></script>



  <!-- endbuild -->

  <!-- Vendors JS -->
  <script src="../assets/vendor/libs/cleavejs/cleave.js"></script>
<script src="../assets/vendor/libs/cleavejs/cleave-phone.js"></script>
<script src="../assets/vendor/libs/bs-stepper/bs-stepper.js"></script>
<script src="../assets/vendor/libs/select2/select2.js"></script>
<script src="../assets/vendor/libs/formvalidation/dist/js/FormValidation.min.js"></script>
<script src="../assets/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js"></script>
<script src="../assets/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js"></script>


<script src="../assets/vendor/libs/apex-charts/apexcharts.js"></script>


  <script src="../assets/js/dashboards-analytics.js"></script>
   
  <!-- Main JS -->
  <script src="../assets/js/main.js"></script>

  <!-- Page JS -->
  <script src="../assets/js/pages-auth-multisteps.js"></script>
  
</body>


<!-- Mirrored from pixinvent.com/demo/frest-clean-bootstrap-admin-dashboard-template/html/vertical-menu-template-bordered/auth-register-multisteps.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 31 Jan 2022 09:24:26 GMT -->
</html>
