Google Local SearchThis is a featured page

Here a demo with Google Local Search
Demo
http://www.danieljordan.de/COD

Login in your COD

Login from a PHP in Siebel COD


Search with Google Local

After you looking you can search on Google Local.
COD Session is displayed

Filter on Location


Filter Address on Location

Find Address
The Copy Button will copy the Address to Siebel COD

Siebel Log

The Data is stored in your COD


How to

First i use PHP with Nusoap on this demo

index.php

<?php include('auth.php'); ?>
<?php include('renew_session.php');?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Daniel Jordan Siebel on Demand Intration with Google Local Search</title>
<link rel='stylesheet' href='http://www.danieljordan.de/COD/login.css' type='text/css' media='all' />
<link rel='stylesheet' href='http://www.danieljordan.de/COD/colors-fresh.css' type='text/css' media='all' />
<script src="http://www.google.com/jsapi?key=your_key"></script>
<script type="text/javascript">


google.load('search', '1');

function OnLoad() {
var searchControl = new google.search.SearchControl();
var localSearch = new google.search.LocalSearch();
searchControl.addSearcher(localSearch);

// Set the Local Search center point
<?
$_SESSION["last_q"]=$_GET["q"];
$_SESSION["Last_loc"]=$_GET["loc"];
?>
var query = "<?PHP echo($_GET['q']); ?>";
var loc = "<?PHP echo($_GET['loc']); ?>";
localSearch.setCenterPoint(loc);
// create a drawOptions object
searchControl.setOnKeepCallback(this, MyKeepHandler,"Copy to Siebel");
var drawOptions = new google.search.DrawOptions();

// tell the searcher to draw itself in linear mode
drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_LINEAR);
searchControl.draw(document.getElementById("content"), drawOptions);
// tell the searcher to draw itself and tell it where to attach


// execute an inital search
if(query) {
searchControl.execute(query);
}

}
function MyKeepHandler(result) {

// clone the result html node
var node = result.html.cloneNode(true);


$title = result.titleNoFormatting;
$street = result.streetAddress;
$city = result.city;
$region = result.region;
$country = result.country;
$zipcode = result.zipcode;
$url = result.url;
if (result.phoneNumbers && result.phoneNumbers.length > 0) {
$phone = result.phoneNumbers[0].number;
} else {
$phone = "unknown";
}


location.href="http://www.danieljordan.de/COD/saveaccount.php?titel=" + escape($title) + '&street=' + escape($street)+ '&city=' + escape($city) + '&zip=' + escape($zipcode) + '&region=' + escape($region) +'&country='+ escape($country) + '&URL=' + escape($url) + '&phone' + escape($phone) ;

// attach it
//var savedResults = document.getElementById("saved_results");
//savedResults.appendChild(node);
}
google.setOnLoadCallback(OnLoad);

</script>
</head>


<body style="font-family: Arial;border: 0 none;">
<div id="content">Loading...</div>
<p id="nav">
<a href="http://www.danieljordan.de/COD/logout.php" title="Logout">Logout</a>
Your COD SessionId <? echo $_SESSION['COD_SESSION'] ?>

</p>



</body>
</html>

Login in your COD renew_session.php

<?php
$username = $_SESSION['COD_USER'];
$password = $_SESSION['COD_PWD'];
$server = $_SESSION['COD_SERVER'];
$SessionId = wslogin($server,$username,$password);
$_SESSION['COD_SESSION'] = $SessionId;

function wslogin($server,$username,$password) {
$url = $server . "/Services/Integration?command=login";
$page = "/Services/Integration?command=login";
$headers = array(
"GET ".$page." HTTP/1.0",
"UserName:" . $username,
"Password:" . $password,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, true);
$data = curl_exec($ch);
if (!curl_errno($ch)) {
// Show me the result
$sessionid = substr($data,(strpos($data,"Set-Cookie:")+23),(strpos($data,";")-strpos($data,"Set-Cookie:")-23));
curl_close($ch);
return $sessionid;
}

}
?>

Save your Account
saveaccount.php
<?php include('auth.php'); ?>
<?php include('renew_session.php');?>

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Daniel Jordan Siebel on Demand Intration with Google Local Search</title>
<link rel='stylesheet' href='http://www.danieljordan.de/COD/login.css' type='text/css' media='all' />
<link rel='stylesheet' href='http://www.danieljordan.de/COD/colors-fresh.css' type='text/css' media='all' />
</head>


<?

$SessionId = $_SESSION['COD_SESSION'];
$Server = $_SESSION['COD_SERVER'];
$titel = $_GET["titel"];
$street = $_GET["street"];
$city = $_GET["city"];
$zipcode = $_GET["zipcode"];
$region = $_GET["region"];
$country = $_GET["country"];
$phone = $_GET["phone"];


echo '<body style="font-family: Arial;border: 0 none;">';


echo '<div id="content">Titel <br>' . $titel . '</div>';

$Sessionid = $_SESSION['COD_SESSION'];
echo '<p id="nav"><a href="http://www.danieljordan.de/COD/logout.php" title="Logout">Logout </a><a href="http://www.danieljordan.de/COD/index.php" title="Search"> Back to Search</a></p>';
echo '<p id="nav"> Your COD SessionId' . $SessionId . '</p>';



$response = getAccountInsert($Server,$SessionId,$titel,$street,$city,$zipcode,$region,$country,$phone);
echo "Insert Account <br>";

print_r($response);

echo '</body>';

function getAccountInsert ($server,$sessionid,$titel,$street,$city,$zipcode,$region,$country,$phone) {

$serverpath = $server . "/Services/Integration;jsessionid=$sessionid";
$namespace= "urn:crmondemand/ws/account/10/2004";
$soapaction = "document/urn:crmondemand/ws/account/10/2004:AccountInsert";
$param = "<ListOfAccount>
<Account>
<IntegrationId/>
<AccountName>" . $titel . "</AccountName>
<MainPhone>" . $phone . "</MainPhone>
<MainFax/>
<Location>" . $city . " " . $region . "</Location>
<WebSite/>
<PrimaryShipToCounty>" . $country . "</PrimaryShipToCounty>
<PrimaryShipToStreetAddress>" . $street . "</PrimaryShipToStreetAddress>
<PrimaryShipToCity>" . $city . "</PrimaryShipToCity>
<PrimaryShipToPostalCode>" . $zipcode . "</PrimaryShipToPostalCode>
</Account>
</ListOfAccount>
";



Find a demo on http://www.danieljordan.de/COD




dajor85570
dajor85570
Latest page update: made by dajor85570 , May 16 2009, 9:16 AM EDT (about this update About This Update dajor85570 Moved from: The Official Oracle Wiki - dajor85570

No content added or deleted.

- complete history)
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)