Do you need a PHP programmer?
Use my services as a freelance PHP programmer by hiring me to do PHP programming on your website project.

I have built many custom PHP applications like project managers, classified ad websites and content management systems. I also work with open source applications such as WordPress, online shopping cart websites like Magento and develop content management systems like Joomla.

Thursday, January 31, 2013

Module Block User Online / Visitor Counter Prestashop 1.5

Hi guys, Are you looking for block user online / visitor counter widget in prestashop 1.5?
Download module here.

1. unzip it. put blockuseronline directory module in prestashop\modules.
2. go to your admin panel. (www.myshop.com/adminxxx)
3. On main menu choose Modules -> Modules
4. All modules will appear.
5. On left side menu, choose other modules (on the bottom).
6. Install block user online modules then visitor counter widget will appear in your front page

This is sample image of the result:



Best regard,
Bayu Prawira

Monday, January 28, 2013

View Counter (Update field +1) - Cakephp

Hi Hallo,
This week (29 jan 2013), I still work in my current project with cakephp framework.
Today I find small problem but I will always share with you guys. I work on I called view counter, where if there any client view detail of any property in my site, it will update field count in database +1.
Maybe it look easy if we do with php and sql. But how we can do it with cakephp framework?

I'm googling, and found this code below:

$this->Article->updateAll(
             array('Property.count' => 'Property.count + 1'),
             array('Property.id' => 5)
);


Hope it can help,
But if you still have any question, write your comment below.

Kind regard,
Bayu Prawira

Thursday, January 24, 2013

Get date of one week based on week number - php

Hi, ,
There are many kind of php function you can use for datetime manipulation. But today I will share a short code that you can use for get date of one week based on your week number.

I have created a function that you can use or develop
Let see my function below :

<?php
 function get_date_in_week($year,$week_number){
  $date = array();
  
  // 1 week 7 days
  for($day = 1; $day <= 7; $day++){
   
   $set_date = strtotime($year."W".($week_number<10?'0':'').$week_number.$day);
   
   if(date('Y',$set_date) == $year){
    $date['year-'.$year]['week-'.$week_number]['day-'.$day] = date('j', $set_date);
   }
   
  }
  
  return $date;
  
 }
?>


Now, you can simple to use, just call the function then you will get date of one week based on your week number.

<pre>
 <?php
  $year = '2013';
  $week_number = '2';
  print_r(get_date_in_week($year,$week_number));
 ?>
</pre>


The result will be like this :

Array
(
    [year-2013] => Array
        (
            [week-2] => Array
                (
                    [day-1] => 7
                    [day-2] => 8
                    [day-3] => 9
                    [day-4] => 10
                    [day-5] => 11
                    [day-6] => 12
                    [day-7] => 13
                )

        )

)

Hope it can helps.
But if you still need help, just write your comment below.
I will try to find out.

Kind regard,
Bayu Prawira