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
| INSERT INTO contents_languages ( | |
| id_content, | |
| id_language, | |
| friendly, | |
| title, | |
| abstract, | |
| text, | |
| place | |
| ) | |
| VALUES |
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
| AddDefaultCharset UTF-8 | |
| #Por defecto para todos | |
| AddCharset ISO-8850-1 .js | |
| #Cambiarlo para un conjunto de archivos |
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
| INSERT INTO tabla ( id, nombre, activo, fecha ) SELECT $id, $nombre, $activo, now() WHERE NOT EXISTS ( SELECT id FROM tabla WHERE nombre = $nombre AND activo = $activo ) |
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
| function generateMatricula() { | |
| $numbers = '0123456789'; | |
| $characters = 'BCDFGHIJKLMNPQRSTVWXYZ'; | |
| $randomString = ''; | |
| for ($i = 0; $i < 4; $i++) { | |
| $randomString .= $numbers[rand(0, strlen($numbers) - 1)]; | |
| } | |
| for ($i = 0; $i < 3; $i++) { | |
| $randomString .= $characters[rand(0, strlen($characters) - 1)]; | |
| } |
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
| $(this).find("input[type='checkbox']").prop("checked",function( i, val ) { return !val; }); |
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
| $.validator.addMethod('require-one', function (value) { | |
| return $('.require-one:checked').size() > 0; }, 'Please check at least one box.'); | |
| var checkboxes = $('.require-one'); | |
| var checkbox_names = $.map(checkboxes, function(e,i) { return $(e).attr("name")}).join(" "); | |
| $("#itemForm").validate({ | |
| groups: { checks: checkbox_names }, | |
| errorPlacement: function(error, element) { | |
| if (element.attr("type") == "checkbox") |
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 | |
| // Obtener el array | |
| $myarray = glob("*.*"); | |
| // Ordenar por fecha ascendente | |
| usort($myarray, create_function('$a,$b', 'return filemtime($a) - filemtime($b);')); |
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
| // Obtener registros de la tabla con fecha superior a hace tres meses | |
| SELECT * FROM tabla WHERE fecha >= DATE_ADD(NOW(),INTERVAL -3 MONTH) | |
| // De otro modo: | |
| SELECT * FROM tabla WHERE fecha >= (NOW() + INTERVAL -3 MONTH) |
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 start = $("#form_expedientes input[name='fecha']").datepicker('getDate'); | |
| var end = $("#form_expedientes input[name='fecha_entrega']").datepicker('getDate'); | |
| if(!start || !end) | |
| return; | |
| var days = 0; | |
| if (start && end) { | |
| days = Math.floor((end.getTime() - start.getTime()) / 86400000); // ms per day | |
| } |
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
| function url_get_contents ($Url) { | |
| if (!function_exists('curl_init')){ | |
| die('CURL is not installed!'); | |
| } | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $Url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
| $output = curl_exec($ch); | |
| curl_close($ch); | |
| return $output; |