[HTML] CSS dan Javascript


Deskripsi
     Untuk tutorial lebih lengkap bisa dilihat di w3schools.com , tapi kali ini saya hanya menyediakan link copy paste di html untuk linking ke file external source, males ngingetnya bro haha :D

Copas Here :

CSS external :
<link rel="stylesheet" type="text/css" href="mystyle.css">

JS external :
<script src="myScript.js"></script>

*kaburrrrrrr

[Cakephp] Ajax Pagination

Deskripsi
      Cara membuat pagination yang disertai ajax, jadi kita ga perlu melakukan refresh page, lumayan mudah.

Howto
controller (in your action)  :
        $this->paginate=array('fields'=>array('model.field1','model.field2'),
                                            'limit'=>100,
                                            'order'=>array('model.field1'),
                                            'conditions'=>array('model.field1'=>'yeah')
                                            );
         $Data=$this->paginate('model');
         $this->set('viewData',$Data);

View :
// on the top of your div table
      <?php
      $this->Paginator->options(array(
      'update' => 'content', // disable this make your pagination without ajax (normal pagination), wrong value parameter can make all of your javascript disable (like jquery bootstrap dll ... ) so its recommend to not use ajax pagination.
      'evalScripts' => true,
      'before' => $this->Js->get('#busy-indicator')->effect('fadeIn', array('buffer' => false)),
      'complete' => $this->Js->get('#busy-indicator')->effect('fadeOut', array('buffer' => false)),
        ));
      ?>

// on the top of table , for pagination number
       <div id="paging">
                <?php
                     echo $this->Paginator->prev('&laquo; Sebelumnya', array('escape' => FALSE));
                     echo ' |';
                     echo $this->Paginator->numbers(array('separator' => false));
                     echo '| ';
                     echo $this->Paginator->next('Selanjutnya &raquo; ', array('escape' => FALSE));
                ?>
        </div>

//sample table body
   <?php foreach($data as $viewData): ?>
        <tr>
             <td><?php echo $data ['XXX']['YYY']?></td>
        </tr>
   <?php endforeach ?>

//on the bottom of div table
<?php echo $this->Js->writeBuffer(); ?>

[Cakephp] Short Fundamental 2

Deskripsi
     Mengenal lebih jauh bagaimana konsep MVC (Model View Controller) pada cakephp yang akan saya jelaskan sesimple mungkin sehingga cepat dimengerti dan dipahami.
     Pada [Cakephp] Short Fundamental yang pertama, sudah dijelaskan MVC secara umum nah sekarang gimana sih pengaplikasian secara mendalam pada cakephp nya ? akan saya berikan point"nya

Step" nya:
1. User request view bedasarkan nama controller dan actionnya yang diambil dari url, sebagai contoh akses:
    www.mydomain.com/login/index
             : Controller
             : Action
 
    Sample code in controller
    <?php
     class loginController extends AppController
     {
         public function index ()
         {
              // action index otomatis dijalankan ketika controller dipanggil 
         }
     }
     ?>


2. Controller dapat mengenali view berdasarkan method (function in class), jika belom ngerti OOP php harap dipelajari terlebih dahulu. here it's

          public function index ()
         {
              // action index otomatis dijalankan ketika controller dipanggil 
         }

3. Karena nama view sudah dikenali maka lokasi file view akan dicari di :
    app/view/controller_name/view_name.ctp
    
   dalam kasus ini maka lokasi filenya :
    app/view/login/index.ctp

4. Satu tambahan lagi, untuk mempassing variable dari Controller ke View  , gunakan syntax ini :
    di Method / Action (penulisan di method controller):
    $this->set('varInView','myvalue');

    di View
     <?php 
            echo $varInView;
     ?>

mudah bukan ? hope this helps :D

[Cakephp] Theme

Deskripsi
      Jika suatu aplikasi web membutuhkan halaman berbeda-beda untuk tiap user / different privilege, akan lebih baik jika menggunakan theme ketimbang pada tampilan view diberi suatu kondisi hal ini dapat mengakibatkan bertambah kompleksnya koding pada view dan juga susah untuk maintenance serta pengembangan kedepan. penggunaan theme dapat mengurangi kompleksitas pada struktur web.

Howto
1. Buat variable global public $theme; di dalam controller tapi di luar action.
2. Untuk penggunaan dalam action caranya seperti ini :
    $this->theme='SamplePage';
3. Controller tidak akan mencari folder dengan nama action yang bersangkutan pada folder view , tetapi mencari nama folder dengan nama Theme nya. sebagai contoh :
    * anda membuat theme dengan spesifikasi seperti ini
       - anda menulis syntax ini $this->theme='SamplePage'; di dalam action bukutamu()
       - anda menggunakan controller MainController
       - maka posisi folder themenya
                            app/view/themed/SamplePage/Main/bukutamu.ctp
       - jika ingin dikombinasikan dengan layout tersendiri juga bisa, misalkan dalam action
         bukutamu() punya layout dengan syntax seperti ini : $this->layout='headerLayout'; 
       - maka posisi folder layout pada themenya
                           app/view/themed/SamplePage/Layouts/headerLayout.ctp
       - jadi di dalam folder themed tadi ada 2 folder : folder Main dan folder Layouts

hope this helps :D

[YII] Create New Project


Deskripsi
       Tidak seperti framework kebanyakan begitu di download langsung bisa dipakai, YII perlu setting tersendiri agar dapat berjalan lancar, kesalahan path pada saat setting bisa juga menimbulkan error yang membuat kita pusing 7 keliling, ok selamat belajar !

Howto
      1. Download YII Source in  Here
      2. Taruh pada root webserver anda , wamp (www) or xampp (htdocs).
      3. Rename folder to yii.
      4. Open command prompt (CMD) and change your path to root webserver (www or htdocs)
          - in cmd your path must looks like this c:/wamp/www> or c:/xampp/htdocs>
      5. Now write this command when you still in root webserver
          for WAMP :
          c:/wamp/www/yii/framework/yiic webapps myproject
       
          for XAMPP
          c:/xampp/htdocs/yii/framework/yiic webapps myproject
       
          Full Example  :
          c:/wamp/www> c:/wamp/www/yii/framework/yiic webapps myproject
          c:/xampp/htdocs> c:/xampp/htdocs/yii/framework/yiic webapps myproject
 
         6. Now your project (myproject) created on your root webserver, you will see this new folder.


* Path mungkin bisa tidak sama karena sesuai dengan instalasi webserver anda.

hope this helps, if you still not understand please read the documentation :D

[YII] Connect Database Mysql / SQL Server 2005


Deskripsi
      Berikut adalah cara setup connection dari framework Yii (1.1.13) ke database Mysql / SQL Server 2005.    

Howto
      1. Activate extension php pdo_mysql (for mysql database) or pdo_mssql (for sqlserver database) , if you don't have pdo for sql server download Here (i hope you know how to activate extension php)
   
      2. Open your file in path Yiiproject/protected/config and see this 2 files :
          - console.php and main.php
   
      3. find string 'db' and equate the settings for 'db' :
       
         for example you have Specification like this :
          * Database : Sqlserver 2005 or Mysql
          * Database Name : 'dbnew'
          * Table : 'user_table'
          * Field : ID (PK + AI) , name

         and this is the correct settings :
          for Mysql Database (required pdo_mysql) :
               'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=dbnew',
'emulatePrepare' => true,
'username' => 'xxx',
'password' => 'xxx',
'charset' => 'utf8',
),

         for Sql Server 2005 Database (not tried another version) :
               'db'=>array(
'connectionString' => 'mssql:server=localhost;dbname=dbnew',
'username' => 'xxx',
'password' => 'xxx',
),

Hope this helps :D

[PHP] Understanding Regex


Deskripsi
      Sebenarnya udah banyak yang nanya regex itu apaan sih ? dan awalnya saya juga seperti itu tetapi sepertinya masih belum terlalu banyak yang membahas tentang regex (kagak tau juga sih tapi tetep aja masih bingung). regex merupakan singkatan dari regular expression dan banyak dipakai di beragam platform, tapi untuk kali ini saya akan menjelaskan regex untuk PHP.

Howto
1. Regex di PHP selalu diawali ^ dan diakhiri dengan $.
2. Untuk penggunaan tergantung dari fungsi PHP yang dipakai , dan HTACCESS juga  menggunakan regex.
3. Untuk basic syntax or example , anda dapat melihat di web ini
    http://www.noupe.com/php/php-regular-expressions.html
    menurut saya sudah sangat lengkap untuk penjelasan dari regex for PHP.

Hope this helps.

[HTML][CSS] Different Position Relative and Float Left or Right


Deskripsi
     Untuk mengetahui perbedaan antara Position relative dengan Float left atau right, sebelumnya kita harus mengetahui konsep dari div itu sendiri.      

Howto
     Div Concept :
* Text or Image is the content of the Div , so to change appearance just add CSS style on div
* Padding is space between text/image and div line
* Margin is space between div line with margin line (not exist just conceptual)
* Position is space between margin line (not exist just conceptual) with outer line (not exist just conceptual)

so the case is what's the different ??

* Position Relative, the div element still intact with the Html Element, and i consider the 'position space' use a maximum width (whatever you change width the div, 'position space' still use maximum width) , that's why no another element beside the div and the element shifted down with another element which same element property.

* Float left / right, the div element still intact with the Html Element, BUT it remove 'Position Space' so the outer line is margin line (does not exist just conceptual), and the div fill the empty space to the top but it adjust with the current width and the element shifted left or right with another element which same element property.

what about absolute ? absolute same as float remove 'position space' but the element NOT intact with the Html Element and another element , so it can stack with the same div which use the same position.

hope's this help !!  

[E-Bussiness Suite] Query PO Amount list by Month - Year


Deskripsi
   Query untuk melisting PO beserta dengan Total Amount.

Howto
1. Karena kita menggunakan view yang recordnya di hidden oleh oracle maka untuk melihatnya gunakan cara INI 
2. Jalankan Query dibawah 

select PRHA.segment1 as PO_NUMBER
        ,PDV.GL_ENCUMBERED_DATE
        ,PO_AMOUNT.AMOUNT

from PO_HEADERS_ALL PRHA
       ,PO_DISTRIBUTIONS_V PDV
       ,PO_LINES_ALL PLA
       ,(select  PRHA.po_header_id
                  ,SUM(PLA.UNIT_PRICE*PLA.QUANTITY) as Amount

         from PO_HEADERS_ALL PRHA
                ,PO_LINES_ALL PLA

              where PRHA.authorization_status = 'APPROVED'
               AND PRHA.po_header_id = PLA.po_header_id
             
              group by PRHA.po_header_id) PO_AMOUNT

where PRHA.authorization_status = 'APPROVED'
AND PRHA.po_header_id = PDV.po_header_id
AND PRHA.po_header_id = PLA.po_header_id
AND PRHA.po_header_id = PO_AMOUNT.po_header_id
-- Low Date Month
AND to_number(to_char(PDV.GL_ENCUMBERED_DATE,'mm')) >= '1'
-- High Date Month
AND to_number(to_char(PDV.GL_ENCUMBERED_DATE,'mm')) <= '12'
-- Year Date
AND to_char(PDV.GL_ENCUMBERED_DATE,'yyyy') = '2011'

group by PRHA.segment1
        ,PO_AMOUNT.AMOUNT
        ,PDV.GL_ENCUMBERED_DATE
order by PRHA.segment1

3. jika masih bermasalah tidak menampilkan record dan menggunakan software Toad coba baca INI

4. jika hasil query ga cocok tolong infokan lewat comment ntar ane cek lagi :D, terima kasih.

[E-Bussiness Suite] Query PO - RR - Voucher(INV) - Voucher(PAYMENT)


Deskripsi
   Query untuk melisting PO beserta dengan RECEIPT NUMBER , VOUCHER(INVOICE) , VOUCHER(PAYMENT).

Howto
1. Karena kita menggunakan view yang recordnya di hidden oleh oracle maka untuk melihatnya gunakan cara INI
2. Jalankan Query dibawah

select  distinct PRHA.segment1 as PO_NUMBER
       ,RVHV.RECEIPT_NUM as RECEIPT_NUMBER
       ,AI.DOC_SEQUENCE_VALUE as VOUCHER_INVOICE
       ,AC.DOC_SEQUENCE_VALUE AS VOUCHER_PAYMENT
 
from PO_HEADERS_ALL PRHA
    ,RCV_SHIPMENT_LINES RSL
    ,RCV_VRC_HDS_V RVHV
    ,AP_INVOICES AI
    ,AP_INVOICE_PAYMENTS_V AIP
    ,AP_CHECKS AC
 
where PRHA.segment1 = '129752'
AND PRHA.po_header_id = RSL.po_header_id
AND RSL.shipment_header_id = RVHV.shipment_header_id
AND AI.invoice_id IN (SELECT apid.invoice_id FROM ap_invoice_distributions apid, po_distributions pod WHERE apid.po_distribution_id = pod.po_distribution_id AND pod.po_header_id = prha.po_header_id AND (pod.po_release_id = '' OR '' is null) AND (pod.po_line_id = '' OR '' is null) AND (pod.line_location_id = '' OR '' is null) AND (pod.po_distribution_id = '' OR '' is null))
AND AI.INVOICE_ID = AIP.INVOICE_ID
AND AIP.CHECK_ID = AC.CHECK_ID;

3. jika masih bermasalah tidak menampilkan record dan menggunakan software Toad coba baca INI

4. jika hasil query ga cocok tolong infokan lewat comment ntar ane cek lagi :D, terima kasih.


--Update Query,
   1. Add Description of PO
   2. Filter by Date Range, Month and Year


select  distinct prha.po_header_id
       ,PRHA.segment1 as PO_NUMBER
       ,PRHA.comments as Description
       ,RVHV.RECEIPT_NUM as RECEIPT_NUMBER
       ,AI.INVOICE_NUM as NUMBER_INVOICE
       ,AI.DOC_SEQUENCE_VALUE as VOUCHER_INVOICE
       ,AC.DOC_SEQUENCE_VALUE AS VOUCHER_PAYMENT
       ,to_char(PDV.GL_ENCUMBERED_DATE,'dd/mm/yyyy') as GL_DATE
     
from PO_HEADERS_ALL PRHA
    ,PO_DISTRIBUTIONS_V PDV
    ,RCV_SHIPMENT_LINES RSL
    ,RCV_VRC_HDS_V RVHV
    ,AP_INVOICES AI
    ,AP_INVOICE_PAYMENTS_V AIP
    ,AP_CHECKS AC
 
where
--PRHA.segment1 = '129752'
PRHA.po_header_id = PDV.po_header_id
AND PRHA.po_header_id = RSL.po_header_id
AND RSL.shipment_header_id = RVHV.shipment_header_id
AND AI.invoice_id IN (SELECT apid.invoice_id FROM ap_invoice_distributions apid, po_distributions pod WHERE apid.po_distribution_id = pod.po_distribution_id AND pod.po_header_id = prha.po_header_id AND (pod.po_release_id = '' OR '' is null) AND (pod.po_line_id = '' OR '' is null) AND (pod.line_location_id = '' OR '' is null) AND (pod.po_distribution_id = '' OR '' is null))
AND AI.INVOICE_ID = AIP.INVOICE_ID
AND AIP.CHECK_ID = AC.CHECK_ID
-- Low Date Month
AND to_number(to_char(PDV.GL_ENCUMBERED_DATE,'mm')) >= '1'
-- High Date Month
AND to_number(to_char(PDV.GL_ENCUMBERED_DATE,'mm')) <= '12'
-- Year Date
AND to_char(PDV.GL_ENCUMBERED_DATE,'yyyy') = '2010'





[Database][Mysql/SQL Server/Oracle] Output Query format Date


Deskripsi
      Berikut adalah cara dalam mendapatkan format output date dari 3 database yakni mysql , oracle , dan Sqlserver, menyebalkan memang jika berhubungan dengan date pada saat query ~_~!.

Howto

Fundamental Datetime
     Pada dasarnya penyimpanan format date pada database normalnya memiliki format :
 - 'YYYY/MM/DD HH:MM:SS AM/PM' => Oracle
-  'MM/DD/YYYY HH:MM:SS AM/PM' => SQL Server
-  'YYYY/MM/DD HH:MM:SS'              => Mysql

nah bagaimana cara narik datanya berdasarkan date ?? berikut adalah contoh query dari masing-masing database.

1. Oracle
    to_date ('10/05/2013','dd/mm/yyyy');
 
example : select *
               from table
              where creation_date > to_date ('10/05/2013','dd/mm/yyyy');


2. SQL Server
   CONVERT(type,field or date,code_format)

here's the code_format (source from w3schools)
Value
(century yy)
Value
(century yyyy)
Input/OutputStandard
-0 or 100mon dd yyyy hh:miAM (or PM)Default
1101mm/dd/yyUSA
2102yy.mm.ddANSI
3103dd/mm/yyBritish/French
4104dd.mm.yyGerman
5105dd-mm-yyItalian
6106dd mon yy
7107Mon dd, yy
8108hh:mm:ss
-9 or 109mon dd yyyy hh:mi:ss:mmmAM (or PM)Default+millisec
10110mm-dd-yyUSA
11111yy/mm/ddJapan
12112yymmddISO
-13 or 113dd mon yyyy hh:mi:ss:mmm (24h)
14114hh:mi:ss:mmm (24h)
-20 or 120yyyy-mm-dd hh:mi:ss (24h)
-21 or 121yyyy-mm-dd hh:mi:ss.mmm (24h)
-126yyyy-mm-ddThh:mi:ss.mmm (no spaces)ISO8601
-130dd mon yyyy hh:mi:ss:mmmAMHijiri
-131dd/mm/yy hh:mi:ss:mmmAMHijiri


Example:
             select  CONVERT(VARCHAR,create_date,103) as create_date
    from MS_CLIENT_H
             where create_date > '2013-02-01 14:26:40'

3. Mysql
    Date_Format(date,format)
 
here's the code_format (source from w3schools)
FormatDescription
%aAbbreviated weekday name
%bAbbreviated month name
%cMonth, numeric
%DDay of month with English suffix
%dDay of month, numeric (00-31)
%eDay of month, numeric (0-31)
%fMicroseconds
%HHour (00-23)
%hHour (01-12)
%IHour (01-12)
%iMinutes, numeric (00-59)
%jDay of year (001-366)
%kHour (0-23)
%lHour (1-12)
%MMonth name
%mMonth, numeric (00-12)
%pAM or PM
%rTime, 12-hour (hh:mm:ss AM or PM)
%SSeconds (00-59)
%sSeconds (00-59)
%TTime, 24-hour (hh:mm:ss)
%UWeek (00-53) where Sunday is the first day of week
%uWeek (00-53) where Monday is the first day of week
%VWeek (01-53) where Sunday is the first day of week, used with %X
%vWeek (01-53) where Monday is the first day of week, used with %x
%WWeekday name
%wDay of the week (0=Sunday, 6=Saturday)
%XYear of the week where Sunday is the first day of week, four digits, used with %V
%xYear of the week where Monday is the first day of week, four digits, used with %v
%YYear, four digits
%yYear, two digits



Example :
     SELECT datecolumn
     FROM `user`
     WHERE datecolumn = date_format('23-05-2013','%d-%m-%y')



Hope this helps :D

[Database][Oracle] Toad not shown hidden record !


Deskripsi
      Kejadian ini terjadi ketika ada hidden record tapi tidak mampu ditampilkan padahal sudah menjalankan syntax seperti di halaman INI dan ketika dicoba di komputer lain yang sudah diinstal toad tapi BISA, aneh kan ? itu kenapa ? apa perlu diinstal ulang ?

Howto
penyebabnya ada di bagian registry
1. Buka registry dan cari Binary Data dengan nama NLS_LANG, klo mau cepat gunakan fitur find (CTRL + F )
2. Jika sudah ketemu pastikan valuenya "AMERICAN_AMERICA.WE8ISO8859P1" (tanpa tanda kutip).
3. Lakukan pencarian kembali dengan pencet F3 dan samakan semua valuenya sampe semua selesai.
4. jika masih tidak bisa berarti penyebabnya bukan di bagian registry.
5. terus gmn dengan value yang sudah keubah ?? instal ulank bro oracle clientnya *kaburrr

[E-Bussiness Suite] Query PO tanpa Receipt Number by Date


Deskripsi
      Query untuk melisting PO yang tidak memiliki RECEIPT NUMBER dan difilter berdasarkan tanggal.

Howto

select distinct PRHA.segment1 as PO_NUMBER

from PO_HEADERS_ALL PRHA
       ,RCV_SHIPMENT_LINES RSL
 
where PRHA.CREATION_DATE >= TO_DATE('17/05/2013','DD/MM/YY')
AND PRHA.CREATION_DATE <= TO_DATE('22/05/2013','DD/MM/YY')
AND PRHA.po_header_id = RSL.po_header_id(+)
AND RSL.po_header_id is null

order by PRHA.segment1;



-- Update--
Jika ingin ditambahkan dengan vendor dan buyer maka querynya seperti ini :

select distinct PRHA.segment1 AS PO_NUMBER
        ,PV.VENDOR_NAME AS VENDOR
        ,HE.FULL_NAME AS BUYER

from PO_HEADERS_ALL PRHA
    ,RCV_SHIPMENT_LINES RSL
    ,PO_VENDORS PV
    ,HR_EMPLOYEES HE
 
where PRHA.CREATION_DATE >= TO_DATE('17/05/2013','DD/MM/YY')
AND PRHA.CREATION_DATE <= TO_DATE('22/05/2013','DD/MM/YY')
AND PRHA.po_header_id = RSL.po_header_id(+)
AND PRHA.VENDOR_ID = PV.VENDOR_ID
AND PRHA.AGENT_ID = HE.EMPLOYEE_ID
AND RSL.po_header_id is null

order by PRHA.segment1;

[E-Bussiness Suite] Query PO dengan Receipt Number by Date


Deskripsi
      Query untuk melisting PO yang memiliki Receipt Number dan difilter berdasarkan tanggal.

Howto



select  distinct PRHA.segment1 as PO_NUMBER
       ,RVHV.RECEIPT_NUM as RECEIPT_NUMBER

from PO_HEADERS_ALL PRHA

    ,RCV_SHIPMENT_LINES RSL
    ,RCV_VRC_HDS_V RVHV
    
where PRHA.CREATION_DATE >= TO_DATE('17/05/2013','DD/MM/YY')
AND PRHA.CREATION_DATE <= TO_DATE('22/05/2013','DD/MM/YY')
AND PRHA.po_header_id = RSL.po_header_id 
AND RSL.shipment_header_id = RVHV.shipment_header_id 


--Update--

Jika ingin ditambahkan Vendor dan Buyer maka akan menjadi seperti ini

select distinct PRHA.segment1 as PO_NUMBER
       ,RVHV.RECEIPT_NUM as RECEIPT_NUMBER
       ,PV.VENDOR_NAME AS VENDOR 
       ,HE.FULL_NAME AS BUYER

from PO_HEADERS_ALL PRHA

       ,RCV_SHIPMENT_LINES RSL
       ,RCV_VRC_HDS_V RVHV
       ,PO_VENDORS PV
       ,HR_EMPLOYEES HE
    
where PRHA.CREATION_DATE >= TO_DATE('17/05/2013','DD/MM/YY')
AND PRHA.CREATION_DATE <= TO_DATE('22/05/2013','DD/MM/YY')
AND PRHA.VENDOR_ID = PV.VENDOR_ID
AND PRHA.AGENT_ID = HE.EMPLOYEE_ID
AND PRHA.po_header_id = RSL.po_header_id 
AND RSL.shipment_header_id = RVHV.shipment_header_id 

[E-Bussiness Suite] Query PR tanpa PO by Date


Deskripsi
      Query untuk melisting PR yang tidak memiliki PO dan difilter berdasarkan tanggal.

Howto


select distinct prha.creation_date,PRHA.segment1
from po_requisition_headers_all PRHA
       ,po_requisition_lines_all PRLA
    
where prha.creation_date >= to_date('17/5/2013','dd/mm/yyyy')
and  prha.creation_date <= to_date('21/5/2013','dd/mm/yyyy')
and prha.requisition_header_id = PRLA.requisition_header_id
and PRLA.line_location_id is null;

[E-Bussiness Suite] Query PR - PO by Date


Deskripsi
     Query untuk melisting PR yang memiliki PO dan difilter berdasarkan tanggal.

Howto
select distinct prha.creation_date,PRHA.segment1, poh.segment1
from po_requisition_headers_all PRHA
       ,po_requisition_lines_all PRLA
       ,po_line_locations_all PLLA
       ,po_headers_all poh
       ,po_lines_all pol
 
where prha.creation_date >= to_date('1/5/2013','dd/mm/yyyy')
and  prha.creation_date <= to_date('21/5/2013','dd/mm/yyyy')
and prha.requisition_header_id = PRLA.requisition_header_id
and PRLA.line_location_id = PLLA.line_location_id
and poh.po_header_id = pol.po_header_id
and pol.po_line_id = plla.po_line_id;

[WebServer][Apache] Understanding Virtual Host

Deskripsi
      Virtual Host dalam webserver apache merupakan suatu metode agar dalam satu host mampu melayani penggunaan banyak nama domain. sebagai contoh :

anda punya server host dengan IP : 192.168.0.2

system operasi win / linux dengan lokasi home dir : htdocs/myweb (windows) atau  /var/www/myweb (linux)
domain anda : keren.com (contoh doank, bukan punya gw)

kemudian teman anda menyewa home dir anda : htdocs/myfriend(windows) atau  /var/www/myfriend (linux)

domain teman anda : teman.com  (contoh doank, bukan punya gw)

bagaimana dalam 1 IP bisa dibinding oleh 2 domain yang berbeda dan mampu mengenali masing-masing folder ? itulah gunanya virtual host


caranya ?? tinggal tambahkan settingan pada confignya , untuk kali ini saya menggunakan apache.


HowTo


1. temukan file httpd.conf, dalam direktory webserver anda

2. hapus tanda '#' pada "Include conf/extra/httpd-vhosts.conf'
3. temukan file httpd-vhosts.conf
4. tambahkan line baru seperti dibawah ini (terserah mau ditaruh di-line mana aja bebas kok)

# Ensure that Apache listens on port 80

Listen 80

# Listen for virtual host requests on all IP addresses

NameVirtualHost *:80

<VirtualHost *:80>                             

    ServerName localhost                       
    DocumentRoot "C:\wamp\www"                 
</VirtualHost>                                 

# Setup "helloworld" Virtual Host              

<VirtualHost *:80>                             
    ServerName "infophpku.xla"                 
    DocumentRoot "C:\wamp\VirtualFolder"       

    <Directory "C:\wamp\VirtualFolder">        

        Options Indexes FollowSymLinks Includes
        AllowOverride All                      
        Order allow,deny                       
        Allow from all                         
    </Directory>                               
</VirtualHost>                                 

5. buat folder baru (untuk virtual host, contoh nama foldernya VirtualFolder) pada path , hasilnya nanti seperti ini : "C:\wamp\VirtualFolder"

6. konfigurasikan file hosts, untuk windows lokasi file host di c:\windows\system32\drivers\etc\
7. buka file tersebut maka anda akan melihat format seperti ini :
    127.0.0.1       localhost
8. fungsinya mapping IP address secara lokal, jadi jika tcp ip mendapatkan masukan nama domain 'localhost' maka akan didirect IP : 127.0.0.1, nama domain 'localhost' akan tersimpan dalam header protokol http yang berguna bagi apache dalam penggunaan virtualhost.
9. pada file host tambahkan line :
    127.0.0.1      infophpku.xla 
    artinya jika kita mengakses nama domain infophpku.xla maka akan didirect ke ip 127.0.0.1 , berarti masuk localhost ? iya memang masuk localhost tapi mempunyai header yang beda yang nanti akan diproses otomatis oleh apache.
10. Restar apache, dan ketikan URL infophpku.xla  pada browser, tapi settingan browser jangan dimasukan ke proxy :)

-- Fix and Test by me --