retriveLinks("cybercolleges",$countryCode); //$countryCode = "au"; $arrCyber = $cyberObj->cyberCourseDetails($id,$countryCode); /* function cyberCourseDetails($id,$countryCode){ $con = mysql_connect("localhost","tcicontr_vs143739","vs143739"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("tcicontr_vs1437391", $con); if($id){ $sql = "SELECT user.sku,user.users,cyber.id,cyber.typeId,cyber.name,cyber.description,cyber.image,cat.name AS category,cat.id AS categoryId, pr.$countryCode FROM cyber_users AS user ,cyber_master AS cyber, cyber_price AS pr, category_master AS cat WHERE user.cyberId =cyber.id AND user.sku=pr.sku AND user.cyberId=$id AND cyber.categoryId= cat.id ORDER BY user.sku ASC"; $rs = mysql_query($sql); $cyber = array(); $cyberId = 0; while($row = mysql_fetch_array($rs)){ if($cyberId != $row['id']){ $cyberId = $row['id']; $cyber[$cyberId]['id'] = $row['id']; $cyber[$cyberId]['typeId'] = $row['typeId']; $cyber[$cyberId]['category'] = $row['category']; $cyber[$cyberId]['name'] = $row['name']; $cyber[$cyberId]['description'] = $row['description']; $cyber[$cyberId]['image'] = $row['image']; $cyber[$cyberId]['categoryId'] = $row['categoryId']; } $cyber[$cyberId]['USERS'][] = array( sku => $row['sku'], users => $row['users'], price => $row[$countryCode] ) ; }//end if while return $cyber; }//end if if $id mysql_close($con); } */ $currency = $countryObj->getCurrency($countryCode); $storeName =$countryObj->getStoreName($countryCode); if($_SERVER['REQUEST_METHOD']=="POST"){ $id = $_POST['id']; $enrollments = $_POST['enrollments']; if($id){ if(!$enrollments)$enrollments = 1; $skuArr = $cyberObj->getSku($id,$enrollments); $sku = $skuArr['sku']; } $urlstring= array("code" => $sku, "qty" => $enrollments, "action" =>"add" ); $crl = curl_init(); $url = "http://carts.mercurycart.com/$storeName/files/index.html "; curl_setopt($crl, CURLOPT_URL, $url); curl_setopt($crl, CURLOPT_POST, 1); curl_setopt($crl, CURLOPT_POSTFIELDS, $urlstring); // grab URL and pass it to the browser $data= curl_exec($crl); // close CURL resource, and free up system resources curl_close($crl); header("location:http://carts.mercurycart.com/$storeName/files/index.html?code=$sku&action=add&qty=$enrollments"); // header("location:http://carts.mercurycart.com/utils/setup_demo_tci.php"); } require(F_PATH."/tpl/modules/cyber/ncyberDetails.tpl.php"); require(F_PATH."/app/includes/nfooter.inc.php"); ?>