Пример #1
0
 /**
  * Ejecuta un procedimiento almacenado de borrar, enviando los atributos necesarios del objeto
  * @return void      
  * @author Johnny Alexander Salazar
  * @version 0.1
  */
 public function erase()
 {
     $query = parent::buildQuery("eliminaRol", array($this->id));
     parent::verify($query);
 }
Пример #2
0
            $currentarray = array_values($currentarray);
            if (count($currentarray) == 0) {
                $current = NULL;
            } else {
                $current = serialize($currentarray);
            }
            //Update Notif Comp
            $notifcomp = explode(";", $row["notification_raw"]);
            for ($j = 0; $j < count($removestub); $j++) {
                unset($notifcomp[$removestub[$j] - $j]);
            }
            if (count($notifcomp) == 0) {
                $notifstr = NULL;
            } else {
                $notifstr = implode(";", $notifcomp);
            }
            //Decrement Notification Count
            $unval = intval($currentrow["numberunseen"]) - $decrementcount;
            if ($unval < 0) {
                $unval = 0;
            }
        }
        $build = strval($connection->buildQuery(1, 1, $column)) . ' = :current, `notification_raw` = :notifstr, `numberunseen` = :unval WHERE id = :profid';
        $postsql = $connectinfo->prepare($build);
        $postsql->execute(array(':current' => $current, ':notifstr' => $notifstr, ':unval' => $unval, ':profid' => $profid));
    } else {
        echo "Error - authorization mismatch";
    }
} else {
    echo 'Error - invalid supplied post data (not enough info?)';
}
 /**
  * Ejecuta una consulta login con los parametros usuario y contraseña
  *
  * @return void      
  * @author Johnny Alexander Salazar
  * @version 0.1
  */
 public function signin()
 {
     $query = parent::buildQuery("login", array((string) $this->user, (string) md5($this->password)));
     //$query = "select login('" . $this->user . "','" . md5($this->password) . "', 'result'); FETCH ALL IN result";
     parent::verifyLogin($query);
 }
Пример #4
0
            $currentarray = unserialize($current);
            $decrementcount = 0;
            if (is_array($currentarray)) {
                if (isset($currentarray['isread'])) {
                    if ($currentarray['data'] == $data) {
                        $currentarray["isread"] = 1;
                        $decrementcount++;
                    }
                } else {
                    for ($i = 0; $i < count($currentarray); $i++) {
                        $loop = $currentarray[$i];
                        if ($loop['data'] == $data) {
                            $loop["isread"] = 1;
                            $currentarray[$i] = $loop;
                            $decrementcount++;
                        }
                    }
                }
            }
            $current = serialize($currentarray);
        }
        $build = strval($connection->buildQuery(1, 1, $column)) . ' = :current WHERE id = :profid';
        $postsql = $connectinfo->prepare($build);
        $postsql->execute(array(':current' => $current, ":profid" => $profid));
        $connection->DecrementNotificationCount($connectinfo, $profid, $decrementcount);
    } else {
        echo "Error - authorization mismatch";
    }
} else {
    echo 'Error - invalid supplied post data (not enough info?)';
}