<div class="testimonial-data">
	            <h1><?php 
    echo $testi->post_title;
    ?>
</h1>
	            <div class="row">
								<div class="col-md-4">
									<dl>
									  <dt>Birth Date</dt>
									  <dd><?php 
    echo birthdate($testi->ID);
    ?>
</dd>
									  <dt>Weight</dt>
									  <dd><?php 
    echo weight($testi->ID);
    ?>
</dd>
									  <dt>Height</dt>
									  <dd><?php 
    echo height($testi->ID);
    ?>
</dd>
									  <dt>Country</dt>
									  <dd><?php 
    echo country($testi->ID);
    ?>
</dd>
									  <dt>Shaft</dt>
									  <dd><?php 
    echo shaft($testi->ID);
Пример #2
0
        $_SESSION['refresh'] = 'false';
    } else {
        $places = $_SESSION['places'];
    }
}
print_r($_SESSION);
//users history
$userevents = getevents($user);
//sanitise data
//yelp
$places = sanitise($places, $userevents);
// get user tags
$usertags = gettags($user);
// weight yelp
for ($i = 0; $i < count($places); $i++) {
    $places[$i] = weight($places[$i], $usertags);
}
//sort yelp
$places = sortevents($places);
$places = array_values($places);
$_SESSION['places'] = $places;
$userlat = $_SESSION['userlat'];
$userlong = $_SESSION['userlong'];
//display top
$suggestion = $places[0];
$postcode = $suggestion['postcode'];
//enrich with foursquare
//geocode to get lat long
$latlong = geocodepost($postcode);
$suggestion['latlong'] = $latlong;
//get foursquare id
Пример #3
0
} else {
    if (isset($_POST['cmd'])) {
        $cmd = $_POST['cmd'];
    }
}
switch ($cmd) {
    case "add":
        add($_POST['page_menu_id']);
        break;
    case "finishAdd":
        finishAdd($_POST['page_menu_id'], $_POST['page_parent'], $_POST['page_label'], $_POST['page_title'], $_POST['page_body']);
        break;
    case "edit":
        edit($_GET['pid']);
        break;
    case "finishEdit":
        finishEdit($_POST['pid'], $_POST['page_menu_id'], $_POST['page_parent'], $_POST['page_label'], $_POST['page_title'], $_POST['page_body']);
        break;
    case "delete":
        deletePage($_GET['pid']);
        break;
    case "move":
        move($_POST['pid'], $_POST['page_menu_id']);
        break;
    case "weight":
        weight($_GET['op'], $_GET['id']);
        break;
    default:
        main();
        break;
}
Пример #4
0
//yelp
$yelp = sanitise($yelp, $userevents);
//eventful
if ($eventful) {
    $eventful = sanitise($eventful, $userevents);
}
// get user tags
$usertags = gettags($user);
// weight yelp
for ($i = 0; $i < count($yelp); $i++) {
    $yelp[$i] = weight($yelp[$i], $usertags);
}
//weight eventful
if ($eventful) {
    for ($i = 0; $i < count($eventful); $i++) {
        $eventful[$i] = weight($eventful[$i], $usertags);
    }
}
//sort yelp
$yelp = sortevents($yelp);
//sort eventful
if ($eventful) {
    $eventful = sortevents($eventful);
}
//pick top
if ($eventful) {
    $suggestion = topevent($yelp[0], $eventful[0]);
    if ($suggestion['name'] == $_SESSION['suggestion']['name']) {
        $suggestion = $yelp[1];
    }
    $_SESSION['suggestion'] = $suggestion;
Пример #5
0
        if ($i != $selected && $value >= $weights[$selected]) {
            return -1;
        }
    }
    return $selected;
}
$imagePath = './images/0.png';
//$imagePath = './images/1.jpg';
$formulario = new \Imagick(realpath($imagePath));
foreach ($regions as $region => $question) {
    $weights = [-1];
    for ($i = 0; $i < count($question['options']); $i++) {
        list($width, $height, $x, $y) = $question['options'][$i];
        $box = $formulario->clone();
        $box->cropImage($width, $height, $x, $y);
        $weights[] = weight($box);
    }
    // TODO: controlar pesos por si hai respostas en branco
    echo "Opción seleccionada: " . selected($weights) . PHP_EOL;
}
//$square->blackThresholdImage('grey');
//$square->contrastImage(true);
//
//$similarity = null;
//$bestMatch = null;
//$comparison = $imagick2->subImageMatch($square, $bestMatch, $similarity);
/*
$similarity->setImageFormat('png');
$similarity->writeImage('images/similarity.png');*/
//var_dump($similarity);
//var_dump($bestMatch);