Exemplo n.º 1
0
 /**
  *
  * @param Integer $dbId the div id you want to put offline/online
  * @return Mixed On success a string with the new status (offline/online). false on error.
  */
 public static function toggleonline($dbId)
 {
     $row = new Pagdivs($dbId);
     $online = $row->get()->online == '0' ? '1' : '0';
     $row->update(array('online' => $online), 'id = ' . $dbId);
     return $online == '0' ? 'offline' : 'online';
 }
Exemplo n.º 2
0
 /**
  * Update label of pagdiv object
  *
  */
 public function updatelabelAction()
 {
     $request = $this->getRequest();
     $status = 0;
     $msg = 'Label NOT saved!';
     if (isset($request->dbid) && $request->dbid > 0) {
         $pagdivs = new Pagdivs();
         if ($pagdivs->update($data = array('label' => $request->label), 'id = ' . $request->dbid)) {
             $status = 1;
             $msg = 'Label saved';
         }
     }
     $this->view->ResultSet = array('message' => $msg, 'status' => $status, 'dbid' => $request->dbid, 'modal' => false);
 }