Monthly Archives: August 2015

Responsive CSS tab

A good design of tab system for accordions with responsive design.
We can find many special effects made for html websites with the help of jquery and css.
An interesting tab menu with added icons and text with additional styles and interest to the viewer. In desktop browser the tabs are display with icon and text. But in mobile, the tabs are display only corresponding icons.

CODE





responsivetab.html



    
    
    Responsive CSS Tabs
    
	


	

Responsive CSS Tabs

PHP is a hyper-text pre-processor

Is a general-purpose scripting language that was originally designed for web development. This helps to produce dynamic web pages. It generally runs on a web server , can be embedded into HTM. Php scripting always starts with . and PHP scripting block can be placed anywhere in the document.

JavaScript is a programming language designed for use in a web browser.It is lightweight and most commonly used as a part of web pages.It is an interpreted programming language with object-oriented capabilities.JavaScript can be placed in the <body> and the <head> sections of an HTML page.JavaScript code must be inserted between <script> and </script> tags in HTML.

JavaScript syntax is the set of rules.JavaScript can be implemented using JavaScript statements in webpages that are placed within the <script>........</script> HTML tags.You can place the <script> tags anywhere within your web page. but it is normally recommended that you should keep it within the <head> tags.

Popup the image with enquiry form using CSS,jquery and javascript in html or php page.This is simple, can edit style, image,form etc.To use it in a real life project like ecommerce website, the customers can post feedbacks as comments in specified product.

JQuery is lightweight write less, do more open source Javascript Library, used for interaction between HTML and JavaScript. JQuery is not a language. But JavaScript is a Language. JQuery is built over JavaScript.The purpose of jQuery is to make it much easier to use JavaScript on your website.





responsivetab1.js

!function()
{
	function e(e,r)
	{
		return[].slice.call((r||document).querySelectorAll(e))
	}
	if(window.addEventListener)
	{
		var r=window.StyleFix={link:function(e)
		{
			try
			{
				if("stylesheet"!==e.rel||e.hasAttribute("data-noprefix"))return
			}
			catch(t)
			{
				return
			}
			var n,i=e.href||e.getAttribute("data-href"),a=i.replace(/[^\/]+$/,""),o=(/^[a-z]{3,10}:/.exec(a)||[""])[0],s=(/^[a-z]{3,10}:\/\/[^\/]+/.exec(a)||[""])[0],l=/^([^?]*)\??/.exec(i)[1],u=e.parentNode,p=new XMLHttpRequest;
			p.onreadystatechange=function()
			{
				4===p.readyState&&n()
			},n=function()
			{
				var t=p.responseText;
				if(t&&e.parentNode&&(!p.status||p.status<400||p.status>600))
				{
					if(t=r.fix(t,!0,e),a)
					{
						t=t.replace(/url\(\s*?((?:"|')?)(.+?)\1\s*?\)/gi,function(e,r,t)
						{
							return/^([a-z]{3,10}:|#)/i.test(t)?e:/^\/\//.test(t)?'url("'+o+t+'")':/^\//.test(t)?'url("'+s+t+'")':/^\?/.test(t)?'url("'+l+t+'")':'url("'+a+t+'")'});var n=a.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1");t=t.replace(RegExp("\\b(behavior:\\s*?url\\('?\"?)"+n,"gi"),"$1")
					}
					var i=document.createElement("style");i.textContent=t,i.media=e.media,i.disabled=e.disabled,i.setAttribute("data-href",e.getAttribute("href")),u.insertBefore(i,e),u.removeChild(e),i.media=e.media
				}
			};
			try{p.open("GET",i),p.send(null)}
			catch(t){"undefined"!=typeof XDomainRequest&&(p=new XDomainRequest,p.onerror=p.onprogress=function(){},p.onload=n,p.open("GET",i),p.send(null))}e.setAttribute("data-inprogress","")
		},styleElement:function(e){if(!e.hasAttribute("data-noprefix")){var t=e.disabled;e.textContent=r.fix(e.textContent,!0,e),e.disabled=t}},styleAttribute:function(e){var t=e.getAttribute("style");t=r.fix(t,!1,e),e.setAttribute("style",t)},process:function(){e("style").forEach(StyleFix.styleElement),e("[style]").forEach(StyleFix.styleAttribute)},register:function(e,t){(r.fixers=r.fixers||[]).splice(void 0===t?r.fixers.length:t,0,e)},fix:function(e,t,n){for(var i=0;i-1&&(e=e.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/gi,function(e,r,t,n){return r+(t||"")+"linear-gradient("+(90-n)+"deg"})),e=r("functions","(\\s|:|,)","\\s*\\(","$1"+i+"$2(",e),e=r("keywords","(\\s|:)","(\\s|;|\\}|$)","$1"+i+"$2$3",e),e=r("properties","(^|\\{|\\s|;)","\\s*:","$1"+i+"$2:",e),t.properties.length){var a=RegExp("\\b("+t.properties.join("|")+")(?!:)","gi");e=r("valueProperties","\\b",":(.+?);",function(e){return e.replace(a,i+"$1")},e)}return n&&(e=r("selectors","","\\b",t.prefixSelector,e),e=r("atrules","@","\\b","@"+i+"$1",e)),e=e.replace(RegExp("-"+i,"g"),"-"),e=e.replace(/-\*-(?=[a-z]+)/gi,t.prefix)},property:function(e){return(t.properties.indexOf(e)?t.prefix:"")+e},value:function(e){return e=r("functions","(^|\\s|,)","\\s*\\(","$1"+t.prefix+"$2(",e),e=r("keywords","(^|\\s)","(\\s|$)","$1"+t.prefix+"$2$3",e)},prefixSelector:function(e){return e.replace(/^:{1,2}/,function(e){return e+t.prefix})},prefixProperty:function(e,r){var n=t.prefix+e;return r?StyleFix.camelCase(n):n}};!function(){var e={},r=[],n=getComputedStyle(document.documentElement,null),i=document.createElement("div").style,a=function(t){if("-"===t.charAt(0)){r.push(t);var n=t.split("-"),i=n[1];for(e[i]=++e[i]||1;n.length>3;){n.pop();var a=n.join("-");o(a)&&-1===r.indexOf(a)&&r.push(a)}}},o=function(e){return StyleFix.camelCase(e)in i};if(n.length>0)for(var s=0;s





download

AJAX-Basic

AJAX is Asynchronous JavaScript and XML.It is based on Javascript and HTTP request. Ajax is not a new programming language.
But a new way to use existing standards.The main function is updating parts of a web page, without reloading the whole page.




AJAX uses asynchronous data transfer (HTTP requests) between the browser and the Web server.

AJAX cannot work independently. It is used in combination with other technologies for create interactive webpages.

  • JavaScript
  • DOM
  • CSS



  • XMLHttpRequest

JavaScript:When an event occurs in a page the javascript functions are called.

DOM:It represents the structure of XML and HTML documents.API for accessing and manipulating structured documents.

CSS:Used for representing presentation style.

XMLHttpRequest:JavaScript object that performs asynchronous interaction with the server.



note:In AJAX , there is not discontinuity and you get the response very quickly, but when you try the standard GCI , you would have to wait for the response and your page also gets refreshed.

Syntax




$.ajax({name:value, name:value, … })

Javascript-operators

Javascript support different types of operators. They are:

  • Arithmetic Operators
  • Comparision Operators
  • Logical (or Relational) Operators



  • Assignment Operators
  • Conditional (or ternary) Operators
  • —–>Arithmetic Operators

    JavaScript supports arithmetic operators . A typical arithmetic operation operates on two numbers.

    eg:
    var x=100=50;
    or
    var x= a+b;(using variables)






    Operator Description
    (+) Addition Add two operands
    eg:A+B(A=10;B=30 will give 40)
    (-)Subtraction Subtracts the second operand from the first
    eg: A-B(A=10;B=30 will give -20)
    (*) Multiplication Multiply both operand
    eg:A*B(A=2;B=4 will give 8)
    (/)Division Divide the numerator by the denominator
    eg:A / B (A=20;B=10 will give 2)
    ( % )Modulus Outputs the remainder of an integer division
    eg: B % A (A=10;B=20 will give 0)
    (++) Increment Increases an integer value by one
    eg: A++ (A=10 will give 11)
    (–) Decrement Decreases an integer value by one
    eg: A– (A=10; will give 9)




    —->Comparision Operators

    Javascript support comparison operator




    Operator Description
    ( = = )Equal Checks if the value of two operands are equal or not.
    eg: A == B (A=10;B=20; is not true).
    ( != ) Not Equal Checks if the value of two operands are equal or not, if the values are not equal, then the condition becomes true.
    eg: A != B (A=10;B=20 is true.)
    ( > ) Greater than Checks if the value of the left operand is greater than the value of the right operand, if yes, then the condition becomes true.
    eg: A > B (A=10; B=20 is not true.)
    ( < ) Less than Checks if the value of the left operand is less than the value of the right operand, if yes, then the condition becomes true.
    eg:A < B(A=10;B=20; is true)
    ( >= ) Greater than or Equal to Checks if the value of the left operand is greater than or equal to the value of the right operand, if yes, then the condition becomes true.
    eg:A >= B (A=10;B=20 is not true)
    ( <= ) Less than or Equal to Checks if the value of the left operand is less than or equal to the value of the right operand, if yes, then the condition becomes true.
    eg: A <= B (A=10; B=20 is true)

    Logical (or Relational) Operators

    Javascript also support different types of logical oprator.




    Operator Description
    ( && ) Logical AND If both the operands are non-zero, then the condition becomes true.
    eg: A && B.
    (||) Logical OR If any of the two operands are non-zero, then the condition becomes true.
    eg: A || B.
    ( ! ) Logical NOT Reverses the logical state of its operand. If a condition is true, then the Logical NOT operator will make it false.
    eg: ! (A && B).

jQuery-Basic

JQuery is lightweight write less, do more open source Javascript Library, used for interaction between HTML and JavaScript. JQuery is not a language. But JavaScript is a Language. JQuery is built over JavaScript.The purpose of jQuery is to make it much easier to use JavaScript on your website.




The jQuery library contains the following features:

  • HTML/DOM manipulation
  • CSS manipulation
  • HTML event methods
  • Effects and animations



  • AJAX
  • Utilities

How to use jQuery?
There are two ways to use jQuery.

  • Local Installation − download jQuery library on your local machine and include it in your HTML code and run.
  • eg:

    <html>
    <head>
    <title>The jQuery Example </title>
    <script type=”text/javascript” src=”/jquery/jquery-2.1.3.min.js”></script >

    <script type=”text/javascript”>
    $(document).ready(function(){
    alert(“Hello World!”);
    });
    </script>

    </head>

    <body>
    </body>
    </html>

  • CDN Based Version − include jQuery library into your HTML code directly from Content Delivery Network (CDN).




  • eg:

    <html>
    <head>
    <title>The jQuery Example</title>
    <script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js”>
    </script>

    <script type=”text/javascript”>
    $(document).ready(function(){
    document.write(“Hello, World!”);
    });
    </script>
    </head>

    <body>

    </body>
    </html>

AngularJS – Reading JSON data

Hi Friends
AngularJS service provide read the data from remote servers using $http. $http.get(url) is the function to use for reading server data.



eg:
<script>
var app = angular.module(‘myApp’, []);
app.controller(‘customersCtrl’, function($scope, $http) {
$http.get(“http://www.prittytimes.com/angular/customers.php”)
.success(function (response) {$scope.names = response.records;});
});
</script>

AngularJS is quickly becoming the dominant JavaScript framework for professional web development.

Browser Fullscreen API using Javascript

Usefull new Javascript API, very simple and useful fullscreen API using Javascript API. The full screen API is an easy way to get the full web content to be displayed on the page. Here the programmatic way to request fullscreen display from the user, and exit fullscreen when request from the user. When it comes to creating special end user experiences have been the ability to show something fullscreen. This can be done at the developers choice, it’s very similar to F11 processing on your keyboard.




demo

Check If The Browser Supports Full Screen API

We now have access to a method called requestFullScreen, so far implemented in Firefox, Google Chrome, Safari and Internet Explorer.

			var docElm = document.documentElement;
			if (docElm.requestFullscreen)
			{
				docElm.requestFullscreen();
			}
			else if (docElm.msRequestFullscreen)
			{
				docElm.msRequestFullscreen();
			}
			else if (docElm.mozRequestFullScreen) 
			{
				docElm.mozRequestFullScreen();
			}
			else if (docElm.webkitRequestFullScreen) 
			{
				docElm.webkitRequestFullScreen();
			}
		




Exit/Cancel The Full Screen

If you want to exit the full screen mode, it is also a method to close the full screen and return back to the normal mode.

		if (document.exitFullscreen)
						{
							document.exitFullscreen();
						}
						else if (document.mozCancelFullScreen)
						{
							document.mozCancelFullScreen();
						}
						else if (document.webkitCancelFullScreen) 
						{
							document.webkitCancelFullScreen();
						}
						else if (document.msExitFullscreen)
						{
							document.msExitFullscreen();
						}
		




FULL CODE

		
		
        
        Fullscreen API- prittytimes.com   
		
		
        

Fullscreen API in prittytimes.com

A demo of the Fullscreen API




This great features are used for image slideshows, you can make the browser go into full screen on a click of an image.

Responsive Accordion with HTML, CSS & jQuery

Create an responsive Accordion with CSS3, HTML5 and jQuery. Accordion toggle is the latest style of toggle. Accordion is mostly using for FAQ and design features. This kind of toggle is make the web page as very attractive ,simple and include more content. Here HTML, CSS & jQuery for accordion. Accordions are mainly used to toggle extra information. They help to organize and de-clutter information.




demo


Table of Content

  • The HTML
  • The CSS



  • The jQuery

The HTML

The layout is pretty. class ‘content white’ used for style full menu and class ‘accordion-container’, style each accordion menu. The class=’accordion-toggle’ will be the “link(a)” for the accordion. The element that comes directly after that will be the element being toggled by clicking on the previous ‘a’ href in class ‘accordion-container’. Toggled div contain image, paragraph,div all html tags.

		
	

Responsive jQuery Accordions

Live html compiler using PHP
Geoloaction in form input type
Popup the image gallery with form
Responsive Navigation Menu Using Only CSS

Responsive menus are built to work with desktop browsers as well as touch and mobile devices. In here the dropdown menu also available in all device using pure CSS. A pure CSS responsive menu created that automatically changes to a toggleable dropdown menu at a specified breakpoint based on CSS3 media queries. If you are having trouble getting your website menu working on an iPhone, iPad, or Android device, then check out these menus.

Ten Open Source Backup and Recovery Tools

In the data center environment the open source tools have many advantages. First and foremost is their low cost and the flexibility they provide. Everyone will be aware of the source code so any enhancements that need to be done have a greater chance of getting implemented, quickly.

Ten FOSS backup tools

  • AMANDA
  • Bacula
  • Bareos
  • Clonezilla
  • FOG
  • Rsync
  • BURP
  • Duplicati
  • BackupPC
  • Box Backup





The CSS

The CSS is just doing some basic styling.







The jQuery

It’s really amazing at how simple jQuery can make our lives. This is all that is required for the accordion:


	
	





download

SQL- Syntax

All the SQL statements start with any of the keywords like SELECT, INSERT, UPDATE, DELETE, ALTER, DROP, CREATE, USE, SHOW. And all the statements end with a semicolon (;). SQL is case insensitive, which means INSERT and insert have same meaning in SQL statements. But MySQL makes difference in table names. So if you are working with MySQL, then you need to give table names as they exist in the database. Commonly used SQl statment are:



SQL CREATE TABLE Statement

CREATE TABLE table_name(
column1 datatype,
column2 datatype,
column3 datatype,
…..
columnN datatype,
PRIMARY KEY( one or more columns )
);




SQL INSERT INTO Statement

INSERT INTO table_name( column1, column2….columnN)
VALUES ( value1, value2….valueN);
);

SQL SELECT Statement

SELECT * from table_name

or

SELECT column1, column2….columnN FROM table_name;

SQL DISTINCT Clause

SELECT DISTINCT column1, column2….columnN FROM table_name;

SQL WHERE Clause

SELECT column1, column2….columnN FROM table_name WHERE CONDITION;

or

SELECT * from table_name WHERE CONDITION;




SQL AND/OR Clause

SELECT column1, column2….columnN FROM table_name WHERE CONDITION-1 {AND|OR} CONDITION-2;

or

SELECT * FROM table_name WHERE CONDITION-1 {AND|OR} CONDITION-2;

SQL BETWEEN Clause

SELECT column1, column2….columnN FROM table_name WHERE column_name BETWEEN val-1 AND val-2;

or

SELECT * FROM table_name WHERE column_name BETWEEN val-1 AND val-2;




SQL IN Clause

SELECT column1, column2….columnN FROM table_name WHERE column_name IN (val-1, val-2,…val-N);

or

SELECT * FROM table_name WHERE column_name IN (val-1, val-2,…val-N);

SQL LIKE Clause

SELECT column1, column2….columnN FROM table_name WHERE column_name LIKE { PATTERN };

SELECT * FROM table_name WHERE column_name LIKE { PATTERN };




SQL UPDATE Statement

UPDATE table_name SET column1 = value1, column2 = value2….columnN=valueN [ WHERE CONDITION ];

SQL DROP TABLE Statement

DROP TABLE table_name;

SQL DELETE Statement

DELETE FROM table_name WHERE {CONDITION};);

SQL COMMIT Statement

COMMIT;




SQL ROLLBACK Statement

ROLLBACK;

SQL-Basic

SQL is Structured Query Language, for storing, manipulating and retrieving data stored in relational database.Its a standard language for Relation Database System. All relational database management systems like MySQL, MS Access, Oracle, Sybase, Informix, postgres and SQL Server use SQL as standard database language.SQL is just a query language, it is not a database. To perform SQL queries, you need to install any database.



Uses of SQL

  • Allows users to access data in relational database management systems.
  • Allows users to describe the data.
  • Allows users to define the data in database and manipulate that data.



  • Allows to embed within other languages using SQL modules, libraries & pre-compilers.
  • Allows users to create and drop databases and tables.
  • Allows users to create view, stored procedure, functions in a database.
  • Allows users to set permissions on tables, procedures, and views




Following is a simple diagram showing SQL Architecture

sql-architecture

Important SQL Commands

The standard SQL commands to interact with relational databases.The SQL Commands can be divided into three. ther are:

  • DDL – Data Definition Language
  • DML – Data Manipulation Language



  • DCL – Data Control Language

DDL – Data Definition Language

  • CREATE : For Creates a new table
  • ALTER :To Modifies an existing database object, such as a table.
  • DROP : To Deletes an entire table

DML – Data Manipulation Language

  • SELECT : Extract certain records from one or more tables
  • INSERT : Creates a record or insert the data into database.
  • UPDATE : Modifies records or update the data in a database
  • DELETE : Deletes records or delete the data from database.




DCL – Data Control Language

  • GRANT :Gives a privilege to user
  • REVOKE :Takes back privileges granted from user