Wednesday, 13 May 2015

Team Leader Interview Questions

  • Tell me about yourself?
  • What are your biggest strengths?
  • Why did you leave your last job?
  • What are your career goals?
  • Why do you want to work here?
  • What is your greatest weakness?
  • What do co-workers say about you?
  • How can you handle it when the boss is wrong?
  • Whoever else learned out of your mistakes
  • What courses do you taking part in?
  • What qualifications do you have beyond academics that qualify you t o make a successful transition into business?
  • How can you handle challenging? Give a good example.
  • Maybe you have designed a mistake?
  • What you would do if two of your team were arguing over how to complete a task?
  • What steps do you take to motivate your team?
  • Why do you want this job?
  • What is the biggest challenge you have faced in work in the past 12 months?
  • What do you know about the centre/company/role?
  • How would your team/manager describe you?
  • What is your biggest achievement?
  • What have you done to promote great customer service?
  • How do you manage change?
  • What was your reason for leaving?
  • Give me an example of how you have dealt with an under-performing team member in the past.
  • Can you give me an example of a time when you had to motivate and develop a team in a challenging work environment?
  • What are your strengths and weaknesses?
  • Tell me about a difficult obstacle you had to overcome recently at work? How did you overcome this?
  • What steps you follow to complete project successfully?

Tuesday, 12 May 2015

Zend framework pagination with array adapter - with code snippets

Zend pagination can be implemented with used of pagination component which is available with Zend Framework v1.6.
It is so loosely coupled that you can use it wherever you want without worrying about any other component at all.

Zend framework pagination with array adapter


In zend frameowork 1.12, Zend paging component provides 5 types of Adapter and are following:
1. Array:
Use a PHP array.
2. DbSelect: Use a Zend_Db_Select instance which return an array.
3. DbTableSelect: Use a Zend_Db_Table_Select instance, which will return the instance of Zend_Db_Table_Rowset_Abstract.
4. Iterator: Use an Iterator instance.
5. Null: Do not use Zend_Paginator to manage data pagination. You can still take advantage of the pagination control feature.

Above out of 5, Here we are using first one with code snippets.



Add following code in views/scripts/mypaging.phtml (This is global file paging)
<div class="pagination" style="width:100%">
    <div style="float:left;width:28%">
    </div>
    <div style="float:right;width:70%;">
        <!-- First page link -->
        <?php if (isset($this->previous)): ?>
              <a href="/<?php echo $this->url(array('page' => $this->first)); ?>">Start</a> |
        <?php else: ?>
                <span class="disabled">Start</span> |
        <?php endif; ?>
 
        <!-- Previous page link -->
 
        <?php if (isset($this->previous)): ?>
              <a href="/<?php echo $this->url(array('page' => $this->previous)); ?>">&lt; Previous</a> |
        <?php else: ?>
            <span class="disabled">&lt; Previous</span> |
        <?php endif; ?>
        <!-- Numbered page links -->
        <?php foreach ($this->pagesInRange as $page): ?>
            <?php if ($page != $this->current): ?>
                <a href="/<?php echo $this->url(array('page' => $page)); ?>"><?php echo $page; ?></a>
            <?php else: ?>
                <?php echo $page; ?>
            <?php endif; ?>
        <?php endforeach; ?>
        <!-- Next page link -->
        <?php if (isset($this->next)): ?>
              | <a href="/<?php echo $this->url(array('page' => $this->next)); ?>">Next &gt;</a> |
        <?php else: ?>
            | <span class="disabled">Next &gt;</span> |
        <?php endif; ?>
        <!-- Last page link -->
        <?php if (isset($this->next)): ?>
              <a href="/<?php echo $this->url(array('page' => $this->last)); ?>">End</a>
        <?php else: ?>
         
        <?php endif; ?>      
    </div>
 </div>


Add Following CSS File for paging- It will design the paging and you can change as per your requirement.
.pagination li {
        border: 0;
        margin: 0;
        padding: 0;
        font-size: 11px;
        list-style: none; /* savers */
        float: left;
}

/* savers .pagination li,*/
.pagination a {
        border-right: solid 1px #DEDEDE;
        margin-right: 2px;
}

.pagination .previous-off,.pagination .next-off {
        color: #888888;
        display: block;
        float: left;
        font-weight: bold;
        padding: 3px 4px;
}

.pagination .next a,.pagination previous a {
        border: none;
        font-weight: bold;
}

.pagination .active {
        color: #000000;
        font-weight: bold;
        display: block;
        float: left;
        padding: 3px 6px; /* savers */
        border-right: solid 1px #DEDEDE;
}

.pagination a:link,.pagination a:visited {
        color: #0e509e;
        display: block;
        float: left;
        padding: 3px 6px;
        text-decoration: underline;
}

.pagination a:hover {
        text-decoration: none;
}



Add Following code in your action of controller.
This is will responsible only for paging.
$data = range(1, 100);
$page = $this->getRequest()->getParam('page', 0);
$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Array($data));
$paginator->setCurrentPageNumber($page);//This is current page       
$paginator->setItemCountPerPage(20); //Total number of records per page
$this->view->paginator = $paginator;  



Add Following code in your view file of action.
This will list the records.

<?php if (count($this->paginator)): ?>
    <ul>
        <?php foreach ($this->paginator as $item): ?>
            <li><?php echo $item; ?></li>
        <?php endforeach; ?>
    </ul>
<?php endif; ?>

<?php
//This is used for pagination
echo $this->paginationControl($this->paginator, 'Sliding', 'my_pagination_control.phtml');
?>