tag:blogger.com,1999:blog-78943416878421039302024-03-13T12:13:45.070+07:00Catatan KecilBlog Catatan Kecil ini berisi kumpulan catatan komputer dan artikel menarik laiinya dari pengalaman yang Admin tuangkan dalam tulisanAnonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.comBlogger69125tag:blogger.com,1999:blog-7894341687842103930.post-80463487810483703312015-10-09T15:01:00.000+07:002015-10-09T15:01:04.953+07:00Cara mudah mengganti foto profil (Avatar) pada Wordpress<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg62hQCDaczORRiQah2FQwwi3lWLntoq-QyL234LBRlGtFW-6CIOJuwrYFw7BQ-h8ivToz58EK0f8Bv1ZOdCaskrY_6zGNdAZrgTrDCoFN2IIyR5otxflLaguhb0coDsDOteF4A9PAMAWI/s1600/worpress.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Cara mudah mengganti foto profil (Avatar) pada Wordpress" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg62hQCDaczORRiQah2FQwwi3lWLntoq-QyL234LBRlGtFW-6CIOJuwrYFw7BQ-h8ivToz58EK0f8Bv1ZOdCaskrY_6zGNdAZrgTrDCoFN2IIyR5otxflLaguhb0coDsDOteF4A9PAMAWI/s1600/worpress.png" title="Cara mudah mengganti foto profil (Avatar) pada Wordpress" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Cara mudah mengganti foto profil (Avatar) pada Wordpress</td></tr>
</tbody></table>
<br />
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Catatan kecil hari akan membahas seputar CMS Wordpress. Barangkali anda sudah bosan dengan avatar bawaan Worpdress atau ingin mengganti dengan foto kesayangan Anda. Silakan ikuti langkah-langkah berikut ini:<br />
<br />
<ol>
<li>Login pada menu admin wordpress</li>
<li>Setelah Anda masuk pada menu Dashboard, pilihlah menu plugin</li>
<li>Pilih Add New</li>
<li>Pada menu pencarian ketikan kata kunci ini "<span style="font-family: 'Open Sans', sans-serif; font-size: 14px; font-weight: 600; line-height: 19.5px; white-space: nowrap;">WP User Avatar"</span></li>
<li><span style="font-family: Open Sans, sans-serif;"><span style="font-size: 14px; line-height: 19.5px; white-space: nowrap;">Aktifkan plugin</span></span></li>
<li><span style="font-family: Open Sans, sans-serif;"><span style="font-size: 14px; line-height: 19.5px; white-space: nowrap;">Akan muncul plugin Avatars, Pilih</span></span></li>
<li><span style="font-family: Open Sans, sans-serif;"><span style="font-size: 14px; line-height: 19.5px; white-space: nowrap;">Pada menu default avatar, Choose Image. Ganti dengan foto kesayangan Anda</span></span></li>
<li><span style="font-family: Open Sans, sans-serif;"><span style="font-size: 14px; line-height: 19.5px; white-space: nowrap;">Selesai</span></span></li>
</ol>
<div>
<span style="font-family: Open Sans, sans-serif;"><span style="font-size: 14px; line-height: 19.5px; white-space: nowrap;">Semoga sedikit catatan kecil ini bisa membantu Anda. Terima kasih</span></span></div>
<br />
<br />Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-25265593429370113702015-10-09T08:53:00.000+07:002015-10-09T11:00:56.625+07:00Membuat filter dropdown di CgridView dari database dan array YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiSf0nReUMO_O7kY8aQ2-VsL1HnD4c-qWPqWIzXoyZ-HARxpVdVIuC0n4ypMW3Kk6_Zyu0IW_VNtWyOntuTgHBycQt69i6W67o03SFiHD-YJdBuI6Tx8fGIYIGWpaeaHlvzbt06L0oArE/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Membuat filter dropdown di CgridView dari database dan array YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiSf0nReUMO_O7kY8aQ2-VsL1HnD4c-qWPqWIzXoyZ-HARxpVdVIuC0n4ypMW3Kk6_Zyu0IW_VNtWyOntuTgHBycQt69i6W67o03SFiHD-YJdBuI6Tx8fGIYIGWpaeaHlvzbt06L0oArE/s1600/yii.jpg" title="Membuat filter dropdown di CgridView dari database dan array YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Membuat filter dropdown di CgridView dari database dan array YII</td></tr>
</tbody></table>
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini merupakan cacatan kecil tentang Membuat filter dropdown di CgridView dari database dan array YII. Simak skriptnya baik-baik:<br />
<br />
//Dari Database <br />
array(<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'name'=>'cari_pend',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'type'=>'raw',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'Pendidikan',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>'CHtml::encode($data->Pend->ijazah)',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'htmlOptions'=>array('width'=>''),<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'filter'=>CHtml::listData(Pendidikan::model()->findAll(),/*seharusnya id*/'ijazah','ijazah'),<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>),<br />
<br />
//Dari Array<br />
<br />
array(<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'name'=>'jnspeg',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'type'=>'raw',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'Jenis Pegawai',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>'MyComponent::ubahJenisPegawai($data->jnspeg)',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'filter'=>array('1'=>'Tenaga Pendidik','2'=>'Tenaga Kependidikan'),<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>),<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-35132472720601105072015-04-08T11:59:00.001+07:002015-10-09T11:01:20.363+07:00Menghapus link home pada menu Breadcrumbs Yii<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Menghapus link home pada menu Breadcrumbs Yii" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Menghapus link home pada menu Breadcrumbs Yii" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Menghapus link home pada menu Breadcrumbs Yii</td></tr>
</tbody></table>
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil mengenai cara menghapus link home pada menu Breadcrumbs YII. Langkah-langkah:<br />
<br />
Buka direktori protected/views/layouts/main.php<br />
<br />
<?php if(isset($this->breadcrumbs)):?><br />
<?php $this->widget('zii.widgets.CBreadcrumbs', array(<br />
'links'=>$this->breadcrumbs,<span class="Apple-style-span" style="color: blue;"> 'homeLink'=>false</span>// untuk menghilangkan menu home pada breadcrum<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>)); ?><!-- breadcrumbs --><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php endif?><br />
<br />
<br />
<br />
Semangat...Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-817758197311204442015-02-25T14:06:00.000+07:002015-10-09T08:23:43.908+07:00Mudahnya menyembunyikan index.php dan memalsukan URL Suffix YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Mudahnya menyembunyikan index.php dan memalsukan URL Suffix YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Mudahnya menyembunyikan index.php dan memalsukan URL Suffix YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mudahnya menyembunyikan index.php dan memalsukan URL Suffix YII</td></tr>
</tbody></table>
<br />
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut catatan kecil mengenai cara menyembunyikan index.php dan memalsukan URL Suffix YII. Simak langkah-langkahnya:<br />
<br />
Caranya cukup masuk folder config pada aplikasi YII Anda<br />
<span style="color: blue;"><code style="background-color: #f9f9f9; border: 0px; font-family: 'andale mono', 'lucida console', monospace; font-size: 13px; font-stretch: normal; line-height: 18px; margin: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">C:\xampp\htdocs\namaaplikasianda\protected\config\</code><code style="background-color: #f9f9f9; border: 0px; font-size: 13px; font-stretch: normal; line-height: 20px; margin: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="font-family: Arial, Helvetica, sans-serif;">main.php</span></code></span><br />
<code style="background-color: #f9f9f9; border: 0px; color: #555555; font-size: 13px; font-stretch: normal; line-height: 20px; margin: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></code>
<code style="background-color: #f9f9f9; border: 0px; color: #555555; font-size: 13px; font-stretch: normal; line-height: 20px; margin: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="font-family: Arial, Helvetica, sans-serif;">//aktifkan kode berikut ini dengan menghapus tanda komentar</span></code><br />
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;">'urlManager'=>array(</span></span></div>
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'urlFormat'=>'path', //Langkah 1 aktifkan URL Path</span></span></div>
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'showScriptName'=>false, //Langkah 2 untuk menyembunyikan index.php [::penting::] pastikan sudah ada file .htaccessdan taruh pada folder aplikasi yii Anda agar tidak error</span></span></div>
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'caseSensitive'=>false, //Langkah 3 untuk menghindari case sensitive pemanggilan controller</span></span></div>
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'urlSuffix'=>'.htmlx', //Langkah 4 menambahkan extensi tertentu</span></span></div>
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'rules'=>array(</span></span></div>
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'<controller:\w+>/<id:\d+>'=>'<controller>/view',</span></span></div>
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',</span></span></div>
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',</span></span></div>
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span></span></div>
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><code style="background-color: #f9f9f9; border: 0px; font-stretch: normal; margin: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"></code></span></span><br />
<div style="text-align: justify;">
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span></span></div>
<div style="text-align: justify;">
<span style="color: #555555; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="color: orange; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><u>contoh file .htaccess</u></span></span></div>
<div style="text-align: justify;">
<span style="color: orange; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;">RewriteEngine on</span></span></div>
<div style="text-align: justify;">
<span style="color: orange; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="color: orange; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"># if a directory or a file exists, use it directly</span></span></div>
<div style="text-align: justify;">
<span style="color: orange; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;">RewriteCond %{SCRIPT_FILENAME} !-f</span></span></div>
<div style="text-align: justify;">
<span style="color: orange; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;">RewriteCond %{SCRIPT_FILENAME} !-d</span></span></div>
<div style="text-align: justify;">
<span style="color: orange; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="color: orange; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"># otherwise forward it to index.php</span></span></div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<span style="color: orange; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;">RewriteRule ^(.*)$ index.php/$1 [L]</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="color: #555555; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 13px; line-height: 20px;"><br /></span></span></div>
<br />
Semangat...Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-89084967438985927652015-02-11T14:06:00.001+07:002015-10-09T11:01:34.235+07:00Menampilkan image/gambar dengan exstensi HTML2PDF YII dari dokumen root<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Menampilkan image/gambar dengan exstensi HTML2PDF YII dari dokumen root" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Menampilkan image/gambar dengan exstensi HTML2PDF YII dari dokumen root" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Menampilkan image/gambar dengan exstensi HTML2PDF YII dari dokumen root</td></tr>
</tbody></table>
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="background-color: white; font-size: 15px; line-height: 19.5px;"><b><br /></b></span></span>
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="background-color: white; font-size: 15px; line-height: 19.5px;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil tentang cara </span><span style="font-size: 15px; line-height: 19.5px;">Menampilkan image/gambar dengan exstensi HTML2PDF YII dari dokumen root. Simak penggalan skrip dibawah ini:</span></span><br />
<strong style="background-color: white; border: 0px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin: 0px; padding: 0px;"><br /></strong>
<strong style="background-color: white; border: 0px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin: 0px; padding: 0px;">html2pdf.class.php pada baris </strong><span style="background-color: white; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px;">5602 diubah menjadi berikut ini:</span><br />
<span style="background-color: white; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px;"><br /></span>
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;">rotected function _tag_open_IMG($param)</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;">{</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $src = str_replace('&amp;', '&', $param['src']);</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $documentRoot = $_SERVER['DOCUMENT_ROOT']; // get server document root </span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $src = $documentRoot. '/' . $src; //aapend server document root to the image soure</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->parsingCss->save();</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->parsingCss->value['width'] = 0;</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->parsingCss->value['height'] = 0;</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->parsingCss->value['border'] = array('type' => 'none', 'width' => 0, 'color' => array(0, 0, 0));</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->parsingCss->value['background'] = array('color' => null, 'image' => null, 'position' => null, 'repeat' => null);</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->parsingCss->analyse('img', $param);</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->parsingCss->setPosition();</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->parsingCss->fontSet();</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $res = $this->_drawImage($src, isset($param['sub_li']));</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> if (!$res) return $res;</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->parsingCss->load();</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->parsingCss->fontSet();</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> $this->_maxE++;</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> return true;</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="background-color: white; font-size: 15px; line-height: 19.5px;"></span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"> }</span></span><br />
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"><br /></span></span>
<span style="color: #222222; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;">sumber : http://stackoverflow.com/questions/22449972/yii-html2pdf-epdf-impossible-de-charger-limage-images-big-logo-png</span></span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-34383072571033021932015-01-26T14:33:00.002+07:002015-10-09T11:01:44.566+07:00Cara memanggil fungsi dari model lain YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Cara memanggil fungsi dari model lain YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Cara memanggil fungsi dari model lain YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Cara memanggil fungsi dari model lain YII</td></tr>
</tbody></table>
<br />
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil tentang Cara memanggil fungsi dari model lain YII. Silakan simak penggalan skript berikut ini:<br />
<br />
<span style="color: blue;">Namamodel::model()->namafungsi();</span><br />
<br />
Contoh<br />
<br />
Kegiatan::model()->Aktifitas();<br />
<br />Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-17606336446374626742015-01-14T09:42:00.000+07:002015-10-09T11:00:44.676+07:00menghilangkan ?r= pada URL YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="menghilangkan ?r= pada URL YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="menghilangkan ?r= pada URL YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">menghilangkan ?r= pada URL YII</td></tr>
</tbody></table>
<br />
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil mengenai cara menghilangkan ?r= pada URL YII. Silakan simak penggalan skrip dibawah ini:<br />
<br />
<span style="color: #38761d;">// uncomment the following to enable URLs in path-format</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/*</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'urlManager'=>array(</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'urlFormat'=>'path',</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'rules'=>array(</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'<controller:\w+>/<id:\d+>'=>'<controller>/view',</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="color: #38761d;"><span class="Apple-tab-span" style="white-space: pre;"> </span>*/</span><br />
<br />
<br />
Menjadi<br />
<br />
<span style="color: cyan;">'</span><span style="color: blue;">urlManager'=>array(</span><br />
<span style="color: blue;"> 'urlFormat'=>'path',</span><br />
<span style="color: blue;"> 'rules'=>array(</span><br />
<span style="color: blue;"> 'gii'=>'gii',</span><br />
<span style="color: blue;"> 'gii/<controller:\w+>'=>'gii/<contruller>',</span><br />
<span style="color: blue;"> 'gii/<controller:\w+>/<action:\w+>'=>'gii/<controller>/<action>',</span><br />
<span style="color: blue;"> ),</span><br />
<span style="color: blue;">),</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-87244478598643426392014-10-23T09:51:00.002+07:002015-10-09T10:24:14.106+07:00Membuat Tombol Create, Save dan Cancel yang animatif dengan YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Membuat Tombol Create, Save dan Cancel yang animatif dengan YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Membuat Tombol Create, Save dan Cancel yang animatif dengan YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Membuat Tombol Create, Save dan Cancel yang animatif dengan YII</td></tr>
</tbody></table>
<div style="text-align: justify;">
<span style="font-family: inherit;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: inherit;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a> </b>- Berikut ini catatan kecil tentang cara Membuat Tombol Create, Save dan Cancel yang animatif dengan YII. Apakah anda bosan dengan tombol bawaan saat generate code dengan GII, mungkin Anda bisa mencoba merubah tombol seperti pada skript berikut ini:</span></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: blue; font-family: Courier New, Courier, monospace;"><div class="row buttons"></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$this->widget('zii.widgets.jui.CJuiButton',array(</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> 'name'=>'btnSubmit',</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> 'caption'=>$model->isNewRecord ? Yii::t('LookupModule.ui', 'Create') : Yii::t('LookupModule.ui','Save'),</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'htmlOptions'=>array(</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> 'style'=>'background:#0064cd;color:#ffffff;',</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> ),</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: blue; font-family: Courier New, Courier, monospace;"> </span></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>));</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>?></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php $this->widget('zii.widgets.jui.CJuiButton', array(</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'buttonType'=>'link',</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'name'=>'btnCancel',</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>'Cancel',</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'caption'=>Yii::t('LookupModule.ui', 'Cancel'),</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'url'=>Yii::app()->request->urlReferrer,</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'htmlOptions'=>array(</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'style'=>'background:#0064cd;color:#ffffff;',</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: blue; font-family: Courier New, Courier, monospace;"> </span></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> )); </span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span> ?></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Semoga bermanfaat dan selamat berkarya untuk Indonesia</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-11683186708084598812014-10-20T15:52:00.000+07:002015-10-09T11:02:00.645+07:00Autocomplete pada form input YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Autocomplete pada form input YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Autocomplete pada form input YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Autocomplete pada form input YII</td></tr>
</tbody></table>
<br />
Sugik-info.blogspot.com - Catatan Kecil. Pada kali ini saya akan berbagi cara untuk membuat fitur autocomplete ala google dengan menggunakan Widgets <span style="color: red; font-family: Menlo, Consolas, 'Courier New', Courier, mono; font-size: 10pt; white-space: pre-wrap;">CJuiAutoComplete. </span><span style="font-family: Menlo, Consolas, 'Courier New', Courier, mono; font-size: 10pt; white-space: pre-wrap;">Kurang lebih screenshotnya seperti pada gambar berikut ini:</span><br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6iOsq6nuuMu2hxfhEyym16ZucY3YSBcT0ImDQzem67-XI_bWXDRkW7pG3SjTbv__EfDYyPcUq1JK8YzL4H0xwIjj2ufOk-9i5tWMag0F4ebg2LnDhD2oSB20XARcBj3a3Zq_qElyobiE/s1600/autokomplet.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="181" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6iOsq6nuuMu2hxfhEyym16ZucY3YSBcT0ImDQzem67-XI_bWXDRkW7pG3SjTbv__EfDYyPcUq1JK8YzL4H0xwIjj2ufOk-9i5tWMag0F4ebg2LnDhD2oSB20XARcBj3a3Zq_qElyobiE/s1600/autokomplet.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Screenshot dari penerapan Autocomplete pada form input Yii</td></tr>
</tbody></table>
<span style="font-family: Menlo, Consolas, 'Courier New', Courier, mono; font-size: 10pt; white-space: pre-wrap;"><br /></span>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Langkah pertama:<br />
Buka File Controller Anda<br />
seperti contoh berikut ini:<br />
<span style="color: blue;">public function actionAutocomplete()</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$res =array();</span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;"> if (isset($_GET['term'])) {</span><br />
<span style="color: blue;"> $qtxt ="SELECT </span><span style="color: red;">nip</span><span style="color: blue;"> from</span><span style="color: red;"> tb_pegawai</span><span style="color: blue;"> WHERE </span><span style="color: red;">nip</span><span style="color: blue;"> LIKE </span><span style="color: red;">:nip</span><br />
<span style="color: blue;"> ORDER BY </span><span style="color: red;">nip</span><span style="color: blue;"> ASC"; </span><br />
<span style="color: blue;"> $command =Yii::app()->db->createCommand($qtxt);</span><br />
<span style="color: blue;"> $command->bindValue("</span><span style="color: red;">:nip</span><span style="color: blue;">", $_GET['term'].'%', PDO::PARAM_STR);</span><br />
<span style="color: blue;"> $res =$command->queryColumn();</span><br />
<span style="color: blue;"> }</span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;"> echo CJSON::encode($res);</span><br />
<span style="color: blue;"> Yii::app()->end();</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;">/////////////////////</span><br />
<span style="color: red;">Masih pada File Controller Anda</span><br />
Tambahkan nama function pada rule<br />
<br />
<span style="color: blue;">public function accessRules()</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>return array(</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array('allow', // allow all users to perform 'index' and 'view' actions</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'actions'=>array('index','view','duplikasi', </span><span style="color: red;">'autocomplete'</span><span style="color: blue;">), //duplikasi adalah metode untuk mecegah data kembar</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'users'=>array('@'),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array('allow', // allow authenticated user to perform 'create' and 'update' actions</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'actions'=>array('create','update','admin',</span><span style="color: red;">'autocomplete</span><span style="color: blue;">'),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'users'=>array('@'),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array('allow', // allow admin user to perform 'admin' and 'delete' actions</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'actions'=>array('admin','delete',</span><span style="color: red;">'autocomplete'</span><span style="color: blue;">),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'users'=>array('admin'),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array('deny', // deny all users</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'users'=>array('*'),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>);</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<br />
Langkah Kedua:<br />
Buka File _Form.php<br />
Edit seperti skrip dibawah ini:<br />
<br />
<span style="color: blue;"><div class="row"></span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php echo $form->labelEx($model,'nip'); ?></span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php </span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$this->widget('zii.widgets.jui.CJuiAutoComplete', array(</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span> 'model'=>$model,</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span> 'attribute'=>'</span><span style="color: red;">nip</span><span style="color: blue;">',</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span> 'value'=>$model-></span><span style="color: red;">nip</span><span style="color: blue;">,</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'name'=>'</span><span style="color: red;">nip</span><span style="color: blue;">',</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'source'=>$this->createUrl('</span><span style="color: red;">Autocomplete</span><span style="color: blue;">'), </span><span style="color: red;">//memanggil function pada controller anda</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// additional options for the autocomplete plugin</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'options'=>array(</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'minLength'=>'2',</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'htmlOptions'=>array(</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'style'=>'width: 200px;',</span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'placeholder' => 'NIP'</span><br />
<span style="color: blue;"> ),</span><br />
<span style="color: blue;">));</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: blue;"> </span></span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>?></span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php echo $form->error($model,'nip'); ?></span><br />
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div></span><br />
<span style="color: blue;"><br /></span>
<span style="color: blue;">Selesai.</span><br />
<span style="color: blue;"><br /></span>
<span style="color: orange;">Semoga catatan kecil ini dapat sedikit membantu Anda.</span><br />
<span style="color: orange;"><br /></span>
Semangat...Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com2tag:blogger.com,1999:blog-7894341687842103930.post-69817977871764418602014-09-22T14:38:00.001+07:002015-10-09T08:57:39.810+07:00Cegah duplikasi data (Kasus cegah NIP ganda) didalam YII dengan try catch<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Cegah duplikasi data (Kasus cegah NIP ganda) didalam YII dengan try catch" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Cegah duplikasi data (Kasus cegah NIP ganda) didalam YII dengan try catch" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Cegah duplikasi data (Kasus cegah NIP ganda) didalam YII dengan try catch</td></tr>
</tbody></table>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil tentang cara Cegah duplikasi data (Kasus cegah NIP ganda) didalam YII dengan try catch. </span><span style="font-family: 'Courier New', Courier, monospace;">Misalkan saja akan mencegah inputan data ganda kita bisa menggunakan langkah-langkah seperti contoh berikut ini:</span></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: blue; font-family: Courier New, Courier, monospace;">Langkah 1:</span><br />
<span style="font-family: Courier New, Courier, monospace;">pada file controller Anda</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">public function actionCreate()</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$model=new Pegawai;</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Uncomment the following line if AJAX validation is needed</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$this->performAjaxValidation($model);</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: blue;">if(isset($_POST['Pegawai']))</span></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>try { //try jika berhasil</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$model->attributes=$_POST['Pegawai'];</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: blue; font-family: Courier New, Courier, monospace;"> </span></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if($model->save())</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span> Yii::app()->user->setFlash('success', 'Data berhasil di simpan');</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span> $this->redirect(array('view','id'=>$model->id));</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>catch(CDbException $e) //catch jika gagal</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Yii::app()->user->setFlash('error', '<strong>Gagal!</strong> NIP sudah ada didalam sistem');</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$this->redirect(array('duplikasi'));</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$this->render('create',array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'model'=>$model,</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>));</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: blue; font-family: Courier New, Courier, monospace;">Langkah 2:</span><br />
<span style="font-family: Courier New, Courier, monospace;">Membuat function</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;">public function actionDuplikasi()</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$this->render('duplikasi');</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;">Langkah 3:</span><br />
<span style="font-family: Courier New, Courier, monospace;">Pada Accesrule tambahkan nama fungsinya</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">public function accessRules()</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>return array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array('allow', // allow all users to perform 'index' and 'view' actions</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'actions'=>array('index','view','<span style="color: blue;">duplikasi</span>'), //duplikasi adalah metode untuk mecegah data kembar</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'users'=>array('@'),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="font-family: Courier New, Courier, monospace;">}</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Langkah 4:</span><br />
<span style="font-family: Courier New, Courier, monospace;">Membuat View</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><?php</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;">$this->breadcrumbs=array(</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//'Error'=>array('index'),</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'Kesalahan'</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;">);</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: blue; font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: blue; font-family: Courier New, Courier, monospace;"><?php</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> foreach(Yii::app()->user->getFlashes() as $key =>$message)</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> echo '<div class="flash-'.$key.'">'.$message.'</div>';</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo CHtml::Button('Kembali',array('onClick'=>'window.history.back(-3)'));</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> ?></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: blue; font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Semoga bermanfaat</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com1tag:blogger.com,1999:blog-7894341687842103930.post-21285893769253740352014-07-15T09:55:00.001+07:002015-10-09T11:10:51.548+07:00Aplikasi aktif pada windows 7 tidak muncul di taskbar<div style="text-align: justify;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsPW0gL3859OpefVXN6MDYdMD3pSBY9P4xVJa2Hljw00jUjAybUrwKfk-kcQ6n1WICiNqoWPyoUp8SBKkMsra4tWh2Ulb06coycSEpaIj0-0-VnrhRaCe-_rWbJg9aD1p6uOhQKzIVoc4/s1600/windows.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><span style="font-family: inherit;"><img alt="Aplikasi aktif pada windows 7 tidak muncul di taskbar" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsPW0gL3859OpefVXN6MDYdMD3pSBY9P4xVJa2Hljw00jUjAybUrwKfk-kcQ6n1WICiNqoWPyoUp8SBKkMsra4tWh2Ulb06coycSEpaIj0-0-VnrhRaCe-_rWbJg9aD1p6uOhQKzIVoc4/s1600/windows.jpg" title="Aplikasi aktif pada windows 7 tidak muncul di taskbar" /></span></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: inherit;">Aplikasi aktif pada windows 7 tidak muncul di taskbar</span></td></tr>
</tbody></table>
<span style="font-family: inherit;"><br />
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b>- Akhir-akhir ini banyak komputer kantor yang kena gejala aneh, secara tiba-tiba aplikasi yang sedang dibuka pada windows 7 tidak muncul pada taskbar, setelah googling kesana kemari akhirnya ketemu juga solusinya. disinyalir windows sudah terinfeksi oleh virus dan spyware, bukan bermaksud promosi tetapi cara ini sudah berhasil saya terapkan, gunakan <span style="color: blue;">Microsoft Security Essential</span> untuk mengatasinya. </span></div>
<span style="font-family: inherit;"><br />
<br />
</span><br />
<span style="font-family: inherit;">atau bisa juga disebabkan oleh windows explorer yang hang, caranya cukup buka task manager (Ctrl+Alt+Del) cari proses explorer.exe dan end task, kemudian New Task explorer.exe</span><br />
<span style="font-family: inherit;"><br />
<span style="text-align: justify;">Semoga berhasil juga di komputer Anda.</span></span><br />
<span style="font-family: inherit;"><span style="text-align: justify;"><br /></span>
Semangat...</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com2tag:blogger.com,1999:blog-7894341687842103930.post-2338950626946128772014-07-11T09:17:00.003+07:002015-10-09T08:35:41.412+07:00Atasi jendela windows yang minimize dengan sendiri<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD8ND_HsVaJdCgLPJpxlQkZnGCtW2Wr8jRrBDTTwH3mSijvinl5Bm4zQQQPqaoxovHNA35KcVSJIo0OFYpMo9UJ5ALEcSXbrOYXz0o3rmU9WI1mjzsw2J-8621WXABxzfK3yXJXk3T2UU/s1600/windows.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Atasi jendela windows yang minimize dengan sendiri" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD8ND_HsVaJdCgLPJpxlQkZnGCtW2Wr8jRrBDTTwH3mSijvinl5Bm4zQQQPqaoxovHNA35KcVSJIo0OFYpMo9UJ5ALEcSXbrOYXz0o3rmU9WI1mjzsw2J-8621WXABxzfK3yXJXk3T2UU/s1600/windows.jpg" title="Atasi jendela windows yang minimize dengan sendiri" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Atasi jendela windows yang minimize dengan sendiri</td></tr>
</tbody></table>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil mengenai cara Atasi jendela windows yang minimize dengan sendiri. </span><span style="font-family: 'Courier New', Courier, monospace;">Pagi ini ada pertanyaan dari rekan kerja di kantor, intinya semua program yang dibuka tidak kelihatan karena minimize dengan sendirinya. karena saya juga masih awam saya tanya di Google. akhirnya masalah dapat diatasi dengan langkah-langkah sebagai berikut:</span></div>
<br />
<ol>
<li><span style="font-family: Courier New, Courier, monospace;">Start</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Run</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">msconfig.exe</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">masuk tab proces</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">non aktifkan pilihan "Interactive Service Detection"</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Restrat</span></li>
</ol>
<br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Semangat...</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-62428347967275966912014-07-03T09:33:00.005+07:002015-10-09T10:28:12.639+07:00Menggabung beberapa field di dalam MySQL<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxoXEl3UfzShRRdrpT-lv-Q0qQti5E1nl4Xktf7vb7dSl8-NQBDslMj-oSs2v6usOKDe1Ch1MgieU_TZ_81AzUWHnxwx6mBahHTdbQvp67C_0GqcQxQ4VvTaSUu7dLIG08A9wpJTCZfHk/s1600/mysql.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Menggabung beberapa field di dalam MySQL" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxoXEl3UfzShRRdrpT-lv-Q0qQti5E1nl4Xktf7vb7dSl8-NQBDslMj-oSs2v6usOKDe1Ch1MgieU_TZ_81AzUWHnxwx6mBahHTdbQvp67C_0GqcQxQ4VvTaSUu7dLIG08A9wpJTCZfHk/s1600/mysql.jpg" title="Menggabung beberapa field di dalam MySQL" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Menggabung beberapa field di dalam MySQL</td></tr>
</tbody></table>
<br />
<span style="font-family: inherit;"><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a> - Berikut ini catatan kecil mengenai cara </span>Menggabung beberapa field di dalam MySQL. Silakan simak penggalan perintah dibawah ini:<br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Contoh</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: blue; font-family: Courier New, Courier, monospace;">SELECT `nip`, concat(`glr_dpn`,' ',`nama`,' ',`glr_blkg`) as `nama_lengkap` from `tb_pegawai`</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Semangat...</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-22076570012516062242014-07-03T09:05:00.002+07:002015-10-09T10:29:56.588+07:00Mengisi tabel dari tabel lain di MySQL<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-Ia_DoYDveFhZKAielthWQKUkfgnOgvIVFVcPd8lAn98xsatlE8ZG-nvwyphGiiRdOc8o_c_VLJs_cQZMSjK9dLc1FPHOA_DIJaBPphxSCbUdbBLGTL-JTTOd1EdhDeDQSuBzbooBIgE/s1600/mysql.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Mengisi tabel dari tabel lain di MySQL" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-Ia_DoYDveFhZKAielthWQKUkfgnOgvIVFVcPd8lAn98xsatlE8ZG-nvwyphGiiRdOc8o_c_VLJs_cQZMSjK9dLc1FPHOA_DIJaBPphxSCbUdbBLGTL-JTTOd1EdhDeDQSuBzbooBIgE/s1600/mysql.jpg" title="Mengisi tabel dari tabel lain di MySQL" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mengisi tabel dari tabel lain di MySQL</td></tr>
</tbody></table>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini adalah cacatan kecil mengenai cara Mengisi tabel dari tabel lain di MySQL. Untuk mengisi data tabel yang diambilkan dari tabel lain cukup menggunakan perintah insert dan select.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Contoh</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<pre><span style="font-family: Courier New, Courier, monospace;">INSERT INTO <span style="color: blue;">tb_pegawai</span> (<span style="color: orange;">no_telp, nama</span>) SELECT <span style="color: orange;">no_hp, nama</span> FROM <span style="color: blue;">karyawan;</span></span></pre>
<pre><span style="font-family: Courier New, Courier, monospace;">
</span></pre>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;">Keterangan Warna biru adalah nama tabel</span><br />
<span style="font-family: inherit;">warna orange adalah nama field dari tabel</span><br />
<span style="font-family: inherit;"><br />
<br />
<br />
Semangat...</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-77634867287673735852014-07-01T10:58:00.003+07:002015-10-09T10:31:24.535+07:00Membuat tabel selang seling di Ms. Excel 2007<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZVxkMgg2mnAed5JYediySNghdYFApMWhjP1OGPbaOV6Zntvf8hyQfXYN5z_K1AbYJA2gOuj7HT9clVJvQr8Zh9k-o7vywISsnyhB5FWHnY7dg9cKlaX98sZyR-XdaGo0aD_LNvtx0M-k/s1600/ms+Office.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Membuat tabel selang seling di Ms. Excel 2007" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZVxkMgg2mnAed5JYediySNghdYFApMWhjP1OGPbaOV6Zntvf8hyQfXYN5z_K1AbYJA2gOuj7HT9clVJvQr8Zh9k-o7vywISsnyhB5FWHnY7dg9cKlaX98sZyR-XdaGo0aD_LNvtx0M-k/s1600/ms+Office.png" title="Membuat tabel selang seling di Ms. Excel 2007" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Membuat tabel selang seling di Ms. Excel 2007</td></tr>
</tbody></table>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini adalah catatan kecil mengenai cara </span>Membuat tabel selang seling di Ms. Excel 2007. <span style="font-family: inherit;">Untuk membuat tabel warna selang-seling di Ms. Excel 2007 caranya sebagai berikut:</span><br />
<span style="font-family: inherit;"><br /></span>
<ol>
<li><span style="font-family: inherit;">Buat tabel yang akan diformat</span></li>
<li><span style="font-family: inherit;">Blok tabel tersebut</span></li>
<li><span style="font-family: inherit;">Klik Home->Conditional Formating->New Rule</span></li>
<li><span style="font-family: inherit;">Masukan rumus <span style="color: blue;">=MOD(ROW();2)=0</span> pada Pilihan Use formula to determinate which cells to format</span></li>
<li><span style="font-family: inherit;">Pilih Format->Fill->Pilih warna->ok</span></li>
<li><span style="font-family: inherit;">Ok</span></li>
<li><span style="font-family: inherit;">Done</span></li>
</ol>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br />
Semangat...</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-20864970514617160652014-06-20T11:14:00.001+07:002015-10-09T11:02:16.859+07:00Menambahkan Scroll Bar pada Cgridview YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Menambahkan Scroll Bar pada Cgridview YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Menambahkan Scroll Bar pada Cgridview YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Menambahkan Scroll Bar pada Cgridview YII</td></tr>
</tbody></table>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil mengenai cara </span>Menambahkan Scroll Bar pada Cgridview YII. <span style="font-family: inherit;">Anda cukup memanfaatkan CSS saja untuk menambah Srcroll Bar seperti langkah berikut ini:</span><br />
<span style="font-family: inherit;">1. Tambahkan skrip ini <span style="color: blue;"><div class="CGridViewContainer"></span> <span style="color: red;">skrip CGridview Anda</span> <span style="color: blue;"></div></span></span><br />
<span style="font-family: inherit;">2. Kemudian pada CSS tepatnya CSS/main.css dengan skrip ini <span style="color: blue;"><div class="CGridViewContainer"></span></span><br />
<span style="font-family: inherit;">3. Refresh....</span><br />
<span style="font-family: inherit;">4. Done</span><br />
<span style="font-family: inherit;"><br />
Semangat...</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com1tag:blogger.com,1999:blog-7894341687842103930.post-55280698601895125592014-04-24T11:25:00.004+07:002015-10-09T11:05:01.528+07:00Membaca sub folder dalam PHP YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj21jHEGbloABxHUs61iIAxClyI82GkbnMP-3boUbjzAbY2lEvZN0_XQB9zx0iNgUkp_gwQpQssbkPcIOnZU6c1zRgg0NfRvmHUIdvJx10I5hewuXqUohNsNodG5Up0ne7j9iHQVcpzh9s/s1600/php.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Membaca sub folder dalam PHP YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj21jHEGbloABxHUs61iIAxClyI82GkbnMP-3boUbjzAbY2lEvZN0_XQB9zx0iNgUkp_gwQpQssbkPcIOnZU6c1zRgg0NfRvmHUIdvJx10I5hewuXqUohNsNodG5Up0ne7j9iHQVcpzh9s/s1600/php.jpg" title="Membaca sub folder dalam PHP YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Membaca sub folder dalam PHP YII</td></tr>
</tbody></table>
<span style="background-color: white; font-family: Georgia, Times, serif; font-size: 14px; line-height: 21px;"><br /></span>
<span style="background-color: white; font-family: Georgia, Times, serif; font-size: 14px; line-height: 21px;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini adalah catatan kecil tentang cara </span><span style="font-family: Georgia, Times, serif; font-size: 14px; line-height: 21px;">Membaca sub folder dalam PHP YII. Silakan simak penggalan kode berikut ini:</span><br />
<span style="font-family: Georgia, Times, serif;"><span style="font-size: 14px; line-height: 21px;"><br /></span></span>
<span style="background-color: white; color: #7a7a7a; font-family: Georgia, Times, serif; font-size: 14px; line-height: 21px;">Kode (‘../’) sama dengan masuk langkah</span><br />
<span style="background-color: white; color: #7a7a7a; font-family: Georgia, Times, serif; font-size: 14px; line-height: 21px;">Kode (../../) </span><span style="background-color: white; color: #7a7a7a; font-family: Georgia, Times, serif; font-size: 14px; line-height: 21px;">sama dengan masuk </span><span style="background-color: white; color: #7a7a7a; font-family: Georgia, Times, serif; font-size: 14px; line-height: 21px;">dua langkah .</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-48543072244453512992014-04-24T11:22:00.000+07:002015-10-09T11:11:59.523+07:00Dropdownlist Dinamis Order By dengan YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Dropdownlist Dinamis Order By dengan YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Dropdownlist Dinamis Order By dengan YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Dropdownlist Dinamis Order By dengan YII</td></tr>
</tbody></table>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Bagi Anda yang baru mengenal YII Framework, barangkali sepenggalan skrip ini akan sedikit bermanfaat. Silakan dicoba:</span><br />
<br />
<span style="font-family: Georgia, Times New Roman, serif;"><div class="row"></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php echo $form->labelEx($model,'jabatan_id'); ?></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: blue;"><?php echo $form->dropDownList($model,'jabatan_id',CHtml::listData(Jabatan::model()->findAll(array('order'=>'jabatan asc')),'id', 'jabatan'),</span></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array('empty'=>'-- Pilih --') );?></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php echo $form->error($model,'jabatan_id'); ?></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div></span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-18246619961429097152014-04-21T12:35:00.003+07:002015-10-09T11:12:11.713+07:00Membuat menu Cancel / Batal pada form input YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Membuat menu Cancel / Batal pada form input YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Membuat menu Cancel / Batal pada form input YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Membuat menu Cancel / Batal pada form input YII</td></tr>
</tbody></table>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini adalah catatan kecil tentang cara Membuat menu Cancel / Batal pada form input YII. </span><span style="font-family: Georgia, 'Times New Roman', serif;">untuk membuat menu Cancal / Batal pada form input YII tinggal menambahkan script berikut pada file </span><span style="color: red; font-family: Georgia, 'Times New Roman', serif;">_form.php</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><div class="row buttons"></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span>&nbsp;&nbsp;</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: red;"><?php</span><span style="color: blue;"> echo CHtml::Button('Cancel',array('onClick'=>"location='index.php?r=</span><span style="color: orange;">pegawai</span><span style="color: blue;">/admin'"));</span><span style="color: red;"> ?></span></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div></span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;">Warna orange diganti sesuai dengan controler Anda sendiri.</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;">Selamat berkarya untuk Indonesia.</span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-27328323373880855122014-04-21T11:53:00.001+07:002015-10-09T11:12:31.669+07:00Hapus data dengan konfirmasi di dalam YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Hapus data dengan konfirmasi di dalam YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Hapus data dengan konfirmasi di dalam YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Hapus data dengan konfirmasi di dalam YII</td></tr>
</tbody></table>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini adalah catatan kecil tentang cara </span>Hapus data dengan konfirmasi di dalam YII. <span style="font-family: inherit;">Untuk menghapus data dengan konfirmasi pada YII, kita bisa masuk pada file admin.php yang berada dalam view dengan menambahkan script seperti yang berwarna biru dibawah ini:</span><br />
<span style="font-family: Courier New, Courier, monospace;">contoh:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><?php $this->widget('zii.widgets.grid.CGridView', array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'id'=>'pegawai-grid',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'dataProvider'=>$model->search(),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'filter'=>$model,</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'columns'=>array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array( //nomor urut pada tabel</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'No', </span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>'$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1', ),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'nama',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'nip',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'glr_dpn',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'glr_blkg',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//'tmp_lhr',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//'tgl_lhr',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//'jnskel',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'name'=>'jnskel',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'type'=>'raw',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'Jenis Kelamin',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>'CHtml::encode($data->ubahjk())',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'htmlOptions'=>array('width'=>''),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//'tmt_cpns',</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'name'=>'cari_gol',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'type'=>'raw',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'Gol Ruang',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>'CHtml::encode($data->gol->gol)',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'htmlOptions'=>array('width'=>''),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//<span class="Apple-tab-span" style="white-space: pre;"> </span>'tmtgol',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//'tgs_tambahan',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//'tmt_tgs_tambahan',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'name'=>'cari_jabatan',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'type'=>'raw',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'Jabatan',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>'CHtml::encode($data->jabatan->jabatan)',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'htmlOptions'=>array('width'=>''),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/*</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'tmtjab',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'mkth',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'mkbl',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'latih_jabatan',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'tmt_latihjab',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>*/<span class="Apple-tab-span" style="white-space: pre;"> </span>array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'name'=>'cari_pend',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'type'=>'raw',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'Pendidikan',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>'CHtml::encode($data->Pend->ijazah)',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'htmlOptions'=>array('width'=>''),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/*<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'namapend',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'luluspend',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>*/</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'jnspeg',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//<span class="Apple-tab-span" style="white-space: pre;"> </span>'ket',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//<span class="Apple-tab-span" style="white-space: pre;"> </span>'status',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//<span class="Apple-tab-span" style="white-space: pre;"> </span>'tmt_status',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'name'=>'cari_unit',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'type'=>'raw',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'Unit',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>'CHtml::encode($data->unit->unit)',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'htmlOptions'=>array('width'=>''),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'class'=>'CButtonColumn',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//'deleteConfirmation'=>"js: 'Are you want to delete '+$(this).parent().parent().children(':first-child').text()+ '?'",</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: blue;">'deleteConfirmation'=>"js: 'Are you want to delete '+$(this).parent().parent().children(':nth-child(2)').text()+ '?'",</span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span><br />
<span style="font-family: Courier New, Courier, monospace;">)); ?></span><br />
<br />Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-21578107231573151152014-04-15T10:49:00.000+07:002015-10-09T11:07:09.517+07:00Watermark di dalam form isian YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Watermark di dalam form isian YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Watermark di dalam form isian YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Watermark di dalam form isian YII</td></tr>
</tbody></table>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil tentang cara membuat tulisan </span>Watermark di dalam form isian YII. Silakan simak penggalan skript berikut ini:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><div class="row"></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php echo $form->labelEx($model,'nama'); ?></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php echo $form->textField($model,'nama',<span style="color: blue;">array('placeholder'=>'Nama lengkap')</span>,array('size'=>60,'maxlength'=>70)); ?></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><?php echo $form->error($model,'nama'); ?></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div></span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-87017799962535287162014-04-07T12:48:00.000+07:002015-10-09T11:12:46.089+07:00Mudahnya membuat Total Pada Kolom CGridView YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Mudahnya membuat Total Pada Kolom CGridView YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Mudahnya membuat Total Pada Kolom CGridView YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mudahnya membuat Total Pada Kolom CGridView YII</td></tr>
</tbody></table>
<br />
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini cacatan kecil tentang cara membuat Total Pada Kolom CGridView YII. Untuk membuat baris total pada widget CGridView Saudara dapat mengikuti langkah-langkah sebagai berikut:<br />
<br />
<div>
1. Buat query dalam controller misal <span style="color: red;">StatistikController.php</span><br />
<div>
<div>
<div>
<span style="color: blue;">public function actionIndex()</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$sql=Yii::app()->db->createCommand()</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>->select(array('unit', 'count(peg.nip) as jumlah'))</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>->from('tb_pegawai peg')</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>->join('tb_unit unit', 'peg.unit_id=unit.id')</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>->group('unit')</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>->queryAll();</span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: blue;"> </span></span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$this->render("statistik",array('data'=>$sql,));</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></div>
</div>
</div>
</div>
<div>
<span style="color: blue;"><br /></span></div>
<div>
2. Conversikan query pada bagian view Saudara seperti ini</div>
<div>
<div>
<span style="background-color: white;"><span style="color: blue;"><?php</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;">$hasil=new CArrayDataProvider($data, array(</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'id'=>'id',</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'sort'=>array(</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'attributes'=>array(</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'unit', 'jumlah',</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),),</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'pagination' => array(</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;"> 'pageSize' => 50, // Banyak record yang akan di tampilkan</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;"> ),</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;">));</span></span></div>
<div>
<span style="background-color: white;"><span style="color: blue;">?></span></span></div>
</div>
<div>
<span style="background-color: white;">agar bisa Saudara tampilkan dalam CGridView</span></div>
<div>
<span style="background-color: white;"><br /></span></div>
<div>
<span style="background-color: white;">3. Unduh extensi </span><a href="http://www.yiiframework.com/extension/gridcolumns" style="-webkit-transition: all 0.4s ease-in-out; background-color: #fdfdfd; box-sizing: border-box; color: #999999; font-family: Verdana, Geneva, sans-serif; font-size: 11px; line-height: 17.600000381469727px; text-decoration: none; transition: all 0.4s ease-in-out;" target="_blank">GridColumn</a> dan letakan di dalam folder extensions</div>
<div>
4. Exsekusi skripnya seperti contoh ini:</div>
<div>
<div>
<span style="color: blue;"><?php $this->widget('zii.widgets.grid.CGridView', array(</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'dataProvider'=>$hasil,</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'columns'=>array(</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array( //nomor urut pada tabel</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'No', </span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>'$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1', ),</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array(</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'name'=>'unit',</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'type'=>'raw',</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'Unit Kerja',</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'footer'=>'<b>Total :</b>',</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: blue;"> </span></span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>array(</span></div>
<div>
<span style="color: blue;"> 'class'=>'ext.gridcolumns.TotalColumn',</span></div>
<div>
<span style="color: blue;"> 'name'=>'jumlah',</span></div>
<div>
<span style="color: blue;"> 'filter'=>'',</span></div>
<div>
<span style="color: blue;"> 'htmlOptions'=>array('style'=>'text-align:right;width:120px'),</span></div>
<div>
<span style="color: blue;"> 'output'=>'Yii::app()->numberFormatter->formatDecimal($value)',</span></div>
<div>
<span style="color: blue;"> 'type'=>'raw',</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'header'=>'Jumlah Pegawai',</span></div>
<div>
<span style="color: blue;"> 'footer'=>true,</span></div>
<div>
<span style="color: blue;"> 'footerHtmlOptions'=>array(</span></div>
<div>
<span style="color: blue;"> 'style'=>'text-align: right; padding-right: 5px;'</span></div>
<div>
<span style="color: blue;"> ), ),</span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: blue;"> </span></span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>),</span></div>
<div>
<span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>));</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-39839815280375979732014-04-07T08:11:00.001+07:002015-10-09T11:09:00.922+07:00Ajax Validation dalam form Yii<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Ajax Validation dalam form Yii" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Ajax Validation dalam form Yii" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Ajax Validation dalam form Yii</td></tr>
</tbody></table>
<br />
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil tentang cara membuat validasi pada form YII menggunakan Ajax. Ajax validation digunakan untuk memvalidasi isian form yang dibutuhkan. caranya sebagai berikut:<br />
<br />
<ol>
<li>Generate CRUD dengan GII</li>
<li>Masuk kontroler dan aktifkan skrip ini <span style="background-color: white;"><span style="color: blue;">$this->performAjaxValidation($model);</span></span></li>
<li><span style="background-color: white;">Masuk pada direktori views dan pada </span><span style="color: blue;">_form.php</span> mengubah nilai menjadi true, pada skrip ini <span style="color: blue;">'enableAjaxValidation'=>true,</span></li>
<li>Done.</li>
</ol>
<div>
Selamat berkreasi</div>
Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-10644299513690035422014-03-28T15:55:00.003+07:002015-10-09T11:13:24.982+07:00Membuat nomor urut otomatis berdasarkan hasil query builder YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Membuat nomor urut otomatis berdasarkan hasil query builder YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Membuat nomor urut otomatis berdasarkan hasil query builder YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Membuat nomor urut otomatis berdasarkan hasil query builder YII</td></tr>
</tbody></table>
<br />
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil mengenai cara membuat nomor urut otomatis berdasarkan hasil query builder YII. Simak langkah-langkahnya:<br />
<br />
Langsung saja, misal dalam controler kita mempunyai skrip seperti ini:<br />
public function actionDukdosen()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$sql=Yii::app()->db->createCommand()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>->select('*')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>->from('tb_pegawai peg')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>->join('tb_golongan gol', 'peg.golongan_id=gol.id')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>->join('tb_jabatan jab', 'peg.jabatan_id=jab.id')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>->join('tb_pendidikan pend', 'peg.ijazah_id=pend.id')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>->join('tb_unit unit', 'peg.unit_id=unit.id')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>->where(array('like','peg.jnspeg','%Dosen%'))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>->order(array('gol.bobot DESC', 'peg.tmtgol ASC', 'jab.bobot DESC', 'peg.mkth DESC', 'peg.mkbl DESC', 'pend.bobot DESC', 'peg.luluspend DESC', 'peg.tgl_lhr ASC'))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>->queryAll();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$this->render("dukdosen",array('duk'=>$sql));<br />
<br />
dalam view kita akan menampilkan data hasil queri tersebut dengan perintah seperti ini:<br />
<table><br />
<tr><td>NO</td><td>NAMA</td><td>NIP</td><td>GOL</td><td>TMT GOL</td><td>JABATAN</td><td>TMT JAB</td><td colspan=2>MASA KERJA</td><td>PENDKN</td><td>TH LULUS</td><td>USIA</td><td>Unit</td><br />
<span style="color: red;"><?php</span><br />
<span style="color: blue;">$no=1;</span><br />
<span style="color: blue;">foreach ($duk as $data):</span><br />
<span style="color: blue;">echo</span> "<tr><br />
<td>$no</td><br />
<td>$data[nama]</td><br />
<td>$data[nip]</td><br />
<td>$data[gol]</td><br />
<td>$data[tmtgol]</td><br />
<td>$data[jabatan]</td><br />
<td>$data[tmtjab]</td><br />
<td>$data[mkth]</td><br />
<td>$data[mkbl]</td><br />
<td>$data[ijazah]</td><br />
<td>$data[luluspend]</td><br />
<td>$data[tgl_lhr]</td><br />
<td>$data[unit]</td><br />
</tr>";<br />
<span style="color: blue;">$no++;</span><br />
<span style="color: blue;">endforeach;</span><br />
<span style="color: red;">?></span><br />
<span style="color: red;"><br /></span>
nah kode yang berwarna biru itulah yang berguna buat memberikan nomor otomatis. Semoga dapat membantu, sekian.Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0tag:blogger.com,1999:blog-7894341687842103930.post-40195054841260807182014-03-20T12:00:00.001+07:002015-10-09T11:13:42.261+07:00Menampilkan relasi antar tabel di dalam CDetailView YII<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Menampilkan relasi antar tabel di dalam CDetailView YII" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJlVuyJtLX6MMe4cREZQjf2z7unzO-R9XAI2UmLa72GMcyc5AqvnbxFGGM0lRr3MNULsk6Ns3WY6A5LSa_MNdzTJFXEJbe7uWOpzccmmxEjXfY7EWQHNfwDv7KFPb47xLkqhH_fkrWtjY/s1600/yii.jpg" title="Menampilkan relasi antar tabel di dalam CDetailView YII" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Menampilkan relasi antar tabel di dalam CDetailView YII</td></tr>
</tbody></table>
<br />
<b><a href="http://sugik-info.blogspot.com/">Sugik-info.blogspot.com</a></b> - Berikut ini catatan kecil tentang cara Menampilkan relasi antar tabel di dalam CDetailView YII. Silakan simak langkah-langkahnya:<br />
<br />
Langkah pertama pastikan sudah membuat relasi di dalam sebuar model<br />
contoh: Model <span style="color: blue;">Pegawai.php</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;">public function relations()</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> array(</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> 'jabatan'=>array(self::BELONGS_TO,</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> 'Jabatan', 'jabatan_id'),</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> );</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Langkah kedua kita tinggal memanggil saja di komponen CDetailView, caranya</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: blue; font-family: Courier New, Courier, monospace;"> <?php $this->widget('zii.widgets.CDetailView', array(</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'data'=>$model,</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'attributes'=>array(</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> 'nama',</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> array(</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: blue;">'label'=>'Jabatan',</span></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'type'=>'raw',</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="color: blue;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'value'=>$model->jabatan</span>()<span style="color: #6aa84f;">/*namarelasi*/</span><span style="color: blue;">->jabatan</span><span style="color: #6aa84f;">/*nama field dalam tabel referensi*/</span>,</span><br />
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: blue;">),</span></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> ),</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"></span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> )); ?></span>Anonymoushttp://www.blogger.com/profile/08047445357457572427noreply@blogger.com0