/** * widget function * works for select menus and some input fields * @param string $title * @param string $function * @param string $name * @param string $value * @param string $attr * @param string $type * @param string $subtitle * @param string $req * @param string $tag * @param string $tag_attr * @param string $extra * @param string $afterwards * @return string * @author edited by Peng Wang <*****@*****.**> */ function ips($title, $function, $name, $value = '', $attr = '', $type = '', $subtitle = '', $req = '', $tag = '', $tag_attr = '', $extra = '', $afterwards = '') { $OBJ =& get_instance(); global $error_msg, $go; // set a default // we might want div later if (!$tag) { $tag = 'label'; } $tag_attr ? $tag_attr = "{$tag_attr}" : ($tag_attr = ''); $OBJ->access->prefs['user_help'] == 1 ? $help = showHelp($title) : ($help = ''); $afterwards ? $afterwards = $afterwards : ($afterwards = ''); if (isset($error_msg[$name])) { $msg = span($error_msg[$name], "class='error'"); } else { $msg = null; } $subtitle ? $subtitle = span($subtitle, "class='small-txt'") : ($subtitle = ''); $title ? $title = label($title . ' ' . $subtitle . ' ' . $help . $msg) : ($title = ''); $req ? $req = showerror($msg) : ($req = ''); $extra ? $add = $extra : ($add = ''); $value = showvalue($name, $value); if ($function === 'input') { $function = input($name, $type, attr($attr), $value); } else { $function ? $function = $function($value, $name, attr($attr), $add) : ($function = null); } return $title . "\n" . $function; }
function ctrl_input_field($errors, $inputType, $isRequired, $name, $labelText, $className, $originalValue = null) { $divClassName; if ('REQUIRED' == $isRequired) { $divClassName = 'requiredField'; } else { $divClassName = 'optionalField'; } echo "<div class = '{$divClassName}'>"; $value; if (sent_value($name) != null) { $value = sent_value($name); } else { $value = $originalValue; } if ('hidden' != $inputType) { //checkboxes look better if the box is on the left if ('checkbox' != $inputType) { label($name, $labelText); echo "<input type =\"{$inputType}\" id = \"{$name}\" name = \"{$name}\" value = \"{$value}\" class = \"{$className}\"/>"; } else { echo "<input type =\"{$inputType}\" id = \"{$name}\" name = \"{$name}\" value = \"{$value}\" class = \"{$className}\"/>"; label($name, $labelText); } error_label($errors, $name); } else { //hidden fields don't have labels or error labels echo "<input type =\"{$inputType}\" id = \"{$name}\" name = \"{$name}\" value = \"{$value}\" class = \"{$className}\"/>"; } echo '</div>'; }
public function tablaDescarga() { if (isset($_POST['miHtml'])) { $htmlEntrada = $_POST['miHtml']; $titulo = $_POST['titulo']; $str = $htmlEntrada; $table = str_get_html($str); $rowData = array(); foreach ($table->find('tr') as $row) { // initialize array to store the cell data from each row $flight = array(); foreach ($row->find('td') as $cell) { // push the cell's text to the array $flight[] = trim($cell->plaintext); } $rowData[] = $flight; } error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); // date_default_timezone_set('Europe/London'); if (PHP_SAPI == 'cli') { die('This example should only be run from a Web Browser'); } $objPHPExcel = new PHPExcel(); $objPHPExcel->getProperties()->setCreator(label('nombreSistema'))->setLastModifiedBy(label('nombreSistema')); // ->setSubject("Prueba de descarga de tabla de personas") // ->setDescription("Documento de prueba de descarga de tabla de excel desde PHP") // ->setKeywords("office 2007 openxml php") // ->setCategory("Documento de prueba"); $hoja = $objPHPExcel->getSheet(0); $hoja->setTitle($titulo); $hoja->fromArray($rowData, '', 'A1'); $cantidadColumnas = count(array_shift($rowData)); $abcd = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's'); $ultimaColumna = $abcd[$cantidadColumnas - 1]; $header = 'a1:' . $ultimaColumna . '1'; $hoja->getStyle($header)->getFill()->setFillType(\PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB('FFFFFF00'); $style = array('font' => array('bold' => true), 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER)); $hoja->getStyle($header)->applyFromArray($style); for ($col = ord('a'); $col <= ord('z'); $col++) { $hoja->getColumnDimension(chr($col))->setAutoSize(true); } header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="' . $titulo . '.xls"'); header('Cache-Control: max-age=0'); header('Cache-Control: max-age=1'); // header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified header('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header('Pragma: public'); // HTTP/1.0 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); exit; } }
function uriboot($label, $uri, $args) { label($label); echo " kernel " . $uri . "\n"; if ($args) { echo " append " . $args . "\n"; } }
function render_meta_box($post) { $templates = Template::getTodosArray(); $select = input_select_simples('id_template', "Template de Evento", $templates); echo label("template", "Template de Evento", $select); $input = input_texto_simples('post_title', 'Título do Evento', 30); echo label("titulo", "Título do Evento", $input); }
/** * Created by PhpStorm. * User: Shunichiro AKI * Date: 2015/09/18 * Time: 23:19 */ function message($id, $transParameters = [], $rawParameters = []) { $mergeParameters = []; foreach ($transParameters as $key => $value) { $mergeParameters[$key] = label($value); } $mergeParameters += $rawParameters; return trans('messages.' . $id, $mergeParameters); }
function add_field($f, $id, $label = "", $req = false, $class = "", $type = "text") { $in = make_tag("input", $class); $in["attribs"]["type"] = $type; $in["attribs"]["id"] = $id; $in["attribs"]["name"] = $id; $in["attribs"]["placeholder"] = $label; !$req || ($in["attribs"]["required"] = ""); $f["children"][] = label($id, $label); $f["children"][] = $in; return $f; }
private function compile(array $tokens) { $cg = (object) ['ts' => TokenStream::fromSlice($tokens), 'parsers' => []]; traverse(rtoken('/^(T_\\w+)·(\\w+)$/')->onCommit(function (Ast $result) use($cg) { $token = $result->token(); $id = $this->lookupCapture($token); $type = $this->lookupTokenType($token); $cg->parsers[] = token($type)->as($id); }), ($parser = chain(rtoken('/^·\\w+$/')->as('type'), token('('), optional(ls(either(future($parser)->as('parser'), chain(token(T_FUNCTION), parentheses()->as('args'), braces()->as('body'))->as('function'), string()->as('string'), rtoken('/^T_\\w+·\\w+$/')->as('token'), rtoken('/^T_\\w+$/')->as('constant'), rtoken('/^·this$/')->as('this'), label()->as('label'))->as('parser'), token(',')))->as('args'), commit(token(')')), optional(rtoken('/^·\\w+$/')->as('label'), null)))->onCommit(function (Ast $result) use($cg) { $cg->parsers[] = $this->compileParser($result->type, $result->args, $result->label); }), $this->layer('{', '}', braces(), $cg), $this->layer('[', ']', brackets(), $cg), $this->layer('(', ')', parentheses(), $cg), rtoken('/^···(\\w+)$/')->onCommit(function (Ast $result) use($cg) { $id = $this->lookupCapture($result->token()); $cg->parsers[] = layer()->as($id); }), token(T_STRING, '·')->onCommit(function (Ast $result) use($cg) { $offset = \count($cg->parsers); if (0 !== $this->dominance || 0 === $offset) { $this->fail(self::E_BAD_DOMINANCE, $offset, $result->token()->line()); } $this->dominance = $offset; }), rtoken('/·/')->onCommit(function (Ast $result) { $token = $result->token(); $this->fail(self::E_BAD_CAPTURE, $token, $token->line()); }), any()->onCommit(function (Ast $result) use($cg) { $cg->parsers[] = token($result->token()); }))->parse($cg->ts); // check if macro dominance '·' is last token if ($this->dominance === \count($cg->parsers)) { $this->fail(self::E_BAD_DOMINANCE, $this->dominance, $cg->ts->last()->line()); } $this->specificity = \count($cg->parsers); if ($this->specificity > 1) { if (0 === $this->dominance) { $pattern = chain(...$cg->parsers); } else { /* dominat macros are partially wrapped in commit()s and dominance is the offset used as the 'event horizon' point... once the entry point is matched, there is no way back and a parser error arises */ $prefix = array_slice($cg->parsers, 0, $this->dominance); $suffix = array_slice($cg->parsers, $this->dominance); $pattern = chain(...array_merge($prefix, array_map(commit::class, $suffix))); } } else { /* micro optimization to save one function call for every token on the subject token stream whenever the macro pattern consists of a single parser */ $pattern = $cg->parsers[0]; } return $pattern; }
function echolabel($blockarr, $theblcokvalue) { if (!empty($blockarr) && is_array($blockarr)) { foreach ($blockarr as $bkey => $bvalue) { if (!isset($bvalue['alang'])) { $bvalue['alang'] = ''; } if (!isset($bvalue['options'])) { $bvalue['options'] = array(); } if (!isset($bvalue['other'])) { $bvalue['other'] = ''; } if (!isset($bvalue['text'])) { $bvalue['text'] = ''; } if (!isset($bvalue['check'])) { $bvalue['check'] = ''; } if (!isset($bvalue['radio'])) { $bvalue['radio'] = ''; } if (!isset($bvalue['size'])) { $bvalue['size'] = ''; } if (!isset($theblcokvalue[$bkey])) { $theblcokvalue[$bkey] = ''; } if (!isset($bvalue['width'])) { $bvalue['width'] = ''; } $labelarr = array('type' => $bvalue['type'], 'alang' => $bvalue['alang'], 'name' => $bkey, 'size' => $bvalue['size'], 'text' => $bvalue['text'], 'check' => $bvalue['check'], 'radio' => $bvalue['radio'], 'options' => $bvalue['options'], 'other' => $bvalue['other'], 'width' => $bvalue['width'], 'value' => $theblcokvalue[$bkey]); if ($bkey == 'order') { if (!isset($theblcokvalue['order'])) { $theblcokvalue['order'] = ''; } if (!isset($theblcokvalue['sc'])) { $theblcokvalue['sc'] = ''; } $labelarr['order'] = $theblcokvalue['order']; $labelarr['sc'] = $theblcokvalue['sc']; } echo label($labelarr); } } }
public function typeAsLabel() { // Grab the type $type = $this->type(); switch ($type) { case 'info': $content = "Info"; break; case 'warning': $content = "Warning"; break; case 'danger': $content = "Critical"; break; } return label($type, $content); }
/** * @return \Illuminate\Contracts\Validation\Validator */ protected function getValidatorInstance() { $validator = parent::getValidatorInstance(); // 写真のバリデーション $validator->each('picture', 'image'); $pictureKeys = $this->getPictureKeys(); $attributeNames = []; foreach ($pictureKeys as $key) { $attributeNames['picture.' . $key] = label('picture'); } $validator->setAttributeNames($attributeNames); $validator->after(function ($validator) use(&$pictureKeys) { $messages = $validator->messages(); foreach ($pictureKeys as $key) { if ($messages->has('picture.' . $key)) { // BootFormで表示できるよう、pictureにメッセージをコピー $validator->errors()->add('picture', $messages->first('picture.' . $key)); return; } } }); return $validator; }
<h2>Envio de SMS</h2> <form method="post"> <div id="poststuff"> <div id="post-body" class="metabox-holder columns-2"> <div id="post-body-content"> <div class="postbox-container"> <div class="postbox"> <h3 class="hndle"><span><?php echo $titulo; ?> </span></h3> <div class="inside"> <form method="post" action=""> <?php echo label('mensagem', 'Mensagem', input_textarea_simples('mensagem', 2, ''), "Variáveis disponíveis para utilização:<br>" . getVariaveis($event)); ?> </div> <div id="major-publishing-actions"> <div id="publishing-action"> <span class="spinner"></span> <input type="submit" name="publish" id="publish" class="button button-primary button-large" value="Enviar" accesskey="p"></div> <div class="clear"></div> </div> </div> </div> </div> </div> </div>
</p> </div> <div id="botonEliminar" class="modal-footer black-text"> <a href="" class="waves-effect waves-red btn-flat modal-action modal-close"><?php echo label('aceptar'); ?> </a> </div> </div> <div id="eliminarFase" class="modal"> <div class="modal-header"> <p><?php echo label('nombreSistema'); ?> </p> <a class="modal-action modal-close cerrar-modal"><i class="mdi-content-clear"></i></a> </div> <div class="modal-content"> <p><?php echo label('confirmarEliminarFase'); ?> </p> </div> <div id="botonEliminar" class="modal-footer black-text"> <a href="" class="waves-effect waves-red btn-flat modal-action modal-close"><?php echo label('aceptar'); ?> </a> </div> </div> <!-- Fin lista modals -->
<?php $string = "<!-- Main content -->\n <section class='content'>\n <div class='row'>\n <div class='col-xs-12'>\n <div class='box'>\n <div class='box-header'>\n \n <h3 class='box-title'>" . strtoupper($table_name) . "</h3>\n <div class='box box-primary'>"; $string .= "\n <form action=\"<?php echo \$action; ?>\" method=\"post\">"; $string .= "<table class='table table-bordered'>"; foreach ($non_pk as $row) { if ($row["data_type"] == 'text') { $string .= "\n\t <tr><td>" . label($row["column_name"]) . " <?php echo form_error('" . $row["column_name"] . "') ?></td>\n <td><textarea class=\"form-control\" rows=\"3\" name=\"" . $row["column_name"] . "\" id=\"" . $row["column_name"] . "\" placeholder=\"" . label($row["column_name"]) . "\"><?php echo \$" . $row["column_name"] . "; ?></textarea>\n </td></tr>"; } else { $string .= "\n\t <tr><td>" . label($row["column_name"]) . " <?php echo form_error('" . $row["column_name"] . "') ?></td>\n <td><input type=\"text\" class=\"form-control\" name=\"" . $row["column_name"] . "\" id=\"" . $row["column_name"] . "\" placeholder=\"" . label($row["column_name"]) . "\" value=\"<?php echo \$" . $row["column_name"] . "; ?>\" />\n </td>"; } } $string .= "\n\t <input type=\"hidden\" name=\"" . $pk . "\" value=\"<?php echo \$" . $pk . "; ?>\" /> "; $string .= "\n\t <tr><td colspan='2'><button type=\"submit\" class=\"btn btn-primary\"><?php echo \$button ?></button> "; $string .= "\n\t <a href=\"<?php echo site_url('" . $c_url . "') ?>\" class=\"btn btn-default\">Cancel</a></td></tr>"; $string .= "\n\t\n </table></form>\n </div><!-- /.box-body -->\n </div><!-- /.box -->\n </div><!-- /.col -->\n </div><!-- /.row -->\n </section><!-- /.content -->"; $hasil_view_form = createFile($string, $target . "views/" . $v_form_file);
</li> <li class="li-hover"> <div class="divider"></div> </li> <?php if ($rolCotizador) { ?> <li class="li-hover"><p class="ultra-small margin more-text"><?php echo label('masOpciones'); ?> </p></li> <li> <a href="<?php echo base_url(); ?> cotizacion/cotizar"> <i class="mdi-action-swap-vert-circle"></i><?php echo label('agregarCotizacion'); ?> </a> </li> <?php } ?> </ul> <a href="#" class="sidebar-collapse btn-floating btn-medium waves-effect waves-light hide-on-large-only darken-2" data-activates="slide-out"> <i class="mdi-navigation-menu"></i> </a> </aside> <!-- END LEFT SIDEBAR NAV-->
case '0'://Error en la transacción alert('<?php echo label('login_errorTransaccion'); ?> '); break; case '1'://no existe $('#mensajeValidacion').text('<?php echo label('login_usuarioNoExiste'); ?> '); // alert(response); break; case '2'://si existe pero contrasena mala $('#mensajeValidacion').text('<?php echo label('login_contrasenaIncorrecta'); ?> '); // alert(response); break; case '3'://correcto // $('#mensajeValidacion').text('correcto'); // alert('login en prueba'); <?php if (isset($urlInicial)) { ?> window.location.href = "<?php echo $urlInicial; ?> "; <?php
return $text ? 'true' : 'false'; } function text2text($text) { return $text ? $text : 'false'; } function js2bool2text($function) { return '<script type="text/javascript"> document.write(' . $function . '() ? "true" : "false"); </script>'; } function js2text($function) { return '<script type="text/javascript"> var t; if(t = ' . $function . '()) document.write(t); else document.write("false"); </script>'; } echo HTML_Decorator::html_start()->render(); echo Site_Decorator::head()->set_title('MWF About')->render(); echo HTML_Decorator::body_start()->render(); echo Site_Decorator::header()->set_title('MWF Device')->render(); echo Site_Decorator::content_full()->set_padded()->add_header('The Framework')->add_subheader('Server Info')->add_section(label('User Agent') . $_SERVER['HTTP_USER_AGENT'])->add_section(label('IP Address') . $_SERVER['REMOTE_ADDR'])->add_subheader('JS Classification')->add_section(label('mwf.classification.isMobile()') . js2bool2text('mwf.classification.isMobile'))->add_section(label('mwf.classification.isBasic()') . js2bool2text('mwf.classification.isBasic'))->add_section(label('mwf.classification.isStandard()') . js2bool2text('mwf.classification.isStandard'))->add_section(label('mwf.classification.isFull()') . js2bool2text('mwf.classification.isFull'))->add_section(label('mwf.classification.isOverride()') . js2bool2text('mwf.classification.isOverride'))->add_section(label('mwf.classification.isPreview()') . js2bool2text('mwf.classification.isPreview'))->add_subheader('PHP Classification')->add_section(label('Classification::is_mobile()') . bool2text(Classification::is_mobile()))->add_section(label('Classification::is_basic()') . bool2text(Classification::is_basic()))->add_section(label('Classification::is_standard()') . bool2text(Classification::is_standard()))->add_section(label('Classification::is_full()') . bool2text(Classification::is_full()))->add_section(label('Classification::is_override()') . bool2text(Classification::is_override()))->add_section(label('Classification::is_preview()') . bool2text(Classification::is_preview()))->add_subheader('JS User Agent')->add_section(label('mwf.userAgent.getOS()') . js2text('mwf.userAgent.getOS'))->add_section(label('mwf.userAgent.getOSVersion()') . js2text('mwf.userAgent.getOSVersion'))->add_section(label('mwf.userAgent.getBrowser()') . js2text('mwf.userAgent.getBrowser'))->add_section(label('mwf.userAgent.getBrowserEngine()') . js2text('mwf.userAgent.getBrowserEngine'))->add_section(label('mwf.userAgent.getBrowserEngineVersion()') . js2text('mwf.userAgent.getBrowserEngineVersion'))->add_subheader('PHP User Agent')->add_section(label('User_Agent::get_os()') . text2text(User_Agent::get_os()))->add_section(label('User_Agent::get_os_version()') . text2text(User_Agent::get_os_version()))->add_section(label('User_Agent::get_browser()') . text2text(User_Agent::get_browser()))->add_section(label('User_Agent::get_browser_engine()') . text2text(User_Agent::get_browser_engine()))->add_section(label('User_Agent::get_browser_engine_version()') . text2text(User_Agent::get_browser_engine_version()))->add_subheader('JS Screen')->add_section(label('mwf.screen.getHeight()') . js2text('mwf.screen.getHeight'))->add_section(label('mwf.screen.getWidth()') . js2text('mwf.screen.getWidth'))->add_section(label('mwf.screen.getPixelRatio()') . js2text('mwf.screen.getPixelRatio'))->add_subheader('PHP Screen')->add_section(label('Screen::get_height()') . text2text(Screen::get_height()))->add_section(label('Screen::get_width()') . text2text(Screen::get_width()))->add_section(label('Screen::get_pixel_ratio()') . text2text(Screen::get_pixel_ratio()))->render(); echo Site_Decorator::button_full()->set_padded()->add_option(Config::get('global', 'back_to_home_text'), Config::get('global', 'site_url'))->render(); echo Site_Decorator::default_footer()->render(); echo HTML_Decorator::body_end()->render(); echo HTML_Decorator::html_end()->render();
</label> </div> <div class="input-field col s12"> <input id="impuesto_valor" name="impuesto_valor" type="number"> <label for="impuesto_valor"><?php echo label('formImpuesto_valor'); ?> </label> <span class="icono-porcentaje-descuento">%</span> </div> </div> <div class="row"> <!--<a style="font-size: larger;float: left;text-decoration: underline;" class="modal-action modal-close"><?php echo label('cancelar'); ?> </a>--> <a onclick="$(this).closest('form').submit()" class="waves-effect btn modal-action" style="margin: 0 20px;"> <?php echo label('impuesto_guardarCambios'); ?> </a> </div> </div> </form> </div> <!-- Fin lista modals -->
var name = file.name; var size = file.size; var type = file.type; var t = type.split('/'); var ext = t.slice(1, 2); if(size > 2097150) { //2097152 alert("<?php echo label('usuarioErrorTamanoArchivo'); ?> "); document.getElementById('userfile').value = ''; } var valid_ext = ['image/png','image/jpg','image/jpeg']; if(valid_ext.indexOf(type)==-1) { alert("<?php echo label('usuarioErrorTipoArchivo'); ?> "); document.getElementById('userfile').value = ''; } if(document.getElementById('userfile').value == ''){ $('#imagen_seleccionada').attr('src', '<?php echo base_url(); ?> files/default-user-image.png'); } else { $('#usuario_fotografia').attr('value', ext); readURL(this); } }); </script>
} if ($value['formtype'] == 'file') { $fileurl = S_URL . '/batch.modeldownload.php?hash=' . rawurlencode(authcode($nameid . ',' . $item[$value['fieldname']], 'ENCODE')); } else { $fileurl = A_URL . '/' . $item[$value['fieldname']]; } if (preg_match("/^(img|flash|file)\$/i", $value['formtype'])) { $value['formtype'] = 'file'; } if ($op == "add") { $valued = $value['fielddefault']; } else { $valued = $item[$value['fieldname']]; } if ($value['formtype'] != 'timestamp') { $htmlarr[$value['id']]['input'] = label(array('type' => $value['formtype'], 'alang' => $value['fieldcomment'], 'name' => $value['fieldname'], 'options' => $temparr2, 'rows' => 10, 'width' => '30%', 'size' => '60', 'value' => $valued, 'other' => $other, 'fileurl' => $fileurl), 0); } else { $item[$value['fieldname']] = sgmdate($item[$value['fieldname']]); $htmlarr[$value['id']]['input'] = <<<EOF \t\t\t<input type="text" name="{$value['fieldname']}" id="{$value['fieldname']}" readonly="readonly" value="{$item[$value['fieldname']]}" /><img src="{$siteurl}/admin/images/time.gif" onClick="getDatePicker('{$value['fieldname']}', event, 21)" /> EOF; } } } elseif ($op == 'view') { if (empty($_SGLOBAL['supe_uid'])) { showmessage('no_permission'); } $item['subject'] = shtmlspecialchars($item['subject']); if (!empty($item['subjectimage'])) { $fileext = fileext($item['subjectimage']); $item['subjectimage'] = $item['subjectthumb'] = A_URL . '/' . $item['subjectimage'];
/** * Create a checkbox field given a field name and value * * @param string $name field name * @param string $text field label * @param integer $value 1 for checked * @param array $args future use */ function bw_checkbox($name, $text, $value = 1, $args = NULL) { $lab = label($name, $text); $icheckbox = icheckbox($name, $value); bw_tablerow(array($lab, $icheckbox)); return; }
} function label($string = "") { echo "\n\n{$string}\n\n"; } $mapClass = new map(); $map = openMapFile($prompt); // repeat while map not found and input was not interrupted by user do { if ($map) { $mapClass->create($map); label("O U T P U T"); echo "highest elevation : " . $mapClass->MAX . "\n X-coordinate: " . $mapClass->X . "\n Y-coordinate: " . $mapClass->Y . "\n Drop = " . $mapClass->DROP . "\n Length = " . $mapClass->LENGTH; echo "\n\nAnswer Email : " . $mapClass->LENGTH . $mapClass->DROP . "@redmart.com"; break; } else { if (prompt("File not found. Do you want to try again? (y/n) : ") === "y") { $map = openMapFile($prompt); if ($map) { $mapClass->create($map); label("O U T P U T"); echo "highest elevation : " . $mapClass->MAX . "\n X-coordinate: " . $mapClass->X . "\n Y-coordinate: " . $mapClass->Y . "\n Drop = " . $mapClass->DROP . "\n Length = " . $mapClass->LENGTH; echo "\n\nAnswer Email : " . $mapClass->LENGTH . $mapClass->DROP . "@redmart.com"; } } else { echo "Thank you for using my program!"; break; } } } while (!$map); print "\n\n";
echo label('formPlan_beneficio3'); ?> </label> </div> <div class="input-field col s12"> <input id="plan_beneficio4" type="checkbox"> <label for="plan_beneficio4"><?php echo label('formPlan_beneficio4'); ?> </label> </div> <div class="input-field col s12 envio-formulario"> <button class="btn waves-effect waves-light right" type="submit" name="action"><?php echo label('formPlan_agregar'); ?> </button> </div> </div> </form> </div> </div> </div> </div> </div> </div> </div> <!--end container--> </section> <!-- END CONTENT
public function typeAsLabel() { switch ($this->entity->type->name) { case 'Skin': $class = 'info'; break; case 'Rank Set': $class = 'success'; break; case 'MOD': $class = 'danger'; break; } return label($class, $this->entity->type->present()->name); }
default: $type = gettype($compare); } } elseif ($type === 'equal') { $type = gettype($compare); } // do the check if ($type === 'length' || $type === 'scalar') { $is_scalar = is_scalar($var); if ($is_scalar && $type === 'length') { return (bool) strlen($var); } return $is_scalar; } if ($type === 'numeric') { return is_numeric($var); } if (gettype($var) === $type) { return true; } return false; } $var = user_input(); // symbolic $type = user_input(); // symbolic $compare = user_input(); // symbolic $result = PMA_isValid($var, $type, $compare); label("after-call");
} $string .= "\n\t );\n \$this->load->view('{$v_form}', \$data);\n } else {\n \$this->session->set_flashdata('message', 'Record Not Found');\n redirect(site_url('{$c_url}'));\n }\n }\n \n public function update_action() \n {\n \$this->_rules();\n\n if (\$this->form_validation->run() == FALSE) {\n \$this->update(\$this->input->post('{$pk}', TRUE));\n } else {\n \$data = array("; foreach ($non_pk as $row) { $string .= "\n\t\t'" . $row['column_name'] . "' => \$this->input->post('" . $row['column_name'] . "',TRUE),"; } $string .= "\n\t );\n\n \$this->" . $m . "->update(\$this->input->post('{$pk}', TRUE), \$data);\n \$this->session->set_flashdata('message', 'Update Record Success');\n redirect(site_url('{$c_url}'));\n }\n }\n \n public function delete(\$id) \n {\n \$row = \$this->" . $m . "->get_by_id(\$id);\n\n if (\$row) {\n \$this->" . $m . "->delete(\$id);\n \$this->session->set_flashdata('message', 'Delete Record Success');\n redirect(site_url('{$c_url}'));\n } else {\n \$this->session->set_flashdata('message', 'Record Not Found');\n redirect(site_url('{$c_url}'));\n }\n }\n\n public function _rules() \n {"; foreach ($non_pk as $row) { $int = $row3['data_type'] == 'int' || $row['data_type'] == 'double' || $row['data_type'] == 'decimal' ? '|numeric' : ''; $string .= "\n\t\$this->form_validation->set_rules('" . $row['column_name'] . "', '" . strtolower(label($row['column_name'])) . "', 'trim|required{$int}');"; } $string .= "\n\n\t\$this->form_validation->set_rules('{$pk}', '{$pk}', 'trim');"; $string .= "\n\t\$this->form_validation->set_error_delimiters('<span class=\"text-danger\">', '</span>');\n }"; if ($export_excel == '1') { $string .= "\n\n public function excel()\n {\n \$this->load->helper('exportexcel');\n \$namaFile = \"{$table_name}.xls\";\n \$judul = \"{$table_name}\";\n \$tablehead = 0;\n \$tablebody = 1;\n \$nourut = 1;\n //penulisan header\n header(\"Pragma: public\");\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0,pre-check=0\");\n header(\"Content-Type: application/force-download\");\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Type: application/download\");\n header(\"Content-Disposition: attachment;filename=\" . \$namaFile . \"\");\n header(\"Content-Transfer-Encoding: binary \");\n\n xlsBOF();\n\n \$kolomhead = 0;\n xlsWriteLabel(\$tablehead, \$kolomhead++, \"No\");"; foreach ($non_pk as $row) { $column_name = label($row['column_name']); $string .= "\n\txlsWriteLabel(\$tablehead, \$kolomhead++, \"{$column_name}\");"; } $string .= "\n\n\tforeach (\$this->" . $m . "->get_all() as \$data) {\n \$kolombody = 0;\n\n //ubah xlsWriteLabel menjadi xlsWriteNumber untuk kolom numeric\n xlsWriteNumber(\$tablebody, \$kolombody++, \$nourut);"; foreach ($non_pk as $row) { $column_name = $row['column_name']; $xlsWrite = $row['data_type'] == 'int' || $row['data_type'] == 'double' || $row['data_type'] == 'decimal' ? 'xlsWriteNumber' : 'xlsWriteLabel'; $string .= "\n\t " . $xlsWrite . "(\$tablebody, \$kolombody++, \$data->{$column_name});"; } $string .= "\n\n\t \$tablebody++;\n \$nourut++;\n }\n\n xlsEOF();\n exit();\n }"; } if ($export_word == '1') { $string .= "\n\n public function word()\n {\n header(\"Content-type: application/vnd.ms-word\");\n header(\"Content-Disposition: attachment;Filename={$table_name}.doc\");\n\n \$data = array(\n '" . $table_name . "_data' => \$this->" . $m . "->get_all(),\n 'start' => 0\n );\n \n \$this->load->view('" . $v_doc . "',\$data);\n }"; } if ($export_pdf == '1') { $string .= "\n\n function pdf()\n {\n \$data = array(\n '" . $table_name . "_data' => \$this->" . $m . "->get_all(),\n 'start' => 0\n );\n \n ini_set('memory_limit', '32M');\n \$html = \$this->load->view('" . $v_pdf . "', \$data, true);\n \$this->load->library('pdf');\n \$pdf = \$this->pdf->load();\n \$pdf->WriteHTML(\$html);\n \$pdf->Output('" . $table_name . ".pdf', 'D'); \n }";
echo '<tr' . $class . '>'; echo '<td>' . $listvalue['fileext'] . '</td>'; echo '<td>' . $listvalue['maxsize'] . '</td>'; echo '<td align="center"><img src="' . S_URL . '/images/base/icon_edit.gif" align="absmiddle"> <a href="' . $newurl . '&op=edit&id=' . $listvalue['id'] . '">' . $alang['space_edit'] . '</a> <img src="' . S_URL . '/images/base/icon_delete.gif" align="absmiddle"><a href="' . $newurl . '&op=delete&id=' . $listvalue['id'] . '" onclick="return confirm(\'' . $alang['delete_all_note'] . '\');">' . $alang['space_delete'] . '</a></td>'; echo '</tr>'; } echo label(array('type' => 'table-end')); if (!empty($multipage)) { echo label(array('type' => 'table-start', 'class' => 'listpage')); echo '<tr><td>' . $multipage . '</td></tr>'; echo label(array('type' => 'table-end')); } } //THE VALUE SHOW if (is_array($thevalue) && $thevalue) { $maxsizearr = array('512' => $alang['attachmenttype_maxsize_0_5'], '1024' => $alang['attachmenttype_maxsize_1'], '1536' => $alang['attachmenttype_maxsize_1_5'], '2048' => $alang['attachmenttype_maxsize_2'], '0' => $alang['attachmenttype_maxsize_0']); echo label(array('type' => 'form-start', 'name' => 'thevalueform', 'action' => $theurl, 'other' => ' onSubmit="return validate(this)"')); echo label(array('type' => 'div-start')); echo label(array('type' => 'table-start')); echo label(array('type' => 'input', 'alang' => 'attachmenttype_title_fileext', 'name' => 'fileext', 'size' => 10, 'width' => '30%', 'value' => $thevalue['fileext'])); echo label(array('type' => 'select-input', 'alang' => 'attachmenttype_title_maxsize', 'name' => 'maxsize', 'options' => $maxsizearr, 'size' => 10, 'value' => $thevalue['maxsize'])); echo label(array('type' => 'table-end')); echo label(array('type' => 'div-end')); echo '<div class="buttons">'; echo label(array('type' => 'button-submit', 'name' => 'thevaluesubmit', 'value' => $alang['common_submit'])); echo label(array('type' => 'button-reset', 'name' => 'thevaluereset', 'value' => $alang['common_reset'])); echo '</div>'; echo '<input name="id" type="hidden" value="' . $thevalue['id'] . '" />'; echo '<input name="valuesubmit" type="hidden" value="yes" />'; echo label(array('type' => 'form-end')); }
function createFileBox($num) { $OBJ =& get_instance(); $s = label($OBJ->lang->word('title') . span(' ' . $OBJ->lang->word('optional'))); for ($i = 0; $i <= $num; $i++) { $i > 0 ? $style = " style='display:none'" : ($style = ''); $s .= div(input("media_title[{$i}]", 'text', "size='20' maxlength='35'", null) . ' ' . input("filename[{$i}]", 'file', "size='20'", null), "class='attachFiles' id='fileInput{$i}'{$style}"); } $s .= p(href($OBJ->lang->word('attach more'), 'javascript:AddFileInput()'), "class='attachMore' id='attachMoreLink'"); return $s; }
} else { ?> <h3 class="hndle"><span>Inserir Badge</span></h3> <div class="inside"> <?php echo label('description', 'Descrição', input_textarea_simples('description', 5, $_POST['description'])); echo label('alias', 'Alias', input_texto_simples('alias', 'Alias', 40, $_POST['alias'])); echo label('allow_repetitions', 'Permite Repetição', input_checkbox_padrao('allow_repetitions', 'Permite Repetição')); echo label('reach_required_repetitions', 'Repetições Requeridas', input_texto_simples('reach_required_repetitions', '', 5, $_POST['reach_required_repetitions'])); // Badge $badges = Gamification::getInstance()->getBadgesArray(); echo label('id_each_badge', 'Badge - para cada', input_select_simples('id_each_badge', 'Badge - para cada', $badges)); echo label('id_reach_badge', 'Badge - ao alcançar', input_select_simples('id_reach_badge', 'Badge - ao alcançar', $badges)); echo label('each_points', 'Pontos - para cada', input_texto_simples('each_points', '', 5, $_POST['each_points'])); echo label('reach_points', 'Pontos - ao alcançar', input_texto_simples('reach_points', '', 5, $_POST['reach_points'])); // 'each_callback' => 'Callback - para cada', // 'reach_callback' => 'Callback - ao alcançar', ?> </div> <div id="major-publishing-actions"> <div id="publishing-action"> <span class="spinner"></span> <input type="submit" name="publish" id="publish" class="button button-primary button-large" value="Salvar" accesskey="p"> </div> <div class="clear"></div> </div> <?php
echo '<input type="reset" value="' . $alang['common_reset'] . '">'; echo '</div>'; echo '</form>'; } if (!empty($thevalue)) { echo '<form method="post" action="' . $theurl . '" name="thevalueform" enctype="multipart/form-data">'; echo '<input type="hidden" name="formhash" value="' . formhash() . '">'; echo '<table cellspacing="0" cellpadding="0" width="100%" class="maintable">'; echo '<tr id="tr_subject"><th>' . $alang['sitemap_name'] . '</th><td><input type="text" name="mapname" size="30" value="' . $thevalue['mapname'] . '"></td></tr>'; echo '<tr id="tr_subject"><th>' . $alang['sitemap_type'] . '</th><td><input type="radio" name="maptype" size="30" value="baidu" ' . ($thevalue['maptype'] == 'baidu' ? 'checked' : '') . ' onclick="changemaptype(this)">Baidu <input type="radio" name="maptype" size="30" value="google" ' . ($thevalue['maptype'] == 'google' ? 'checked' : '') . ' onclick="changemaptype(this)">Google</td></tr>'; echo '<tbody id="typehtml_baidu" style="display:' . $baidu_style . '">'; echo '<tr id="tr_subject"><th>' . $alang['sitemap_changefreq'] . '</th><td><input type="text" name="changefreq_baidu" value="' . (is_numeric($thevalue['changefreq']) ? $thevalue['changefreq'] : 15) . '" id="changefreq_baidu"></td></tr>'; echo '<tr id="tr_subject"><th>' . $alang['sitemap_num'] . '</th><td><input type="text" name="mapnum_baidu" size="30" value="' . (empty($thevalue['mapnum']) ? 100 : $thevalue['mapnum']) . '"></td>'; echo '</tbody>'; echo '<tbody id="typehtml_google" style="display:' . $google_style . '">'; echo label(array('type' => 'select', 'name' => 'changefreq_google', 'options' => $options, 'value' => $thevalue['changefreq'], 'alang' => $alang['sitemap_changefreq'])); echo '<tr id="tr_subject"><th>' . $alang['sitemap_num'] . '</th><td><input type="text" name="mapnum_google" size="30" value="' . (empty($thevalue['mapnum']) ? 5000 : $thevalue['mapnum']) . '"></td>'; echo '</tbody>'; echo '<tr id="tr_subject"><th>' . $alang['sitemap_createtype'] . '</th><td><input id="createtype_baidu" type="radio" name="createtype" size="30" value="0" ' . ($thevalue['createtype'] == 0 ? 'checked' : '') . ' ' . $disabled . '>' . $alang['sitemap_createtype_0'] . ' <input id="createtype_google" type="radio" name="createtype" size="30" value="1" ' . ($thevalue['createtype'] == 1 ? 'checked' : '') . ' ' . $disabled . '>' . $alang['sitemap_createtype_1'] . '</td></tr>'; echo '</table>'; echo '<div class="buttons">'; if ($_GET['op'] == 'edit') { echo '<input type="hidden" name="slogid" value="' . $thevalue['slogid'] . '">'; } echo '<input type="submit" name="thevalue" value="' . $alang['common_submit'] . '" class="submit"> '; echo '<input type="reset" value="' . $alang['common_reset'] . '">'; echo '</div>'; echo '</form>'; } function write($text, $n = 0) {