fatal error: call to a member function saveas() on a non-object yii

the problem is here (in the view file):

<?php
$form = $this->beginWidget(‘CActiveForm’, array(
‘id’ => ‘surat-form’,
‘enableAjaxValidation’ => false,
‘htmlOptions’ => array(‘enctype’ => ‘multipart/form-data’, ‘title’ => ‘form title’),
));
?>

yes, add this line:

‘htmlOptions’ => array(‘enctype’ => ‘multipart/form-data’, ‘title’ => ‘form title’),

you’re welcome.

unified modelling language

disclaimer: my english is bad, every correction will be very appreciated.

it’s a gloomy night. but, depends on what you’re listening to.

cause if one day you wake up and find that your missing me,
and your heart starts to wonder where on this earth i can be,

if you know from what song that chunk of lyrics is, that’s what i’m listening to now. it makes me remember the darkness memories of my past. it’s about two girls who have one same physical characteristic on their shape of teeth. the detail of the shape is a secret. if i write it here, i’m afraid there will be a mass tooth surgery soon. because, well, i got this thing called a crush on them.

but as you all probably know, i’m unskilled in love. so i have never told them. and now they have been married already. their wedding ceremony were happen at the same date, the same month, and the same year, or shortly: the same day. but different places. the first girl, she invited me to come to her wedding ceremony. but since it was outside of the town where i’m living, i couldn’t come. the second one, is in the town, but i didn’t get the invitation, and i didn’t even know that she’s gonna have a wedding ceremony that day too. i’m just accidentally passing through in the front of a building where i can see the bride’s name in the janur kuning, her name. to make sure, i checked it out in the social media aaand it’s true. her wedding.

i believe that everything is happen for reasons. the similarity of their teeth, their wedding ceremony at the same day, myself who is accidentally passing by the building. there must be something with it, a miracle, a magical, conspiracy. at least, i can make a post based on this true story.

speaking of wedding ceremony, there are many things that related to it, especially the foods. but i’m not gonna tell you anything about the wedding foods today. i’m gonna tell you a story about a cup. a wedding cup.

the uml cup

my class in the college, has a tradition. every person who get married, deserves one small cup, and one big cup. they can have the small cup for good, but the big cup is passed to the next one who get married, and also get her/his name carved on it. that big cup is called the uml cup. in the realm of software, uml stands for unified modeling language, it is a standardized general-purpose modeling language in the field of object-oriented software engineering. but in this cup, it stands for: “udah menikah lho” (just married).

pacifist uml cup

the process of carving the name is done in a trophy store in bandung. so, there has to be someone in bandung who take care of it. that someone is not me, until the sixth edition of the uml cup.

the sixth wedding was held outside bandung. the previous one who handled the trophy was pregnant and can’t go too far. so that is my first job, just to deliver the cup from bandung to cipanas puncak, bogor. the next job is not just to deliver, but also to get the name carved on the uml cup, and to buy the small cup.

why me? here’s the story..

that night, a pack of guys suddenly appear in front of me. they said they’re looking for a transporter, who specializes moving goods of all kinds. i asked why they chose me.

“because you have reputation. you’re slow, but you never late. maybe you can carry a 9 months pregnant woman through any motor cross circuit and she feels no significant shocks . and when you were a baby, the doctor miss-injected you with some brand of cola instead of immunization serum.”
“huh? is that true? what’s the relation with cola? anyway, i’m sorry,” i said, “i’m not available.”

the next second they’re pointing a shotgun to my mouth. a shotgun with cheese bullets. i was very afraid. so i said to them,

“okay, but with one condition.”
“we’re listening, what condition is that?” they’re grinning.
“i’m not wearing shoes.”
“deal.”

ya ya ya, that’s not the real story. let’s just talk about the trophy store.

the trophy store is located at the new castle street in parijs van java (jalan astana anyar, bandung). traffic jam often occurs in this road because it has many adjacent intersections. the road is also very hot due to the lack of trees. if you are a white skinned person, then you’ll be brown soon after passing this road. if you wore a dry shirt, then it’ll get wet under 3 minutes in this road because of your sweat. if it’s not for the happiness of my friends’ wedding, i wouldn’t do it.

most of my friends (the members of my class) have left bandung ever since we graduated, so the wedding also spread in several places in indonesia, outside this town. it is hard to deliver the small cup because it is more fragile than the big one. that’s why after the 15th edition of the uml cup, the small cup is replaced by medal. the missions aren’t always completed. the big cup didn’t attend in the 15th, the 17th, and the 18th wedding. the medal of the 17th wedding also didn’t arrive in time.

there are many friends who helped me did the missions, and most of them are not married yet. thank you my friends, when we leave this year, we’ll be 25. i hope our turn will come soon. very soon.

soon, very soon

picture source: izismile.com

membuat interface website

sejak dulu mazhab yg saya yakini saat membuat interface suatu website adalah: semakin mudah dimengerti oleh pengguna maka semakin bagus.

tadi malam saya dpt pencerahan baru. ternyata ada website yg disengaja dibuat “menyusahkan” pengunjungnya, dengan maksud “menahan” pengunjung lebih lama di website tersebut, agar mengurangi jumlah bounce, alias pengunjung yg datangnya hanya sebentar sekali.

interface dpt dibuat serumit mungkin sampai titik termaksimal dimana pengunjung masih tetap mau (tertantang) bertahan di website itu untuk mencoba-coba klak-klik sana sini. tapi jangan sampai terlalu susah juga, sampai orang tidak tertarik untuk klik sama sekali.

selain supaya lebih lama, rancangan interface yg rumit tersebut juga bisa dibuat supaya pengunjung dapat “diperdaya” “diarahkan” sehingga mereka mengunjungi semua bagian dari website (atau beberapa bagian yang kita inginkan untuk dikunjungi).

interface bisa disebut rumit saat pengunjung datang ke website dan mereka bingung, misal: “hah, apa ini? kalau saya mau melakukan anu klik yg mana ya..” jika pengunjung tetap bertahan dan mencoba klik sana sini, dan besok2nya masih mau berkunjung, maka misi tercapai.. tapi jika pengunjung tidak tertarik untuk klik sama sekali, atau besok2nya kapok datang ke website yg dibuat, maka misi gagal..

tentu saja ada banyak faktor yang bisa “menahan” pengunjung selain daripada interface. bisa karena isi situs tersebut memang menarik dan berbobot. misal ada kuis berhadiah jalan2 ke tokyo, atau lomba melamar, dimana pemenang akan dibiayai pesta pernikahannya + bulan madunya, dll. bisa juga karena situs tersebut sudah banyak yg menggunakan, sehingga begitu ada orang baru berkunjung, dia akan merasa tertantang untuk mencoba-coba terus, sampai terbiasa. dan faktor2 lainnya seperti situs orang yg disayangi, situs kantor yg harus dikunjungi untuk memasukkan data pekerjaan, orang2 membutuhkan situs itu untuk melakukan sesuatu & tdk bisa di situs lain, dst.

tidak semua perancangan interface suatu website harus menganut paham ini. paham ini digunakan bila ada kebutuhan untuk “menahan” pengunjung saja. jika pengunjung yg datang sebentar dan pengunjung yang datang lama dianggap sama saja, maka tidak perlu pusing2 memikirkan interface yg rumit tapi menantang.

itu.

-just write what you can’t remember, what you can’t tell-

validasi form sederhana dengan javascript

form validation with javascript

berhubung pekerjaan di kantor msh dikit, padahal harus menulis utk archive di bln juni, namun tidak menemukan bahan tulisan yg asik, maka dg amat terpaksa saya tulis ini.. sebuah kode sederhana, untuk validasi form dg javascript, hohoho..  warning, kode2 ini tidak dimaksudkan utk programmer tingkat advance, ini hanya sekedar untuk dilihat-lihat dan dicoba-coba aja..

oke yg ini bagian html nya, tinggal di-copy, di-paste, trus di-save dgn nama file: terserah.htm (mungkin kodenya terlihat terpotog, padahal klo udah di-copy and then di-paste, ngga kepotong kok,, dijamin)

<script type='text/javascript' src='validasi.js'></script>
<form name='latihan' method='post' onsubmit='return validasiFormSaatSubmit(this)' action='proses.php'>
 <table>
  <tr>
   <td valign='top' width='100'>Nama Pengguna</td>
   <td valign='top'> : </td>
   <td><input type='text' name='text_nama' onFocus ='getValue(this)' onBlur ='setValue(this)' size='45'></td>
  </tr>
  
  <tr>
   <td valign='top' width='100'>Status Pengguna</td>
   <td valign='top'> : </td>
   <td>
    <input type='radio' value='S' name='radio_status' id='radio_1'>Sudah Menikah<br>
    <input type='radio' value='L' name='radio_status' id='radio_2'>Lajang
   </td>
  </tr>
  <tr>
   <td valign='top'>Kesan</td>
   <td valign='top'> : </td>
   <td><textarea name='textarea_kesan' rows='5' cols='49' onFocus ='getValue(this)' onBlur ='setValue(this)'></textarea></td>
  </tr>
  <tr>
   <td> </td>
   <td> </td>
   <td><input type='submit' name='latihan_submit' value='Kirim'></td>
  </tr>
 </table>
</form>

nah, gimana? sudah di-save? oke sekarang kode yg kedua, ini untuk file bernama: validasi.js, ingat ya, validasi.js, harus sama! klo mau diganti, maka link pada bagian kode yg diatas td yg: src=’validasi.js’ harus diganti juga ya..

function validasiFormSaatSubmit(siForm)
{     
 var alasan = "";
 
 alasan += validasiNamaPengguna(siForm.text_nama);
 alasan += validasiStatusPengguna(siForm.radio_status);
 alasan += validasiKesan(siForm.textarea_kesan);
         
 if (alasan != "") {
  alert("Beberapa field harus dikoreksi:\n" + alasan);
  return false;
 }
 return true;
}
   
function validasiNamaPengguna(isi)
{
 var pesan = "";
 
 if (isi.value == "") {  
  isi.style.background = 'Yellow';
  pesan = "- Silakan masukkan Nama Pengguna.\n";
 } else {
  isi.style.background = 'White';
 }
 return pesan;
}
function validasiStatusPengguna(isi)
{ 
 var pesan = "";
 
 if ((isi[0].checked == false ) && (isi[1].checked == false))
 {
  pesan = "- Silakan pilih Status Pengguna.\n";          
 }      
 return pesan;
}

function validasiKesan(isi)
{
 var pesan = "";
    
 if (isi.value == "") {
  isi.style.background = 'Yellow';
  pesan = "- Silakan masukkan Kesan.\n";
 } else {
  isi.style.background = 'White';
 }
 return pesan;
}

oke, jalankan saja file terserah.htm td, tapi pastikan dia satu folder dgn file validasi.js nya ya.. sip.. sekian saja tulisan kali ini. mudah-mudahan membantu klo lg berurusan dgn validasi form di sisi client..

-just write what you can’t remember, what you can’t tell-