[VB.NET] Time difference and summation of time


Description
       this article will help you you , how to summation of time and time diference between 2 time, of course you can modified based on what you need. this example below using 12h format, but will return 24h format.

HowTo
time 1 : 09:30:30 AM (it's string use textbox) as lowtime
time 2 : 07:15:15 PM (it's string use textbox) as hightime

Here's the function for time difference

    Public Function timeDifference(ByVal lowtime As Date, ByVal hightime As Date)
        Dim hours, minutes, seconds
        hours = CStr(Math.Floor((hightime - lowtime).TotalHours)).PadLeft(2, "0")
        minutes = CStr(Math.Floor(((hightime - lowtime).TotalMinutes) Mod 60)).PadLeft(2, "0")
        seconds = CStr(Math.Floor(((hightime - lowtime).TotalSeconds) Mod 60)).PadLeft(2, "0")
        MsgBox(hours & ":" & minutes & ":" & seconds)
    End Function


Here's the function for summation of time

    Public Function summationOfTime(ByVal lowtime As String, ByVal hightime As String)
        Dim timespanLowtime, timespanHightime, timespanSum As TimeSpan
        timespanLowtime = TimeSpan.Parse(lowtime)
        timespanHightime = TimeSpan.Parse(hightime)
        timespanSum = timespanLowtime + timespanHightime
        MsgBox(timespanSum.ToString)
    End Function

don't worry , the function above is well format :D

[Cakephp] Component

Description
      What is component ? component is a separate class or function from cakephp that define by user. it's very usefull if you have class that you want to include in cakephp.

How To
1. Create file component in : app/controller/component/[your files here].
the rules : - name file same as name class
               - the class must extend "component"
               - outside class must be define : App::uses('Component', 'Controller');

for example i want to create custom function for ACL (access control list) :
[1]. create file with name : AclComponent.php
    // the path : app/controller/component/AclComponent.php
[2]. copy paste the code below :
 <?php   
 App::uses('Component', 'Controller');  
 class AclComponent extends Component {  
   public function authorization($role)   
   {  
     switch($role)  
     {  
     case 'ADMIN':   
       return true;  
       break;   
     case 'ROLE1':  
       return false;  
       break;   
     case 'ROLE2':   
       return false;  
       break;  
     }       
   }  
 }  
 ?>  

2. Include your custom class (component) on variable $components, make sure $components declare on app controller , so you not always declare $components in every controller.
 public $components = array('Acl','DebugKit.Toolbar','Session',......);  

3. Now you can access components in any controller , for example because we create ACL we can validate every user from the role they have in beforeFilter function. here's my custom code using for ACL.

 public function beforeFilter(){  
     parent::beforeFilter();  
     // ACL Function based on role  
     if($this->Acl->authorization('YOUR ROLE HERE'))  
     {  
       //if true then do nothing or bypass  
     }  
     else  
     {  
       // if false then force to logout (user attempt hijack from URL)  
       $this->redirect(array('controller'=>'auth','action'=>'logout'));  
     }  
   }  

done , that's all how to create a component using cakephp

[Cakephp-Template] Template Header using Bootstrap


Description
     this template is use for me :D

How to

CSS
#header
{
    padding:12px 0px 12px 0px;
    border: 2px 0px 0px 0px inset white;
    background-color: #296f87;
}

#headerLogo
{
    display: inline-block;
    color:white;
    font-weight: bolder;
    font-size: 16px;
}



HTML
<div id="header">
    <div style="width:87%;margin:auto">
        <div id="headerLogo">LOGO - </div>
        <div id="headerLogo">Traffic Promo Non Air Time Consume</div>
    </div>
</div>

<div class="navbar navbar-default" role="navigation" style="margin:0px">
    <div style="width:87%;margin:auto">
        <div class="navbar-header">
          <a class="navbar-brand" href="#">NATC</a>
        </div>

        <nav style="margin:auto" >
             <ul id="navbar-id" class="nav navbar-nav">
                <li id="index" class="active"><a href="<?php echo $this->Html->url(array('controller'=>'main','action'=>'index')) ?>"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> Home</a></li>
                <li id="search"><a href="<?php echo $this->Html->url(array('controller'=>'main','action'=>'search')) ?>"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> Search Data</a></li>
                <li id="master"><a href="<?php echo $this->Html->url(array('controller'=>'master','action'=>'index')) ?>"><span class="glyphicon glyphicon-hdd" aria-hidden="true"></span> Master Data</a></li>
                <li id="admin"><a href="<?php echo $this->Html->url(array('controller'=>'admin','action'=>'index')) ?>"><span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> Administrator</a></li>
              </ul>
        </nav>

        <ul class="nav navbar-nav navbar-right">
            <li>
                <div style="padding-top:9%;height:50px">
                    <button onclick="logout()" type="button" class="btn btn-danger">
                        <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
                        Logout
                    </button>
                </div>
            </li>
        </ul>
    </div>
</div>

[Cakephp-Template] table pagination + Jquery + bootstrap

Description
       this template is use for me :)

How to

CSS
tr
{ /* make sure change cursor when over row , it looks like profesional LOL */
    cursor: pointer;
    cursor: hand;
}

#rowtable:hover
{
    background:#a0dfff;
}

#rowtable.clicked
{ /*it means id='rowtable' class='clicked'*/
    background:#00bfff;
}



Javascript
$().ready(function(){
    $('tr').click(function() {
               $(this).removeClass("clicked");
               $(this).addClass("clicked").siblings().removeClass("clicked");
   });
});

HTML
<div id="container">
          <h2 class="page-header">View User</h2>
          <div class="pagination pagination-large">
            <ul class="pagination">
                <?php
                    echo $this->Paginator->prev(__('prev'), array('tag' => 'li'), null, array('tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
                    echo $this->Paginator->numbers(array('separator' => '','currentTag' => 'a', 'currentClass' => 'active','tag' => 'li','first' => 1));
                    echo $this->Paginator->next(__('next'), array('tag' => 'li','currentClass' => 'disabled'), null, array('tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
                ?>
            </ul>
          </div>
          <table style="margin:0 auto" class="table table-bordered">
              <tr>
                  <th>Username</th>
                  <th>Fullname</th>
                  <th>Role</th>
                  <th>Last Login</th>
                  <th>Login IP Address</th>
                  <th>Status</th>
                  <th>Action</th>
              </tr>
           
              <tr id="rowtable">
                  <td>Admin</td>
                  <td>Mahendra M.W.</td>
                  <td>Administrator</td>
                  <td>10-12-2014</td>
                  <td>xx.xx.xx.xx</td>
                  <td>Aktif</td>
                  <td style="text-align:center">
                      <a class="btn btn-primary" style="width:80px;">Edit</a>
                      <a class="btn btn-primary" style="width:80px;">Disabled</a>
                  </td>
              </tr>
           
              <tr>
                  <th colspan="16" style="text-align:left">
                      <?php echo 'Page '.$this->Paginator->counter(array(
                      'separator' => ' of '
                      ));?>
                  </th>
              </tr>
           </table>
           <?php echo $this->Js->writeBuffer(); ?>
      </div>

[WebServer] Enable SSL on Apache - Self Signed

Description
i am not the author of this article, but it's important that web not only develop develop and develop, but we must thinking about security.

Original Author : Bob Silverberg

Original Articel : Enable SSL

How to 

Step 1 - What You Need

  • A copy of Apache that includes SSL support.
  • A copy of OpenSSL.
  • An openssl.cnf file.
The copy of Apache that I had installed on my machine did not include SSL support, so I moseyed on down to the Apache download page. You'll notice on that page that there are files named something like apache_2.2.11-win32-x86-openssl-0.9.8i.msi, as well as files named something likeapache_2.2.11-win32-x86-no_ssl.msi. You need to have the openssl version installed, not the no_sslversion (duh). I couldn't find any reliable info on manually adding SSL support to a no_ssl install, so I simply downloaded the most up-to-date version of the openssl installer and ran it. It successfully upgraded my version of Apache without overwriting any of my existing config files.
The nice thing about that installer is that it includes a copy of OpenSSL, so you don't need to download that separately.
Finally, you need an openssl.cnf file, which doesn't come with the package. I downloaded one that works from Neil's site. If that link is broken you can find a copy attached to this blog post. I have Apache installed in C:\Apache\, which means that I can find OpenSSL in C:\Apache\bin\, so I copied the openssl.cnf file into that directory.

Step 2 - Create a Self-Signed Certificate

This step will create a number of files related to your certificate. Each of those files has the same name, with a different extension. In the example commands below I've used the name bob. Feel free to replace that with anything you like.
Open a command prompt and switch to the directory that contains OpenSSL (C:\Apache\bin\, in my case). To create a new certificate request type the following:

1openssl req -config openssl.cnf -new -out bob.csr -keyout bob.pem
You'll be prompted to answer a bunch of questions, the answers to which can all be left blank except for:
  • PEM pass phrase: This is the password associated with the private key (bob.pem) that you're generating. This will only be used in the next step, so make it anything you like, but don't forget it.
  • Common Name: This should be the fully-qualified domain name associated with this certificate. I was creating a certificate for a site on my local machine which I browsed to via http://savacms/, so I just entered savacms. If I was creating a cert for my blog I would have entered www.silverwareconsulting.com.
When the command completes you should have a two files called bob.csr and bob.pem in your folder.
Now we need to create a non-password protected key for Apache to use:

1openssl rsa -in bob.pem -out bob.key
You'll be prompted for the password that you created above, after which a file called bob.key should appear in your folder.
Finally, we need to create an X.509 certificate, which Apache also requires:

1openssl x509 -in bob.csr -out bob.cert -req -signkey bob.key -days 365
And that's it - you now have a self-signed certificate that Apache can use to enable SSL. I chose to move the required files from C:\Apache\bin\ to C:\Apache\conf\ssl\, but you can put them anywhere as you'll be pointing to them in your Apache config files.

Step 3 - Enable SSL on Apache

Open your httpd.conf file (which for me is in C:\Apache\conf\) and uncomment (remove the # sign) the following lines:
  • #LoadModule ssl_module modules/mod_ssl.so
  • #Include conf/extra/httpd-ssl.conf
Open your httpd-ssl.conf file (which for me is in C:\Apache\conf\extra\) and update the section entitled <VirtualHost _default_:443>. You'll need to update the values of ServerAdmin,DocumentRootServerNameErrorLog and CustomLog to match your environment. You'll also need to point SSLCertificateFile to your .cert file and SSLCertificateKeyFile to your .key file.
Restart Apache and browse to https://localhost/. You're now accessing your Apache server over SSL!

Step 4 - Create a VirtualHost Entry for Your Site

If you're like me, you're running Apache because you want to run multiple sites on your local machine. In that case you undoubtedly have multiple <VirtualHost> entries in your httpd-vhosts.conf file. In order to access a particular site via SSL, you need to add an additional <VirtualHost> entry for it. To illustrate I'll show you an existing <VirtualHost> entry that I have, and then the new <VirtualHost> that I created to allow me to access that site via SSL. Here's the original entry:

1<VirtualHost *:80>
2ServerAdmin bob.silverberg@gmail.com
3DocumentRoot C:/wwwroot/savaCMS
4ServerName savaCMS
5DirectoryIndex index.html, index.cfm
6ErrorLog logs/savaCMS-error_log
7CustomLog logs/savaCMS-access_log common
8<Directory C:/wwwroot/savaCMS>
9Options All
10AllowOverride All
11</Directory>
12</VirtualHost>
And here's the additional entry that I added:

1<VirtualHost *:443>
2SSLEngine on
3SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
4SSLCertificateFile "C:/Apache/conf/ssl/savacms.cert"
5SSLCertificateKeyFile "C:/Apache/conf/ssl/savacms.key"
6ServerAdmin bob.silverberg@gmail.com
7DocumentRoot C:/wwwroot/savaCMS
8ServerName savaCMS
9DirectoryIndex index.html, index.cfm
10ErrorLog logs/savaCMS-error_log
11CustomLog logs/savaCMS-access_log common
12<Directory C:/wwwroot/savaCMS>
13Options All
14AllowOverride All
15</Directory>
16</VirtualHost>
I can now browse to http://savaCMS/ as well as https://savaCMS/! Hopefully these instructions will be found by the next person who chooses to attempt this.

my comment : Holy shittttt great article saving my hours, thanks bob :D

if you need another reference here's the link


[Foundation] Cheat cheet foundation framework


Description
     this is cheatsheet to fast learning foundation framework, just copy paste the code and run it from your webserver apache / nginx. some element like icon won't appear until you download the icon / font on official site.

How To
<html>
 <head>
  <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/css/foundation.css" />
  <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/css/foundation.min.css" />
  <link rel="stylesheet" href="css/foundation-icons.css" />
  <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/vendor/modernizr.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/vendor/modernizr.min.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.min.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.offcanvas.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.joyride.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.alert.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.reveal.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.clearing.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.slider.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.tooltip.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.equalizer.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.tabs.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/5.3.1/js/foundation/foundation.accordion.js"></script>
  <script>
  //normal javascript
  function message()
  {
   alert("hello world");
  }
  
  // all of foundation framework use jquery
  $("document").ready(function(){
   /* activate feature such as : Alert , Off Canvas, clearing, slider, equalizer*/
   $(document).foundation();
   
   /* activate joyride feature*/
   $(document).foundation('joyride', 'start');
   
   function showModal()
   {
    $("#myModal").foundation('reveal', 'open');
    $("#myModal").foundation('reveal', 'close');
   }
   
  
  });
  </script>
  
  <!-- font size for icon set --> 
  <style>  
  .size-12 { font-size: 12px; }
        .size-14 { font-size: 14px; }      
        .size-16 { font-size: 16px; }      
        .size-18 { font-size: 18px; }      
        .size-21 { font-size: 21px; }      
        .size-24 { font-size: 24px; }      
        .size-36 { font-size: 36px; }      
        .size-48 { font-size: 48px; }      
        .size-60 { font-size: 60px; }      
        .size-72 { font-size: 72px; }
  </style>
 </head>
<body>

  <!-- classes for button -->
     <a id="satu" href="#" class="small radius button">Radius Button</a><br/>
        <a id="dua"href="#" class="small round button">Round Button</a><br/>            
        <a id="tiga"href="#" class="medium success button">Success Btn</a><br/>
        <a href="#" class="medium alert button">Alert Btn</a><br/>
        <a href="#" class="medium secondary button">Secondary Btn</a></p>  
  <a href="#" class="large button">Large Simple Button</a><br/>
        <a id="empat" href="#" class="large radius button" onclick="message()">Large Radius Button</a><br/>
        <button class="tiny button" onclick="message()">Button</button><br/>
  

  
  
  <!-- Joyride-->
   <!-- Panel-->
   <div id="firstStop" class="panel">This is Panel 1</div>
   <div id="numero1" class="panel">This is Panel 2</div>
   <div id="numero2" class="panel">This is Panel 3</div>
   
   <!-- Joyride Class-->
   <ol class="joyride-list" data-joyride>
    <li data-id="firstStop" data-text="Next" data-options="tip_location: top; prev_button: false">
     <h4>First Tutor</h4>
     <p>Hello and welcome to the Joyride documentation page, first this is Panel</p>
    </li>
    <li data-id="alertFeature" data-class="custom so-awesome" data-text="Next" data-prev-text="Prev">
     <h4>Second Tutor</h4>
     <p>this is Alert, You can close this alert by click icon close on the right.</p>
    </li>
    <li data-id="iconStyling" data-button="Next" data-prev-text="Prev" data-options="tip_location:top;tip_animation:fade">
     <h4>Third Tutor</h4>
     <p>this icon using graphic vector , styling use text property !.</p>
    </li>
    <li data-button="End" data-prev-text="Prev">
     <h4>Best Foundation Feature</h4>
     <p>Awesone this is best framework styling ever after</p>
    </li>
   </ol>
    
  
  <!-- Alert Feature-->
  <div id="alertFeature" data-alert class="alert-box success radius">
   This is a success alert with a radius.
   <a href="#" class="close">&times;</a>
  </div>

  <div data-alert class="alert-box warning round">
   This is a warning alert that is rounded.
   <a href="#" class="close">&times;</a>
  </div>

  <div data-alert class="alert-box info radius">
   This is an info alert with a radius.
   <a href="#" class="close">&times;</a>
  </div>

  <div data-alert class="alert-box alert round">
   This is an alert - alert that is rounded.
   <a href="#" class="close">&times;</a>
  </div>

  <div data-alert class="alert-box secondary">
   This is a secondary alert.
   <a href="#" class="close">&times;</a>
  </div>
  
  
  
  <!-- Off Canvas Feature -->
  <div class="off-canvas-wrap" data-offcanvas>
  <div class="inner-wrap">
   <nav class="tab-bar">
   <section class="left-small">
    <a class="left-off-canvas-toggle menu-icon" href="#"><span></span></a>
   </section>

   <section class="middle tab-bar-section">
    <h1 class="title">Foundation</h1>
   </section>

   <section class="right-small">
    <a class="right-off-canvas-toggle menu-icon" href="#"><span></span></a>
   </section>
   </nav>

   <aside class="left-off-canvas-menu">
    <ul class="off-canvas-list">
     <li><label>Foundation</label></li>
     <li><a href="#">The Psychohistorians</a></li>
     <li><a href="#">The Encyclopedists</a></li>
     <li><a href="#">The Mayors</a></li>
     <li><a href="#">The Traders</a></li>
     <li><a href="#">The Merchant Princes</a></li>
    </ul>
   </aside>

   <aside class="right-off-canvas-menu">
    <ul class="off-canvas-list">
     <li><label>Users</label></li>
     <li><a href="#">Hari Seldon</a></li>
     <li><a href="#">...</a></li>
    </ul>
   </aside>

   <section class="main-section" style="height:250px">
    Add content Here , you can adjust height the off canvas from this element ...
   </section>
   <a class="exit-off-canvas"></a>
  </div>
  </div>
  
  <!-- Paragraph-->
  <p class="text-left">Left Paragraph</p>
  <p class="text-right">Right Paragraph</p>
  <p class="text-center">Middle Paragraph</p>
  <p class="text-justify">Justify</p>
 


  <!-- Modal -->
  <a href="#" data-reveal-id="myModal" class="small button" onclick="showModal()">Click Me For A Modal</a>
  <div id="myModal" class="reveal-modal" data-reveal>
   <h2>Awesome. I have it.</h2>
   <p class="lead">Your couch.  It is mine.</p>
   <p>I'm a cool paragraph that lives inside of an even cooler modal. Wins!</p>
   <a class="close-reveal-modal">&#215;</a>
  </div>
  
  <!-- Grid System -->
  <div class="row">
   <div class="small-2 large-4 columns">small2 large4</div>
   <div class="small-4 large-4 columns">small4 large4</div>
   <div class="small-6 large-4 columns">small6 large4</div>
  </div>
  <div class="row">
   <div class="small-6 columns">large3</div>
   <div class="medium-6 columns">large6</div>
   <div class="large-3 columns">large3</div>
  </div>
 
  <!-- Grid Block -->
  <ul class="small-block-grid-3">
   <li><-- Your content goes here 1--></li>
   <li><-- Your content goes here 2--></li>
   <li><-- Your content goes here 3--></li>
   <li><-- Your content goes here 4--></li>
  </ul>
  
  <!-- Top Nav Bar -->
  <nav class="top-bar" data-topbar>
    <ul class="title-area">
   <li class="name">
     <h1><a href="#">Title Top Navigation</a></h1>
   </li>
    <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
   <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
    </ul>

    <section class="top-bar-section">
   <!-- Right Nav Section -->
   <ul class="right">
     <li class="active"><a href="#">Right Button Active</a></li>
     <li class="has-dropdown">
    <a href="#">Right Button Dropdown</a>
    <ul class="dropdown">
      <li><a href="#">First link in dropdown</a></li>
      <li class="active"><a href="#">Active link in dropdown</a></li>
    </ul>
     </li>
   </ul>
   
   <!-- Left Nav Section -->
   <ul class="left">
     <li><a href="#">Left Nav Button</a></li>
   </ul>
    </section>
  </nav>

  
  <!-- Sub Navigation -->
  <dl class="sub-nav">
    <dt>Sub Navigation:</dt>
    <dd class="active"><a href="#">First Sub Nav</a></dd>
    <dd><a href="#">Second Sub Nav</a></dd>
    <dd><a href="#">Third Sub Nav</a></dd>
    <dd><a href="#">And Last</a></dd>
  </dl>
  
  <!-- Icon Feature -->
  <!-- to use icon feature download icon pack foundation on official site -->
  <!-- to edit path , open foundation-icon.css-->
  <i class="step fi-address-book size-12"></i>
  <i class="step fi-pencil size-14"></i>
  <i class="step fi-address-book size-16"></i>
  <i class="step fi-address-book size-18"></i>
  <i class="step fi-address-book size-21"></i>
  <i class="step fi-address-book size-24"></i>
  <i class="step fi-address-book size-36"></i>
  <i class="step fi-address-book size-48"></i>
  <i class="step fi-address-book size-60"></i>
  <i id="iconStyling" class="step fi-address-book size-72" style="color:blue;text-shadow:0 0 5px red"></i>
  
  
  <!-- Breadcrumb Feature -->
  <ul class="breadcrumbs">
    <li><a href="#">Home</a></li>
    <li><a href="#">Features</a></li>
    <li class="unavailable"><a href="#">Gene Splicing</a></li>
    <li class="current"><a href="#">Cloning</a></li>
  </ul>
  
  <!-- tooltip Feature -->
  <span data-tooltip class="has-tip" title="Tooltips are awesome, you should totally use them!">extended information</span>
  
  
  <!-- range slider Feature-->
  <div class="row">
    <div class="small-10 medium-11 columns">
   <div class="range-slider" data-slider data-options="display_selector: #sliderOutput3;">
     <span class="range-slider-handle"></span>
     <span class="range-slider-active-segment"></span>
   </div>
    </div>
    <div class="small-2 medium-1 columns">
   <span id="sliderOutput3"></span>
    </div>
  </div>
  
  <!-- Pricing Table Feature -->
  <ul class="pricing-table">
    <li class="title">Standard</li>
    <li class="price">$99.99</li>
    <li class="description">An awesome description</li>
    <li class="bullet-item">1 Database</li>
    <li class="bullet-item">5GB Storage</li>
    <li class="bullet-item">20 Users</li>
    <li class="cta-button"><a class="button" href="#">Buy Now</a></li>
  </ul>
  <!-- Thumbnail Feature -->
  <a class="th" href="https://ssl.gstatic.com/gb/images/v1_2e543709.png">
   <img src="https://ssl.gstatic.com/gb/images/v1_2e543709.png">
  </a>
  
  <!-- Clearing Feature -->
  <ul class="clearing-thumbs" data-clearing>
   <li><a href="http://www.zurb.com/blog/system/images/1028/original/balance.jpg?1377285282"><img src="http://www.zurb.com/blog/system/images/1028/original/balance.jpg?1377285282-th"></a></li>
   <li><a href="http://www.zurb.com/blog/system/images/1021/original/icon-progress.jpg?1377283888"><img src="http://www.zurb.com/blog/system/images/1021/original/icon-progress.jpg?1377283888"></a></li>
   <li><a href="http://zurb.com/playground/uploads/project/thumb/5/foundation-icons.jpg"><img src="http://zurb.com/playground/uploads/project/thumb/5/foundation-icons.jpg-th"></a></li>
  </ul>
  
  <!-- Equalizer Feature -->
  <div class="row" data-equalizer>
    <div class="large-6 columns panel" data-equalizer-watch>
   Pellentesque habitant morbi tristique senectus 
   et netus et malesuada fames ac turpis egestas. 
   Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, 
   ante. Donec eu libero sit amet quam egestas semper. 
   Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
    </div>
    <div class="large-6 columns panel" data-equalizer-watch>
    Pellentesque habitant morbi tristique senectus 
   et netus et malesuada fames ac turpis egestas. 
   Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, 
   ante. Donec eu libero sit amet quam egestas semper. 
   Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
    </div>
  </div>
  
  
  <!-- Accordion Feature -->
  <dl class="accordion" data-accordion>
    <dd class="accordion-navigation">
   <a href="#panel1">Accordion 1</a>
   <div id="panel1" class="content active">
      <p>Omai gat</p>
     <div class="tabs-content">
    <div class="content active" id="panel2-1">
      <p>First panel content goes here...</p>
    </div>
    <div class="content" id="panel2-2">
      <p>Second panel content goes here...</p>
    </div>
    <div class="content" id="panel2-3">
      <p>Third panel content goes here...</p>
    </div>
    <div class="content" id="panel2-4">
      <p>Fourth panel content goes here...</p>
    </div>
     </div>
   </div>
    </dd>
    <dd class="accordion-navigation">
   <a href="#panel2">Accordion 2</a>
   <div id="panel2" class="content">
     Panel 2. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
   </div>
    </dd>
    <dd class="accordion-navigation">
   <a href="#panel3">Accordion 3</a>
   <div id="panel3" class="content">
     Panel 3. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
   </div>
    </dd>
  </dl>
  
  <!-- Progress Bar Feature-->
  <div class="progress">
    <span class="meter" style="width:50%;background:red"></span>
  </div>
</body>
</html>

[E-Bussiness Suite] Query PR which don't have PO R12


Description
    this is query to display PR with details line ,Cost center, last approver (action history) ,  which don't have PO, you can costumize this query that can display all PR which have or Not a PO.

How to 

select distinct prha.segment1 as PR_NUM
       ,prla.LINE_NUM
       ,gcc.SEGMENT3 as Cost_Center
       ,prla.ITEM_DESCRIPTION
       ,prla.QUANTITY
       ,prla.UNIT_PRICE
       ,prla.UNIT_PRICE * prla.QUANTITY as Total_Amount
       ,pha.SEGMENT1 as PO_NUM
       ,prha.CREATION_DATE as Tanggal_Buat_PR
       ,reqah.full_name req_last_approver
       ,reqah.action_date "Date PR Approver"
       ,prha.AUTHORIZATION_STATUS STATUS_PR
FROM    po.po_requisition_headers_all prha
        , po.po_requisition_lines_all prla
        , po.po_line_locations_all plla
        , po.po_lines_all pla
        , po_headers_all PHA
        , gl.gl_code_combinations gcc
        , po.po_req_distributions_all prda
        , (SELECT prha.requisition_header_id
           ,papf.full_name
           ,pah.action_code
           ,pah.object_id
           ,pah.ACTION_DATE
           FROM po.po_action_history pah
                      , po.po_requisition_headers_all prha
                      , applsys.fnd_user fu
                      , hr.per_all_people_f papf
                  WHERE prha.ORG_ID = '86'
                    --AND prha.segment1 = '8880'
                    AND pah.object_id = prha.requisition_header_id
                    AND pah.employee_id = fu.employee_id
                    AND fu.employee_id = papf.person_id
                    AND SYSDATE BETWEEN papf.effective_start_date
                                    AND papf.effective_end_date
                    AND pah.object_type_code = 'REQUISITION'
                    AND pah.action_code = 'APPROVE'
                    AND pah.sequence_num =
                           (SELECT MAX(sequence_num)
                              FROM po.po_action_history pah1
                             WHERE pah1.object_id = pah.object_id
                               AND pah1.object_type_code = 'REQUISITION'
                               AND pah1.action_code = 'APPROVE')) reqah
WHERE prha.ORG_ID = '86'
AND prha.AUTHORIZATION_STATUS = 'APPROVED'
--AND prha.segment1 = '8880'
AND prha.creation_date >= to_date('1/1/2014','dd/mm/yyyy')
AND prha.creation_date <= to_date('12/8/2014','dd/mm/yyyy')
AND prha.requisition_header_id = prla.requisition_header_id
--linking to action history (reqah) based on header PR / PO
AND reqah.requisition_header_id = prha.requisition_header_id
--distribution always linking to Line ID
AND prda.REQUISITION_LINE_ID = prla.REQUISITION_LINE_ID
--if line location is Null then the PO doesn't exist, if exist then PO exist too.
AND plla.line_location_id is null
AND prla.line_location_id = plla.line_location_id(+)
AND plla.po_header_id = pla.po_header_id(+)
AND pla.po_header_id = pha.po_header_id(+)
AND gcc.CODE_COMBINATION_ID = prda.CODE_COMBINATION_ID
-- select your cost center , this is optional you can comment it if you want display all cost center
AND gcc.SEGMENT3 in ('000','001')
order by prha.segment1,prla.line_num, gcc.SEGMENT3 asc

[Oracle Client] Provider not found windows 7 x64 - Oracle Client


Description

    * Update 18 July 2017 ---------

     this is caused by the installation was not correct. for example case your application using ODAC (Oracle Data Access Component) like OLEDB or ODBC, but you install Oracle Client 10G 32bit. the oracle client install successful but the provider not list in unified data link (UDL).
    Or another case like this , when in win XP your application using MSDAORA (it's data component for oracle from microsoft) but in x64 Architecture MSDAORA not support so you must using ODAC for x64. microsoft not support anymore MSDAORA for x64.

Solution :

1. Disable UAC

    - 
Open User Account Control Settings by clicking the Start button , and then clicking Control Panel. In the search box, type uac, and then click Change User Account Control settings.

    - move the slider to the Never notify position, and then click OK If you're prompted for an administrator password or confirmation, type the password or provide confirmation. 
   
    - Don't forget to RESTART THE COMPUTER (it doesn't effect if you not restart).


2. you must install the correct architecture oracle client, if the target machine use x86 architecture use oracle client x86. but if the target machine use x64 architecture use x64 instead. Advised to renew the oracle client form 10G to 11G..

here's the link, before download register account first and accept the agreement on the top of page
x86 or 32bit
Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (32-bit)

x64 or 64bit
Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (x64).

*path installation example "
d:\oracle\product\11.2.0\client_1\


3. Download Oracle Data Access 64-bit (ODAC x64) DOWNLOAD HERE and extract it (in my case i extract to d:\oracle\odac *you can put anywhere).


4. Open CMD in Administrator Mode and navigate to d:\oracle\odac.

5. Execute command line from CMD :
    install.bat all D:\oracle\product\11.2.0\client_1\ odac
    * wait until finish install

6. After finish navigate D:\oracle\product\11.2.0\client_1\ODP.NET\bin\4\
   execute command :
   OraProvCfg.exe /action:gac /providerpath:D:\oracle\product\11.2.0\client_1\ODP.NET\bin\4\Oracle.DataAccess.dll

7. Next, navigate : D:\oracle\product\11.2.0\client_1\ASP.NET\bin\4\
    execute command :
      OraProvCfg.exe /action:gac /providerpath:D:\oracle\product\11.2.0\client_1\ASP.NET\bin\4\Oracle.web.dll

8. Now setting environment variable path, on system variable :
    Add New :
    ORACLE_HOME : D:\oracle\product\11.2.0\client_1\
    TNS_ADMIN : D:\oracle\product\11.2.0\client_1\network\admin

    Add PATH:  
    xxxxx;%ORACLE_HOME%;%TNS_ADMIN%

9. Change connection provider from "msdora.1" to "oraoledb.oracle"

10. andddddd it's MAGICCC !!!
   

[VB.NET] Read and Write Inifile (.ini)


Description
     IniFile is a file used to store data that will be used by an application or another application interface. very useful for storing small amount of data such as startup settings and others. IniFile uses almost same as XML. just the use of XML wider than IniFile. 

IniFile also have one advantage that it's light as a text file (. Txt). very suitable for storing small amounts of data settings for lightweight applications. if somewhat complex applications use XML.

Howto
    1. Api Declaration, create a module and write this Windows API :
'wind32 API IniFile
    Private Declare Auto Function GetPrivateProfileString Lib "kernel32" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As StringBuilder, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
    Public Declare Function WritePrivateProfileString Lib "Kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Long
    Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

  2. Create function to write IniFile:
    'function Write IniFile
    Public Function WriteIni(ByVal sSection As String, ByVal sKeyName As String, ByVal sNewString As String, ByVal sFileName As String) As Integer
        Dim Vb
        Vb = WritePrivateProfileString(sSection, sKeyName, sNewString, sFileName)
    End Function

  3. Create function to read IniFile:
    Public Function ReadIni(ByVal Key As String, ByVal SubKey As String, ByVal strFileName As String) As String
    Dim res As Integer
    Dim data As StringBuilder

    data = New StringBuilder(500)
    res = GetPrivateProfileString(Key, SubKey, "", data, data.Capacity, strFileName)
    Return data.ToString
    End Function

  4. How to call ?
      - to write just call : WriteIni("app_header", "variable", value, "d:\pathinifile.ini")
        the result in Inifile :
        [app_header]
        variable=value
   
       - to read just call : myvar = ReadIni("app_header", "variable", "d:\pathinifile.ini")
         the result : myval = value

   5. a little additional information , if you need to check file existing for example inifile exist or not , you can use this, create function FileExist
    'function check file exist
    Public Function FileExists(ByVal sFileName As String) As Boolean
        Dim intReturn As Integer
        Try
            intReturn = GetAttr(sFileName)
            FileExists = True
        Catch
            Exit Function
            FileExists = False
        End Try
    End Function
   - to use : FileExists("d:\pathinifile.ini"), it will return true if file exist and false if file not found.

works great

[VB.NET] Kill Process Excel


Description
      If you use vb.net to generate excel but the process excel cannot be terminate, this would be a serous problem , because if you do the work repeatedly excel process will accumulate and this will make the memory becomes full the effect of windows can be hang and it's dangerous. to prevent this we must kill the excel process but if you open another excel it will closed too. the solution is simply that you must find the process id of the object, and kill that object by id.

How to
1. i will give sample code below (create object excel)

        Dim oexcel As Object
        Dim obook As Object
        Dim osheet As Object

       'create Object excel
        Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
        oexcel = CreateObject("Excel.Application")
        obook = oexcel.workbooks.Add
        osheet = obook.worksheets(1)

       'Create Header First  
       osheet.Range("A1").Value = "Header 1"
       osheet.Range("B1").Value = "Header 2"
            
       osheet.Range("A2").Value = "Cell 1"
       osheet.Range("B2").Value = "Cell 2"

       oexcel.DisplayAlerts = False
       obook.SaveAs("D:\myfile.xls")
       oexcel.Quit()
       oexcel = Nothing
       MsgBox("Extract to Excel Complete, file save in :" & "D:\myfile.xls")

* the code above only create object excel and write some value into file, but it not close the process yet. to create kill excel process by PiD we must create sub and call it.

2. Create sub "killCurrentExcel()" 
    - first step we must declare win32 API. create a module and write this :
          'win32 API
    Public Declare Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hWnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer
    Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr

   - After win32 API has been declare , create the function : 
      Public Sub killCurrentExcel (ByVal oexcel As Object)
        Dim proc As System.Diagnostics.Process
        Dim intPID As Integer
        Dim intResult As Integer
        Dim iHandle As IntPtr
        Dim strVer As String

        strVer = oexcel.Version
        iHandle = IntPtr.Zero
        If CInt(strVer) > 9 Then
            iHandle = New IntPtr(CType(oexcel.Parent.Hwnd, Integer))
        Else
            iHandle = FindWindow(Nothing, oexcel.Caption)
        End If
        oexcel.Workbooks.Close()
        oexcel.Quit()
        Marshal.ReleaseComObject(oexcel)
        oexcel = Nothing
        intResult = GetWindowThreadProcessId(iHandle, intPID)
        proc = System.Diagnostics.Process.GetProcessById(intPID)
        proc.Kill()
      End Sub
      
3. Call killCurrentExcel() before messagebox of the excel with format : 
      killCurrentExcel("your object excel here")  so it will be "killCurrentExcel(oexcel)"

4. Here's the full listing :
    ' sub for generate excel
    Public Sub generateExcel()
        Dim oexcel As Object
        Dim obook As Object
        Dim osheet As Object

       'create Object excel
        oexcel = CreateObject("Excel.Application")
        obook = oexcel.workbooks.Add
        osheet = obook.worksheets(1)
        Try
            'Create Header First  
            osheet.Range("A1").Value = "Header 1"
            osheet.Range("B1").Value = "Header 2"
            
            osheet.Range("A2").Value = "Cell 1"
            osheet.Range("B2").Value = "Cell 2"

            oexcel.DisplayAlerts = False
            obook.SaveAs("D:\myfile.xls")
            oexcel.Quit()
            killCurrentExcel(oexcel)
            oexcel = Nothing
            MsgBox("Extract to Excel Complete, file save in :" & "D:\myfile.xls")
    end sub

    'sub for kill process by PiD
    Public Sub killCurrentExcel (ByVal oexcel As Object)
        Dim proc As System.Diagnostics.Process
        Dim intPID As Integer
        Dim intResult As Integer
        Dim iHandle As IntPtr
        Dim strVer As String

        strVer = oexcel.Version
        iHandle = IntPtr.Zero
        If CInt(strVer) > 9 Then
            iHandle = New IntPtr(CType(oexcel.Parent.Hwnd, Integer))
        Else
            iHandle = FindWindow(Nothing, oexcel.Caption)
        End If
        oexcel.Workbooks.Close()
        oexcel.Quit()
        Marshal.ReleaseComObject(oexcel)
        oexcel = Nothing
        intResult = GetWindowThreadProcessId(iHandle, intPID)
        proc = System.Diagnostics.Process.GetProcessById(intPID)
        proc.Kill()
      End Sub

   in module declare 2 Win32 API :
       Public Declare Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hWnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer
    Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
    

works great :D