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 | |
class SMTP_validateEmail { | |
/* Validate an email address. */ | |
function validEmail($email) { | |
$isValid = true; | |
$atIndex = strrpos($email, "@"); | |
if (is_bool($atIndex) && !$atIndex) { | |
$isValid = false; |
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 | |
class SMTP_validateEmail { | |
/* Validate an email address. */ | |
function validEmail($email) | |
{ | |
$isValid = true; | |
$atIndex = strrpos($email, "@"); | |
if (is_bool($atIndex) && !$atIndex) | |
{ |
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 | |
if (isset($_POST["tombol"])) | |
{ | |
echo "<pre>"; | |
//print_r($_POST); | |
echo "</pre>"; | |
$head = $_POST["head"]; | |
$detail = $_POST["item"]; | |
echo "Head Looping Foreach <br/>"; |
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 | |
public function myupload($file_name, $opt) { | |
$this->load->helper('directory'); | |
$opt_folder_uploads = ( ($opt["opt_folder_uploads"] == NULL) || ($opt["opt_folder_uploads"] == "") ? "./media/uploads/news/" . date("Y-m") : $opt["opt_folder_uploads"] ); | |
$opt_input_text_name = ( ($opt["opt_input_text_name"] == NULL) || ($opt["opt_input_text_name"] == "") ? "userfile" : $opt["opt_input_text_name"] ); | |
$opt_type = ( ($opt["opt_type"] == NULL) || ($opt["opt_type"] == "") ? "images" : $opt["opt_type"] ); | |
$opt_prefix = ( ($opt["opt_prefix"] == NULL) || ($opt["opt_prefix"] == "") ? NULL : $opt["opt_prefix"] ); | |
$opt_suffix = ( ($opt["opt_suffix"] == NULL) || ($opt["opt_suffix"] == "") ? NULL : $opt["opt_suffix"] ); |
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
CREATE TABLE `mahasiswa` ( | |
`nim` INT(8) UNSIGNED ZEROFILL NOT NULL DEFAULT '00000000', | |
`nama` VARCHAR(50) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci', | |
PRIMARY KEY (`nim`) | |
) | |
COLLATE='utf8_general_ci' | |
ENGINE=InnoDB; | |
CREATE DEFINER=`root`@`127.0.0.1` FUNCTION `id_auto_mahasiswa`(`kodejurusan` INT, `kodekonsentrasi` INT, `kodekampus` INT) | |
RETURNS int(10) unsigned |
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 | |
function curl_get_html($options, $file) { | |
$ch = curl_init(); | |
foreach ($options as $key => $value) { | |
curl_setopt($ch, $key, $value); | |
} | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$server_output = curl_exec($ch); | |
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
CREATE FUNCTION explode(isDelimiter VARCHAR(12),inString VARCHAR(255),position INT) | |
RETURNS VARCHAR(255) | |
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(inString, isDelimiter, position), | |
LENGTH(SUBSTRING_INDEX(inString, isDelimiter, position -1)) + 1),isDelimiter, ''); | |
-- usage : | |
-- select explode ('|', 'suhendra|yohana|putra',1); -- give output suhendra | |
-- select explode ('|', 'suhendra|yohana|putra',2); -- give output yohana | |
-- select explode ('|', 'suhendra|yohana|putra',3); -- give output putra |
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
CREATE FUNCTION explode(isDelimiter VARCHAR(12),inString VARCHAR(255),position INT) | |
RETURNS VARCHAR(255) | |
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(inString, isDelimiter, position), | |
LENGTH(SUBSTRING_INDEX(inString, isDelimiter, position -1)) + 1),isDelimiter, ''); | |
-- usage : | |
-- select explode ('|', 'suhendra|yohana|putra',1); -- give output suhendra | |
-- select explode ('|', 'suhendra|yohana|putra',2); -- give output yohana | |
-- select explode ('|', 'suhendra|yohana|putra',2); -- give output putra |
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 ($) { | |
$.fn.forceNumeric = function () { | |
return this.each(function () { | |
$(this).keyup(function() { | |
if (!/^[0-9]+$/.test($(this).val())) { | |
$(this).val($(this).val().replace(/[^0-9]/g, '')); | |
} | |
}); | |
}); | |
}; |
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
Number.prototype.formatMoney = function(decPlaces, thouSeparator, decSeparator) { | |
var n = this, | |
decPlaces = isNaN(decPlaces = Math.abs(decPlaces)) ? 2 : decPlaces, | |
decSeparator = decSeparator == undefined ? "." : decSeparator, | |
thouSeparator = thouSeparator == undefined ? "," : thouSeparator, | |
sign = n < 0 ? "-" : "", | |
i = parseInt(n = Math.abs(+n || 0).toFixed(decPlaces)) + "", | |
j = (j = i.length) > 3 ? j % 3 : 0; | |
return sign + (j ? i.substr(0, j) + thouSeparator : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thouSeparator) + (decPlaces ? decSeparator + Math.abs(n - i).toFixed(decPlaces).slice(2) : ""); | |
}; |
NewerOlder