Wednesday, February 12, 2014

How to Create simple Dynamic menu using HTML and CSS

Here Goes the HTML PART please add below css page in to your html part(header section)
<link href="test_css.css" rel="stylesheet" type="text/css">
_________________________________________________________________________________
<div>
  <ul id="trans-nav">
 <li class="active"><a href="#" target="_top">Dash Board</a></li>
 <li><a href="#">My Account</a></li>
 <li><a href="#">Manage Trials</a>
  <ul>
   <li><a href="#">Add Trial Manager</a></li>
   <li><a href="#">View Trials</a></li>
  </ul>
 </li>
 <li><a href="#" target="_top">Manage Category</a>
 <ul>
    <li><a href="#" target="_top">Create Crop</a></li>
     <li><a href="#" target="_top">Create Category</a></li>
     <li><a href="#" target="_top">Create Sub Category</a></li>
 </ul>
  <li><a href="#" target="_top">Reports</a></li>
  <li><a href="#" target="_top">Logout</a></li>
 </li>
 </ul>
</div>
_________________________________________________________________________________
Here is the CSS part save it give any name for ex xy.css
_________________________________________________________________________________
#trans-nav { list-style-type: none; height: 40px; padding: 0; margin: 0; }
#trans-nav { list-style-type: none; height: 40px; padding: 0; margin: 0; }
#trans-nav li { float: left; position: relative; left:225px; padding: 0; line-height: 90px; min-width:150px;  background: #279174; }
#trans-nav li:hover { background-position: center; }
#trans-nav li a { display: block; padding: 0 15px; color: #fff; text-decoration: none; }
#trans-nav li a:hover { color: #a3f1d7; }
#trans-nav li ul { opacity: 0; position: absolute; left: 0; width: 15em; background: #63867f; list-style-type: none; padding: 0; margin: 0; }
#trans-nav li:hover ul { opacity: 1; }
#trans-nav li ul li { float: none; position: static; height: 0; line-height: 0; background: none; }
#trans-nav li:hover ul li { height: 30px; line-height: 30px; }
#trans-nav li ul li a { background: #63867f; }
#trans-nav li ul li a:hover { background: #279174; }

Thursday, February 6, 2014

Mgento 1.2 How we can implement Graphical Chart result in php!

Easy Sample code to implement:
 four type of graph given with Variables are User defined!
<?php
require ('gChart.php');
ini_set('display_errors','1');
 $type = $_POST["type"];
 $var1 = $_POST["var1"];
 $var2 = $_POST["var2"];
 $var4 = $_POST["var4"];
 $var3 = $_POST["var3"];
?>
<?php
ini_set('display_errors','1');
?>
<html>
<head>
<title>Test</title>

<style type="text/css">
img { display:block; }
</style>
</head>
<body>
<h1>Sample charts</h1>
<h1>Quick examples.</h1>
<table align="center">
<tr>
<td>
<h2>Pie Chart</h2> // Type1
<?php
$piChart = new gPieChart();
$piChart->addDataSet(array($var1,$var2,$var3,$var4));
$piChart->setLegend(array("first", "second", "third","fourth"));
$piChart->setLabels(array("first", "second", "third","fourth"));
$piChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa"));
?>
<img src="<?php print $piChart->getUrl();  ?>" /> <br> Simple chart .
</td>
<td>
<h2>3D Pie Chart</h2> type2
<?php
$pie3dChart = new gPie3DChart();
$pie3dChart->addDataSet(array($var1,$var2,$var3,$var4));
$pie3dChart->setLegend(array("first", "second", "third","fourth"));
$pie3dChart->setLabels(array("first", "second", "third","fourth"));
$pie3dChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa"));
?>
<img src="<?php print $pie3dChart->getUrl();  ?>" /> <br> 3D Simple Chart.
</td>
</tr>
<tr>
<td>
<h2>Grouped Bar Chart</h2> type3
<?php
$barChart = new gBarChart(250,250,'s');
$barChart->addDataSet(array(0,10,20,30,20,70,80));
$barChart->addDataSet(array(0,20,10,5,20,30,10));
$barChart->addHiddenDataSet(array(10,0,20,15,60,40,30));
$barChart->addValueMarkers('D','76A4FB',2,0,3);
$barChart->setAutoBarWidth();
?>
<img src="<?php print $barChart->getUrl();  ?>" /> <br> compound bar chart using the gGroupedBarChart class and addValueMarkers().
</td>
<td>
<h2>Line Chart with Grid Lines</h2> type4
<?php
$lineChart = new gLineChart(300,300);
$lineChart->addDataSet(array($var1,$var2,$var3,$var4));
$lineChart->addDataSet(array(212,115,366,140));
$lineChart->addDataSet(array(112,95,116,140));
$lineChart->setLegend(array("first", "second", "third","fourth"));
$lineChart->setColors(array("ff3344", "11ff11", "22aacc", "3333aa"));
$lineChart->setVisibleAxes(array('x','y'));
$lineChart->setDataRange(0,400);
$lineChart->addAxisRange(0, 1, 4, 1);
$lineChart->addAxisRange(1, 0, 400);
$lineChart->setGridLines(33,10);
?>
<img src="<?php print $lineChart->getUrl();  ?>" /> <br> line chart using the gLineChart class.
</td>
</tr>
</table>
</body>
</html>

Wednesday, February 5, 2014

Some Important PHP Functions

Some String Functions in Php
1.      String Length in Php:
<?php
echo strlen("Hello world!");
?>

2.      String Position
<?php
echo strpos("Hello world!","world");
?>
3.      String Constant
<?php
define("GREETING", "Welcome to W3Schools.com!");
echo GREETING; // not Case-sensitive.
echo greeting;
?>
Note: Every time we echo GREETING it will print Welcome to W3Schools.com!
4.      Some Tricky arithmetic operations are
<?php 
$x=10; 
echo $x; // outputs 10

$y=20; 
$y += 100;
echo $y; // outputs 120

$z=50;
$z -= 25;
echo $z; // outputs 25

$i=5;
$i *= 6;
echo $i; // outputs 30

$j=10;
$j /= 5;
echo $j; // outputs 2

$k=15;
$k %= 4;
echo $k; // outputs 3
?>
5.      String Operations
<?php
$a = "Hello";
$b = $a . " world!";
echo $b; // outputs Hello world! 

$x="Hello";
$x .= " world!";
echo $x; // outputs Hello world! 
?>
6.      PHP foreach loop
<?php 
$colors = array("red","green","blue","yellow"); 
foreach ($colors as $value)
  {
  echo "$value <br>";
  }
?>
7.      User Defined Function in PHP
<?php
function writeMsg()
{
echo "Hello world!";
}
writeMsg(); // call the function

?>
8.  Function argument

<?php
function familyName($fname)
{
echo "$fname Refsnes.<br>";
}

familyName("Jani");
familyName("Hege");
familyName("Stale");
familyName("Kai Jim");
familyName("Borge");
?>

Tuesday, February 4, 2014

Magento 1.1 EAV-Database model

Entity–attribute–value model

Entity–attribute–value model (EAV) is a data model to describe entities where the number of attributes (properties, parameters) that can be used to describe them is potentially vast.
 In mathematics, this model is known as asparse matrix.

EAV is also known as object–attribute–value model,vertical database model and open schema.
Many cases where data can be modelled in statically relational terms an EAV based approach is an anti-pattern which can lead to longer development times.

we have a user entity which has attribute firstname,lastname,address then in traditional table structure we would create a table with name ‘user’ and add columns to the table named firstname,lastname,address. Maybe a few more columns like Primary Key or Foreign Key depending on our business requirements.

entity in which the number of attribute/columns is very large lets say 100 and on top of that only few attributes are required i.e when we gather data about that entity out of the 100 columns around 10% of the columns we get data, rest 90% we rarely get data. In such a case our traditional table would have a single table with 100 columns and most the columns would be empty or filled with NULL values. This would be a very bad table structure for such a data. In such case, we use EAV database model for tables.

Monday, February 3, 2014

Magento a latest and new buzz in e-commerce industry stay tuned(It's main post remain posts will be Magento 1.1 and further)

What exactly a magento is:
               it's an e commerce standard for performing all the task a e-commerce site may need, it's simple you can add custom HTML contents in non intrusive manner, without modifying magento template,

what are the overall things that we need to know about magento
* how to handle magento layouts.
*accessing layout xml files.
*Bolcks & templetes.
*how its can be a alternative to widgets.

you can add third extensions like 
*Google analytics.
*Reinvigorate.
*Crezy egg.
 though about later two i dn't know much about.

Going to the basics of magent.
-It has some app code directories.
-a structure and creation of magento module.
-Enent observer.
-logging.

Two be a Magento expert you have to Disable the cache
 which you can do using # Admin panel->System->Cache Management->Select all->Action: Disable->Submit
 
1.App code directory which is something a functional module for Product, Category, Customer, Payment
 app/data/core
2.Provided by third party available through magento connect built in function, which is package manager.
app/data/community
3.It's somethong which is used to add bespoke module(bespoke i don't know)
app/data/local
4.Another important thing is module name-space
for say app/code/local/SmashingMagazine 
Files are case sensitive.

Structure
app
 -code
   -local
     -SmashingMagazine
       -log product update
         -etc
           -config.xml
         -etc
     -log product update
-SmashingMagazine
 -local
 -code
app



Saturday, August 24, 2013

Wamp server is not working/Yellow!

I’be been working on php for 2 months now and developing on my laptop with WAMP installed before uploading to work’s dev server. Now working with SQL Server instead of MySQL, I’ve installed SQL SERVER 2008 CTP for test and suddently Apache went down as port 80 was used by Microsoft HTTPAPI/2.0.
I then found SSRS (SQL Server Reporting Services) was still running after uninstalling SQL Server 2008 as it features a web service even though IIS is not installed according to wiki.
I couldn’t find any info on google relating to this small issue that puzzled me for a short while. i hope this helps finding ppl stupid like me sometimes to solve their problem.

Solution: Just disabled the SQL Reporting Service and I can finally use port 80 again
process  step 1: Run->services.msc->SQL Reporting Service just disable it!
or
Switch off Skype from there!