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
$(document).ready(function(){ | |
$('#getDatos').click(function(){ | |
$.ajax({ | |
url: 'consulta.php', | |
success: function(data){ | |
$("p").remove(); | |
console.log(data); //<=== Esta puede ser removida; | |
var datos = $.parseJSON(data); | |
console.log(datos); //<=== Esta puede ser removida; | |
$.each(datos, function(i, row) { |
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 | |
$cadena = "1"; | |
echo str_pad($cadena, 3, "0", STR_PAD_LEFT); | |
?> |
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
var tablaEntradas = $('#tableAjaxEntradas').DataTable(); | |
$.ajax({ | |
url: 'c_repor/obtenerEntradas', | |
dataType: 'json', | |
type: 'GET', | |
success: function(response){ | |
$.each(response, function(i, object){ | |
var datos = []; | |
var i = 0; |
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 | |
$interval = 7; | |
$fecha = '2015-02-25'; | |
$date = new DateTime(''.$fecha.''); | |
$date->add(new DateInterval('P'.$interval.'D')); | |
echo $date->format('Y-m-d') . "\n"; | |
?> |
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
var db = null; | |
var example = angular.module('starter', ['ionic', 'ngCordova']) | |
.run(function($ionicPlatform, $cordovaSQLite) { | |
$ionicPlatform.ready(function() { | |
if(window.cordova && window.cordova.plugins.Keyboard) { | |
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false); | |
} | |
if(window.StatusBar){ | |
StatusBar.styleDefault(); |
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 | |
$data1 = new stdClass; | |
$data1->id = 10; | |
$data1->url = 11; | |
$data1->otrodato = 12; | |
$data2 = new stdClass; | |
$data2->id = 13; | |
$data2->url = 14; |
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
DELETE n1 | |
FROM table1 n1, table1 n2 | |
WHERE n1.id > n2.id | |
AND n1.id_name = n2.id_name; | |
/* | |
* With this query you can | |
* delete the duplicate rows in one table (table1) | |
* ´WHERE n1.id > n2.id´ with this line you can keep the first row | |
* if you want keep the second row you need use ´WHERE n1.id < n2.id´ |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@admin | |
DocumentRoot /var/www/myproject.dev/public_html | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> |
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
/* | |
* Implementation with Ionic Framework with $cordovaFile plugin | |
* ngCordova. | |
*/ | |
.controller('Ctrl', function($scope, $cordovaFile) { | |
$scope.backupDatabase = function() { | |
// Backup Database ; | |
var URI_DB = cordova.file.applicationStorageDirectory+'databases/'; |
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
var var_object = { | |
'one': 'The first key', | |
'two': 'The second key', | |
'three': 'The third key' | |
}; | |
var size_object = Object.keys(var_object).length; | |
console.log('The size is: ' + size_object); // The size is: 3 ; |
OlderNewer