This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Saturday, 7 December 2013

Open Popup Div Using Javascript

Javascript popup is the most popular and cool Javascript effects for websites, as a web developer or designer we can apply this cool Javascript effects very easy in our projects. If your wonder on how to create a popup div in your own hand. In this tutorial I would like to share on how to create a pop up div effect using the Javascript.

In this Javascript example we create a Javascript popup div in ‘on click trigger’ event, that pop up displays with opacity background and it will remains center the popup.

Complete Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript">
function openpopup(id){
      //Calculate Page width and height
      var pageWidth = window.innerWidth;
      var pageHeight = window.innerHeight;
      if (typeof pageWidth != "number"){
      if (document.compatMode == "CSS1Compat"){
            pageWidth = document.documentElement.clientWidth;
            pageHeight = document.documentElement.clientHeight;
      } else {
            pageWidth = document.body.clientWidth;
            pageHeight = document.body.clientHeight;
      }
      }
      //Make the background div tag visible...
      var divbg = document.getElementById('bg');
      divbg.style.visibility = "visible";
       
      var divobj = document.getElementById(id);
      divobj.style.visibility = "visible";
      if (navigator.appName=="Microsoft Internet Explorer")
      computedStyle = divobj.currentStyle;
      else computedStyle = document.defaultView.getComputedStyle(divobj, null);
      //Get Div width and height from StyleSheet
      var divWidth = computedStyle.width.replace('px', '');
      var divHeight = computedStyle.height.replace('px', '');
      var divLeft = (pageWidth - divWidth) / 2;
      var divTop = (pageHeight - divHeight) / 2;
      //Set Left and top coordinates for the div tag
      divobj.style.left = divLeft + "px";
      divobj.style.top = divTop + "px";
      //Put a Close button for closing the popped up Div tag
      if(divobj.innerHTML.indexOf("closepopup('" + id +"')") < 0 )
      divobj.innerHTML = "<a href=\"#\" onclick=\"closepopup('" + id +"')\"><span class=\"close_button\">X</span></a>" + divobj.innerHTML;
}
function closepopup(id){
      var divbg = document.getElementById('bg');
      divbg.style.visibility = "hidden";
      var divobj = document.getElementById(id);
      divobj.style.visibility = "hidden";
}
</script>

<style type="text/css">
<!--
.popup {
      background-color: #DDD;
      height: 300px; width: 500px;
      border: 5px solid #666;
      position: absolute; visibility: hidden;
      font-family: Verdana, Geneva, sans-serif;
      font-size: small; text-align: justify;
      padding: 5px; overflow: auto;
      z-index: 2;
}
.popup_bg {
      position: absolute;
      visibility: hidden;
      height: 100%; width: 100%;
      left: 0px; top: 0px;
      filter: alpha(opacity=70); /* for IE */
      opacity: 0.7; /* CSS3 standard */
      background-color: #999;
      z-index: 1;
}
.close_button {
      font-family: Verdana, Geneva, sans-serif;
      font-size: small; font-weight: bold;
      float: right; color: #666;
      display: block; text-decoration: none;
      border: 2px solid #666;
      padding: 0px 3px 0px 3px;
}
body { margin: 0px; }
-->
</style>
</head>

<body>
<a href="#" onclick="openpopup('popup1')">Open Popup Div #1</a>
<div id="popup1" class="popup">
Popup Div Tag #1 content goes here!
</div>

<a href="#" onclick="openpopup('popup2')">Open Popup Div #2</a>
<div id="popup2" class="popup">
Popup Div Tag #2 content goes here!
</div>

<div id="bg" class="popup_bg"></div>
</body>
</html>

Google Maps Autoscroll Sidebar

Many of the Google Maps you see embedded on web pages are accompanied by a list of the items that are plotted on the map - sometimes referred to as a sidebar. Often, the items in the sidebar are links that enable the user to see where that item is located.

In this section, we're going to add a sidebar to the page we built in the previous section that read and plotted points stored in an JSON . This sidebar will list the names of the candidate cities as links that open their associated info windows when clicked.


Creating Expandable & Collapsible Div In JQuery & HTML

The use of expandable and collapsible panels is widespread on the Internet. There are many plugins and code available that allow you to implement various types of expandable content or ‘accordion’ effects which essentially involve the user clicking on a panel heading to reveal the content underneath. Expandable panels are often used as a way to break up content rich pages into more visually appealing sections, where visitors can choose to read more about a particular section if they wish.

This tutorial walks through the processes and code required to create your own version of expandable panels using a mix of HTML, CSS and jQuery. Modifying and styling the panels is easy and the code has been tested on multiple browsers and devices including Internet Explorer 8, 9 and 10 as well as Chrome, FireFox and Safari. The expandable panels are also responsive and fit 100% of the parent container.

Demo                             


Complete Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Demo of expandable &amp; collapsible panels in jQuery</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
(function($) {
    $(document).ready(function () { 
        /*-------------------- EXPANDABLE PANELS ----------------------*/
        var panelspeed = 500; //panel animate speed in milliseconds
        var totalpanels = 3; //total number of collapsible panels   
        var defaultopenpanel = 0; //leave 0 for no panel open   
        var accordian = false; //set panels to behave like an accordian, with one panel only ever open at once      

        var panelheight = new Array();
        var currentpanel = defaultopenpanel;
        var iconheight = parseInt($('.icon-close-open').css('height'));
        var highlightopen = true;
         
        //Initialise collapsible panels
        function panelinit() {
                for (var i=1; i<=totalpanels; i++) {
                    panelheight[i] = parseInt($('#cp-'+i).find('.expandable-panel-content').css('height'));
                    $('#cp-'+i).find('.expandable-panel-content').css('margin-top', -panelheight[i]);
                    if (defaultopenpanel == i) {
                        $('#cp-'+i).find('.icon-close-open').css('background-position', '0px -'+iconheight+'px');
                        $('#cp-'+i).find('.expandable-panel-content').css('margin-top', 0);
                    }
                }
        }

        $('.expandable-panel-heading').click(function() {           
            var obj = $(this).next();
            var objid = parseInt($(this).parent().attr('ID').substr(3,2));  
            currentpanel = objid;
            if (accordian == true) {
                resetpanels();
            }
             
            if (parseInt(obj.css('margin-top')) <= (panelheight[objid]*-1)) {
                obj.clearQueue();
                obj.stop();
                obj.prev().find('.icon-close-open').css('background-position', '0px -'+iconheight+'px');
                obj.animate({'margin-top':0}, panelspeed);
                if (highlightopen == true) {
                    $('#cp-'+currentpanel + ' .expandable-panel-heading').addClass('header-active');
                }
            } else {
                obj.clearQueue();
                obj.stop();
                obj.prev().find('.icon-close-open').css('background-position', '0px 0px');
                obj.animate({'margin-top':(panelheight[objid]*-1)}, panelspeed); 
                if (highlightopen == true) {
                    $('#cp-'+currentpanel + ' .expandable-panel-heading').removeClass('header-active');   
                }
            }
        });
         
        function resetpanels() {
            for (var i=1; i<=totalpanels; i++) {
                if (currentpanel != i) {
                    $('#cp-'+i).find('.icon-close-open').css('background-position', '0px 0px');
                    $('#cp-'+i).find('.expandable-panel-content').animate({'margin-top':-panelheight[i]}, panelspeed);
                    if (highlightopen == true) {
                        $('#cp-'+i + ' .expandable-panel-heading').removeClass('header-active');
                    }
                }
            }
        }
             

        $(window).load(function() {
  panelinit();
        }); //END LOAD
    }); //END READY
})(jQuery);
</script>


<style type="text/css">
/* --------- COLLAPSIBLE PANELS ----------*/

h2, p, ol, ul, li {
margin:0px;
padding:0px;
font-size:13px;
font-family:Arial, Helvetica, sans-serif;
}
ol, ul {
padding:3px 0 10px 22px;
}
li {
padding:0 0 4px 0;
}
hr {
border:none;
height:1px;
border-top:1px dashed #999;
}
#container {
width:300px;
margin:auto;
margin-top:100px;
}

.expandable-panel {
    width:100%; 
    position:relative;
    min-height:50px;
    overflow:auto;
    margin-bottom: 20px;
border:1px solid #999;
}   
.expandable-panel-heading {
    width:100%; 
    cursor:pointer;
    min-height:50px;
    clear:both;
    background-color:#E5E5E5;
    position:relative;
}
.expandable-panel-heading:hover {
    color:#666;
}
.expandable-panel-heading h2 {
    padding:14px 10px 9px 15px; 
    font-size:18px;
    line-height:20px;
}
.expandable-panel-content { 
    padding:0 15px 0 15px;
    margin-top:-999px;
}
.expandable-panel-content p {
    padding:4px 0 6px 0;
}
.expandable-panel-content p:first-child  {
padding-top:10px;
}
.expandable-panel-content p:last-child {
padding-bottom:15px;
}
.icon-close-open {
    width:20px;
    height:20px;
    position:absolute;
    background-image:url(icon-close-open.png);
    right:15px;
}

.expandable-panel-content img {
float:right;
padding-left:12px;
clear:both;
}
.header-active {
    background-color:#D0D7F3;
}

</style>
</head>
<body>
<div id="container">
    <div class="expandable-panel" id="cp-1">
        <div class="expandable-panel-heading">
            <h2>Panel content heading 1<span class="icon-close-open"></span></h2>
      </div>
        <div class="expandable-panel-content">
            <p>This is a regular paragraph within the first collapsible panel.</p>
            <hr />
            <p>A second paragraph after a HR element within the first collapsible panel.</p>
        </div>
    </div>
     
    <div class="expandable-panel" id="cp-2">
        <div class="expandable-panel-heading">
            <h2>Panel content heading 2<span class="icon-close-open"></span></h2>
      </div>
        <div class="expandable-panel-content">
             <p>Another collapsible panel. The following variables can be set expandable panels:</p>
            <ol>
            <li><em>panelspeed:</em> defines panel expand/collapse speed in milliseconds</li>
                <li><em>totalpanels:</em> the total number of colapsible panels used</li>
                <li><em>defaultopenpanel:</em> leave at 0 to keep all panels initially closed</li>
                <li><em>accordian:</em> sets accordion effect (only one panel can remain open at once)</li>
            </ol>
        </div>
    </div>
     
    <div class="expandable-panel" id="cp-3">
        <div class="expandable-panel-heading">
            <h2>Panel content heading 3<span class="icon-close-open"></span></h2>
      </div>
        <div class="expandable-panel-content">
        
        <p><img src="image1.jpg" height="70" alt="penguins" />This last collapsible panel contains an image floated right to the paragraph content.</p>
        <p>One thing good to note with the expandable panels is that adding top or bottom padding to the expandable-panel-content class can cause animation issues in IE 8</p>
        </div>
    </div>
     <p style="margin-top:50px;"><a style="color:#CCC;" href="http://www.webdevdoor.com/jquery/expandable-collapsible-panels-jquery/">Return to expandable panels post &raquo;</a></p>
</div>

</body>
</html>
         

Friday, 29 November 2013

Reading Excel Files In PHP

In this tutorial I’m going to show you how you can use the php library called PHP Excel Reader to read excel files using php. Yes, things like excel readers for php has already been written by smart people in the past so I’m not going to show you how to build an excel reader from scratch. It’s not quite my level yet, I still consider myself a beginner. Anyway, let’s get to the main topic.


Index.php

<?php
include 'excel_reader.php';       // include the class
$excel = new PhpExcelReader;      // creates object instance of the class
$excel->read('data2.xls');   // reads and stores the excel file data

// Test to see the excel data stored in $sheets property
/*echo '<pre>';
var_export($excel->sheets);
echo '</pre>';
*/$rows=$excel->sheets[0]['numRows'];
$cols=$excel->sheets[0]['numCols'];
echo "<table>";
for($i=2;$i<$rows;$i++)
{
echo "<tr>";
for($j=1;$j<$rows;$j++)
{
echo "<td>".$excel->sheets[0]['cells'][$i][$j]."</td>";
//echo $excel->sheets[0]['cells'][$i][$j];
}
echo "</tr>";
}
echo "</table>";
?>

Thursday, 28 November 2013

PHP jQuery Comment/News Updates Script

Hi, today i am going to show you about facebook auto updates, as we seen in facebook at right side top of the corner we able to see the user activity updates, i have done same concept using jquery, ajax and php, let's see how we do this - See more at: http://www.lessoncup.com/2013/11/jquery-news-updates.html#sthash.voMAxzug.dpuf

DEMO                         DOWNLOAD

index.php

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>jQuery News Updates</title>

<script type="text/javascript" src="jquery-1.10.2.min.js"></script>

<script>

$(document).ready(function(){

$('.send').click(function(){

var name=$('#name').val();
var mess=$('#mess').val();
if(name==""){
alert('enter your name');
}else if(mess==""){
alert('enter your message');
}else{

var messdata= "name="+name+"&mess="+mess;
$("#loader").show();
$("#loader").fadeIn(400).html('<img src="loader.gif" align="absmiddle">&nbsp;<span class="loading">Loading updates</span>');
$('.send').css({ "width": "82px", "cursor": "wait" });
$('.send').text('Tweeting wait..');
$.ajax({
type:"post",
data:messdata,
url:"sendmessage.php",
cache:false,
success:function(msg){

$(".forms1").val('');
$("#loader").hide();
$("ul#amsalert").prepend(msg);
$("ul#amsalert li:first").slideDown(500);
$('.send').css({ "width": "40px", "cursor": "pointer" });
$('.send').text('Tweet');

}
});
}
});
});

</script>

<style>

body{ font-family:Verdana, Geneva, sans-serif; color:#000; font-size:11px; background-color:#FFF; margin:0; padding:0;}

.lessoncup{width:300px; height:auto;border:solid #6895CC 1px;-webkit-box-shadow: 0 2px 5px #666;
box-shadow: 0 2px 5px #666; padding:10px;font-family:Arial, Helvetica, sans-serif; font-size:11px; margin:50px 0 0 400px; float:left;}

.messages{width:250px; height:638px; overflow:hidden;border:solid #8CACDD;font-family:Arial, Helvetica, sans-serif;font-size:11px; float:right; border-width:0 0 1px 1px;}

#loader{font-size:12px;display:none; margin:0 auto; width:112px; height:20px; padding:10px;}

#amsalert{ color:#fff; padding:0;list-style:none; margin:0; padding-left:1px;}

#amsalert li{ background-color:#6895CC; margin-top:1px; padding:10px; display:none; cursor:pointer;}

#amsalert li:hover{ background-color:#4E65C0; cursor:pointer;}

#msalert{ color:#fff; padding:0;list-style:none; margin:0; padding-left:1px;}

#msalert li{ background-color:#6895CC; margin-top:1px; padding:10px;}

#msalert li:hover{ background-color:#4E65C0; cursor:pointer;}

#mname{ color:#FF0; font-weight:bold;}

.ul{ margin:0; padding:0; list-style:none;}

.ul li{ padding:10px; padding-bottom:0; font-size:12px; color:#000;}

.send{ background-color:#6895CC; border:none; border-radius:5px; padding:10px; width:40px; cursor:pointer; color:#fff;}

.send:hover{ background-color:#4E65C0;}

.forms1{color:#333;padding:10px; width:200px; border:solid #6895CC 1px; font-size:14px; resize:none; margin:5px 0 5px 0; outline:none;border-radius:5px;}

#formbox{width:240px; height:auto;margin:0 auto;}



</style>

</head>

<body>

<div class="lessoncup">
<div id="formbox">

    <ul class="ul">
      <li> <span> Name:</span><br/>
        <input name="name" type="text" id="name" class="forms1" placeholder="name">
      </li>
      <li>Message<span>:</span><br/>
        <textarea name="mess" class="forms1" id="mess" placeholder="enter message"></textarea>
      </li>
      
      <li style="margin-top:5px;">
        <div class="send">Tweet</div>
      </li>
    </ul>
  </div>
</div>

<div class="messages">
<div id="loader"></div>
<ul id="amsalert">

</ul>
<?php include("messagealerts.php")?>
</div>



<div style="margin:0 auto; clear:both;width:400px;font-family:Verdana, Geneva, sans-serif; font-size:9px; color:#CCC; margin-top:10px;">(c) Mohammad Khasim Productions - for more lessons<strong>&nbsp;<a href="http://www.lessoncup.com" style="text-transform:lowercase;" target="_blank">www.lessoncup.com</a></strong></div>
</body>
</html>

sendmessage.php


<?php
extract($_REQUEST);
include("db.php");

$sql=mysql_query("insert into messages(name,message) values('$name','$mess')");

$msql=mysql_query("select * from messages order by mid desc");
$mrow=mysql_fetch_array($msql);
?>

<li><span id="mname"><?php echo $mrow['name']?></span><br/>
<?php echo substr($mrow['message'],0,40);?>
</li>


messagealerts.php


<?php
extract($_REQUEST);
include("db.php");

$sql=mysql_query("select * from messages order by mid desc limit 0 , 20");
while($row=mysql_fetch_array($sql)){
?>
<ul id="msalert">
<li><span id="mname"><?php echo $row['name']?></span><br/>
<?php echo substr($row['message'],0,40);?>
</li>
</ul>
<?php }?>

Tuesday, 19 November 2013

Create Marker on Google Map Using PHP

In this example , coordinates values are automatically fetch when the user puts marker on the map. This tutorial which I will be teaching here will have Google map, putting,hiding and deleting markers on the map functionality.It is very light weight Google Maps code and easy to use and it is mostly build in javascript.

<!DOCTYPE html>
<html>
<head>
<script
src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false">
</script>
<script>
var myCenter=new google.maps.LatLng(51.508742,-0.120850);
var markers = [];
var map;
function initialize()
{
var mapProp = {
center:myCenter,
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
google.maps.event.addListener(map, 'click', function(event) {
placeMarker(event.latLng);
});
function placeMarker(location) {
var marker = new google.maps.Marker({
position: location,
map: map,
});
markers.push(marker);
var infowindow = new google.maps.InfoWindow({
content: 'Latitude: ' + location.lat() + '<br>Longitude: ' + location.lng()
});
infowindow.open(map,marker);
}
}
function setAllMap(map) {
for (var i = 0; i < markers.length; i++) {
markers[i].setMap(map);
}
}
function clearMarkers() {
setAllMap(null);
}
function showMarkers() {
setAllMap(map);
}
// Deletes all markers in the array by removing references to them.
function deleteMarkers() {
clearMarkers();
markers = [];
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<input onclick="clearMarkers();" type=button value="Hide Markers">
<input onclick="showMarkers();" type=button value="Show All Markers">
<input onclick="deleteMarkers();" type=button value="Delete Markers">
<div id="googleMap" style="width:700px;height:400px;"></div>
</body>
</html>

PHP/AJAX Grid View System

Few days ago I have developed a Grid system using PHP, jQuery and Ajax. I want to share this with my dear users. It is not very well parametrized or generic but if have little much understanding of jQuery and Ajax then its easy to use. Give your feed back about zGrid.

Demo                    Download

Friday, 15 November 2013

Php Ajax Datagrid Example

DataGrid has an extremely simple and flexible API. This allows developers to begin using DataGrid very quickly, and allows them to access even advanced features with ease. DataGrid ships with examples covering virtually all features of the grid, that provide a simple and effective way of showing how to use the API. We've taken a few of these examples to convey some idea of the simplicity of using DataGrid in any PHP application.

DataGrid with AJAX features

View Data
Dependent dropdown lists (regions and countries)
Tabular(inline) layout for filtering
AJAX paging, details
Tree PostBack methods: GET, POST and AJAX
etc.

Demo                                              Download

Database:

-- phpMyAdmin SQL Dump
-- version 2.11.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 15, 2013 at 06:37 AM
-- Server version: 5.0.51
-- PHP Version: 5.2.5

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `sales`
--



--
-- Table structure for table `calling_info`
--

CREATE TABLE `calling_info` (
  `call_id` bigint(255) NOT NULL auto_increment,
  `Mobile` varchar(255) NOT NULL,
  `com_name` varchar(255) NOT NULL,
  `telesales` varchar(255) NOT NULL,
  `call_date` varchar(255) NOT NULL,
  `call_date1` datetime NOT NULL,
  PRIMARY KEY  (`call_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1005 ;

Saturday, 9 November 2013

Making/Embed jw Player With PHP

The JW Player is the Internet's most advanced and flexible media player.The JW Player Plugin enables you to embed Flash and HTML5 audio and video, plus RTMP and YouTube streams, on your site using.

The JW Player Plugin makes it extremely easy to deliver Flash and HTML5 video through your website. This plugin has been developed by LongTail Video, the creator of the JW Player, and allows for easy customization and embedding of Flash and HTML5 video using the JW Player in your WordPress posts. It provides support for all of the JW Player 6 configuration options, including custom watermarks, HLS/RTMP streaming and VAST/VPAID advertising.

Key Features
  • Full support for JW Player 6 for Flash and HTML5.
  • Full integration into the WordPress media library. Embed video with the JW Player as you write your posts.
  • Support for adding External Media to your Media Library, including Youtube and RTMP streams.
  • A full featured playlist manager - order your media by simply dragging the mouse.
  • A powerful shortcode system for customizations at embed time.

Friday, 8 November 2013

Free PHP Mass/Bulk Mailer Script

Inbox PHP Mailer & Inbox Mass Mailer is a compact easy to use ,server (web) based email mailer. It is specifically designed for the small business market, not to be the biggest or most featured but to be a clean efficient contact tool helping you to send newsletters to your clients, contact your staff, send one email or many.

Why Emailer
A huge amount of people use web based email services such as Hotmail and Yahoo. If they want to get in touch with you by email, instead of being able to simply click an email link (like users with email clients such as Outlook), they have to go to the email providers website - log in to their account - create a new email - copy your email address across and then finally send the email.

That is a bit of a long way round when you could have a simple form for them to fill in and send to you, so you should have an email form on your website to make it more user friendly for your visitors/potential custmers.c

Steps:
1:  Upload excel file


2: