<?
    										if($years > 0)
					                        {
					                        	echo '<p style="color: rgba(255, 206, 86); font-weight: bold; text-align: center; border-bottom: 0; font-size: 70px; margin-bottom: 0px;">'.$years.'</p><p style="color: rgba(255, 206, 86); font-weight: bold; text-align: center; border-bottom: 0; margin-bottom: 0px;"> year </p>';
					                        }
					                        if($months > 0)
					                        {
					                        	echo '<p style="color: rgba(255, 206, 86); font-weight: bold; text-align: center; border-bottom: 0; font-size: 70px; margin-bottom: 0px;">'.$months.'</p><p style="color: rgba(255, 206, 86); font-weight: bold; text-align: center; border-bottom: 0; margin-bottom: 0px;">month</p>';
					                        }
					                        if($days > 0)
					                        {
					                        	echo '<p style="color: rgba(255, 206, 86); font-weight: bold; text-align: center; border-bottom: 0; font-size: 70px; margin-bottom: 0px;">'.$days.'</p><p style="color: rgba(255, 206, 86); font-weight: bold; text-align: center; border-bottom: 0; margin-bottom: 0px;">day</p>';
					                        }


   								'gross_pay'				=> $this->model_bi_staff->get_gross_pay(),


   								echo'<hr style="background-color: white;">';
			<div class="card-body bg-gradient-16 text-white" style="background-color: transparent;">
				<div class="col-lg-6 col-sm-12">
					<div class="row">
						echo '</div></div></div></div>';
					</div>

					echo '';
					</div>
					</div>
<?php ?> //graph in staff_content - crm
					<hr style="background-color: white;">
					    <div class="card-body bg-gradient-16  text-white" style="background-color: transparent;">
					        <div class="row">
					            <div class="col-md-4">
					                <br>
					                <h5 class="text-white">CRM Grade <i class="fas fa-chart-line"></i>
					                <button data-printid="1" onclick="printCRM(this)" type="button" style="color: #fff;"><i class="fa fa-print"></i></button></h5>
					                <canvas id="crmByStaff_chart" height="200"></canvas><br>
					            </div>

					            <div class="col-md-4">
					                <br>
					                <h5 class="text-white">CRM New Client for <?php echo date('Y'); ?> 
					                    <i class="fas fa-chart-line"></i>
					                    <button data-printid="2" onclick="printCRM(this)" type="button" style="color: #fff;"><i class="fa fa-print"></i></button>
					                </h5>
					                <canvas id="crmNewByStaff_chart" height="200"></canvas><br>
					            </div>
					        </div>



					        <?php 
			                    $bData  = array();
			                    $xLabel = array();

			                    foreach ($crm_grade as $key => $row) 
			                    {    
			                        array_push($xLabel,'Grade'. $row['grade']);
			                        array_push($bData, $row['total']);
			                    }

			                    $data_btn = array
			                    (
			                        'data-printid' => 1,
			                        'data-year' => 'ALL',
			                        'data-month' => 'ALL',
			                        'onclick' => 'printCRM(this)',
			                    );

			                    $dataPie = array(
			                        'title' => 'CRM Grade',
			                        'titleID' => 'chart_crm_grade',
			                        'chartName' => 'crmGradeByStaff', //id for canvas
			                        'height' => '200',
			                        'x_labels' => $xLabel,
			                        'dataSets' => array(
			                            'dataSet' => array(
			                                'label' => 'Grade by Staff',
			                                'data' => $bData,
			                                'backgroundColor' => array(
			                                'rgba(2, 163, 53)',
			                                'rgba(0, 139, 199)',
			                                'rgba(219, 117, 0)',
			                                'rgba(194, 10, 10)'
			                            ))
			                        ),
			                        'btn_data' => $data_btn
			                    );

			                  	$this->load->view('bi/graph_pie',$dataPie);
			                ?>

			                 <!--  <div class="table-responsive">
                				        <div class="col-12">
                                    
                        					<?php if ($cpds){ ?>
                        						<?php foreach ($cpds as $key => $cpd): //debug($cpd)?> 

                        							<span class="d-none d-sm-block">
                        								<div class="row border bg-light">
                        									<div class="col border-right text-center text-dark"><b>Year</b></div>
                        									<div class="col border-right text-center text-dark"><b>No of Training</b></div>
                        									<div class="col-6 border-right text-center text-dark">
                        										<div class="row">
                        											<div class="col-6">
                        												<b>Type</b>
                        											</div>
                        											<div class="col">
                        												<b>Required</b>
                        											</div>
                        											<div class="col">
                        												<b>Earned</b>
                        											</div>
                        											<div class="col">
                        												<b>Balance</b>
                        											</div>
                        										</div>
                        									</div>
                        								</div>

                        								<div class="row text-dark">
                        									<div class="col border d-flex align-items-center">
                        										<p id="year"><?php echo $year; ?></p>
                        									</div>
                        									<div class="col border d-flex align-items-center">
                        										<p id="no_of_training"><?php echo $cpd->no_of_training;?></p>
                        									</div>
                        									<div class="col-6 border">
                        										<div class="row border-bottom">
                        											<div class="col-6 border-right p-2">Structured Technical</div>
                        											<div class="col-2 border-right p-2"><?php echo $cpd->st_target; ?></div>
                        											<div class="col-2 border-right p-2"><?php echo $earned_cpd['st_earned'][$key]; ?></div>
                        											<div class="col-2 p-2 text-center">
                        												<?php echo (!empty($st_balanced))?'<span class="badge badge-danger px-4" >'.$st_balanced.'</span>':'<span class="badge badge-success px-4" > 0 </span>'; ?>
                        											</div>
                        										</div>
                        										<div class="row border-bottom">
                        											<div class="col-6 border-right p-2">Structured Non-Technical</div>
                        											<div class="col-2 border-right p-2"><?php echo $cpd->sn_target; ?></div>
                        											<div class="col-2 border-right p-2"><?php echo $earned_cpd['sn_earned'][$key]; ?></div>
                        											<div class="col-2 p-2 text-center">
                        												<?php echo (!empty($sn_balanced))?'<span class="badge badge-danger px-4" >'.$sn_balanced.'</span>':'<span class="badge badge-success px-4">0</span>'; ?>
                        											</div>
                        										</div>
                        										<div class="row border-bottom">
                        											<div class="col-6 border-right p-2">Unstructured Technical</div>
                        											<div class="col-2 border-right p-2"><?php echo $cpd->ut_target; ?></div>
                        											<div class="col-2 border-right p-2"><?php echo $earned_cpd['ut_earned'][$key]; ?></div>
                        											<div class="col-2 p-2 text-center">
                        												<?php echo (!empty($ut_balanced))?'<span class="badge badge-danger px-4" >'.$ut_balanced.'</span>':'<span class="badge badge-success px-4">0</span>'; ?>
                        											</div>
                        										</div>
                        										<div class="row border-bottom">
                        											<div class="col-6 border-right p-2">Unstructured Non-technical</div>
                        											<div class="col-2 border-right p-2"><?php echo $cpd->un_target; ?></div>
                        											<div class="col-2 border-right p-2"><?php echo $earned_cpd['un_earned'][$key]; ?></div>
                        											<div class="col-2 p-2 text-center">
                        												<?php echo (!empty($un_balanced))?'<span class="badge badge-danger px-4">'.$un_balanced.'</span>':'<span class="badge badge-success px-4">0</span>'; ?>
                        											</div>
                        										</div>
                        									</div>
                        								</div>
                        							</span>

                        							<span class="d-block d-sm-none">

                        								<div class="row">
                        									<div class="col-12 mb-1">
                        										<strong class="text-uppercase">year</strong> <br>
                        										<?php echo $year; ?>
                        									</div>
                        								</div>
                        								
                        								<hr>
                        								<div class="row">
                        									<div class="col-12 mb-1">
                        										<strong class="text-uppercase">No of training</strong> <br>
                        										<?php echo $cpd->no_of_training;?>
                        									</div>
                        								</div>
                        								<hr>

                        								<div class="row">
                        									<div class="col-12 mb-1">
                        										<strong class="text-uppercase">structured technical</strong><br>
                        										<ul>
                        											<li>
                        												<strong class="text-uppercase">Required : </strong> <?php echo $cpd->st_target; ?>
                        											</li>
                        											<li>
                        												<strong class="text-uppercase">Earned : </strong> <?php echo $earned_cpd['st_earned'][$key]; ?>
                        											</li>
                        											<li>
                        												<strong class="text-uppercase">Balanced : </strong> 
                        												<?php  
                        												$st_balanced = $cpd->st_target - $earned_cpd['st_earned'][$key]; 
                        												if($st_balanced > 0){
                        													echo $st_balanced;
                        												}else{
                        													echo '0';
                        												}
                        												?>
                        											</li>
                        											<li>
                        												<?php 
                        												if($st_balanced > 0){
                        													echo '<span class="badge badge-danger px-4">Not Comply</span>';
                        												}else{
                        													echo '<span class="badge badge-success px-4">Comply</span>';
                        												}
                        												?>
                        											</li>
                        										</ul>
                        									</div>
                        								</div>
                        								<hr>

                        								<div class="row">
                        									<div class="col-12 mb-1">
                        										<strong class="text-uppercase">structured non technical</strong><br>
                        										<ul>
                        											<li>
                        												<strong class="text-uppercase">Required : </strong> <?php echo $cpd->sn_target; ?>
                        											</li>
                        											<li>
                        												<strong class="text-uppercase">Earned : </strong> <?php echo $earned_cpd['sn_earned'][$key]; ?>
                        											</li>
                        											<li>
                        												<strong class="text-uppercase">Balanced : </strong> 
                        												<?php  
                        												$sn_balanced = $cpd->sn_target - $earned_cpd['sn_earned'][$key]; 
                        												if($sn_balanced > 0){
                        													echo $sn_balanced;
                        												}else{
                        													echo '0';
                        												}
                        												?>
                        											</li>
                        											<li>
                        												<?php 
                        												if($sn_balanced > 0){
                        													echo '<span class="badge badge-danger px-4">Not Comply</span>';
                        												}else{
                        													echo '<span class="badge badge-success  px-4">Comply</span>';
                        												}
                        												?>
                        											</li>
                        										</ul>
                        									</div>
                        								</div>
                        								<hr>
                        								
                        								<div class="row">
                        									<div class="col-12 mb-1">
                        										<strong class="text-uppercase">unstructured technical</strong><br>
                        										<ul>
                        											<li>
                        												<strong class="text-uppercase">Required : </strong> <?php echo $cpd->ut_target; ?>
                        											</li>
                        											<li>
                        												<strong class="text-uppercase">Earned : </strong> <?php echo $earned_cpd['ut_earned'][$key]; ?>
                        											</li>
                        											<li>
                        												<strong class="text-uppercase">Balanced : </strong> 
                        												<?php  
                        												if($ut_balanced > 0){
                        													echo $ut_balanced;
                        												}else{
                        													echo '0';
                        												}
                        												?>
                        											</li>
                        											<li>
                        												<?php echo (!empty($ut_balanced))?'<span class="badge badge-danger px-4" >Not Comply</span>':'<span class="badge badge-success px-4">Comply</span>'; ?>
                        											</li>
                        										</ul>
                        									</div>
                        								</div>
                        								<hr>
                        								
                        								<div class="row">
                        									<div class="col-12 mb-1">
                        										<strong class="text-uppercase">unstructured non technical</strong><br>
                        										<ul>
                        											<li>
                        												<strong class="text-uppercase">Required : </strong> <?php echo $cpd->un_target; ?>
                        											</li>
                        											<li>
                        												<strong class="text-uppercase">Earned : </strong> <?php echo $earned_cpd['un_earned'][$key]; ?>
                        											</li>
                        											<li>
                        												<strong class="text-uppercase">Balanced : </strong> 
                        												<?php  
                        												if($un_balanced > 0){
                        													echo $un_balanced;
                        												}else{
                        													echo '0';
                        												}
                        												?>
                        											</li>
                        											<li>
                        												<?php echo (!empty($un_balanced))?'<span class="badge badge-danger px-4" >Not Comply</span>':'<span class="badge badge-success px-4">Comply</span>'; ?>	
                        											</li>
                        										</ul>
                        									</div>
                        								</div>
                        								<hr>
                        							</span>
                        							
                        						<?php endforeach ?>
                        					<?php } else{?>
                        						<div class="row border bg-light">
                        							<div class="col">
                        								No training have been allocated to <?php echo $users['name']; ?> for year <?php echo $year ?>
                        							</div>
                        						</div>
                        					<?php
                        					} ?>
                	        		     </div>
                	        	      </div> -->
                	        	  </div>



                                

<!--  <div class="col-12 table-responsive " style="margin-top:2rem">
            <table class="table table-bordered" width="100%" border="1">
                  <thead>
                        <th class="sorting border-top text-center" tabindex="0" rowspan="1" colspan="1" aria-label="#: activate to sort column ascending">
                              #
                        </th>
                        <th class="sorting border-top text-center" tabindex="0" rowspan="1" colspan="1">
                              Office unit
                        </th>
                        <th class="sorting border-top text-center" tabindex="0" rowspan="1" colspan="1">
                              Complaint Category
                        </th>
                        <th class="sorting border-top text-center" tabindex="0" rowspan="1" colspan="1">
                              Problem
                        </th>
                        <th class="sorting border-top text-center" tabindex="0" rowspan="1" colspan="1">
                              File Name
                        </th>
                        <th class="sorting border-top text-center" tabindex="0" rowspan="1" colspan="1">
                              Request Date
                        </th>
                        <th class="sorting border-top text-center" tabindex="0" rowspan="1" colspan="1">
                              Fix Date
                        </th>
                        <th class="sorting border-top text-center" tabindex="0" rowspan="1" colspan="1" >
                    Status
                </th>     
                  </thead>

                  <tbody id="print_maintenance_list">
                        <?php if(!empty($MaintenanceList)) { ?> 
                              <?php foreach($MaintenanceList as $key => $row) { //debug($row); ?>
                                    <tr>
                                          <td class="text-center"><?php echo $key+1; ?></td>
                                          <td>Unit: <?php echo $row['office_unit']; ?><br>Floor: <?php echo $row['floor']; ?></td>
                                          <td><?php echo $row['complain_category']; ?></td>
                                          <td><?php echo $row['problem']; ?></td>
                                          <td><?php echo $row['photo_title']; ?></td>
                                          <td class="text-center"><?php echo date('d-m-Y',strtotime($row['createdTS'])); ?></td>
                                          <td class="text-center"><?php echo ($row['date_fixed'] != '0000-00-00')?date('d-m-Y',strtotime($row['date_fixed'])):''; ?></td>
                            <td class="text-center"><?php echo ($row['status_app']==null || $row['status_app']=='Pending' )?'Pending':$row['status_app']; ?>
                                    </tr>
                              <?php } ?>
                        <?php } ?>
                  </tbody>    
            </table>    
      </div> -->


			                

									