<?php
if (!class_exists('MySqlHelper')) require_once("../MySqlHelper.class.php");
if (!class_exists('crmHelper')) require_once("../class/crmHelper.class.php");

MySqlHelper::getInstance()->query("SELECT * FROM `cl_hlusers`.`webform_results` order by session_id asc");
$res = MySqlHelper::getInstance()->fetchAssoc();
$privatekey = crmHelper::GetWebformPrivateKey();

//echo substr($res[0]['result'], 10);

/*header('Content-Type: text/xml; charset=utf-8');
header('Content-Disposition: inline; filename=response.xml');
echo '<Results>';
foreach ($res as &$results) {
    echo crmHelper::decode($privatekey, $results["session_id"], substr($results["result"], 10));
}
echo '</Results>'*/

echo base64_decode("c2Vzc2lvbj0yeHkkdW5oaUVFSGhVc0tCY3ZVbjdR&pkey=20I6Qfyl_9HgPExgHpqO_W");
