Skip to content

Instantly share code, notes, and snippets.

View eboominathan's full-sized avatar
🎯
Focusing

Boominathan Elango eboominathan

🎯
Focusing
View GitHub Profile
tablename: bdates
fields: bday (date: only month and day), name (vchar - 25), IP (vchar - 20)
1. Show to all:
$today = date("m/d"); // get today's date (month and day only!)
$sql = "select * from `bdates` where `bday`='".$today."'";
$list = mysql_query($sql);
while ($lst = mysql_fetch_array($list))
{
echo ("Happy birthday " . $lst['name'] . "!<br>");
@eboominathan
eboominathan / model
Created September 4, 2015 12:00
problem solved !
function GetRow($keyword)
{
$this->db->like("hotel_name", $keyword);
$data= $this->db->get('hotels')->result_array();
$check=count($data);
if($check==0)
{
$this->db->like("hotel_name", $keyword);
return $this->db->get('gallery')->result_array();
@eboominathan
eboominathan / .htaccess
Created September 28, 2015 03:16
CI: Simple .htaccess using mod_rewrite for CodeIgniter
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
<html>
<head>
<meta charset="utf-8">
<title>OFFICIUM247-Home</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link href="css/main.css" rel="stylesheet">
<link href="css/demo.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<?php
include 'include/connect.php';
$tableqry = "SELECT image,maincat_name,php_name FROM tblmaincategories ";
$num_rows = mysql_num_rows(mysql_query("SELECT image,maincat_name,php_name FROM tblmaincategories "));
$result = mysql_query($tableqry);
?>
<html>
<head>
<meta charset="utf-8">
@eboominathan
eboominathan / Lbs.php
Created October 12, 2015 09:31 — forked from amrishodiq/Lbs.php
PHP Code Igniter library class to get latitude & longitude, get address for specified latitude & longitude, get direction from one place to another place, and so on. Most LBS concept I implemented with PHP.
<?php
/**
* Written by Amri Shodiq.
* Do not hesitate to copy and paste this code.
* It's not embarassing.
*/
if (!defined('BASEPATH'))
exit ('No direct script access allowed');
@eboominathan
eboominathan / country_state_city.sql
Created December 13, 2015 09:59
Country,State.City Master
This file has been truncated, but you can view the full file.
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 13, 2015 at 10:50 AM
-- Server version: 5.6.21
-- PHP Version: 5.5.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@eboominathan
eboominathan / Pagination.php
Created December 25, 2015 12:24
Pagination in javascript
<script type="text/javascript">
$('table.paginated').each(function() {
var currentPage = 0;
var numPerPage = 10;
var $table = $(this);
$table.bind('repaginate', function() {
$table.find('tbody tr').hide().slice(currentPage * numPerPage, (currentPage + 1) * numPerPage).show();
});
$table.trigger('repaginate');
var numRows = $table.find('tbody tr').length;
@eboominathan
eboominathan / wednesday_only.php
Created January 2, 2016 04:55 — forked from anonymous/wednesday_only.php
Insert only wednesday of the year
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "test";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
@eboominathan
eboominathan / camera.html
Created January 6, 2016 08:58 — forked from dhavaln/camera.html
Phonegap Camera Capture Example
<!DOCTYPE html>
<html>
<head>
<title>Capture Photo</title>
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"/>
<script type="text/javascript" charset="utf-8" src="js/phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
var pictureSource; // picture source
var destinationType; // sets the format of returned value