+44 (0)1223 659363 contact@acep.org.uk

trends3

[insert_php]
global $wpdb;
$current_user = wp_get_current_user();
//print_r($current_user);
$formid=$current_user->description;
echo “Form ID is”.$formid.PHP_EOL;
$fordb=$current_user->user_login;
//$uem=$current_user->user_email;
//echo “Logged in is”.$fordb;
$uem=$_POST[’emailid’];
$uem=$_GET[’emailid’];
//echo “Posted User Email.”.$uem.PHP_EOL;

$sql=”SELECT layout FROM 4zgc14mywebsitetransfercom_1667397749.wp_fsq_form WHERE id=$formid”;
$sqll=”SELECT design FROM 4zgc14mywebsitetransfercom_1667397749.wp_fsq_form WHERE id=$formid”;
$fname= $wpdb->get_var($sql);
$testing= $wpdb->get_var($sqll);

$sections=((substr_count($fname, ‘”title”‘))-1);
//echo “Number of sections>”.$sections.PHP_EOL;
$finda='”title”‘;
$findb=”subtitle”;

$headings=array();$totalq=array();

for ($x = 2; $x <= $sections; $x++) { $sectiona=strposx($fname,"timer",$x); $sectionb=strposx($fname,"timer",$x+1); $newsection=substr($fname,$sectiona,($sectionb-$sectiona)); $quests=substr_count($newsection,"container"); //echo "Quests>“.$quests;
$totalq[$x-1]=$quests;
$posa=strposx($fname,$finda,$x+1);
$posb=strposx($fname,$findb,$x+1);
$newstring=substr($fname,$posa+10,(($posb-10)-$posa));
$quotestart=strposx($newstring,'”‘,1);
$quoteend=strposx($newstring,'”‘,2);
$newstring=substr($newstring,$quotestart+1,(($quoteend-$quotestart)-1));
//echo $newstring.PHP_EOL;
$headings[$x-1]=$newstring;
}
//print_r($headings);
//print_r($totalq);

//echo $fname.PHP_EOL.PHP_EOL;

//mysql_close();

function rev ($string, $char)
{
if (false !== strrpos ($string, $char))
{
return strlen ($string) – strrpos ($string, $char) – 1;
}
}

function strposX($haystack, $needle, $number){
if($number == ‘1’){
return strpos($haystack, $needle);
}elseif($number > ‘1’){
return strpos($haystack, $needle, strposX($haystack, $needle, $number – 1) + strlen($needle));
}else{
return error_log(‘Error: Value for parameter $number is out of range’);
}
}

//extract sub questions

$count=0;$qnumber=0;
$subq=array();

foreach($headings as $key => $value) {

for ($x = 1; $x <= $totalq[$key]; $x++) {$finder="Question P".($x+$qnumber); //echo $finder.PHP_EOL; $whereit=strpos($testing,$finder); $keepers=substr($testing ,0,$whereit); $whereit2=rev($keepers,"richtext"); $whereit3=strlen($keepers)-$whereit2; $lengy=$whereit3-$whereit; //echo "HERE ".$whereit." IS IS ".$whereit3." LENG>“.$lengy.PHP_EOL;
$mememe=substr($testing,$whereit3,($whereit-$whereit3));
$gobegin=strposx($mememe,”:”,4);
$goend=strposx($mememe,”:”,5);
$tada=substr($mememe,$gobegin+2,($goend-$gobegin)-5);
$count=$count+1;$subq[$count]=$tada;
//echo $tada.PHP_EOL;
}
$qnumber=$qnumber+$totalq[$key];
}
//print_r($subq);

$resulttable=”wp_fsqm_direct_”.$formid;

$sqll=”SELECT count(id) FROM $resulttable”;
$resulter= $wpdb->get_var($sqll);
//echo “SQL is “.$sqll.PHP_EOL;
//echo “THIS IS IT>”.$resulter.PHP_EOL;

$sql=”SELECT * FROM $resulttable WHERE pinfo1=’$uem'”;
//echo $sql;
$resultz= $wpdb->get_row($sql);
//print_r($resultz);

$userinput=array();$count=0;

foreach ($resultz as $key => $value) {
$subs = substr($key, 0, 3);
if ($subs==”mcq”){$count=$count+1;$userinput[$count]=$value;}
}
//print_r($userinput);
$len = count($userinput);
$r= array_slice($userinput,0, $len / 2);
$p=array_slice($userinput, $len / 2);
//print_r($r);print_r($p);
$len = count($headings);
$newheadings= array_slice($headings,0, $len / 2);
//print_r($newheadings);

[/insert_php]

[content_band style=”color: #333;” bg_color=”#ffddea” border=”all” inner_container=”true”] [custom_headline style=”margin-top: 0;” level=”h3″ looks_like=”h3″]Control Panel[/custom_headline]

[tab_nav type=”three-up”][tab_nav_item title=”Individual Responses” active=”true”][tab_nav_item title=”Training priority breakdown” active=””][tab_nav_item title=”Personalised needs” active=””][/tab_nav]

[insert_php]

echo “

Viewing results for: “.$uem.”

“.PHP_EOL;

echo “

Highlighted fields are those which are relevant

“; echo “


“; $count=0; foreach ($newheadings as $key => $value) { $cband=”[content_band style=’color: #333;’ bg_color=’#ffddea’ border=’all’ inner_container=’true’][custom_headline style=’margin-top: 0;’ level=’h4′ looks_like=’h3′]”.$value.”[/custom_headline]”; echo “

“.$value.”

“; //echo $cband;

//echo “KEY “.$key.PHP_EOL; if ($key==0){$adder=1;} ELSE {$adder=0;} echo “

“;

for ($x=1;$x<=$totalq[$key+1]+$adder;$x++){ echo "

“; } echo “
“;

if ($r[$count-1]>4){echo ““.$subq[$count].”“;} else {echo $subq[$count];} $differ=$r[$count-1]-$p[$count-1]; //echo $differ; //echo $count.PHP_EOL; echo “

“; //echo $r[$count-1].$p[$count-1];

$need=””; if ($r[$count-1]>4){ if ($differ>3) {$need=”Serious training need”;} elseif ($differ>1) {$need=”Training need that should be satisfied”;} }

echo $need;//echo $differ; $count=$count+1; echo “

“;

} [/insert_php]

[insert_php] $count=0;$relev=array();$counter2=0; foreach ($newheadings as $key => $value) { $relevcount=0; $cband=”[content_band style=’color: #333;’ bg_color=’#ffddea’ border=’all’ inner_container=’true’][custom_headline style=’margin-top: 0;’ level=’h4′ looks_like=’h3′]”.$value.”[/custom_headline]”; //echo $cband;

//echo “KEY “.$key.PHP_EOL; if ($key==0){$adder=1;} ELSE {$adder=0;} //echo “

“;

for ($x=1;$x<=$totalq[$key+1]+$adder;$x++){ echo "

“; } //echo “
“;

if ($r[$count-1]>4){//echo ““.$subq[$count].”“; $relevcount=$relevcount+1;} else {//echo $subq[$count]; } $differ=$r[$count-1]-$p[$count-1]; //echo $differ; //echo $count.PHP_EOL; //echo “

“; //echo $r[$count-1].$p[$count-1];

$need=””; if ($r[$count-1]>4){ if ($differ>3) {$need=”Serious training need”;} elseif ($differ>1) {$need=”Training need that should be satisfied”;} }

//echo $need;//echo $differ; $count=$count+1; //echo “

“; $relev[$counter2]=$relevcount;$counter2=$counter2+1; } //print_r($relev); //print_r($totalq);

$cband=”[content_band style=’color: #333;’ bg_color=’#ffddea’ border=’all’ inner_container=’true’][custom_headline style=’margin-top: 0;’ level=’h4′ looks_like=’h3′]Relevance to job by theme[/custom_headline]”; echo $cband;

foreach ($relev as $key => $value){ //echo $value.”>”.$totalq[$key+1].PHP_EOL; $pct=round(($value/$totalq[$key+1])*100); $codify=”[skill_bar style=’background-color: #222′ heading=’$newheadings[$key]’ percent=”.$pct.”%]”; $codify=”

’$newheadings[$key
80%
’ percentage=”.$pct.” color=’#2ecc71′ show_percent=’true’]”; echo do_shortcode($codify); } [/insert_php]

[insert_php] $count=0;$relev=array();$counter2=0;$prioritycount=array(); foreach ($newheadings as $key => $value) { $relevcount=0;$priority=0; $cband=”[content_band style=’color: #333;’ bg_color=’#ffddea’ border=’all’ inner_container=’true’][custom_headline style=’margin-top: 0;’ level=’h4′ looks_like=’h3′]”.$value.”[/custom_headline]”; //echo $cband;

//echo “KEY “.$key.PHP_EOL; if ($key==0){$adder=1;} ELSE {$adder=0;} //echo “

“;

for ($x=1;$x<=$totalq[$key+1]+$adder;$x++){ echo "

“; } //echo “
“;

if ($r[$count-1]>4){//echo ““.$subq[$count].”“; $relevcount=$relevcount+1;} else {//echo $subq[$count]; } $differ=$r[$count-1]-$p[$count-1]; //echo $differ; //echo $count.PHP_EOL; //echo “

“; //echo $r[$count-1].$p[$count-1];

$need=””; if ($r[$count-1]>4){ if ($differ>3) {$need=”Serious training need”;$priority=$priority+2;} elseif ($differ>1) {$need=”Training need that should be satisfied”;$priority=$priority+1;} }

//echo $need;//echo $differ; $count=$count+1; //echo “

“; $relev[$counter2]=$relevcount; $prioritycount[$counter2]=$priority; $counter2=$counter2+1; } //print_r($relev); //print_r($totalq);

$cband=”[content_band style=’color: #333;’ bg_color=’#ffddea’ border=’all’ inner_container=’true’][custom_headline style=’margin-top: 0;’ level=’h4′ looks_like=’h3′]Training deficit by theme[/custom_headline]”; echo $cband;

foreach ($prioritycount as $key => $value){ //echo $value.”>”.$totalq[$key+1].PHP_EOL; $pct=round(($value/($totalq[$key+1]*2))*100); $codify=”[skill_bar style=’background-color: #222′ heading=’$newheadings[$key]’ percent=”.$pct.”%]”; $codify=”

’$newheadings[$key
80%
’ percentage=”.$pct.” color=’#2ecc71′ show_percent=’true’]”; echo do_shortcode($codify); } //print_r($prioritycount); //print_r($totalq); [/insert_php]

[insert_php] $count=0;$relev=array();$counter2=0;$prioritycount=array();$newpctt=array();$kounter=0; foreach ($newheadings as $key => $value) { $relevcount=0;$priority=0; $cband=”[content_band style=’color: #333;’ bg_color=’#ffddea’ border=’all’ inner_container=’true’][custom_headline style=’margin-top: 0;’ level=’h4′ looks_like=’h3′]”.$value.”[/custom_headline]”; //echo $cband;

//echo “KEY “.$key.PHP_EOL; if ($key==0){$adder=1;} ELSE {$adder=0;} //echo “

“;

for ($x=1;$x<=$totalq[$key+1]+$adder;$x++){ echo "

“; } //echo “
“;

if ($r[$count-1]>4){//echo ““.$subq[$count].”<\mark>“; $relevcount=$relevcount+1;} else {//echo $subq[$count]; } $differ=$r[$count-1]-$p[$count-1]; //echo $differ; //echo $count.PHP_EOL; //echo “

“; //echo $r[$count-1].$p[$count-1];

$need=””; if ($r[$count-1]>4){ if ($differ>3) {$need=”Serious training need”;$priority=$priority+2;} elseif ($differ>1) {$need=”Training need that should be satisfied”;$priority=$priority+1;} }

//echo $need;//echo $differ; $count=$count+1; //echo “

“; $relev[$counter2]=$relevcount; $prioritycount[$counter2]=$priority; $counter2=$counter2+1; } //print_r($relev); //print_r($totalq);

$cband=”[content_band style=’color: #333;’ bg_color=’#ffddea’ border=’all’ inner_container=’true’][custom_headline style=’margin-top: 0;’ level=’h4′ looks_like=’h3′]Overall training priority[/custom_headline]”; echo $cband;

for ($x = 0; $x <= count($prioritycount)-1; $x++){ $pct=round(($prioritycount[$x]/($totalq[$x+1]*2))*100); $pctt=round(($relev[$x]/$totalq[$x+1])*100); $newpct=round(($pctt/100)*$pct); $codify="[skill_bar heading='$newheadings[$x]' percent=".$newpct."%]"; $codify="[skillbar title='$newheadings[$x]' percentage=".$newpct." color='#2ecc71' show_percent='true']"; $newpctt[$kounter]=$newpct;$kounter=$kounter+1; echo do_shortcode($codify); } print_r($high); [/insert_php] [/tab][tab] [insert_php] $count=0;$relev=array();$counter2=0;$prioritycount=array(); $counter3=0;;$low=array();$high=array();$counter4=0;$highsc=array(); foreach ($newheadings as $key => $value) { $relevcount=0;$priority=0; $cband=”[content_band style=’color: #333;’ bg_color=’#ffddea’ border=’all’ inner_container=’true’][custom_headline style=’margin-top: 0;’ level=’h4′ looks_like=’h3′]Personalised Training Needs[/custom_headline]”; //echo $cband;

//echo “KEY “.$key.PHP_EOL; if ($key==0){$adder=1;} ELSE {$adder=0;} //echo “

“;

for ($x=1;$x<=$totalq[$key+1]+$adder;$x++){ echo "

“; } //echo “
“;

if ($r[$count-1]>4){//echo ““.$subq[$count].”<\mark>“; $relevcount=$relevcount+1;} else {//echo $subq[$count]; } $differ=$r[$count-1]-$p[$count-1]; //echo $differ; //echo $count.PHP_EOL; //echo “

“; //echo $r[$count-1].$p[$count-1];

$need=””; $ok=0; if ($r[$count-1]>4){ if ($differ>3) {$highsc[$counter3]=$differ.”!”.$value;$need=”Serious training need”;$priority=$priority+2;$high[$counter3]=$subq[$count];$counter3=$counter3+1;} elseif ($differ>1) {$ok=2;$need=”Training need that should be satisfied”;$priority=$priority+1;$low[$counter4]=$subq[$count];$counter4=$counter4+1;} } //echo $need;//echo $differ; $count=$count+1; //echo “

“; $relev[$counter2]=$relevcount; $prioritycount[$counter2]=$priority; $counter2=$counter2+1; } //print_r($relev); //print_r($totalq);

$cband=”[content_band style=’color: #333;’ bg_color=’#ffddea’ border=’all’ inner_container=’true’][custom_headline style=’margin-top: 0;’ level=’h4′ looks_like=’h3′]Personalised Training Needs[/custom_headline]”; echo $cband;

for ($x = 0; $x <= count($prioritycount)-1; $x++){ $pct=round(($prioritycount[$x]/($totalq[$x+1]*2))*100); $pctt=round(($relev[$x]/$totalq[$x+1])*100); $newpct=round(($pctt/100)*$pct); $codify="[skill_bar heading='$newheadings[$key]' percent=".$newpct."%]"; $codify="[skillbar title='$newheadings[$key]' percentage=".$newpct." color='#2ecc71' show_percent='true']"; //echo do_shortcode($codify); } echo "

“; echo “

“; echo “

“;echo “Must be satisfied“; echo “

“;echo “Should be satisfied“;echo “

“; foreach ($high as $key => $value) { echo “

  • “.$value.PHP_EOL;} echo “

  • “; foreach ($low as $key => $value) { echo “

  • “.$value.PHP_EOL;} echo “
  • “;

    foreach ($highsc as $key => $value) { $stringer=$value; $pos = strpos($stringer, “!”)+1; $len=strlen($stringer); $newstring=substr($stringer,$pos,$len-$pos); $subscore=substr($stringer,0,$pos-1); //echo $newstring.PHP_EOL;echo $subscore.PHP_EOL; $multiplier=array_search($newstring,$newheadings).PHP_EOL; //echo “Subscore:”.$subscore.”Multiplier”.$multiplier.”“; //echo “Going to”.$newpctt[intval($multiplier)].”“; $weight=$subscore*$newpctt[intval($multiplier)]; $weighter[$key][0]=$weight;$weighter[$key][1]=$high[$key]; } //print_r($weighter);

    rsort($weighter);

    $cband=”[content_band style=’color: #333;’ bg_color=’#ffddea’ border=’all’ inner_container=’true’][custom_headline style=’margin-top: 0;’ level=’h4′ looks_like=’h3′]Personalised, Prioritised Training Needs[/custom_headline]”; echo $cband;

    echo “

    Top priority

    “;

    foreach ($weighter as $key => $value) { echo ($key+1).”. “.$value[1].PHP_EOL;}

    [/insert_php]