Ejemplo n.º 1
0
 public static function request($id = NULL, $default = NULL, $post = COBRA_REQUEST_POST, $clear = true, $safe = true, $size = COBRA_REQUEST_SIZE)
 {
     if ($post) {
         $v = (!isset($_POST[$id]) or $_POST[$id] == '') ? $default : $_POST[$id];
         if ($clear) {
             unset($_POST[$id]);
         }
     } else {
         $v = (!isset($_REQUEST[$id]) or $_REQUEST[$id] == '') ? $default : $_REQUEST[$id];
         if ($clear) {
             unset($_REQUEST[$id]);
         }
     }
     if ($safe && !empty($v)) {
         $v = coStr::subalnum($v, $size);
     }
     return $v;
 }
Ejemplo n.º 2
0
 public function CallProcedureSelect($procedure = NULL, $arguments = NULL, $fields = NULL, $limit = COBRA_DB_SELECT_LIMIT, $offset = 0)
 {
     if (empty($procedure)) {
         throw new coDBEx(__METHOD__);
     }
     $procedure = __k_safe_str($procedure, COBRA_DB_PROCEDURE_NAME_SIZE);
     $fields = coStr::a2f($fields);
     $query = 'SELECT ' . $fields . ' FROM ' . $procedure;
     $query .= '(' . coStr::a2f($arguments, '', true) . ')';
     return $this->Select($query, $limit, $offset);
 }