$this->load->library('zipcode');
//20001 is Washington, DC
//36083 is Tuskegee, AL
$this->zipcode->get_distance(20001, 36083);
Distance between 20001 and 36083 is 662.4 milesYou must install the zipcode database table from here. The table name is "zip_code".
echo img_tag('car.jpg', array('alt' => 'Sample Image', 'title' => 'Sample Image', 'width' => 450, 'height' => 320));

echo img_src('sample.jpg')
echo jscript('sample.js');
echo style('sample.css');
class Welcome extends Controller
{
function Welcome()
{
parent::Controller();
$this->xajax->registerFunction(array('gimme_inflection',&$this,'gimme_inflection'));
$this->xajax->processRequest();
}
function index()
{
$view['xajax_js'] = $this->xajax->getjavascript('assets/js/');
$this->load->view('welcome_message', $view);
}
function gimme_inflection($data, $what)
{
$this->load->library('form_validation');
$this->load->helper('inflector');
//new xajax response object
$response = new xajaxResponse();
$this->form_validation->set_rules('value', 'Your word', 'required|min_length[3]');
foreach($data as $id => $field)
{
$_POST[$id] = $field;
}
$word = $data['value'];
$$what = $what($word); // either $plural or $singular
if ($this->form_validation->run())
{
if($what == 'singular')
{
$opposite = 'plural';
}
if($what == 'plural')
{
$opposite = 'singular';
}
//Assign the value to a div
$response->Assign($what . '-span', 'innerHTML', $$what);
$response->Assign($opposite . '-span', 'innerHTML', '');
$response->Assign('value', 'value', $$what);
}
else
{
$this->form_validation->set_error_delimiters('', '');
$response->Alert(form_error('value'));
}
//returns the response
return $response;
}
}
<form name="inflection">
<p>Enter a word:</p>
<input id="value" name="value" />
<input type="button" onclick="xajax_gimme_inflection(xajax.getFormValues('inflection'), 'plural');" value="Plural!" />
<input type="button" onclick="xajax_gimme_inflection(xajax.getFormValues('inflection'), 'singular');" value="Singular!"/>
</form>
<h4>Singular: <span id="singular-span"></span></h4>\
<h4>Plural: <span id="plural-span"></span></h4>
View "sample.htm" fetched via Ajax
<p><a href="sample.htm" rel="facebox">View "sample.htm" fetched via Ajax</a></p>
Lightbox is an elegant, unobtrusive script that overlays a larger version of an image on the current page for display when clicked on- an image thumbnail viewer if you will. It's a snap to setup and works on all modern browsers.
Sample Image
<?php echo img_src('gallery/1.png'); rel="lightbox" title="sample image desc">Sample Image</a>or
<?php echo img_src('gallery/1.png'); rel="lightbox[group1]" title="sample image desc">Sample Image</a>
You will have to edit assets/js/lightbox.js to give the proper location of closelabel.gif and loading.gif
<style>
h3.red {
color:#FF0000;
font-weight:bold;
font-size:18px;
}
h3.big-purple {
color:#663399;
font-size:24px;
}
</style>
<script language="javascript" src="http://www.gandylabs.com/assets/css/facelift/flir.js">
<script type="text/javascript">
FLIR.init( { path: 'http://www.gandylabs.com/assets/css/facelift/' } );
FLIR.auto([ 'h1', 'h2', 'h3.red', 'h3.big-purple']);
</script>
Package created by Gandy Labs