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.

Thursday, 28 August 2014

Add Drop Down to Yii Grid


Add  Drop Down to Yii Grid

$myColumns [] = array(
    'type' => 'raw',
    'header' => "Page Size",
'filter' => CHtml::dropDownList('pageSize', $pageSize, Yii::app()->params['defaultPageDdSize'], array('style' => 'font-size:11px; width: 50px; padding: 0px 0px 0px 0px; height: initial; ',)),
      'value' => '"<a href=\'javascript:void(0);\' onclick=\'renderView(".$data->id_games.")\' class=\'view\' data-toggle=\'tooltip\' title=\'\' data-original-title=\'View\'>
                  <i class=\'icon-eye-open\'></i></a> &nbsp;
      <a href=\'' . Yii::app()->controller->createUrl('update&id=$data->id_games') . '\' class=\'update\'  data-toggle=\'tooltip\' title=\'\' data-original-title=\'Update\'>
        <i class=\'icon-pencil\'></i></a> &nbsp;
<a class=\'delete\' onclick=\'renderDeleteForm(".$data->id_games.")\' data-toggle=\'tooltip\' title=\'\' data-original-title=\'Delete\'>
        <i class=\'icon-trash\'></i></a>
"',
    'htmlOptions' => array('class' => 'button-column','style' => 'width:62px')
);

Monday, 18 August 2014

Get the count of records from a table in yii


Get the count of records from a table .
The best of way of retrieving the count of a query in yii.

For all record
$sql = "SELECT COUNT(*) FROM tablename;
$numRecordsFound = Yii::app()->db->createCommand($sql)->queryScalar();

For Criteria Based record.

$sql = "SELECT COUNT(*) FROM tablename where columnName=".$columnValue;
$numRecordsFound = Yii::app()->db->createCommand($sql)->queryScalar();

Monday, 11 August 2014

Window.location.href () and Window.open () methods in JavaScript


window.location.href is not a method, it's a property that will tell you the current URL location of the browser. Setting the property to something different will redirect the page.

window.open() is a method that you can pass a URL to that you want to open in a new window. For
example:
window.location.href example:
window.location.href = 'phplessonstips.blogspot.in'; //Will take you to phplessonstips blog.
window.open() example:

window.open('phplessonstips.blogspot.in'); //This will open phplessonstips.blogspot.in in a new window.

List OF BANK PAN Numbers

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