<?php function array_to_csv_download($array, $filename = "export.csv", $delimiter = ";") { header('Content-Type: application/csv'); header('Content-Disposition: attachement; filename="' . $filename . '";'); header("Pragma: no-cache"); header("Expires: 0"); $f = fopen('php://output', 'w'); $headings = array(get_string('student', 'mootyper'), get_string('vmistakes', 'mootyper'), get_string('timeinseconds', 'mootyper'), get_string('hitsperminute', 'mootyper'), get_string('fullhits', 'mootyper'), get_string('precision', 'mootyper'), get_string('timetaken', 'mootyper'), get_string('wpm', 'mootyper')); fputcsv($f, $headings, $delimiter); foreach ($array as $gr) { $fields = array($gr->firstname . ' ' . $gr->lastname, $gr->mistakes, $gr->timeinseconds . ' s', $gr->hitsperminute, $gr->fullhits, $gr->precisionfield . '%', date('d. M Y G:i', $gr->timetaken), $gr->wpm); fputcsv($f, $fields, $delimiter); } fclose($f); } require_once dirname(dirname(dirname(__FILE__))) . '/config.php'; require_once dirname(__FILE__) . '/lib.php'; require_once dirname(__FILE__) . '/locallib.php'; $m_id = optional_param('mootyperid', 0, PARAM_INT); $m_is_exam = optional_param('isexam', 0, PARAM_INT); if ($m_is_exam) { $grds = get_typergradesfull($m_id, 2, 0); } else { $grds = get_typer_grades_adv($m_id, 0, 0, 2, 0); } array_to_csv_download($grds, get_string('gradesfilename', 'mootyper'));
/** * User management dashboard */ public function actionDashboard() { // check permissions // if (!Yii::app()->user->checkAccess('manageUser')) { // Helper::authException(); // } // params $export = Yii::app()->getRequest()->getQuery('export'); $status = Yii::app()->request->getParam('status', false); $criteria = new CDbCriteria(); $criteria->condition = 'userProfile.CompanyID = :CompanyID'; $criteria->params = array(':CompanyID' => Yii::app()->user->companyID); // get user info for dashboard switch ($status) { case 'deleted': // get all deleted/inactive users $UserModels = UserLogin::model()->with('userProfile')->with('userRole')->findAllByAttributes(array('IsActive' => 0), $criteria); break; default: // get all active users $UserModels = UserLogin::model()->with('userProfile')->with('userRole')->findAllByAttributes(array('IsActive' => 1), $criteria); } $users = array(); $exportarray = array(); foreach (array_keys($UserModels) as $key) { // separate models $UserLogin = $UserModels[$key]; $UserProfile = $UserModels[$key]->userProfile; $UserRole = $UserModels[$key]->userRole; // create empty object $users[$key] = new stdClass(); // set values used on dashboard $users[$key]->Name = sprintf('%s, %s', $UserProfile->LastName, $UserProfile->FirstName); $users[$key]->FirstName = $UserProfile->FirstName; $users[$key]->MiddleName = $UserProfile->MiddleName; $users[$key]->LastName = $UserProfile->LastName; $users[$key]->Email = $UserLogin->LoginEmail; //$users[$key]->Phone = Helper::formatPhoneNumber($UserProfile->WorkPhone); $users[$key]->Phone = $UserProfile->WorkPhone; $users[$key]->EmployeeID = $UserProfile->EmployeeID; $users[$key]->Role = $UserRole->UserRoleID; $users[$key]->ID = $UserLogin->UserLoginID; //$users[$key]->Added = Helper::formatDashboardDate($UserLogin->RowInsertDate); $users[$key]->Added = $UserLogin->RowInsertDate; $users[$key]->IsActive = $UserLogin->IsActive; $CandidateInfo = Candidate::model()->findByAttributes(array('Email' => $UserLogin->LoginEmail)); if (!isset($CandidateInfo)) { $DirectEmail = ''; $JobTitle = ''; $Phone = ''; $HireDate = ''; $CurrentStartDate = ''; $PositionLevel = ''; $CareerPath = ''; } else { $UserProfile = UserProfile::model()->findbypk($CandidateInfo->UserProfileID); if (!isset($UserProfile)) { $DirectEmail = ''; $JobTitle = $CandidateInfo->Title; $Phone = $CandidateInfo->WorkPhone; $HireDate = $CandidateInfo->HireDate; $CurrentStartDate = $CandidateInfo->PositionDate; $PositionLevel = $CandidateInfo->CompanyPositionID; $CareerPath = $CandidateInfo->CareerPath; } else { $DirectEmail = $UserProfile->Email; $JobTitle = $CandidateInfo->Title; $Phone = $CandidateInfo->WorkPhone; $HireDate = $CandidateInfo->HireDate; $CurrentStartDate = $CandidateInfo->PositionDate; $PositionLevel = $CandidateInfo->CompanyPositionID; $CareerPath = $CandidateInfo->CareerPath; } } $exportarray[$key] = array($users[$key]->FirstName, $users[$key]->MiddleName, $users[$key]->LastName, $users[$key]->Email, $DirectEmail, $users[$key]->EmployeeID, $JobTitle, $Phone, $HireDate, $CurrentStartDate, $PositionLevel, $CareerPath); } // render view if ($export == "csv") { function array_to_csv_download($array, $filename = "export.csv", $delimiter = ",") { // open raw memory as file so no temp files needed, you might run out of memory though $f = fopen('php://memory', 'w'); // loop over the input array fputcsv($f, array('First Name', 'Middle Name', 'Last Name', 'Email', 'Employee ID', 'Job Title', 'Phone', 'Hire Date', 'Current Role Start Date', 'Position Level', 'Career Path')); foreach ($array as $line) { // generate csv lines from the inner arrays fputcsv($f, $line, $delimiter); } // reset the file pointer to the start of the file fseek($f, 0); // tell the browser it's going to be a csv file header('Content-Type: application/csv'); // tell the browser we want to save it instead of displaying it header('Content-Disposition: attachment; filename="' . $filename . '";'); // make php send the generated csv lines to the browser fpassthru($f); } array_to_csv_download($exportarray, Yii::app()->user->companyName . " Users_" . DATE('Y') . ".csv"); die(''); } $this->render('dashboard', array('users' => $users, 'status' => $status)); }
public function actionreportProduction($segment = false) { if (Yii::app()->user->agreeToTerms == 0) { $this->redirect(Yii::app()->createUrl('company/terms')); } $displayYear = $_REQUEST['Year']; $reporttype = $_REQUEST['reporttype']; $userProfileModel = new UserProfile(); $candidateModel = new Candidate(); $companyModel = new Company(); $managersArray = array(); $CandidateTotalArray = array(); $fundamentalsModel = new CompanyFundamentals(); $competenciesModel = new CompanyCompetencies(); $learningagilityModel = new CompanyLearningAgility(); $criteria3 = new CDbCriteria(); $criteria3->condition = 'CompanyID = :CompanyID'; $criteria3->params = array(':CompanyID' => Yii::app()->user->companyID); $fundamentals = $fundamentalsModel->findAllByAttributes(array(), $criteria3); $competencies = $competenciesModel->findAllByAttributes(array(), $criteria3); $learningagility = $learningagilityModel->findAllByAttributes(array(), $criteria3); $exportarray = array(); $excelexport = 0; $i = 0; function array_to_csv_download($array, $filename = "export.csv", $delimiter = ",") { // open raw memory as file so no temp files needed, you might run out of memory though $f = fopen('php://memory', 'w'); // loop over the input array fputcsv($f, array('Candidate', 'Candidate Business Unit', 'Current Job Title', 'Time in Position', 'Readiness', 'Composite Rating')); //Candidate Business Unit Current Job Title Time in Position Readiness Composite Rating foreach ($array as $line) { // generate csv lines from the inner arrays fputcsv($f, $line, $delimiter); } // reset the file pointer to the start of the file fseek($f, 0); // tell the browser it's going to be a csv file header('Content-Type: application/csv'); // tell the browser we want to save it instead of displaying it header('Content-Disposition: attachment; filename="' . $filename . '";'); // make php send the generated csv lines to the browser fpassthru($f); } $criteria = new CDbCriteria(); $criteria2 = new CDbCriteria(); $criteria3 = new CDbCriteria(); $criteria4 = new CDbCriteria(); $criteria->with = array('performances', 'ratings', 'plannings'); if (!isset($_REQUEST['userselected'])) { $this->redirect(array('user/reportgenerate')); } if (isset($_REQUEST['matrixselect'])) { $selectmanagers = $_REQUEST['userselected']; $session['selectmanagers'] = $selectmanagers; $criteria5 = new CDbCriteria(); //$criteria5->condition = 'UserProfileID = :UserProfileID'; $criteria5->addInCondition('UserProfileID', $selectmanagers); $level1 = $candidateModel->findAllByAttributes(array(), $criteria5); $CandidateTotalArray[] = $level1; $userlist = array(); $criteria->condition = 'RatingYear = :RatingYear AND PerformanceYear = :RatingYear AND PlanningYear = :RatingYear AND CompanyID = :CompanyID AND IsActive = :IsActive'; $criteria->params = array(':RatingYear' => $displayYear, ':CompanyID' => Yii::app()->user->companyID, ':IsActive' => 1); $criteria->addInCondition("UserProfileID", $selectmanagers); $matrix = $candidateModel->findAllByAttributes(array(), $criteria); } else { $criteria->condition = 'RatingYear = :RatingYear AND PerformanceYear = :RatingYear AND PerformanceYear = :RatingYear AND CompanyID = :CompanyID AND IsActive = :IsActive'; $criteria->params = array(':RatingYear' => $displayYear, ':CompanyID' => Yii::app()->user->companyID, ':IsActive' => 1); $matrix = $candidateModel->findAllByAttributes(array(), $criteria); } $criteria3->condition = 'companyID = :companyID'; $criteria3->params = array(':companyID' => Yii::app()->user->companyID); $criteria3->order = 'Email'; // $userManagers = UserProfile::model()->findAllByAttributes(array('order' => 'Email'),$criteria3); $managersArray[0] = Yii::app()->user->companyName; $userManagers = UserProfile::model()->findAllByAttributes(array(), $criteria3); foreach ($userManagers as $UserManager) { $managersArray[$UserManager->UserProfileID] = $UserManager->Email; } $managerArray = $managersArray; $criteria2->with = array('companyPerformances', 'companyPotentials'); $companyPerformance = $companyModel->findByPk(Yii::app()->user->companyID, $criteria2); //$this->render('matrix', array('companyPerformance' => $companyPerformance, 'matrix' => $matrix, 'segment' => $segment, 'managerArray' => $managerArray, 'selectmanagers' => $selectmanagers, 'facil_matrix' => $facil_matrix, 'filter' => $filter)); $candidate_performance = array(); $performance_weight = array(); $potential_weight = array(); $a = 0; foreach ($companyPerformance->companyPerformances as $performance) { // echo '<p>'.$performance->Category.': '.$performance->Weighting.'</p>'; $performance_weight[$a] = $performance->Weighting; $a++; } $performance1_weight = $performance_weight[0] / 100; //Contribution $performance2_weight = $performance_weight[1] / 100; //Conduct $performance3_weight = $performance_weight[2] / 100; //Effort $a = 0; $lastsection = 0; foreach ($companyPerformance->companyPotentials as $potential) { if ($lastsection != $potential->Section) { //echo '<p>'.$potential->Section.': ' . $potential->Category.': '.$potential->SectionWeighting.'</p>'; $potential_weight[$a] = $potential->SectionWeighting; $a++; } $lastsection = $potential->Section; } $potential1_weight = $potential_weight[0] / 100; $potential2_weight = $potential_weight[1] / 100; $potential3_weight = $potential_weight[2] / 100; $i = 0; $datapoints = ""; $tips = ""; //Per Candidate $loopCount = 1; $mmContent = ""; $content = ""; $lastUserProfileID = ""; $contentheader = ' <style type="text/css"> <!-- table { vertical-align: top; } tr { vertical-align: top; } td { vertical-align: top; } .candidate { padding:5px; width:96%; font-size: 16px; font-weight:bold; } .reportsectionheader { background-color:#eeeeee; padding:5px; width:100%; border-bottom:1px solid black; font-size: 14px; font-weight:bold; } .reportheader { background-color:#dddddd; padding:5px; width:12%; border-bottom:1px solid black; font-weight:bold; } .reportcontent { width:20%; padding:5px; border-bottom:1px solid black; } .footerheader { font-size:11px; font-weight: bold; } .footercontent { font-size:14px } --> </style>'; foreach ($matrix as $matrix) { $display = true; if ($display) { $performance1 = $matrix->performances[0]->Contribution; //Contribution $performance2 = $matrix->performances[0]->Conduct; //Conduct $performance3 = $matrix->performances[0]->Effort; //Effort $performance1 = $performance1 * $performance1_weight; $performance2 = $performance2 * $performance2_weight; $performance3 = $performance3 * $performance3_weight; $candidate_potential = array(); $candidate_performance = array(); $datapoint = ""; $potential1 = $matrix->ratings[0]->GeneralCognitiveCapability; $potential2 = $matrix->ratings[0]->EnergyAchievementOrientation; $potential3 = $matrix->ratings[0]->CulturalFit; $potential4 = $matrix->ratings[0]->Execution; $potential5 = $matrix->ratings[0]->Judgement; $potential6 = $matrix->ratings[0]->Relationships; $potential7 = $matrix->ratings[0]->Influences; $potential8 = $matrix->ratings[0]->Inspiration; $potential9 = $matrix->ratings[0]->Innovation; $potential10 = $matrix->ratings[0]->Learning; $potential11 = $matrix->ratings[0]->Ingenuity; $potential12 = $matrix->ratings[0]->PeopleSmart; $potential13 = $matrix->ratings[0]->ChangeLeader; $potential14 = $matrix->ratings[0]->ComposedUnderPressure; $potential15 = $matrix->ratings[0]->PersonalInsight; $potential16 = $matrix->ratings[0]->AdaptsEasily; if ($potential1 < 2 || $potential2 < 2 || $potential3 < 2) { $potential1 = 0; $potential2 = 0; $potential3 = 0; } $potential_section1 = ($potential1 + $potential2 + $potential3) / 3 * $potential1_weight; $potential_section2 = ($potential4 + $potential5 + $potential6 + $potential7 + $potential8 + $potential9 + $potential10) / 7 * $potential2_weight; $potential_section3 = ($potential11 + $potential12 + $potential13 + $potential14 + $potential15 + $potential16) / 6 * $potential3_weight; $candidate_potential[$i] = round($potential_section1 + $potential_section2 + $potential_section3, 1); $candidate_performance[$i] = round($performance1 + $performance2 + $performance3, 1); if ($candidate_performance[$i] > '2.92') { $candidate_performance[$i] = '2.92'; } if ($candidate_potential[$i] == '3') { $candidate_potential[$i] = '2.98'; } if ($candidate_performance[$i] == '2.92' && $candidate_potential[$i] > '2.96') { $candidate_potential[$i] = '2.92'; } if (array_search($candidate_potential[$i], $candidate_potential)) { $candidate_potential[$i] = $candidate_potential[$i] - '.2'; } if (array_search($candidate_performance[$i], $candidate_performance)) { $candidate_potential[$i] = $candidate_potential[$i] - '.2'; } $readiness = CompanyReadiness::model()->findByAttributes(array('ReadinessID' => $matrix->plannings[0]->Readiness)); if ($readiness) { $readiness = $readiness->ReadinessDescription; $ReadinessDescription = $readiness; } else { $readiness = ""; $ReadinessDescription = ""; } $CurrentPositionlevel = CompanyPosition::model()->findByAttributes(array('CompanyPositionID' => $matrix->plannings[0]->CurrentPositionLevel)); if ($CurrentPositionlevel) { $CurrentPosition = $CurrentPositionlevel->Description; } else { $CurrentPosition = ""; } $NextStepPositionLevel = CompanyPosition::model()->findByAttributes(array('CompanyPositionID' => $matrix->plannings[0]->NextStepPositionLevel)); if ($NextStepPositionLevel) { $NextPosition = $NextStepPositionLevel->Description; } else { $NextPosition = ""; } $FutureStepPositionLevel = CompanyPosition::model()->findByAttributes(array('CompanyPositionID' => $matrix->plannings[0]->LongTermPositionLevel)); if ($FutureStepPositionLevel) { $FuturePosition = $FutureStepPositionLevel->Description; } else { $FuturePosition = ""; } $Competency[] = array('label' => $competencies[0]->Name, 'amount' => $matrix->ratings[0]->Execution); $Competency[] = array('label' => $competencies[1]->Name, 'amount' => $matrix->ratings[0]->Judgement); $Competency[] = array('label' => $competencies[2]->Name, 'amount' => $matrix->ratings[0]->Relationships); $Competency[] = array('label' => $competencies[3]->Name, 'amount' => $matrix->ratings[0]->Influences); $Competency[] = array('label' => $competencies[4]->Name, 'amount' => $matrix->ratings[0]->Inspiration); $Competency[] = array('label' => $competencies[5]->Name, 'amount' => $matrix->ratings[0]->Innovation); $Competency[] = array('label' => $competencies[6]->Name, 'amount' => $matrix->ratings[0]->Learning); foreach ($Competency as $key => $row) { $label[$key] = $row['label']; $amount[$key] = $row['amount']; } array_multisort($amount, SORT_ASC, $label, SORT_DESC, $Competency); $LearningAgility[] = array('lalabel' => $learningagility[0]->Name, 'laamount' => $matrix->ratings[0]->Ingenuity); $LearningAgility[] = array('lalabel' => $learningagility[1]->Name, 'laamount' => $matrix->ratings[0]->PeopleSmart); $LearningAgility[] = array('lalabel' => $learningagility[2]->Name, 'laamount' => $matrix->ratings[0]->ChangeLeader); $LearningAgility[] = array('lalabel' => $learningagility[3]->Name, 'laamount' => $matrix->ratings[0]->ComposedUnderPressure); $LearningAgility[] = array('lalabel' => $learningagility[4]->Name, 'laamount' => $matrix->ratings[0]->PersonalInsight); $LearningAgility[] = array('lalabel' => $learningagility[5]->Name, 'laamount' => $matrix->ratings[0]->AdaptsEasily); foreach ($LearningAgility as $key => $row) { $lalabel[$key] = $row['lalabel']; $laamount[$key] = $row['laamount']; } array_multisort($laamount, SORT_ASC, $lalabel, SORT_DESC, $LearningAgility); if ($lastUserProfileID != $matrix->UserProfileID) { $candidateManager = UserProfile::model()->findAllByPk($matrix->UserProfileID); $candidateManagerEmail = $candidateManager[0]->Email; $candidateManagerName = $candidateManager[0]->FirstName . " " . $candidateManager[0]->LastName; } $diff = time() - strtotime($matrix->PositionDate); $years = floor($diff / (365 * 60 * 60 * 24)); $months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24)); $days = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24)); if ($reporttype == 'Export') { //Candidate Business Unit Current Job Title Time in Position Readiness Composite Rating $excelexport = 1; $exportarray[$i] = array($matrix->FirstName . ' ' . $matrix->MiddleName, $matrix->BusinessUnit, $matrix->Title, $years . ' Year(s), ' . $months . ' months', $ReadinessDescription, $candidate_performance[$i] * $candidate_potential[$i]); $i++; } elseif ($reporttype == 'Planning') { $content = $content . ' <page> <table cellspacing="0" style="width: 96%;"> <tr> <td style="width: 20%;"> <img src="http://inventivetalentreviews.com/themes/itr/assets/admin/layout3/img/itrlogo.png" style="width:240px"> </td> <td style="width: 60%; text-align: left; font-weight: bold; font-size: 20pt;"> <span style="font-size: 10pt"><br></span> <div style="margin-left:220px">Confidential</div> </td> <td style="width: 20%; text-align:right"> <br/><br/> Date Prepared:<br/> ' . date("Y-m-d") . ' </td> </tr> </table> <div class="candidate">' . $matrix->FirstName . ' ' . $matrix->MiddleName . ' ' . $matrix->LastName . '</div> <table cellspacing="0" style="width: 100%;"> <tr > <td class="reportheader">Employee ID</td> <td class="reportcontent">' . $matrix->EmployeeID . '</td> <td class="reportheader">Current Job Title</td> <td class="reportcontent">' . $matrix->Title . '</td> <td class="reportheader">Business Unit</td> <td class="reportcontent">' . $matrix->BusinessUnit . '</td> </tr> </table> <br/><br/> <div class="candidate">Planning Year ' . $matrix->plannings[0]->PlanningYear . '</div> <table cellspacing="0" style="width: 100%;"> <tr><td class="reportheader" style="width:300px">1<sup>st</sup> Competency Development Opportunity:</td> <td class="reportcontent">' . $label[0] . '</td></tr> <tr><td class="reportheader" style="width:300px">2<sup>nd</sup> Competency Development Opportunity:</td> <td class="reportcontent">' . $label[1] . '</td></tr> <tr><td class="reportheader" style="width:300px">3<sup>rd</sup> Competency Development Opportunity:</td> <td class="reportcontent">' . $label[2] . '</td></tr> <tr><td class="reportheader" style="width:300px">Learning Agility Development Opportunity:</td> <td class="reportcontent">' . $lalabel[0] . '</td></tr> <tr><td class="reportheader" style="width:300px">Suggestions for Enhancing Experience:</td> <td class="reportcontent">' . $matrix->plannings[0]->MostImportantNeedForExperience . '</td></tr> <tr><td class="reportheader" style="width:300px">Other Development Opportunities:</td> <td class="reportcontent">' . $matrix->plannings[0]->OtherDevelopment . '</td></tr> <tr><td class="reportheader" style="width:300px">Add Notes for Development Strategies:</td> <td class="reportcontent">' . $matrix->plannings[0]->Notes . '</td></tr> </table> </page>'; } else { $content = $content . '<page> <table cellspacing="0" style="width: 96%;"> <tr> <td style="width: 20%;"> <img src="http://inventivetalentreviews.com/themes/itr/assets/admin/layout3/img/itrlogo.png" style="width:240px"> </td> <td style="width: 60%; text-align: left; font-weight: bold; font-size: 20pt;"> <span style="font-size: 10pt"><br></span> <div style="margin-left:220px">Confidential</div> </td> <td style="width: 20%; text-align:right"> <br/><br/> Date Prepared:<br/> ' . date("Y-m-d") . ' </td> </tr> </table> <div class="candidate">' . $matrix->FirstName . ' ' . $matrix->MiddleName . ' ' . $matrix->LastName . '</div> <table cellspacing="0" style="width: 100%; border:1px solid black"> <tr><td colspan=6 class="reportsectionheader">PROFILE</td></tr> <tr > <td class="reportheader">Employee ID</td> <td class="reportcontent">' . $matrix->EmployeeID . '</td> <td class="reportheader">Current Job Title</td> <td class="reportcontent">' . $matrix->Title . '</td> <td class="reportheader">Business Unit</td> <td class="reportcontent">' . $matrix->BusinessUnit . '</td> </tr> <tr> <td class="reportheader">Hire Date</td> <td class="reportcontent">' . $matrix->HireDate . '</td> <td class="reportheader">Start Date of Current Position</td> <td class="reportcontent">' . $matrix->PositionDate . '</td> <td class="reportheader">Time in Position</td> <td class="reportcontent">' . $years . ' Year(s), ' . $months . ' months</td> </tr> <tr> <td class="reportheader">Company Position Level</td> <td class="reportcontent">' . $CurrentPosition . '</td> <td class="reportheader">Career Path</td> <td class="reportcontent">' . $matrix->CareerPath . '</td> <td class="reportheader">Key Position</td> <td class="reportcontent">' . $matrix->KeyPosition . '</td> </tr> <tr> <td class="reportheader">Education</td> <td class="reportcontent">' . $matrix->Education . '</td> <td class="reportheader">Work Phone</td> <td class="reportcontent">' . $matrix->WorkPhone . '</td> <td class="reportheader">Candidate Email</td> <td class="reportcontent">' . $matrix->Email . '</td> </tr> <tr> <td class="reportheader">Direct Manager</td> <td class="reportcontent">' . $candidateManagerEmail . '</td> <td class="reportheader">Direct Manager Email</td> <td class="reportcontent" colspan=3>' . $candidateManagerName . '</td> </tr> </table> <br/> <table cellspacing="0" style="width: 100%; border:1px solid black"> <tr><td colspan=6 class="reportsectionheader">PLANNING YEAR ' . $matrix->plannings[0]->PlanningYear . '</td></tr> <tr > <td class="reportheader">Next Step Position Level</td> <td class="reportcontent">' . $NextPosition . '</td> <td class="reportheader">Readiness for Next Step</td> <td class="reportcontent">' . $ReadinessDescription . '</td> <td class="reportheader">Long-Term Position Level</td> <td class="reportcontent">' . $FuturePosition . '</td> </tr> <tr> <td class="reportheader">Mobility</td> <td class="reportcontent">' . $matrix->plannings[0]->Mobility . '</td> <td class="reportheader">Engagement / Retention</td> <td class="reportcontent">' . $matrix->plannings[0]->Engagement . '</td> <td class="reportheader">Career Path</td> <td class="reportcontent">' . $matrix->plannings[0]->CareerPath . '</td> </tr> <tr> <td class="reportheader">1st Competency</td> <td class="reportcontent">' . $label[0] . '</td> <td class="reportheader">2nd Competency</td> <td class="reportcontent">' . $label[1] . '</td> <td class="reportheader">3rd Competency</td> <td class="reportcontent">' . $label[2] . '</td> </tr> <tr> <td class="reportheader">Learning Agility</td> <td class="reportcontent">' . $lalabel[0] . '</td> <td class="reportheader">Assessment and Coaching</td> <td class="reportcontent" colspan=3>' . $matrix->plannings[0]->AssessmentAndCoaching . '</td> </tr> </table> <span class="footerheader"><br/>Most Important Need for Experience:</span><br/> <span class="footercontent">' . $matrix->plannings[0]->MostImportantNeedForExperience . '</span> <span class="footerheader"><br/><br/>Other Development:</span><br/> <span class="footercontent">' . $matrix->plannings[0]->OtherDevelopment . '</span> <span class="footerheader"><br/><br/>Performance Notes:</span><br/> <span class="footercontent">' . $matrix->performances[0]->Notes . '</span> <span class="footerheader"><br/><br/>Potential Notes:</span><br/> <span class="footercontent">' . $matrix->ratings[0]->Notes . '</span> <span class="footerheader"><br/><br/>General Notes:</span><br/> <span class="footercontent">' . $matrix->plannings[0]->Notes . '</span> <table cellspacing="0" style="width: 98%;"> <tr> <td style="width: 100%; text-align:right; font-size:8px"> Copyright © ' . date('Y') . ' by Inventive Talent Consulting </td> </tr> </table> </page>'; } $loopCount++; $lastUserProfileID = $matrix->UserProfileID; } } //if EXCEL if ($excelexport) { array_to_csv_download($exportarray, Yii::app()->user->companyName . "_StackedCandidate_" . $displayYear . ".csv"); //Yii::app()->user->companyName . "_StackedCandidate_" . DATE('Y') . ".csv" } else { $html2pdf = Yii::app()->ePdf->HTML2PDF(); $html2pdf = new HTML2PDF('L', 'A4', 'en'); $html2pdf->WriteHTML($contentheader . $content); // $html2pdf->Output($reporttype . date('Y') . ".pdf" ); //$html2pdf->Output($reporttype . date('Y') . ".pdf" , 'D'); $html2pdf->Output(Yii::app()->user->companyName . "_" . $reporttype . "_" . $displayYear . ".pdf", 'D'); } }
<?php require 'init.php'; if ($_GET['typ'] == "vazby_v2") { $do_csv[] = array("User A", "User B", "Vazba", "ID Fotky"); $sql = mysql_query("SELECT * FROM wp_instaapi_vazby2 where zdroj='" . $_GET['zdroj'] . "'"); while ($data = mysql_fetch_assoc($sql)) { $do_csv[] = array($data['userA'], $data['userB'], $data['vazba'], $data['id_fotky']); } array_to_csv_download($do_csv, $_GET['zdroj'] . ".csv"); } if ($_GET['typ'] == "uzivatele_v2") { $do_csv[] = array("username", "followed_by", "follows", "media", "bio", "website", "fulname", "profile_picture"); $sql = mysql_query("SELECT * FROM wp_instaapi_userdata where existuje=1"); while ($data = mysql_fetch_assoc($sql)) { $do_csv[] = array($data["username"], $data["followed_by"], $data["follows"], $data["media"], $data["bio"], $data["website"], $data["fulname"], $data["profile_picture"]); } array_to_csv_download($do_csv, "uzivatele_v2.csv"); }
$str_fechas = implode(';', $array_fechas); $str_fechas = "Names;" . $str_fechas; $first_row = explode(";", $str_fechas); $export[] = $first_row; $export[] = array('Test A - Algoritmo de Alberto Cejas Sánchez'); for ($i = 0; $i < count($array_nombres); $i++) { $tmp_array = array(); $tmp_string = ""; $tmp_string .= $array_nombres[$i] . ";"; for ($j = $i * count($array_fechas); $j < $i * count($array_fechas) + count($array_fechas); $j++) { $tmp_string .= $array_datos[$j] . ";"; } $tmp_array = explode(";", $tmp_string); $export[] = $tmp_array; } $export[] = array('Test B - Algoritmo de refuerzo adaptativo'); for ($i = 0; $i < count($array_nombres_b); $i++) { $tmp_array = array(); $tmp_string = ""; $tmp_string .= $array_nombres_b[$i] . ";"; for ($j = $i * count($array_fechas); $j < $i * count($array_fechas) + count($array_fechas); $j++) { $tmp_string .= $array_datos_b[$j] . ";"; } $tmp_array = explode(";", $tmp_string); $export[] = $tmp_array; } array_to_csv_download($export, "statistics_guessit.csv"); } } } mysqli_close($mysqli);