Esempio n. 1
0
 public function addForm()
 {
     $themes = glob(DIR_THEME . '/*');
     $themeNames = [];
     foreach ($themes as $theme) {
         $themeData = parse_json_file($theme . '/composer.json');
         $theme = str_replace(DIR_THEME . '/', '', $theme);
         $themeNames[$theme] = $themeData['extra']['name'];
     }
     $data = [];
     $data['content'] = view('sites/form', ['title' => t('new_site'), 'name' => '', 'locales' => substr(app('request')->getPreferredLanguage(app('translator')->installedPackages), 0, 2), 'domains' => app('request')->server['HTTP_HOST'], 'use_alias_as_path' => 0, 'maintenance_mode' => 0, 'need_cache' => 0, 'template' => HTML::select('theme', '', $themeNames, 'class="form-control"'), 'site' => 'new', 'sites' => str_replace(DIR_SITE, '', glob(DIR_SITE . 's*'))]);
     $data['sidebar_right'] = HTML::saveButton() . HTML::mastercodeInput();
     $data['sidebar_left'] = '';
     $data['form_url'] = 'admin/sites/add';
     $data['meta_title'] = t('site_creation');
     $data['breadcrumbs'] = [['url' => '?route=config', 'title' => t('settings')], ['url' => '?route=config/sites', 'title' => t('site_list')], ['title' => t('site_creation')]];
     $d = document($data);
     return $d;
 }
Esempio n. 2
0
</td>
</tr>
<tr>
    <td class="align-right">Timezone</td>
    <td><?php 
echo HTML::input('message->timezone', array('class' => 'input-field'));
?>
 <?php 
echo HTML::validation_message('message->timezone');
?>
</td>
</tr>
<tr>
    <td class="align-right">Preferred meeting</td>
    <td><?php 
echo HTML::select('message->meeting', array('No preference / Not sure', 'Monday 11am Central (GMT-6)', 'Monday 7pm Central (GMT-6)', 'Thursday 9am GMT', 'All meetings'), $message->meeting, array('class' => 'input-field'));
?>
 <?php 
echo HTML::validation_message('message->meeting');
?>
</td>
</tr>
-->
<tr valign="top">
    <td class="align-right">Why you'd like to join<br/>and how you found us</td>
    <td><?php 
echo HTML::textarea('message->content', array('cols' => 40, 'rows' => 7));
?>
</td>
</tr>
<tr>
Esempio n. 3
0
 function run($dbi, $argstr, &$request, $basepage)
 {
     extract($this->getArgs($argstr, $request));
     if (empty($action)) {
         return $this->error(fmt("A required argument '%s' is missing.", "action"));
     }
     $form = HTML::form(array('action' => $request->getPostURL(), 'method' => strtolower($method), 'class' => 'wikiaction', 'accept-charset' => $GLOBALS['charset']), HiddenInputs(array('action' => $action, 'group_id' => GROUP_ID)));
     $nbsp = HTML::Raw('&nbsp;');
     $already_submit = 0;
     foreach ($this->inputbox as $inputbox) {
         foreach ($inputbox as $inputtype => $input) {
             if ($inputtype == 'radiobutton') {
                 $inputtype = 'radio';
             }
             // convert from older versions
             $input['type'] = $inputtype;
             $text = '';
             if ($inputtype != 'submit') {
                 if (empty($input['name'])) {
                     return $this->error(fmt("A required argument '%s' is missing.", $inputtype . "[][name]"));
                 }
                 if (!isset($input['text'])) {
                     $input['text'] = gettext($input['name']);
                 }
                 $text = $input['text'];
                 unset($input['text']);
             }
             switch ($inputtype) {
                 case 'checkbox':
                 case 'radio':
                     if (empty($input['value'])) {
                         $input['value'] = 1;
                     }
                     if (is_array($input['value'])) {
                         $div = HTML::div(array('class' => $class));
                         $values = $input['value'];
                         $name = $input['name'];
                         $input['name'] = $inputtype == 'checkbox' ? $name . "[]" : $name;
                         foreach ($values as $val) {
                             $input['value'] = $val;
                             if ($request->getArg($name)) {
                                 if ($request->getArg($name) == $val) {
                                     $input['checked'] = 'checked';
                                 } else {
                                     unset($input['checked']);
                                 }
                             }
                             $div->pushContent(HTML::input($input), $nbsp, $val, $nbsp, "\n");
                             if (!$nobr) {
                                 $div->pushContent(HTML::br());
                             }
                         }
                         $form->pushContent($div);
                     } else {
                         if (empty($input['checked'])) {
                             if ($request->getArg($input['name'])) {
                                 $input['checked'] = 'checked';
                             }
                         } else {
                             $input['checked'] = 'checked';
                         }
                         if ($nobr) {
                             $form->pushContent(HTML::input($input), $nbsp, $text, $nbsp);
                         } else {
                             $form->pushContent(HTML::div(array('class' => $class), HTML::input($input), $text));
                         }
                     }
                     break;
                 case 'editbox':
                     $input['type'] = 'text';
                     if (empty($input['value']) and $s = $request->getArg($input['name'])) {
                         $input['value'] = $s;
                     }
                     if ($nobr) {
                         $form->pushContent(HTML::input($input), $nbsp, $text, $nbsp);
                     } else {
                         $form->pushContent(HTML::div(array('class' => $class), HTML::input($input), $text));
                     }
                     break;
                 case 'combobox':
                     // TODO: moACDROPDOWN
                     $values = $input['value'];
                     unset($input['value']);
                     $input['type'] = 'text';
                     if (is_string($values)) {
                         $values = explode(",", $values);
                     }
                     if (empty($values)) {
                         if ($input['method']) {
                             $input['value'] = xmlrequest($input['method']);
                         } elseif ($s = $request->getArg($input['name'])) {
                             $input['value'] = $s;
                         }
                     } elseif (is_array($values)) {
                         $name = $input['name'];
                         unset($input['name']);
                         foreach ($values as $val) {
                             $input = array('value' => $val);
                             if ($request->getArg($name)) {
                                 if ($request->getArg($name) == $val) {
                                     $input['selected'] = 'selected';
                                 } else {
                                     unset($input['selected']);
                                 }
                             }
                             //$select->pushContent(HTML::option($input, $val));
                         }
                     }
                     if ($nobr) {
                         $form->pushContent(HTML::input($input), $nbsp, $text, $nbsp);
                     } else {
                         $form->pushContent(HTML::div(array('class' => $class), HTML::input($input), $text));
                     }
                     break;
                 case 'pulldown':
                     $values = $input['value'];
                     unset($input['value']);
                     unset($input['type']);
                     $select = HTML::select($input);
                     if (is_string($values)) {
                         $values = explode(",", $values);
                     }
                     if (empty($values) and $s = $request->getArg($input['name'])) {
                         $select->pushContent(HTML::option(array('value' => $s), $s));
                     } elseif (is_array($values)) {
                         $name = $input['name'];
                         unset($input['name']);
                         foreach ($values as $val) {
                             $input = array('value' => $val);
                             if ($request->getArg($name)) {
                                 if ($request->getArg($name) == $val) {
                                     $input['selected'] = 'selected';
                                 } else {
                                     unset($input['selected']);
                                 }
                             }
                             $select->pushContent(HTML::option($input, $val));
                         }
                     }
                     $form->pushContent($text, $nbsp, $select);
                     break;
                 case 'reset':
                 case 'hidden':
                     $form->pushContent(HTML::input($input));
                     break;
                     // change the order of inputs, by explicitly placing a submit button here.
                 // change the order of inputs, by explicitly placing a submit button here.
                 case 'submit':
                     //$input['type'] = 'submit';
                     if (empty($input['value'])) {
                         $input['value'] = $buttontext ? $buttontext : $action;
                     }
                     unset($input['text']);
                     if (empty($input['class'])) {
                         $input['class'] = $class;
                     }
                     if ($nobr) {
                         $form->pushContent(HTML::input($input), $nbsp, $text, $nbsp);
                     } else {
                         $form->pushContent(HTML::div(array('class' => $class), HTML::input($input), $text));
                     }
                     // unset the default submit button
                     $already_submit = 1;
                     break;
             }
         }
     }
     if ($request->getArg('start_debug')) {
         $form->pushContent(HTML::input(array('name' => 'start_debug', 'value' => $request->getArg('start_debug'), 'type' => 'hidden')));
     }
     if (!USE_PATH_INFO) {
         $form->pushContent(HiddenInputs(array('pagename' => $basepage)));
     }
     if (!$already_submit) {
         if (empty($buttontext)) {
             $buttontext = $action;
         }
         $submit = Button('submit:', $buttontext, $class);
         if ($cancel) {
             $form->pushContent(HTML::span(array('class' => $class), $submit, Button('submit:cancel', _("Cancel"), $class)));
         } else {
             $form->pushContent(HTML::span(array('class' => $class), $submit));
         }
     }
     return $form;
 }
Esempio n. 4
0
        <input type="hidden" name="action" id="action" value="">
        <!-- Filters -->
        <div class="row filters">
            <!-- Search -->
            <div class="col-sm-3 col-xs-6 filter">
                <?php 
echo HTML::search();
?>
            </div>
            <!-- Estado -->
            <div class="col-sm-3 col-xs-6 col-md-2 filter">
                <?php 
$userNull = new User();
?>
                <?php 
echo HTML::select("statusId", $userNull->statuses, $_REQUEST["estadoId"], array("class" => "change-submit"), array("id" => "-1", "display" => "- Estado -"));
?>
            </div>
        </div>
        <!-- Results -->
        <?php 
if (count($results)) {
    ?>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th><?php 
    echo Html::sortableLink("id", "Id");
    ?>
</th>
Esempio n. 5
0
 public function usuarioEdit($usuario_id, $usuario_tipo)
 {
     $getDataDB = new DB();
     $login = new ModelLogin();
     $image = new ModelImage();
     switch ($usuario_tipo) {
         case "musico":
             if (isset($_POST['form_edit_account'])) {
                 if (empty($_POST['usuario_nombre'])) {
                     echo MESSAGE_FORM_NOMBRE_EMPTY;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } elseif (!preg_match('/^[a-z\\d]{2,64}$/i', $_POST['usuario_telefono'])) {
                     echo MESSAGE_FORM_TELEFONO_EMPTY;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } elseif (strlen($_POST['usuario_telefono']) != 9) {
                     echo MESSAGE_FORM_TELEFONO_INVALID;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } elseif ($_POST['usuario_idioma'] == "") {
                     $_POST['usuario_idioma'] == $login->getUserDataCampo($usuario_id, "usuario_idioma");
                 } elseif ($_POST['usuario_idioma'] != "ca" && $_POST['usuario_idioma'] != "en" && $_POST['usuario_idioma'] != "es") {
                     echo MESSAGE_FORM_IDIOMA;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } elseif ($_POST['usuario_idioma'] != "ca" && $_POST['usuario_idioma'] != "en" && $_POST['usuario_idioma'] != "es") {
                     echo MESSAGE_FORM_IDIOMA;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } else {
                     $query_mod_account = DB::connect()->prepare("UPDATE  `uqfhhbcn_whymusic`.`wm_usuarios` SET  `usuario_nombre` =  :usuario_nombre,\n                `usuario_telefono` =  :usuario_telefono,\n                `usuario_idioma` = :usuario_idioma,\n                `usuario_descripcion` = :usuario_descripcion,\n                `estilo_id` = :estilo_id WHERE  `wm_usuarios`.`usuario_id` = :usuario_id;");
                     $query_mod_account->bindValue(':usuario_id', $usuario_id, PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_nombre', $_POST['usuario_nombre'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_idioma', $_POST['usuario_idioma'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_telefono', $_POST['usuario_telefono'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_descripcion', $_POST['usuario_descripcion'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':estilo_id', $_POST['estilo_nombre'], PDO::PARAM_STR);
                     $query_mod_account->execute();
                     if ($query_mod_account) {
                         echo MESSAGE_CORRECT_MOD;
                         if ($login->getTypeOfUser() == "administrador") {
                             ROUTER::redirect_to_action("admin/admin", 2);
                         } else {
                             ROUTER::redirect_to_action("account/edit", 2);
                         }
                     } else {
                         echo MESSAGE_ERROR_SQL;
                         echo HTML::br(2);
                         echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                     }
                 }
             } else {
                 echo HTML::title("h3", "Editar foto de perfil");
                 echo HTML::open_form(ROUTER::create_action_url("account/edit"), "POST", "fileToUpload", array("enctype" => "multipart/form-data"));
                 echo HTML::label("fileToUpload", "Sube tu foto");
                 echo HTML::input("file", "fileToUpload", null, array("id" => "fileToUpload"));
                 echo HTML::br(1);
                 echo HTML::input("submit", "usuario_foto", "Subir foto");
                 echo HTML::close_form();
                 echo HTML::open_form(ROUTER::create_action_url('account/edit'), "POST", "form_edit_account");
                 /*Guarrada provisional*/
                 $_SESSION['usuario_id_edit'] = $login->getUserDataCampo($usuario_id, "usuario_id");
                 $_SESSION['usuario_tipo_edit'] = $login->getUserDataCampo($usuario_id, "usuario_tipo");
                 /*Fin de la gurrada*/
                 echo HTML::title("h3", "Editar foto de perfil");
                 echo HTML::open_form(ROUTER::create_action_url("account/edit"), "POST", "usuario_foto", array("enctype" => "multipart/form-data"));
                 echo HTML::label("usuario_foto", "Sube tu foto");
                 echo HTML::input("file", "fileToUpload", null, array("id" => "fileToUpload"));
                 echo HTML::input("submit", "usuario_foto", "Subir foto");
                 echo HTML::close_form();
                 echo HTML::label("usuario_nombre", WORDING_NOMBRE_MUSICO);
                 echo HTML::input("text", "usuario_nombre", $login->getUserDataCampo($usuario_id, "usuario_nombre"), array("placeholder" => "Su nombre"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_idioma", WORDING_IDIOMA);
                 echo HTML::select("usuario_idioma", array("Idioma por defecto" => $login->getUserDataCampo($usuario_id, 'usuario_idioma'), "Inglés" => "en", "Castellano" => "es", "Catalán" => "ca"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_telefono", WORDING_TELEFON);
                 echo HTML::input("text", "usuario_telefono", $login->getUserDataCampo($usuario_id, "usuario_telefono"), array("placeholder" => "9XXXXXXXX"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_descripcion", "Descripción grupo:");
                 echo HTML::textArea("4", "50", $login->getUserDataCampo($usuario_id, "usuario_descripcion"), "usuario_descripcion");
                 echo HTML::br(2);
                 echo HTML::label("estilo_nombre", "Estilo de música:");
                 echo HTML::selectArray("estilo_nombre", $getDataDB->getFieldSQL("wm_estilo", "estilo_nombre , estilo_id", ""));
                 echo HTML::br(2);
                 echo HTML::button_HTML5("submit", BUTTON_MOD_DATA, "form_edit_account");
                 echo HTML::close_form();
             }
             break;
         case "local":
             if (isset($_POST['form_edit_account'])) {
                 if (empty($_POST['usuario_nombre'])) {
                     echo MESSAGE_FORM_NOMBRE_EMPTY;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } elseif (!preg_match('/^[a-z\\d]{2,64}$/i', $_POST['usuario_telefono'])) {
                     echo MESSAGE_FORM_TELEFONO_EMPTY;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } elseif (strlen($_POST['usuario_telefono']) != 9) {
                     echo MESSAGE_FORM_TELEFONO_INVALID;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } elseif ($_POST['usuario_idioma'] == "") {
                     $_POST['usuario_idioma'] == $login->getUserDataCampo($usuario_id, "usuario_idioma");
                 } elseif ($_POST['usuario_idioma'] != "ca" && $_POST['usuario_idioma'] != "en" && $_POST['usuario_idioma'] != "es") {
                     echo MESSAGE_FORM_IDIOMA;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } else {
                     $query_mod_account = DB::connect()->prepare("UPDATE  `uqfhhbcn_whymusic`.`wm_usuarios` SET  `usuario_nombre` =  :usuario_nombre,\n                `usuario_telefono` =  :usuario_telefono,\n                `usuario_direccion` =  :usuario_direccion,\n                `usuario_descripcion` =  :usuario_descripcion,\n                `usuario_lat` =  :usuario_lat,\n                `usuario_lon` =  :usuario_lon,\n                `usuario_idioma` = :usuario_idioma WHERE  `wm_usuarios`.`usuario_id` = :usuario_id;");
                     $query_mod_account->bindValue(':usuario_id', $usuario_id, PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_nombre', $_POST['usuario_nombre'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_direccion', $_POST['usuario_direccion'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_descripcion', $_POST['usuario_descripcion'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_lon', $_POST['usuario_lon'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_lat', $_POST['usuario_lat'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_idioma', $_POST['usuario_idioma'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_telefono', $_POST['usuario_telefono'], PDO::PARAM_STR);
                     $query_mod_account->execute();
                     if ($query_mod_account) {
                         echo MESSAGE_CORRECT_MOD;
                         if ($login->getTypeOfUser() == "administrador") {
                             ROUTER::redirect_to_action("admin/admin", 2);
                         } else {
                             ROUTER::redirect_to_action("account/edit", 2);
                         }
                     } else {
                         echo MESSAGE_ERROR_SQL;
                         echo HTML::br(2);
                         echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                     }
                 }
             } else {
                 echo HTML::title("h3", "Editar foto de perfil");
                 echo HTML::open_form(ROUTER::create_action_url("account/edit"), "POST", "fileToUpload", array("enctype" => "multipart/form-data"));
                 echo HTML::label("fileToUpload", "Sube tu foto");
                 echo HTML::input("file", "fileToUpload", null, array("id" => "fileToUpload"));
                 echo HTML::br(1);
                 echo HTML::input("submit", "usuario_foto", "Subir foto");
                 echo HTML::close_form();
                 echo HTML::open_form(ROUTER::create_action_url('account/edit'), "POST", "form_edit_account");
                 /*Guarrada provisional*/
                 $_SESSION['usuario_id_edit'] = $login->getUserDataCampo($usuario_id, "usuario_id");
                 $_SESSION['usuario_tipo_edit'] = $login->getUserDataCampo($usuario_id, "usuario_tipo");
                 /*Fin de la gurrada*/
                 echo HTML::label("usuario_nombre", WORDING_NOMBRE_LOCAL);
                 echo HTML::input("text", "usuario_nombre", $login->getUserDataCampo($usuario_id, "usuario_nombre"), array("placeholder" => "Su nombre"));
                 echo HTML::br(2);
                 echo HTML::label("Gmaps", "Selecciona tu ubicación:");
                 echo HTML::open_div(array("id" => "myMap"));
                 echo HTML::close_div();
                 echo HTML::br(2);
                 echo HTML::label("usuario_direccion", WORDING_DIRECCION);
                 echo HTML::input("text", "usuario_direccion", $login->getUserDataCampo($usuario_id, 'usuario_direccion'), array("id" => "address", "style" => "width:600px;"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_lat", WORDING_LATITUD);
                 echo HTML::input("text", "usuario_lat", $login->getUserDataCampo($usuario_id, 'usuario_lat'), array("id" => "latitude"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_lon", WORDING_LONGITUD);
                 echo HTML::input("text", "usuario_lon", $login->getUserDataCampo($usuario_id, 'usuario_lon'), array("id" => "longitude"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_idioma", WORDING_IDIOMA);
                 echo HTML::select("usuario_idioma", array("Idioma por defecto" => $login->getUserDataCampo($usuario_id, 'usuario_idioma'), "Inglés" => "en", "Castellano" => "es", "Catalán" => "ca"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_telefono", WORDING_TELEFON);
                 echo HTML::input("text", "usuario_telefono", $login->getUserDataCampo($usuario_id, "usuario_telefono"), array("placeholder" => "9XXXXXXXX"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_descripcion", "Descripción grupo:");
                 echo HTML::textArea("4", "50", $login->getUserDataCampo($usuario_id, "usuario_descripcion"), "usuario_descripcion");
                 echo HTML::br(2);
                 echo HTML::label("estilo_nombre", WORDING_PROFILE_ESTILO);
                 echo HTML::selectArray("estilo_nombre", $getDataDB->getFieldSQL("wm_estilo", "estilo_nombre , estilo_id", ""));
                 echo HTML::br(2);
                 echo HTML::button_HTML5("submit", BUTTON_MOD_DATA, "form_edit_account");
                 echo HTML::close_form();
             }
             break;
             /**
              * FORM FAN
              */
         /**
          * FORM FAN
          */
         case "fan":
             if (isset($_POST['form_edit_account'])) {
                 if (empty($_POST['usuario_nombre'])) {
                     echo MESSAGE_FORM_NOMBRE_EMPTY;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } elseif ($_POST['usuario_idioma'] == "") {
                     $_POST['usuario_idioma'] == $login->getUserDataCampo($usuario_id, "usuario_idioma");
                 } elseif ($_POST['usuario_idioma'] != "ca" && $_POST['usuario_idioma'] != "en" && $_POST['usuario_idioma'] != "es") {
                     echo MESSAGE_FORM_IDIOMA;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } elseif ($_POST['usuario_idioma'] != "ca" && $_POST['usuario_idioma'] != "en" && $_POST['usuario_idioma'] != "es") {
                     echo MESSAGE_FORM_IDIOMA;
                     echo HTML::br(2);
                     echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                 } else {
                     $query_mod_account = DB::connect()->prepare("UPDATE  `uqfhhbcn_whymusic`.`wm_usuarios` SET  \n                `usuario_nombre` =  :usuario_nombre,\n                `usuario_apellido1` =  :usuario_apellido1,\n                `usuario_apellido2` =  :usuario_apellido2,\n                `usuario_idioma` = :usuario_idioma \n                 WHERE  `wm_usuarios`.`usuario_id` = :usuario_id;");
                     $query_mod_account->bindValue(':usuario_id', $usuario_id, PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_nombre', $_POST['usuario_nombre'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_apellido1', $_POST['usuario_apellido1'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_apellido2', $_POST['usuario_apellido2'], PDO::PARAM_STR);
                     $query_mod_account->bindValue(':usuario_idioma', $_POST['usuario_idioma'], PDO::PARAM_STR);
                     $query_mod_account->execute();
                     if ($query_mod_account) {
                         echo MESSAGE_CORRECT_MOD;
                         if ($login->getTypeOfUser() == "administrador") {
                             ROUTER::redirect_to_action("admin/admin", 2);
                         } else {
                             ROUTER::redirect_to_action("account/edit", 2);
                         }
                     } else {
                         echo MESSAGE_ERROR_SQL;
                         echo HTML::br(2);
                         echo "<a href='javascript:history.back()'> Volver Atrás</a>";
                     }
                 }
             } else {
                 echo HTML::title("h3", "Editar foto de perfil");
                 echo HTML::open_form(ROUTER::create_action_url("account/edit"), "POST", "fileToUpload", array("enctype" => "multipart/form-data"));
                 echo HTML::label("fileToUpload", "Sube tu foto");
                 echo HTML::input("file", "fileToUpload", null, array("id" => "fileToUpload"));
                 echo HTML::br(1);
                 echo HTML::input("submit", "usuario_foto", "Subir foto");
                 echo HTML::close_form();
                 echo HTML::open_form(ROUTER::create_action_url('account/edit'), "POST", "form_edit_account");
                 echo HTML::title("h3", "Edición de los datos de usuario");
                 /*Guarrada provisional*/
                 $_SESSION['usuario_id_edit'] = $login->getUserDataCampo($usuario_id, "usuario_id");
                 $_SESSION['usuario_tipo_edit'] = $login->getUserDataCampo($usuario_id, "usuario_tipo");
                 /*Fin de la gurrada*/
                 echo HTML::label("usuario_nombre", WORDING_NOMBRE);
                 echo HTML::input("text", "usuario_nombre", $login->getUserDataCampo($usuario_id, "usuario_nombre"), array("placeholder" => "Su nombre"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_apellido1", WORDING_APELLIDO1);
                 echo HTML::input("text", "usuario_apellido1", $login->getUserDataCampo($usuario_id, "usuario_apellido1"), array("placeholder" => "Su nombre"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_apellido2", WORDING_APELLIDO2);
                 echo HTML::input("text", "usuario_apellido2", $login->getUserDataCampo($usuario_id, "usuario_apellido2"), array("placeholder" => "Su nombre"));
                 echo HTML::br(2);
                 echo HTML::label("usuario_idioma", WORDING_IDIOMA);
                 echo HTML::select("usuario_idioma", array("Idioma por defecto" => $login->getUserDataCampo($usuario_id, 'usuario_idioma'), "Inglés" => "en", "Castellano" => "es", "Catalán" => "ca"));
                 echo HTML::br(2);
                 echo HTML::button_HTML5("submit", BUTTON_MOD_DATA, "form_edit_account");
                 echo HTML::close_form();
             }
             break;
         case "administrador":
             echo "DESDE LA BASE DE DATOS";
             break;
         default:
             echo "No tienes permisos para estar aquí...";
             break;
     }
 }
Esempio n. 6
0
     if (isset($select1)) {
         array_push($select, $select1);
     }
     if (isset($select2)) {
         array_push($select, $select2);
     }
     if (isset($select3)) {
         array_push($select, $select3);
     }
     if (isset($select4)) {
         array_push($select, $select4);
     }
     if (isset($select5)) {
         array_push($select, $select5);
     }
     $data_html = $obj->select($var_name, $label, $select, $div_name);
     $data_css = $obj_css->styles($var_name, $color, $width, $height, $x_position, $y_position, $z_index, $font_size, $font_color);
     $obj->write_to_file($data_html, $html_file_name, $css_file_name, $data_css);
     $insert = "INSERT INTO `CMS`.`html_css` (`ID`, `HTML`, `CSS`,  `FORM_ID`,`STATUS`, `NAME`) VALUES (NULL, '{$data_html}', '{$data_css}', {$index_of_form},'1', '{$label}');";
     $result = $conn->query($insert);
     $ID = mysqli_insert_id($conn);
     $insert_div_data = "INSERT INTO `CMS`.`divs` (`ID`, `ELEMENT`, `HTML_CSS_ID`) VALUES (NULL, '{$data_html}',{$ID});";
     $result = $conn->query($insert_div_data);
     echo 'HTML & CSS Code created successfully<br/>';
     break;
 case 'file_html':
     $data_html = $obj->file_html($var_name, $label, $value, $div_name);
     $data_css = $obj_css->styles($var_name, $color, $width, $height, $x_position, $y_position, $z_index, $font_size, $font_color);
     $obj->write_to_file($data_html, $html_file_name, $css_file_name, $data_css);
     $insert = "INSERT INTO `CMS`.`html_css` (`ID`, `HTML`, `CSS`,  `FORM_ID`,`STATUS`, `NAME`) VALUES (NULL, '{$data_html}', '{$data_css}', {$index_of_form},'1', '{$label}');";
     $result = $conn->query($insert);
Esempio n. 7
0
 function asEditableTable($type)
 {
     global $WikiTheme;
     if (!isset($this->_group)) {
         $this->_group =& $GLOBALS['request']->getGroup();
     }
     $table = HTML::table();
     $table->pushContent(HTML::tr(HTML::th(array('align' => 'left'), _("Access")), HTML::th(array('align' => 'right'), _("Group/User")), HTML::th(_("Grant")), HTML::th(_("Del/+")), HTML::th(_("Description"))));
     $allGroups = $this->_group->_specialGroups();
     foreach ($this->_group->getAllGroupsIn() as $group) {
         if (!in_array($group, $this->_group->specialGroups())) {
             $allGroups[] = $group;
         }
     }
     //array_unique(array_merge($this->_group->getAllGroupsIn(),
     $deletesrc = $WikiTheme->_findData('images/delete.png');
     $addsrc = $WikiTheme->_findData('images/add.png');
     $nbsp = HTML::raw('&nbsp;');
     foreach ($this->perm as $access => $groups) {
         //$permlist = HTML::table(array('class' => 'cal','valign' => 'top'));
         $first_only = true;
         $newperm = HTML::input(array('type' => 'checkbox', 'name' => "acl[_new_perm][{$access}]", 'value' => 1));
         $addbutton = HTML::input(array('type' => 'checkbox', 'name' => "acl[_add_group][{$access}]", 'title' => _("Add this ACL"), 'value' => 1));
         $newgroup = HTML::select(array('name' => "acl[_new_group][{$access}]", 'style' => 'text-align: right;', 'size' => 1));
         foreach ($allGroups as $groupname) {
             if (!isset($groups[$groupname])) {
                 $newgroup->pushContent(HTML::option(array('value' => $groupname), $this->groupName($groupname)));
             }
         }
         if (empty($groups)) {
             $addbutton->setAttr('checked', 'checked');
             $newperm->setAttr('checked', 'checked');
             $table->pushContent(HTML::tr(array('valign' => 'top'), HTML::td(HTML::strong($access . ":")), HTML::td($newgroup), HTML::td($nbsp, $newperm), HTML::td($nbsp, $addbutton), HTML::td(HTML::em(getAccessDescription($access)))));
         }
         foreach ($groups as $group => $bool) {
             $checkbox = HTML::input(array('type' => 'checkbox', 'name' => "acl[{$access}][{$group}]", 'title' => _("Allow / Deny"), 'value' => 1));
             if ($bool) {
                 $checkbox->setAttr('checked', 'checked');
             }
             $checkbox = HTML(HTML::input(array('type' => 'hidden', 'name' => "acl[{$access}][{$group}]", 'value' => 0)), $checkbox);
             $deletebutton = HTML::input(array('type' => 'checkbox', 'name' => "acl[_del_group][{$access}][{$group}]", 'style' => 'background: #aaa url(' . $deletesrc . ')', 'title' => _("Delete this ACL"), 'value' => 1));
             if ($first_only) {
                 $table->pushContent(HTML::tr(HTML::td(HTML::strong($access . ":")), HTML::td(array('class' => 'cal-today', 'align' => 'right'), HTML::strong($this->groupName($group))), HTML::td(array('align' => 'center'), $nbsp, $checkbox), HTML::td(array('align' => 'right', 'style' => 'background: #aaa url(' . $deletesrc . ') no-repeat'), $deletebutton), HTML::td(HTML::em(getAccessDescription($access)))));
                 $first_only = false;
             } else {
                 $table->pushContent(HTML::tr(HTML::td(), HTML::td(array('class' => 'cal-today', 'align' => 'right'), HTML::strong($this->groupName($group))), HTML::td(array('align' => 'center'), $nbsp, $checkbox), HTML::td(array('align' => 'right', 'style' => 'background: #aaa url(' . $deletesrc . ') no-repeat'), $deletebutton), HTML::td()));
             }
         }
         if (!empty($groups)) {
             $table->pushContent(HTML::tr(array('valign' => 'top'), HTML::td(array('align' => 'right'), _("add ")), HTML::td($newgroup), HTML::td(array('align' => 'center'), $nbsp, $newperm), HTML::td(array('align' => 'right', 'style' => 'background: #ccc url(' . $addsrc . ') no-repeat'), $addbutton), HTML::td(HTML::small(_("Check to add this ACL")))));
         }
     }
     if ($type == 'default') {
         $table->setAttr('style', 'border: dotted thin black; background-color:#eee;');
     } elseif ($type == 'inherited') {
         $table->setAttr('style', 'border: dotted thin black; background-color:#ddd;');
     } elseif ($type == 'page') {
         $table->setAttr('style', 'border: solid thin black; font-weight: bold;');
     }
     return $table;
 }
Esempio n. 8
0
    }

    function change_script(form) {
      var url = form.url.value;
      var script = form.script.value;
      top.location.href = 'http://' + top.YAWF.domain + '/test/runner.part?url=' + escape(url) + '&script=' + escape(script);
    }
  </script>
</head>
<body onload="setup()">
  <form id="browser" onsubmit="top.YAWF.open(this.url.value); return false">
    <input type="button" name="home" value="Home" onclick="top.YAWF.open(this.form.url.value = '/')" />
    <label for="url">Address</label>
    <input type="text" id="url" name="url" value="<?php 
echo $url;
?>
" size="40" maxlength="100" />
    <input type="submit" name="go" value=" Go " />
    using test script
    <?php 
echo HTML::select('script', $scripts, $script, array('onchange' => 'change_script(this.form)'));
?>
    <a href="#" onclick="top.YAWF.open('test/script.part?script=' + document.forms.browser.script.value)">view</a>
    <span id="flash"><?php 
echo $error;
?>
</span>
  </form>
</body>
</html>
 public function formLocal()
 {
     $login = new ModelLogin();
     if (isset($_POST['form_edit_account'])) {
         if (empty($_POST['usuario_nombre'])) {
             echo MESSAGE_FORM_NOMBRE_EMPTY;
             echo HTML::br(2);
             echo "<a href='javascript:history.back()'> Volver Atrás</a>";
         } elseif (empty($_POST['usuario_apellido1']) || empty($_POST['usuario_apellido2'])) {
             echo MESSAGE_FORM_APELLIDO_EMPTY;
             echo HTML::br(2);
             echo "<a href='javascript:history.back()'> Volver Atrás</a>";
         } elseif (strlen($_POST['usuario_nombre']) > 64 || strlen($_POST['usuario_nombre']) < 2) {
             echo MESSAGE_FROM_NOMBRE_LENGHT;
             echo HTML::br(2);
             echo "<a href='javascript:history.back()'> Volver Atrás</a>";
         } elseif (!preg_match('/^[a-z\\d]{2,64}$/i', $_POST['usuario_nombre'])) {
             echo MESSAGE_FORM_NOMBRE_CARACTER;
             echo HTML::br(2);
             echo "<a href='javascript:history.back()'> Volver Atrás</a>";
         } elseif (empty($_POST['usuario_telefono'])) {
             echo MESSAGE_FORM_TELEFONO_EMPTY;
             echo HTML::br(2);
             echo "<a href='javascript:history.back()'> Volver Atrás</a>";
         } elseif (strlen($_POST['usuario_telefono']) != 9) {
             echo MESSAGE_FORM_TELEFONO_INVALID;
             echo HTML::br(2);
             echo "<a href='javascript:history.back()'> Volver Atrás</a>";
         } elseif ($_POST['usuario_idioma'] == "") {
             $_POST['usuario_idioma'] == $login->getFormData($_SESSION['usuario_nombre_usuario'], "usuario_idioma");
         } elseif ($_POST['usuario_idioma'] != "ca" && $_POST['usuario_idioma'] != "en" && $_POST['usuario_idioma'] != "es") {
             echo MESSAGE_FORM_IDIOMA;
             echo HTML::br(2);
             echo "<a href='javascript:history.back()'> Volver Atrás</a>";
         } else {
             $query_mod_account = DB::connect()->prepare("UPDATE  `uqfhhbcn_whymusic`.`wm_usuarios` SET  `usuario_nombre` =  :usuario_nombre,\n            `usuario_apellido1` =  :usuario_apellido1,\n            `usuario_apellido2` =  :usuario_apellido2,\n            `usuario_telefono` =  :usuario_telefono,\n            `usuario_idioma` = :usuario_idioma WHERE  `wm_usuarios`.`usuario_nombre_usuario` =:usuario_nombre_usuario;");
             $query_mod_account->bindValue(':usuario_nombre_usuario', "musico", PDO::PARAM_STR);
             $query_mod_account->bindValue(':usuario_nombre', $_POST['usuario_nombre'], PDO::PARAM_STR);
             $query_mod_account->bindValue(':usuario_apellido1', $_POST['usuario_apellido1'], PDO::PARAM_STR);
             $query_mod_account->bindValue(':usuario_apellido2', $_POST['usuario_apellido2'], PDO::PARAM_STR);
             $query_mod_account->bindValue(':usuario_idioma', $_POST['usuario_idioma'], PDO::PARAM_STR);
             $query_mod_account->bindValue(':usuario_telefono', $_POST['usuario_telefono'], PDO::PARAM_STR);
             $query_mod_account->execute();
             // if username or/and email find in the database
             // TODO: this is really awful!
             if ($query_mod_account) {
                 echo MESSAGE_CORRECT_MOD;
                 ROUTER::redirect_to_action("account/edit", 2);
             } else {
                 echo MESSAGE_ERROR_SQL;
                 echo HTML::br(2);
                 echo "<a href='javascript:history.back()'> Volver Atrás</a>";
             }
         }
     } else {
         echo HTML::open_form(ROUTER::create_action_url('account/edit'), "POST", "form_edit_account");
         echo HTML::label("usuario_nombre", WORDING_USERNAME);
         echo HTML::input("text", "usuario_nombre", $login->getFormData($_SESSION['usuario_nombre_usuario'], "usuario_nombre"), array("placeholder" => "Su nombre"));
         echo HTML::br(2);
         echo HTML::label("usuario_apellido1", WORDING_APELLIDO1);
         echo HTML::input("text", "usuario_apellido1", $login->getFormData($_SESSION['usuario_nombre_usuario'], "usuario_apellido1"), array("placeholder" => "Su apellido"));
         echo HTML::br(2);
         echo HTML::label("usuario_apellido2", WORDING_APELLIDO2);
         echo HTML::input("text", "usuario_apellido2", $login->getFormData($_SESSION['usuario_nombre_usuario'], "usuario_apellido2"), array("placeholder" => "Su segundo apellido"));
         echo HTML::br(2);
         echo HTML::label("usuario_idioma", WORDING_IDIOMA);
         echo HTML::select("usuario_idioma", array("Idioma por defecto" => $login->getFormData($_SESSION['usuario_nombre_usuario'], 'usuario_idioma'), "Inglés" => "en", "Castellano" => "es", "Catalán" => "ca"));
         echo HTML::br(2);
         echo HTML::label("usuario_telefono", WORDING_TELEFON);
         echo HTML::input("text", "usuario_telefono", $login->getFormData($_SESSION['usuario_nombre_usuario'], "usuario_telefono"), array("placeholder" => "9XXXXXXXX"));
         echo HTML::br(2);
         echo HTML::button_HTML5("submit", BUTTON_MOD_DATA, "form_edit_account");
         echo HTML::close_form();
     }
 }
Esempio n. 10
0
 static function select_prt($sql_or_array, $name, $request = null, $xtra = null, $blank_option = true)
 {
     echo HTML::select($sql_or_array, $name, $request, $xtra, $blank_option);
 }
Esempio n. 11
0
<div class="modal fade" id="mosca2Modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cerrar</span></button>
                <h4 class="modal-title" id="myModalLabel">Añadir Logo2</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" role="form">
                    <label for="entradaId" class="col-sm-3 control-label">
                        Logo2
                    </label>
                    <div class="form-group">
                        <div class="col-sm-7">
                            <?php 
echo HTML::select("moscaId2", $moscas2, null, array("id" => "moscaId2", "class" => "select2"), null, array("display" => "nombre"));
?>
                        </div>
                    </div>

                    <label for="entradaId" class="col-sm-3 control-label">
                        Delay
                    </label>
                    <div class="form-group">
                        <div class="col-sm-7">
                            <input type="text" id="delay" name="delay" class="form-control dateMask" value="00:00:00:00" placeholder="HH:MM:SS:FR">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
Esempio n. 12
0
                            </div>
                        </div>
                    <?php 
}
?>
                    <?php 
if (!empty($entradasFIN)) {
    ?>
                        <!-- Entrada FIN -->
                        <div class="form-group edfin">
                            <label class="col-sm-3 control-label">
                                FIN
                            </label>
                            <div class="col-sm-8">
                                <?php 
    echo HTML::select("entradaIdFin", $entradasFIN, $entrada->entradaIdFin, array("id" => "entradaIdFin", "class" => "select2"), null, array("display" => "nombre"));
    ?>
                            </div>
                        </div>
                    <?php 
}
?>
                </div>
            </div>
        </div>
    </div>
</form>

<script>

    //Date Mask
Esempio n. 13
0
 protected function getSelect($name, $value = null, $items = array(), $attributes = null)
 {
     DOC::addChosen();
     $arr = array();
     $arr[0] = '--не задана--';
     foreach ($items as $row) {
         $arr[$row->getId()] = $row;
     }
     return HTML::select($name, $arr, $value, $attributes);
 }