title: How implement multiple editable column with yii-booster?
body: <p>Am working on a Yii staff-hours scheduling project, stuck on editable-curd-staffhours-module. I want to store staff scheduling hours in <code>StaffHours</code>table using Editable <a href="http://vitalets.github.com/x-editable/index.html" rel="nofollow noreferrer">Yii Booster Extension</a>.</p>
  
  <p>My <code>staffhours</code> table DB stucture as:</p>
  
  <p><code>id(pk) user_id(fk) staff_id(int) monday(text) tuesday(text) wednesday(text)    thursday(text)  friday(text) saturday(text) sunday(text)</code></p>
  
  <p>All day-text fields used to store serialize time as in associative-array format:</p>
  
  <pre><code>array(
   '12:00 AM' =&gt; 'open',
   '12:30 AM' =&gt; 'close',
   '01:00 AM' =&gt; 'close',
   '01:30 AM' =&gt; 'open',
   '02:00 AM' =&gt; 'open',
   .
   .
   .
   '11:00 PM' =&gt; 'close'
   '11:30 PM' =&gt; 'close'
  );
  </code></pre>
  
  <p>I have implemented Editable UI using <a href="http://vitalets.github.com/x-editable/index.html" rel="nofollow noreferrer">Yii Booster Extension</a>, watch snap below:</p>
  
  <p><strong>Problem</strong> is that am unable to recognize how to store/update staff-hours data in DB.</p>
  
  <p><img src="https://i.stack.imgur.com/aoQV2.jpg" alt="enter image description here"></p>
  
  <p><strong>Some Of Code</strong> i have done</p>
  
  <p><strong>---- In View ----</strong></p>
  
  <pre><code>&lt;?php
  $this-&gt;breadcrumbs=array(
      'Settings'=&gt;array('settings/settings'),
      'Staff Hours',
  );  
          $user_id = Yii::app()-&gt;user-&gt;getId();
          $condition = "user_id = '$user_id'";
          $data = StaffHours::model()-&gt;findAll();
          $Monday = unserialize($data[0]['monday']);
          $Tuesday = unserialize($data[0]['tuesday']);
          $Wednesday = unserialize($data[0]['wednesday']);
          $Thursday = unserialize($data[0]['thursday']);
          $Friday = unserialize($data[0]['friday']);
          $Saturday = unserialize($data[0]['saturday']);
          $Sunday = unserialize($data[0]['sunday']);
          foreach($data as $data)
          {
  ?&gt;
  
      &lt;div id="settinghead"&gt;StaffS Hours &lt;/div&gt;
          &lt;div id="leftmenu"&gt; &lt;?php $this-&gt;widget('application.components.widgets.SettingsMenu.settingsmenuWidget'); ?&gt;&lt;/div&gt;
          &lt;div id="rightcontent"&gt;
              &lt;div id="pageheding"&gt;Staff Hours Detail &lt;/div&gt;
                  &lt;table class="items table table-bordered"&gt;
                  &lt;thead&gt; 
                  &lt;tr&gt;&lt;th scope="col"&gt;Time&lt;/th&gt;   &lt;th scope="col"&gt;Monday&lt;/th&gt; &lt;th scope="col"&gt;Tuesday&lt;/th&gt;&lt;th scope="col"&gt;Wednesday&lt;/th&gt;
                  &lt;th scope="col"&gt;Thursday&lt;/th&gt;&lt;th scope="col"&gt;Friday&lt;/th&gt;&lt;th scope="col"&gt;Saturday&lt;/th&gt;&lt;th scope="col"&gt;Sunday&lt;/th&gt; &lt;/tr&gt;
                   &lt;/thead&gt;
                   &lt;?php 
                  $start = strtotime('12:00am');
                  $end = strtotime('11:59pm');
                  for( $i = $start; $i &lt;= $end; $i += 900) 
                  {   
                      $time = date('h:i A', $i);
                  ?&gt;
                    &lt;tr&gt;
                      &lt;th scope="row"&gt;&lt;?php echo $time; ?&gt;&lt;/th&gt;
                      &lt;td id="mon&lt;?php echo $time; ?&gt;"&gt;
                      &lt;?php  
                      $this-&gt;widget('bootstrap.widgets.TbEditableField', array(
                          'type' =&gt; 'select',
                          'model' =&gt; $data,
                          'emptytext' =&gt; $Monday[$time],
                          'attribute' =&gt; 'monday',
                          'url' =&gt; $this-&gt;createUrl('staffhours/updatetime&amp;time='.$time), //url for submit data
                          'source' =&gt; array('Open', 'Close', 'Away'),
                          'value' =&gt; $time,
                          'enabled' =&gt; true
                      )); 
                      ?&gt;
                      &lt;/td&gt;
                      &lt;td id="tue&lt;?php echo date('g:i A', $i); ?&gt;"&gt;&lt;?php echo $Tuesday[$time]; ?&gt;&lt;/td&gt;
                      &lt;td id="wed&lt;?php echo date('g:i A', $i); ?&gt;"&gt;&lt;?php echo $Wednesday[$time]; ?&gt;&lt;/td&gt;
                      &lt;td id="thu&lt;?php echo date('g:i A', $i); ?&gt;"&gt;&lt;?php echo $Thursday[$time]; ?&gt;&lt;/td&gt;
                      &lt;td id="fri&lt;?php echo date('g:i A', $i); ?&gt;"&gt;&lt;?php echo $Friday[$time]; ?&gt;&lt;/td&gt;
                      &lt;td id="sat&lt;?php echo date('g:i A', $i); ?&gt;"&gt;&lt;?php echo $Saturday[$time]; ?&gt;&lt;/td&gt;
                      &lt;td id="sun&lt;?php echo date('g:i A', $i); ?&gt;"&gt;&lt;?php echo $Sunday[$time]; ?&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                  &lt;?php
                  }
              }
                  ?&gt;
                  &lt;/table&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p><strong>---- In StaffHoursController Controller ----</strong></p>
  
  <pre><code>/**
   * Update time.
   */
  public function actionUpdatetime($time)
  {
      $user_id = Yii::app()-&gt;user-&gt;getId();
      $pk = $_POST['pk'];
      $day = $_POST['name'];
      $status = $_POST['value'];
      $GetData = StaffHours::model()-&gt;findByPk($pk);
      $DayTimes = unserialize($GetData-&gt;monday);
      if(array_key_exists($time, $DayTimes))
      {
          unset($DayTimes[$time]);
          //merge new value
          $DayTimes[$time] = $status;
          array_push($DayTimes, $DayTimes[$time]);
          $attributes = array($day =&gt; serialize($DayTimes));
          $condition = "id = '$pk' AND user_id = '$user_id'";
          StaffHours::model()-&gt;updateByPk($pk, $attributes, $condition);
      }
  }
  </code></pre>
  
  <p>If am going wrong or another easy way available to staff hours using Editable-UI.</p>
  
  <p>Then please suggest a better way to store Staff-Hours using Editable-UI.</p>