Friday, 20 March 2015

Showing a CSS Based Loading Animation While Your Site Loads

Here is the example.


<!DOCTYPE html>
<html class="loading">
 <head>
  <meta charset="utf-8">
  <title>Loading Example</title>
  <style>
   html {
    -webkit-transition: background-color 1s;
    transition: background-color 1s;
   }
   html, body { min-height: 100%; }
   html.loading {
    background: #333 url('http://code.jquery.com/mobile/1.3.1/images/ajax-loader.gif') no-repeat 50% 50%;
    -webkit-transition: background-color 0;
    transition: background-color 0;
   }
   body {
    -webkit-transition: opacity 1s ease-in;
    transition: opacity 1s ease-in;
   }
   html.loading body {
    opacity: 0;
    -webkit-transition: opacity 0;
    transition: opacity 0;
   }
   button {
    background: #00A3FF;
    color: white;
    padding: 0.2em 0.5em;
    font-size: 1.5em;
   }
  </style>
  <script>
   var html = document.getElementsByTagName('html')[0];
   var removeLoading = function() {
    // In a production application you would remove the loading class when your
    // application is initialized and ready to go.  Here we just artificially wait
    // 3 seconds before removing the class.
    setTimeout(function() {
     html.className = html.className.replace(/loading/, '');
    }, 3000);
   };
   removeLoading();
  </script>
 </head>
 <body>
  <!-- AVERT YER EYES.  This button is a hack to demo this.  Do not use onclick attributes. -->
  <button onclick="html.className = 'loading'; removeLoading();">Reload</button>

  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. </p>

  <p>Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Fusce ac turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. </p>
 </body>
</html>

For any query contact me or see the ref.site http://tjvantoll.com/2013/04/24/showing-a-css-based-loading-animation-while-your-site-loads/
Thanks "TJ VanToll" for this nice and simple code.

Tuesday, 24 February 2015

Open multiple window on page load with JavaScript

<script type="text/javascript">
function performCalc(url) {
var randomnumber = Math.floor((Math.random()*100)+1);
window.open(url,"_blank",'PopUp'+randomnumber+',scrollbars=1,menubar=0,resizable=1,width=100,height=100');
}

for (i = 0; i < 5; i++) {
var url ='www.'+i+'.com';
performCalc(url);
}          
</script>

Thursday, 12 February 2015

Magento – Get Logged In Customer’s Full Name, First Name, Last Name and Email Address

// Check if any customer is logged in or not
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
 
    // Load the customer's data
    $customer = Mage::getSingleton('customer/session')->getCustomer();
 
    $customer->getPrefix();
    $customer->getName(); // Full Name
    $customer->getFirstname(); // First Name
    $customer->getMiddlename(); // Middle Name
    $customer->getLastname(); // Last Name
    $customer->getSuffix();
 
    // All other customer data
    $customer->getWebsiteId(); // ID
    $customer->getEntityId(); // ID
    $customer->getEntityTypeId(); // ID
    $customer->getAttributeSetId(); // ID
    $customer->getEmail();
    $customer->getGroupId(); // ID
    $customer->getStoreId(); // ID
    $customer->getCreatedAt(); // yyyy-mm-ddThh:mm:ss+01:00
    $customer->getUpdatedAt(); // yyyy-mm-dd hh:mm:ss
    $customer->getIsActive(); // 1
    $customer->getDisableAutoGroupChange();
    $customer->getTaxvat();
    $customer->getPasswordHash();
    $customer->getCreatedIn(); // Admin
    $customer->getGender(); // ID
    $customer->getDefaultBilling(); // ID
    $customer->getDefaultShipping(); // ID
    $customer->getDob(); // yyyy-mm-dd hh:mm:ss
    $customer->getTaxClassId(); // ID
}

Friday, 30 January 2015

Chain select drop down And Table Row

Chain select drop down And Table Row


<!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> Chain select drop down And Table Row Added By Sanjay Singh Rao</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
$( document ).ready(function() {
$("#selectadult").val(0);
$( "#chkavl" ).click(function() {
var adcout=$("#selectadult").val();
var cdcout=$("#selectchild").val();
if($(".appendRow").length > 0){
$('#myTable tr.appendRow').remove();
}
var tblHtml = '';
var k=1;
if(adcout > 0){
for(i=0;i<adcout;i++){
tblHtml += '<tr class="appendRow"><td width="5%" height="30">&nbsp;'+ k +'</td><td width="5%" height="30">Adult</td>';
tblHtml += '<td width="15%" height="30"><input type="text" name="adultName[]" value="" id="adultName'+ k +'"></td>';
tblHtml += '<td width="15%" height="30"><input type="text" name="adultAge[]" value="" id="adultAge'+ k +'"></td>';
tblHtml += '<td width="15%" height="30"><select name="adultGender[]"><option value="Male">Male</option><option value="Female">Female</option></select></td>';
tblHtml += '<td width="15%" height="30"><input type="text" name="adultIdProof[]" value="" id="adultIdProof'+ k +'"></td>';
 k++;
}
}
if(cdcout > 0){
for(i=0;i<cdcout;i++){
tblHtml += '<tr class="appendRow"><td width="5%" height="30">&nbsp;'+ k +'</td><td width="5%" height="30">Child</td>';
tblHtml += '<td width="15%" height="30"><input type="text" name="childName[]" value="" id="childName'+ k +'"></td>';
tblHtml += '<td width="15%" height="30"><input type="text" name="childAge[]" value="" id="childAge'+ k +'"></td>';
tblHtml += '<td width="15%" height="30"><select name="childGender[]"><option value="Male">Male</option><option value="Female">Female</option></select></td>';
tblHtml += '<td width="15%" height="30"><input type="text" name="childIdProof[]" value="" id="childIdProof'+ k +'"></td>';
 k++;
}
}
if(tblHtml.length > 0){
$('#myTable').append(tblHtml);
}
});

});
</script>
<script language="javascript" type="text/javascript">

function setOptions(chosen) {
var selbox = document.myform.opttwo;

selbox.options.length = 0;
if (chosen == " ") {
  selbox.options[selbox.options.length] = new Option('Please Select Child','0');

}
if (chosen == "1") {
  selbox.options[selbox.options.length] = new Option('Please Select Child','0');
  selbox.options[selbox.options.length] = new Option('1','1');
  selbox.options[selbox.options.length] = new Option('2','2');
selbox.options[selbox.options.length] = new Option('3','3');
  selbox.options[selbox.options.length] = new Option('4','4');
  selbox.options[selbox.options.length] = new Option('5','5');
selbox.options[selbox.options.length] = new Option('6','6');
  selbox.options[selbox.options.length] = new Option('7','7');

}
if (chosen == "2") {
   selbox.options[selbox.options.length] = new Option('Please Select Child','0');
  selbox.options[selbox.options.length] = new Option('1','1');
  selbox.options[selbox.options.length] = new Option('2','2');
selbox.options[selbox.options.length] = new Option('3','3');
  selbox.options[selbox.options.length] = new Option('4','4');
  selbox.options[selbox.options.length] = new Option('5','5');
selbox.options[selbox.options.length] = new Option('6','6');
}
if (chosen == "3") {
   selbox.options[selbox.options.length] = new Option('Please Select Child','0');
  selbox.options[selbox.options.length] = new Option('1','1');
  selbox.options[selbox.options.length] = new Option('2','2');
selbox.options[selbox.options.length] = new Option('3','3');
  selbox.options[selbox.options.length] = new Option('4','4');
  selbox.options[selbox.options.length] = new Option('5','5');

}
if (chosen == "4") {
   selbox.options[selbox.options.length] = new Option('Please Select Child','0');
  selbox.options[selbox.options.length] = new Option('1','1');
  selbox.options[selbox.options.length] = new Option('2','2');
selbox.options[selbox.options.length] = new Option('3','3');
  selbox.options[selbox.options.length] = new Option('4','4');

}
if (chosen == "5") {
   selbox.options[selbox.options.length] = new Option('Please Select Child','0');
  selbox.options[selbox.options.length] = new Option('1','1');
  selbox.options[selbox.options.length] = new Option('2','2');
selbox.options[selbox.options.length] = new Option('3','3');
  
}
if (chosen == "6") {
   selbox.options[selbox.options.length] = new Option('Please Select Child','0');
  selbox.options[selbox.options.length] = new Option('1','1');
  selbox.options[selbox.options.length] = new Option('2','2');
}
if (chosen == "7") {
   selbox.options[selbox.options.length] = new Option('Please Select Child','0');
  selbox.options[selbox.options.length] = new Option('1','1');
}
}
</script>
<style type="text/css">
.select{
font-family:tahoma;
font-size:11px;
color:#000000;
font-weight:normal;
width:215px;
}
</style>
</head>

<body>

<div class="container"><!-- middle div starts here-->
<div><input type="button" id="chkavl" name="chkavl" value="Check Availability" /></div>
<div class="middle">
    <div class="right-outer"><div class="center">
      <div class="content"><form name="myform"><div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tbody><tr>
    <td width="33%">
<select id="selectadult" name="optone" class="select" size="1" onchange="setOptions(document.myform.optone.options[document.myform.optone.selectedIndex].value);">
<option value="0">Please Select Adult</option>
          <option value="1">1</option>
          <option value="2">2 </option>
          <option value="3">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
          <option value="6">6</option>
<option value="7">7</option>
          <option value="8">8</option>
</select>
</td>
    <td width="33%">
<select name="opttwo" size="1" class="select" id="selectchild">
<option value="0" selected="selected">Please Select Child</option>
</select></td>
    <td width="33%"></td>
  </tr>
  
</tbody></table>

<table width="100%" border="1" cellspacing="5" cellpadding="5" id="myTable">
 <tbody><tr>
<td width="5%" height="30">&nbsp;#</td>
<td width="5%" height="30">&nbsp;Type</td>
        <td width="35%" height="30">&nbsp;Name</td>
 <td width="15%" height="30">&nbsp;Age</td>
        <td width="15%" height="30">&nbsp;Gender</td>
   <td width="30%" height="30">&nbsp;ID Proof Number<span>*</span></td>
        </tr>
</tbody></table>
</div>

<div id="chkAvailability"></div>
</form> 

</div>
</div>
    </div>
</div>
</div>
</body></html>

Work with cmd (Command Line) For database import, Yii Setup, Composer check,

Work with cmd (Command Line)  For database import, Yii Setup, Composer check Belwo images and commands









Check the Composer Install or not With Detail Information

To check the composer is install or not in your windows system. By run the below command line code.


In the image the a1b-sr is the name of the user created in your windows system.

Monday, 1 September 2014

Smarty: Request variables and other useful smarty functions


{$smarty} reserved variable The PHP reserved {$smarty} variable can be used to access several enviroment and request variables. The full list of them follows. Request variables {* display value of page from URL ($_GET) phplessonstips.blogspot.in/index.php?page=foo *} {$smarty.get.page} {* display the variable "page" from a form ($_POST['page']) *} {$smarty.post.page} {* display the value of the cookie "username" ($_COOKIE['username']) *} {$smarty.cookies.username} {* display the server variable "SERVER_NAME" ($_SERVER['SERVER_NAME'])*} {$smarty.server.SERVER_NAME} {* display the system environment variable "PATH" *} {$smarty.env.PATH} {* display the php session variable "id" ($_SESSION['id']) *} {$smarty.session.id} {* display the variable "username" from merged get/post/cookies/server/env *} {$smarty.request.username} {$smarty.now} The current timestamp can be accessed with {$smarty.now} {* use the date_format modifier to show current date and time *} {$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'} {$smarty.version} Returns the version of Smarty the template was compiled with.

List OF BANK PAN Numbers

List OF BANK PAN Numbers Bank/Home Loan Providers PAN Number Allahabad Bank AACCA8464F Andhra Bank AABCA7375C Axis Bank...