This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The JavaScript | |
It's important to point out that Titanium's Titanium.XML.DOMDocument object implements DOM2-level structures. Here's the magic XML to JSON code: | |
*/ | |
// Changes XML to JSON | |
function xmlToJson(xml) { | |
// Create the return object | |
var obj = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML::macro('table', function($fields = array(), $table_fields = array(), $data = array(), $resource, $status = true, $showEdit = true, $showDelete = true, $showView = true) | |
{ | |
$table = '<table id="sample-table-2" class="table table-striped table-bordered table-hover well datatables">'; | |
$table .='<thead>'; | |
$table .='<tr>'; | |
foreach ($table_fields as $table_field) | |
{ | |
$table .= '<th>' . Str::title($table_field) . '</th>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get the current user that will be the origin of our operations | |
$currentUser = User::find(10); | |
// Get ID of a User whose autoincremented ID is less than the current user, but because some entries might have been deleted we need to get the max available ID of all entries whose ID is less than current user's | |
$previousUserID = User::where('id', '<', $currentUser->id)->max('id'); | |
// Same for the next user's id as previous user's but in the other direction | |
$nextUserID = User::where('id', '>', $currentUser->id)->min('id'); |
NewerOlder