Cycle Coach

mail;
$clientId= ‘RoadCC’;
$clientToken=’c0f88c7399c2445aba80806580a86403′;
$host=’www.trainsmart.com’;
$request = ‘http://’.$host.’/SmartServices/clientAccess/getUserToken?clientId=’.$clientId.’&email=’.$email.’&clientToken=’.$clientToken.”;
// Make the request
$response = file_get_contents($request);
$trainsmartResponse = simplexml_load_string($response);
//
$token =$trainsmartResponse->accessToken;
//
//create event
if (isset($_POST[‘eventType’])):
$eventName = isset($_POST[“eventName”]) ? $_POST[“eventName”] : ”;
$eventType = isset($_POST[“eventType”]) ? $_POST[“eventType”] : ”;
$eventStartDate = isset($_POST[“eventStartDate”]) ? $_POST[“eventStartDate”] : ”;
$sportType = isset($_POST[“sportType”]) ? $_POST[“sportType”] : ”;
$productSku = isset($_POST[“productSku”]) ? $_POST[“productSku”] : ”;
$eventPrice = isset($_POST[“eventPrice”]) ? $_POST[“eventPrice”]: ”;

//setting up the request to add the new event
$addEventRequest = ‘https://’.$host.’/SmartServices/external/’.$clientId.’/addEvent’;
$payload =’‘.$clientToken.’‘.$email.’‘.$eventName.’‘.$eventStartDate.’‘.$sportType.’‘.$eventType.’‘.$productSku.’‘.$eventPrice.’‘;

//print $payload;

//Just to make sure xml is well formatted
$addEventRequestPayload =simplexml_load_string($payload,’SimpleXMLElement’,LIBXML_NOCDATA);

$stream_options = array(
‘http’ => array(
‘method’ => ‘POST’,
‘header’ => ‘Content-type: application/xml’ . “rn”,
‘content’ => $payload));

$context = stream_context_create($stream_options);
$response = file_get_contents($addEventRequest, null, $context);
//echo $response;
endif;
if ($user->uid):
?>

//For testing SSO use something like this: flashvars.clientUserId = ""; flashvars.clientSecToken = ""; flashvars.isPurchasingEvent = "";

var params = {}; params.quality = "high"; params.play = "true"; params.loop = "true"; params.wmode = "window"; params.scale = "showall"; params.menu = "true"; params.devicefont = "false"; params.salign = ""; params.allowscriptaccess = "always"; params.allowFullScreen = "true"; var attributes = {}; attributes.align = "middle"; swfobject.embedSWF( "http:///SmartZones/SmartZones.swf", "flashContent", "960", "700", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);

Get Adobe Flash player

This page requires Flash Player version 10.0.0 or higher.