May 28, 2013

Ajax Example in Zend Framework


/* Part1: Client Side Code  */

<div id="content">
    <a href="javascript:void(0);" onclick="callAjax();">Click Here To Call Ajax Method</a>  
</div>

<script>
function callAjax()
{
    var baseurl = getBaseURL();
    var data = '';
    var param1 = '1';
    var param2 = '2';
    var param3 = '3';
    data += "param1="+param1+"&param2="+param2+"&param3="+param3;
    jQuery.ajax({
        url: baseurl+"controllerName/actionName",
        type: "POST",
        dataType: 'json',
        data: data,
        success: function(data){
            for(i=0;i<data.length;i++){
               alert(data[i]);
           }
        },
        error:function(){
            alert("Ajax request failed.");
        }
    });
}

</script>

/* Part2: Server Side Code  */


/* Contrller Name: Index
   Action Name: testajaxcall
*/
class IndexController extends Zend_Controller_Action {
public function testajaxcallAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$params = $this->_request->getParams();

if (isset($params['param1']))
$param1 = $params['param1'];

if ("" != $param1)
{
$msg = array();
/* Business logic here
---- --- --
---
*/
$msg[] = 'Success';
echo json_encode($msg);
exit;
}
}
}

Note: You will know more about jQuery & Download latest version of jQuery from  
http://jquery.com/

May 24, 2013

SAIL Recruitment 2013 – VISL

VISVESVARAYA IRON AND STEEL PLANT
BHADRAVATI-577 301, District:SHIVAMOGGA, KARNATAKA STATE

Employment Notification No. Pers(W)/01/2013

Visvesvaraya Iron & Steel Plant, Bhadravati, a unit of Steel Authority of India
Limited, is looking for competent personnel for recruitment to the following posts:

1 Post : Operator –cum-Technician – Trainees:

Discipline SC ST OBC UR PH No. of Posts.
Diploma in Mechanical 02 –04 (incl. one Backlog)

Diploma in Metallurgy 02 01 04 (incl. one Backlog)

Diploma in Electrical or Electrical & Electronics
Diploma in Mechatronics
Diploma in Computer Science
*Dip-in-Mechatronics is a combination of Mechanical, Instrumentation and Automation subjects
.
2. Post : Junior Operator –cum-Technician – Trainees:
Trade SC ST OBC UR PH No. of Posts.
Heavy vehicle driver
(Pay Loader
/Dumper Operator)

**Reservation for PH is on the horizontal basis. In case of Physically Handicapped candidates
(PH), the posts are reserved for Orthopaedically Handicapped (one arm affected, one leg
affected) with a minimum of 40% disability.
Reservation for Ex-servicemen is on the horizontal basis
Vacancies (including Reserved vacancies) are provisional and may vary according to the
requirement of the Company.

Click Here to download Official Advt.

Click Here to Apply Online


May 23, 2013

JQuery Animated Menu Free


Click on below links for Demo & Sample code...

How to Make a Smooth Animated Menu with jQuery





Note: You will know more about jQuery & Download latest version of jQuery from  
http://jquery.com/

May 15, 2013

Magento: addAttributeToFilter & Conditions

Examples:

/* Showing all disabled products having  display_date less than equal to current date */


$model = Mage::getModel('catalog/product');


$currentTimestamp = Mage::getModel('core/date')->timestamp(time());
$currentDate = date('Y-m-d', $currentTimestamp);


$collection = $model->getCollection()
   ->addAttributeToSelect(array('entity_id', 'status'))
   ->addAttributeToFilter('status', array('eq' => 2)) // 2- Disabled products
   ->addAttributeToFilter('display_date', array('lteq' => $currentDate));

Note: 'display_date' is a custom attribute.

# Following are the some examples of conditions:

Equals:
$_products->addAttributeToFilter('status', array('eq' => 1));

Not Equals:
$_products->addAttributeToFilter('sku', array('neq' => 'testsku'));

Like:
$_products->addAttributeToFilter('sku', array('like' => 'PG%'));

Not Like:
$_products->addAttributeToFilter('sku', array('nlike' => 'testprod%'));

In:
$_products->addAttributeToFilter('id', array('in' => array(1,3,8)));

Not In:
$_products->addAttributeToFilter('id', array('nin' => array(1,3,8)));

Greater Than:
$_products->addAttributeToFilter('id', array('gt' => 6));

Less Than:
$_products->addAttributeToFilter('id', array('lt' => 6));

Greater Than or Equals To:
$_products->addAttributeToFilter('id', array('gteq' => 6));

Less Than or Equals To:
$_products->addAttributeToFilter('id', array('lteq' => 6));

Note: You will know more about Magento & Download latest version of Magento from http://www.magentocommerce.com/

Magento: How to get current date

How to Get Current Date:
Example:

$currentTimestamp = Mage::getModel('core/date')->timestamp(time());
echo $currentDate = date('Y-m-d', $currentTimestamp);

How to format Dates:
Example:
$Date = '2013-05-15';
$dateTimestamp = Mage::getModel('core/date')->timestamp(strtotime($Date));
echo $currentDate = date('d.m.Y', $dateTimestamp);

Note: You will know more about Magento & Download latest version of Magento from http://www.magentocommerce.com/