Esempio n. 1
0
/**
 * Editor
 *
 * @param array $attr
 * @param array $item
 *
 * @return string
 */
function editor(array $attr, array $item) : string
{
    if (!in_array('edit', $attr['actions'])) {
        return '';
    }
    $item[$attr['id']] = $item[$attr['id']] ?? $attr['val'];
    $attr['opt'] = opt($attr);
    $attr['context'] = 'edit';
    $attr['html']['id'] = html_id($attr, $item);
    $attr['html']['name'] = html_name($attr, $item);
    $attr['html']['data-type'] = $attr['type'];
    if ($attr['required'] && !ignorable($attr, $item)) {
        $attr['html']['required'] = true;
    }
    if (!empty($attr['multiple'])) {
        $attr['html']['multiple'] = true;
    }
    if (!empty($item['_error'][$attr['id']])) {
        $attr['html']['class'] = empty($attr['html']['class']) ? 'invalid' : $attr['html']['class'] . ' invalid';
    }
    $html = '';
    $callback = fqn('editor_' . $attr['type']);
    if (is_callable($callback)) {
        $html = $callback($attr, $item);
    } else {
        // @todo
        switch ($attr['frontend']) {
            case 'select':
                $html = editor_select($attr, $item);
                break;
            case 'checkbox':
            case 'radio':
                $html = editor_opt($attr, $item);
                break;
            case 'color':
            case 'email':
            case 'url':
                $html = editor_text($attr, $item);
                break;
            case 'number':
            case 'range':
                $html = editor_int($attr, $item);
                break;
            case 'date':
            case 'time':
                $html = editor_datetime($attr, $item);
                break;
            case 'file':
                $html = editor_file($attr, $item);
                break;
            case 'textarea':
                $html = editor_textarea($attr, $item);
                break;
        }
    }
    return $html ? html_label($attr, $item) . $html . html_message($attr, $item) : '';
}
Esempio n. 2
0
 public function jsonGuardarClub()
 {
     $result = new stdClass();
     try {
         $data['name'] = $this->request['name'];
         $data['description'] = $this->request['description'];
         //$data['zona']        = $this->request['zona'];
         $idClub = $this->request['idClub'];
         //print_r($data);
         $userData = $this->clubModel->updateClub($idClub, $data);
         if ($userData) {
             $result->message = html_message("Se actualizo correctamente los datos del Club", "success");
         }
     } catch (Exception $e) {
         $result->message = "No se pudo actualizar los datos " . $e->getMessage();
     }
     echo json_encode($result);
 }
Esempio n. 3
0
 public function jsonGuardarPartido()
 {
     $result = new stdClass();
     try {
         $data['goles1'] = $this->request['goles1'];
         $data['goles2'] = $this->request['goles2'];
         $data['equipo1'] = $this->request['equipo1'];
         $data['equipo2'] = $this->request['equipo2'];
         $fecha = $this->request['fecha'];
         $hora = $this->request['hora'];
         $minutos = $this->request['minuto'];
         $time = new DateTime($fecha);
         $time->setTime($hora, $minutos);
         $stamp = $time->format('Y-m-d H:i');
         $data['fecha'] = $stamp;
         $data['puntos1'] = $this->request['puntos1'];
         $data['puntos2'] = $this->request['puntos2'];
         $data['comments'] = $this->request['comments'];
         $idpartido = $this->request['idpartido'];
         //print_r($data);
         $userData = $this->partidoModel->updatepartido($idpartido, $data);
         if ($userData) {
             $result->message = html_message("Se actualizo correctamente los datos del partido", "success");
         }
     } catch (Exception $e) {
         $result->message = "No se pudo actualizar los datos " . $e->getMessage();
     }
     echo json_encode($result);
 }
Esempio n. 4
0
        $reply_message = trim($m->content);
    }
    $reply_message = htmlspecialchars($reply_message);
    $reply_message = preg_replace("|(-- \n.*)\$|s", '', $reply_message);
    // strip the sig
    $reply_message = wordwrap($reply_message, 74, "\n");
    $reply_message = trim($reply_message);
    $reply_message = preg_replace("/(\\A|\n)/", "\$1> ", $reply_message);
    $reply_message = $reply_message . "\n\n";
    ?>
<select class="predefined_message">
<option value="">Predefined Reply</option>
<?php 
    $predefined = get_predefined_names();
    foreach ($predefined as $id => $name) {
        echo html_message('<option value="%d">%s</option>', $id, $name);
    }
    ?>
</select>
<label>Reply to: <strong class="reply-to"><?php 
    echo htmlspecialchars($thread->email);
    ?>
</strong>
<textarea name="message_reply" class="widetext reply" style="height: <?php 
    echo substr_count($reply_message, "\n") + 8;
    ?>
em ">
<?php 
    echo "{$m->email} wrote:\n";
    echo $reply_message;
    ?>
Esempio n. 5
0
/**
* Error and message handler, call with trigger_error if reqd
*/
function msg_handler($errno, $msg_text, $errfile, $errline)
{
    global $config, $lang;
    global $msg_code, $msg_title, $msg_long_text;
    // Do not display notices if we suppress them via @
    if (error_reporting() == 0) {
        return;
    }
    // Message handler is stripping text. In case we need it, we are possible to define long text...
    if (isset($msg_long_text) && $msg_long_text && !$msg_text) {
        $msg_text = $msg_long_text;
    }
    $msg_code = empty($msg_code) ? GENERAL_MESSAGE : $msg_code;
    switch ($errno) {
        case E_NOTICE:
            // Mighty Gorgon: if you want to report uninitialized variables, comment the "BREAK" below...
            break;
        case E_WARNING:
            // Check the error reporting level and return if the error level does not match
            // If DEBUG is defined to FALSE then return
            if (defined('DEBUG') && !DEBUG) {
                return;
            }
            // If DEBUG is defined the default level is E_ALL
            if (($errno & (defined('DEBUG') ? E_ALL : error_reporting())) == 0) {
                return;
            }
            if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) {
                // flush the content, else we get a white page if output buffering is on
                if ((int) @ini_get('output_buffering') === 1 || strtolower(@ini_get('output_buffering')) === 'on') {
                    @ob_flush();
                }
                // Another quick fix for those having gzip compression enabled, but do not flush if the coder wants to catch "something". ;)
                $config['gzip_compress_runtime'] = isset($config['gzip_compress_runtime']) ? $config['gzip_compress_runtime'] : $config['gzip_compress'];
                if (!empty($config['gzip_compress_runtime'])) {
                    if (@extension_loaded('zlib') && !headers_sent() && !ob_get_level()) {
                        @ob_flush();
                    }
                }
                // remove complete path to installation, with the risk of changing backslashes meant to be there
                $errfile = str_replace(array(phpbb_realpath(IP_ROOT_PATH), '\\'), array('', '/'), $errfile);
                $msg_text = str_replace(array(phpbb_realpath(IP_ROOT_PATH), '\\'), array('', '/'), $msg_text);
                echo '<b>[Icy Phoenix Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
            }
            return;
            break;
        case E_USER_ERROR:
            $msg_text = !empty($lang[$msg_text]) ? $lang[$msg_text] : $msg_text;
            $msg_title_default = !empty($lang['General_Error']) ? $lang['General_Error'] : 'General Error';
            $msg_title = !empty($lang[$msg_title]) ? $lang[$msg_title] : $msg_title_default;
            $return_url = !empty($lang['CLICK_RETURN_HOME']) ? sprintf($lang['CLICK_RETURN_HOME'], '<a href="' . IP_ROOT_PATH . '">', '</a>') : '<a href="' . IP_ROOT_PATH . '">Return to home page</a>';
            garbage_collection();
            html_message($msg_title, $msg_text, $return_url);
            exit_handler();
            // On a fatal error (and E_USER_ERROR *is* fatal) we never want other scripts to continue and force an exit here.
            exit;
            break;
        case E_USER_WARNING:
        case E_USER_NOTICE:
            define('IN_ERROR_HANDLER', true);
            $status_not_found_array = array('ERROR_NO_ATTACHMENT', 'NO_FORUM', 'NO_TOPIC', 'NO_USER');
            if (in_array($msg_text, $status_not_found_array)) {
                if (!defined('STATUS_404')) {
                    define('STATUS_404', true);
                }
            }
            message_die($msg_code, $msg_text, $msg_title, $errline, $errfile, '');
    }
}
Esempio n. 6
0
 public function jsonGuardarPlayer()
 {
     $result = new stdClass();
     try {
         $data['name'] = $this->request['name'];
         $data['last'] = $this->request['last'];
         $data['ci'] = $this->request['ci'];
         $data['fechanacimiento'] = $this->request['fechanacimiento'];
         $data['idclub'] = $this->request['club'];
         $data['parentesco'] = $this->request['parentesco'];
         $data['documento'] = $this->request['documentos'];
         $data['disciplina'] = $this->request['disciplina'];
         $data['notas'] = $this->request['notas'];
         $idplayer = $this->request['idplayer'];
         //print_r($data);
         $userData = $this->playerModel->updatePlayer($idplayer, $data);
         if ($userData) {
             $result->message = html_message("Se actualizo correctamente los datos del jugador", "success");
         }
     } catch (Exception $e) {
         $result->message = "No se pudo actualizar los datos " . $e->getMessage();
     }
     echo json_encode($result);
 }