29 มิ.ย. 2557

CGridView : Get the absolute row number in a grid

code ในส่วนของ Cgridview

        array(
            'header'=>'No.',
        'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
    ),





อ้างอิง  http://stackoverflow.com/questions/5834522/get-the-absolute-row-number-in-a-grid

แสดง popup window ใน cGridview (bootstrap : TbGridView)

Code ในส่วของ girdview


28 มิ.ย. 2557

Twitter's Bootstrap - create a form with 2 columns

Twitter's Bootstrap - create a form with 2 columns




Legend text

Supporting help text

Legend text

Supporting help text

อ้างอิง http://www.way2blogging.org/2010/07/display-scripts-and-css-codes-between_09.html

Apacher Error : could not reliably determine


httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName


host ตัวอย่าง  data.udonpit.ac.th

แก้ไขไฟล์  /etc/hosts

Open mod_rewrite บน CentOS

mod_rewrite

mod_rewrite is an Apache module used to manipulate URL's and is compiled into the base Apache HTTP Server in CentOS. See the mod_rewrite documenation for more information.

30 พ.ค. 2557

การหาผลรวมของ Column ใน CGridView

การหาผลรวมของ Column ใน CGridView



public function getSearchCriteria()
{
    $criteria=new CDbCriteria;

    $criteria->compare('id',$this->id);
    $criteria->compare('name',$this->name);
    // ... more search conditions

    return $criteria;
}

public function search()
{
    return new CActiveDataProvider(get_class($this), array(
        'criteria'=>$this->getSearchCriteria(),
    ));
}

public function totals()
{
    $criteria=$this->getSearchCriteria();
    $criteria->select='SUM(somecolumn)';
    return $this->commandBuilder->createFindCommand($this->getTableSchema(),$criteria)->queryScalar();
}



17 มี.ค. 2557

7 Reasons Why You Will Never Do Anything Amazing With Your Life

7 Reasons Why You Will Never Do Anything Amazing With Your Life

A unique perspective on what it takes to succeed.


Yeah that’s right; you heard me… I’m talking to you… I’m calling you out.