예제 #1
0
function error ($phrase) {
	global $cols;
	$args = func_get_args();
	array_shift($args);
	return '<tr id="error">
	<td colspan="' . $cols . '">' . phrase($phrase, $args) . '</td>
</tr>
';
}
예제 #2
0
	
	if ($article['url_spanish'] != "" 
		&& file_exists($config['dir_article'].$article['url_spanish'])) {
		if (!unlink($config['dir_article'].$article['url_spanish'])) {
			$possible_errors++;
		}
	}
	
	$db->query("DELETE FROM `article` WHERE `id`=".$db->sql($_GET['id']));
	
	if ($db->num_rows()) {
		if (!$possible_errors) {
			message($phrase['success_delete'], MESSAGE_SUCCESS);
		}
		else {
			message(phrase($phrase['success_minor_errors'], $possbible_errors));
		}
	}
	else {
		message($phrase['error_delete'], MESSAGE_ERROR);
	}
}
else {
	$result = $db->query("SELECT * FROM `article` WHERE 1 ORDER BY `weight` ASC, `name_english` ASC");
	
	$n = $db->num_rows();
	$i = 0;
	$logger->log('num rows', $n);
	while ($article = $db->fetch_array($result)) {
		$logger->log($i);
		eval('$html["articles"] .= "'.fetch_template('admin_article_bit').'";');
예제 #3
0
function prep_project_for_output(&$project) {
	global $phrase, $compiled_phrase, $config, $db, $symbol, $currency, $area;
	
	$project['rooms_min'] = convert_rooms($project['rooms_min']);
	$project['rooms_max'] = convert_rooms($project['rooms_max']);
	$project['area_min'] = convert_area($project['area_min']);
	$project['area_max'] = convert_area($project['area_max']);
	$project['price_min'] = convert_currency($project['price_min']);
	$project['price_max'] = convert_currency($project['price_max']);
	
	if ($project['photo'] == '') {
		$project['photo'] = $config['default_photo'];
	}
	else if (is_numeric($project['photo'])) {
		$project['photo'] = $db->query_result("SELECT `photo` FROM `project` WHERE `id`=".$db->sql($project['photo']));
	}
	
	if ($project['logo'] == '') {
		$project['logo'] = $config['default_logo'];
	}
	else if (is_numeric($project['logo'])) {
		$project['logo'] = $db->query_result("SELECT `logo` FROM `project` WHERE `id`=".$db->sql($project['logo']));
	}
	
	if ($project['banner'] == '') {
		$project['banner'] = $config['default_banner'];
	}
	else if (is_numeric($project['banner'])) {
		$project['banner'] = $db->query_result("SELECT `banner` FROM `project` WHERE `id`=".$db->sql($project['banner']));
	}
	
	$compiled_phrase['estrato'] = phrase(
										$phrase['x_de_estrato_y'], 
										($project['type'] == $config['project_type']['apartment'] ? $phrase['apartments'] : $phrase['houses']), 
										$project['estrato']);
	
	$compiled_phrase['rooms'] = phrase($phrase['de_x_a_y_habitaciones'], $project['rooms_min'], $project['rooms_max']);
	if ($project['rooms_min'] == $project['rooms_max'])
	{
		$compiled_phrase['rooms'] = phrase($phrase['de_x_habitaciones'], $project['rooms_min'], $project['rooms_max']);
	}
		$compiled_phrase['rooms'] = "test";
	
	$compiled_phrase['area'] = phrase($phrase['areas_de_x_hasta_y'], $project['area_min'].$area, $project['area_max'].$area);
	
	$compiled_phrase['price'] = phrase(
										($project['vende'] ? $phrase['ofertas_desde_x_hasta_y'] : $phrase['ofertas_desde_x_hasta_y']), 
										$symbol.$project['price_min'].' '.$currency, 
										$symbol.$project['price_max'].' '.$currency);
}
예제 #4
0
while ($apartment = $db->fetch_array($result)) {
	if ($apartment['plan'] == '') {
		$apartment['plan'] = $config['default_floorplan'];
	}
	
	$apartment['bedrooms'] = convert_rooms($apartment['bedrooms']);
	$apartment['bathrooms'] = convert_rooms($apartment['bathrooms']);
	$apartment['area_min'] = convert_area($apartment['area_min']);
	$apartment['area_max'] = convert_area($apartment['area_max']);
	$apartment['price_min'] = convert_currency($apartment['price_min']);
	$apartment['price_max'] = convert_currency($apartment['price_max']);
	
	$compiled_phrase['area'] = phrase($phrase['areas_de_x_hasta_y'], $apartment['area_min'].$area, $apartment['area_max'].$area);
	
	$compiled_phrase['price'] = phrase(
										($project['vende'] ? $phrase['ofertas_desde_x_hasta_y'] : $apartment['ofertas_desde_x_hasta_y']), 
										$symbol.$apartment['price_min'].' '.$currency, 
										$symbol.$apartment['price_max'].' '.$currency);
						
	if ($apartment['y'] > $config['size_mediabox']) {
		$multiplier = $config['size_mediabox']/$apartment['y'];
		$apartment['x'] *= $multiplier;
		$apartment['y'] = $config['size_mediabox'];
	}
					
	$html['javascript_inline_apartments'] .= '{src:"'.$config['url'].$config['dir_floorplan'].$apartment['plan'].'",caption:"",type:"jpg",width:"'.$apartment['x'].'",height:"'.$apartment['y'].'"},'."\n";

	eval('$html["apartments"] .= "'.fetch_template('project_apartment_bit').'";');
	
	$i++;
}