当前位置: 首页>>代码示例>>PHP>>正文


PHP print_alert函数代码示例

本文整理汇总了PHP中print_alert函数的典型用法代码示例。如果您正苦于以下问题:PHP print_alert函数的具体用法?PHP print_alert怎么用?PHP print_alert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了print_alert函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: set_start

function set_start($idx)
{
    global $URL, $pn;
    $dbh = dbconnect();
    $query = "select poll_idx,status from poll_data where poll_idx={$idx}";
    $sth = dbquery($dbh, $query);
    list($poll_idx, $edate) = dbselect($sth);
    if (!$poll_idx) {
        print_alert("존재하지 않는 데이터입니다.   ", 'back');
        exit;
    } elseif ($status == 1) {
        print_alert("현재 설문중입니다.   ", 'back');
        exit;
    }
    /* 설문 재개 */
    $query = "update poll_data set status='1' where poll_idx={$idx}";
    $sth = dbquery($dbh, $query);
    if (!$sth) {
        $msg = "에러가 발생하였습니다.<br><br>\n" . mysql_error();
        print_message($msg);
    } else {
        header("Location: {$URL['list']}?pn={$pn}");
        exit;
    }
    dbclose($dbh);
    exit;
}
开发者ID:puchon,项目名称:php4-book,代码行数:27,代码来源:modify.php

示例2: login

function login($id, $passwd, $url)
{
    $dbh = dbconnect();
    $query = "select mem_id,mem_pw from member_data where mem_id='{$id}'";
    $sth = dbquery($dbh, $query);
    if (!$sth) {
        print_msg(mysql_error());
    }
    list($mem_id, $mem_pw) = dbselect($sth);
    dbclose($dbh);
    if (!$mem_id) {
        print_alert("해당 ID가 없습니다.  ", 'back');
    } elseif ($mem_pw != $passwd) {
        print_alert("비밀번호가 틀립니다.  ", 'back');
    } else {
        setcookie("MemberID", $mem_id);
        header("Location: {$url}");
    }
    return;
}
开发者ID:puchon,项目名称:php4-book,代码行数:20,代码来源:login.php

示例3: view_result

function view_result($idx)
{
    global $URL;
    $dbh = dbconnect();
    /* 설문 내용 뽑기 */
    $query = "select * from poll_data where poll_idx={$idx}";
    $sth = dbquery($dbh, $query);
    list($poll_idx, $question, $sdate, $edate, $status, $answer_no, $answer[1], $answer[2], $answer[3], $answer[4], $answer[5], $answer[6], $answer[7], $answer[8], $answer[9], $answer[10]) = dbselect($sth);
    if (!$poll_idx) {
        print_alert("잘못된 설문번호입니다.   ", 'back');
        exit;
    }
    /* 결과 뽑기 */
    $query = "select answer,count(answer) from poll_result where poll_idx={$idx} group by answer";
    $sth = dbquery($dbh, $query);
    while (list($answer_num, $count) = dbselect($sth)) {
        $RESULT[$answer_num] = $count;
        $sum += $count;
    }
    /* 결과 화면 출력 */
    print_header();
    echo "\n<table border=1 bordercolor=white bordercolorlight=silver cellpadding=3 cellspacing=0 width=350>\n<tr><td colspan=2 bgcolor=f6f6f6 align=center><font size=2><b>설문 결과</b><br><br>{$question}</b></font></td></tr>\n";
    for ($i = 1; $i <= $answer_no; $i++) {
        $result_count = $RESULT[$i];
        if (!$result_count) {
            $result_count = 0;
        }
        if ($sum) {
            $ratio = round($result_count / $sum * 100, 0);
            $width = $ratio * 2;
        } else {
            $sum = 0;
            $ratio = 0;
            $width = 0;
        }
        echo "\n<tr><td width=300><font size=2>{$i}. {$answer[$i]}<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;<img src=\"{$URL['home']}/icon/bar{$i}.gif\" width='{$width}' height=10> ({$result_count})</font></td>\n    <td width=50 align=right><font size=2 color=NAVY>{$ratio}%</font></td>\n</tr>\n";
    }
    echo "\n<tr><td colspan=2 bgcolor=f6f6f6 align=right><font size=2>총 투표 수 : {$sum}</font>\n</td></tr>\n</table>\n<center>\n<input type=button value=\"   닫   기   \" onClick=\"window.close();\">\n<!--a href=\"javascript:this.close();\">[닫기]</a-->\n";
    print_footer();
}
开发者ID:puchon,项目名称:php4-book,代码行数:40,代码来源:result.php

示例4: header

	회원관리 (회원정보 수정)
	2001.06 by Jungjoon Oh
*/
require "db-lib.php";
require "mem-lib.php";
if (!$MemberID) {
    header("Location: member_edit_form.php");
    exit;
}
// 데이타 확인
$dbh = dbconnect();
$query = "select mem_id from member_data where mem_id='{$MemberID}'";
$sth = dbquery($dbh, $query);
if (!$sth) {
    print_alert(mysql_error(), 'back');
}
list($mem_id) = dbselect($sth);
// 존재하지 않을때
if (!$mem_id) {
    print_alert("존재하지 않는 ID 입니다.", 'back');
    exit;
}
$query = "update member_data set " . "mem_pw='{$passwd}'," . "mem_name='{$name}'," . "mem_email='{$email}'," . "mem_url='{$url}'," . "mem_tel='{$tel}'," . "mem_hp='{$hp}'," . "mem_addr1='{$addr1}'," . "mem_addr2='{$addr2}'," . "mem_zip='{$zip1}-{$zip2}' " . "where mem_id='{$MemberID}'";
// Update
$sth = dbquery($dbh, $query);
if (!$sth) {
    print_alert(mysql_error(), 'back');
} else {
    print_alert("수정이 완료되었습니다.   ", "url|mem_edit_form.php");
}
exit;
开发者ID:puchon,项目名称:php4-book,代码行数:31,代码来源:mem_edit.php

示例5: print_alert

if (!$sth) {
    print_alert(mysql_error(), 'back');
}
$data = dbselect($sth);
for ($i = 0; $i <= 16; $i++) {
    $data[$i] = ereg_replace("\"", "'", $data[$i]);
}
list($nc_index, $nc_group, $nc_id, $nc_date, $nc_name, $nc_company, $nc_depart, $nc_title, $nc_tel, $nc_fax, $nc_hp, $nc_email, $nc_url, $nc_address, $nc_relation, $nc_note, $nc_pub) = $data;
// 존재하지 않을때
if (!$nc_index) {
    print_alert("데이터가 존재하지 않습니다.", 'stop');
    exit;
}
// 등록한 사람이 아닐때
if ($mem_id != $nc_id) {
    print_alert("명함을 등록한 사람만 수정할수있습니다.   ", 'back');
    exit;
}
$name = "nc_pub" . $nc_pub;
${$name} = "checked";
$name = "nc_group" . $nc_group;
${$name} = "selected";
print_header("명함수정");
print_location_bar("명함수정");
?>


<script language="JavaScript">
<!--

function calLength(str)
开发者ID:puchon,项目名称:php4-book,代码行数:31,代码来源:nc_edit_form.php

示例6: print_alert

<?php

/*
	게시판 (글목록)
	2001.06 by Jungjoon Oh
*/
require "db-lib.php";
require "bbs-lib.php";
if (!$db) {
    print_alert("DB를 지정하셔야 합니다.", 'back');
    exit;
}
if (!$m) {
    $m = 'list';
}
/* Table 이름 지정 */
$table_name = "bbs_" . $db;
if (!$pn) {
    $pn = 1;
}
/* DB접속 */
$dbh = dbconnect();
$from_string = "from=list";
$start_num = ($pn - 1) * $max_list;
$end_num = $pn * $max_list;
/* 전체 글수 */
$query = "select count(idx) from {$table_name}";
$sth = dbquery($dbh, $query);
list($total_count) = dbselect($sth);
/* 데이터 $max_list 만큼 뽑아서 @LIST_DATA 에 저장. */
$query = "select {$column} from {$table_name} order by idx desc,replynum limit {$start_num},{$max_list}";
开发者ID:puchon,项目名称:php4-book,代码行数:31,代码来源:list.php

示例7: elseif

if (!$id) {
    $errmsg .= "* ID를 입력해주세요.\\n";
} elseif (!check_id($id)) {
    $errmsg .= "* 이미 사용중인 ID입니다.\\n";
}
if (!$name) {
    $errmsg .= "* 성명을 입력해주세요.\\n";
}
if (!$idnum1 || !$idnum2) {
    $errmsg .= "* 주민등록번호를 입력해주세요.\\n";
} elseif (!check_idnum("{$idnum1}{$idnum2}")) {
    $errmsg .= "* 이미 등록된 주민등록번호입니다.\\n";
}
if ($errmsg) {
    $errmsg = "- 아래의 사항을 확인하세요\\n\\n" . $errmsg;
    print_alert($errmsg, 'back');
}
$dbh = dbconnect();
if ($zip1 && $zip2) {
    $zip = "{$zip1}-{$zip2}";
}
// Make Query
$query = "insert into member_data " . "(mem_id,mem_pw,mem_date,mem_name,mem_idnum,mem_email," . "mem_url,mem_tel,mem_hp,mem_addr1,mem_addr2,mem_zip) values " . "('{$id}','{$passwd}',sysdate(),'{$name}','{$idnum1}-{$idnum2}','{$email}'," . "'{$url}','{$tel}','{$hp}','{$addr1}','{$addr2}','{$zip}')";
$sth = dbquery($dbh, $query);
if (!$sth) {
    $msg = "에러가 발생하였습니다.<br>\n" . mysql_error();
    print_message($msg, "에러");
} else {
    $msg = "\n<table width=500 align=center>\n<tr><td><center><b>등록이 완료되었습니다.</b></center><br><br>\n    </td>\n</tr>\n</table>\n";
    print_message($msg, "회원등록");
}
开发者ID:puchon,项目名称:php4-book,代码行数:31,代码来源:mem_register.php

示例8: lang

<div class="row">
	<!-- TITULO DE GESTION DE USUARIOS -->
	<div style="margin-top: 15px" class="col-md-10 col-md-offset-1">
		<h1><strong><?php echo lang('user.gestion') ?></strong></h1><br />
		<h2 style="color: #424242"><?php echo lang('user.watch') ?></h2>
		<?php if($this->session->flashdata('success_delete')) : ?>
			<?php print_alert('Usuario eliminado con éxito','success') ?>
		<?php endif ?>
		<?php if($this->session->flashdata('success_edit')) : ?>
			<?php print_alert('Datos de usuario editados con éxito','success') ?>
		<?php endif ?>
	</div>
	
	<!-- TABLA DE USUARIOS REGISTRADOS -->
	<div class="col-md-10 col-md-offset-1 table-responsive" style="margin-top: 15px">
		<table class="table table-bordered">
			<thead>
				<tr>
					<th><a href=""><?php echo lang('id') ?></a></th>
					<th><a href=""><?php echo lang('nombre') ?></a></th>
					<th><a href=""><?php echo lang('rol') ?></a></th>
					<th><a href=""><?php echo lang('status') ?></a></th>
					<th><a href=""><?php echo lang('fecha_creacion') ?></a></th>
					<th style="text-align: center"><a href=""><?php echo lang('eliminar') ?></a></th>
				</tr>
			</thead>
			<tbody>
				<?php if(isset($usuarios) && !empty($usuarios)) : ?>
					<?php foreach($usuarios as $key => $user) : ?>
						<?php
							if($user->id_estado == 1) $color = '088A08';
开发者ID:kelgwiin,项目名称:tesis,代码行数:31,代码来源:usuario_ver.php

示例9: foreach

        ###### Bei Reload variablen neu befüllen #######
        foreach ($_POST as $key => $val) {
            ${$key} = $val;
        }
    }
}
print "\n<div class='popup'>\n\t<form action='index.php?" . $_SERVER['QUERY_STRING'] . "' method='post'>\n\t\t<div class='popup-head'>\n\t\t\t<i class='icon-popup'></i>" . v('CMT_HEADLINE_' . strtoupper($action));
if (isset($id)) {
    print "<span># " . $id . "</span>";
}
print "\n\t\t</div><!-- /.popup-head -->\n\t\t<div class='popup-content'>";
if (isset($alert)) {
    print print_alert('error', v('CMT_HEADLINE_SAVE_ERROR'), v('CMT_TEXT_SAVE_ERROR'));
}
if (isset($success)) {
    print print_alert('success', v('CMT_HEADLINE_SAVE_SUCCESS'), v('CMT_TEXT_SAVE_SUCCESS'));
}
if (!isset($c_active)) {
    $c_active = 1;
}
if (!isset($language)) {
    $language = CMT_USER_LANGUAGE;
}
if (isset($update_parent)) {
    $formdata['update_parent'] = array('type' => 'hidden', 'value' => 1);
}
$formdata['date'] = array('type' => 'datepicker', 'label' => v('CMT_DATE'), 'parent_class' => 'date', 'value' => array('date' => date('d.m.Y', $date), 'time' => date('H:i', $date)));
$formdata['title'] = array('type' => 'text', 'label' => v('CMT_TITLE'), 'style' => array('class' => "col-3_of_7"));
$formdata['content'] = array('type' => 'textarea', 'label' => v('CMT_CONTENT'));
$formdata['c_active'] = array('type' => 'checkbox', 'label' => v('CMT_ACTIVE'));
foreach ($formdata as $key => $val) {
开发者ID:entire-media,项目名称:comator,代码行数:31,代码来源:engine_cmt_labels.php

示例10: dbconnect

}
// 데이타 가져오기
$dbh = dbconnect();
$query = "select * from member_data where mem_id='{$MemberID}'";
$sth = dbquery($dbh, $query);
if (!$sth) {
    print_alert(mysql_error(), 'back');
}
$data = dbselect($sth);
for ($i = 0; $i <= 11; $i++) {
    $data[$i] = ereg_replace("\"", "'", $data[$i]);
}
list($mem_id, $mem_pw, $mem_date, $mem_name, $mem_idnum, $mem_email, $mem_url, $mem_tel, $mem_hp, $mem_addr1, $mem_addr2, $mem_zip) = $data;
// 존재하지 않을때
if (!$mem_id) {
    print_alert("존재하지 않는 ID 입니다.", 'back');
    exit;
}
list($mem_zip1, $mem_zip2) = split("-", $mem_zip);
?>


<html>
<head>
<title>회원가입</title>

<script language="JavaScript">
<!--
function OpenZipcode(){
        window.open("zip/zipcode.php?form=f&zip1=zip1&zip2=zip2&address=addr1","ZipWin","width=480,height=200,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}
开发者ID:puchon,项目名称:php4-book,代码行数:31,代码来源:mem_edit_form.php

示例11: print_alert

    print_alert(mysql_error(), 'back');
}
list($d_idx, $d_passwd, $d_filename) = dbselect($sth);
/* 존재하지 않을때 */
if (!$idx) {
    print_alert("데이터가 존재하지 않습니다.", 'stop');
} elseif ($passwd != $d_passwd && $passwd != $admin_passwd) {
    print_alert("비밀번호가 일치하지 않습니다.   ", 'back');
}
/* 파일 등록 여부 확인 */
if ($d_filename) {
    unlink("{$upload_path}/{$db}/{$d_filename}");
}
/* 글 삭제 */
$query = "delete from {$table_name} where idx={$idx}";
/* 첫번째 글이 아닌경우 */
if ($rn != 1) {
    $query .= " and replynum={$rn}";
}
$sth = dbquery($dbh, $query);
if (!$sth) {
    print_alert(mysql_error(), 'back');
} else {
    print_alert("삭제가 완료되었습니다.   ", "opener|{$url}");
}
exit;
function passwd_form($db, $idx, $rn, $back_url)
{
    global $URL;
    echo "\n<html>\n<head><title>비밀번호 확인</title>\n<script language=JavaScript>\nfunction check_form()\n{\n\tif (document.pwform.passwd.value =='')\n\t{\n\t\talert('비밀번호를 입력하세요.    ');\n\t\treturn false;\n\t}\n\treturn true;\n}\n</script>\n</head>\n\n<body onLoad='document.pwform.passwd.focus();'>\n<center>\n<font size=2 color=NAVY>글 작성시 입력했던 비밀번호를 입력하세요.</font>\n<form method=POST name=pwform action='{$URL['delete']}' onSubmit='return check_form();'>\n<input type=hidden name=db value='{$db}'>\n<input type=hidden name=idx value='{$idx}'>\n<input type=hidden name=rn value='{$rn}'>\n<input type=hidden name=url value='{$back_url}'>\n<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=300>\n<TR><TD ALIGN=center VALIGN=middle>\n    <FONT SIZE=2><B>비밀번호</B></FONT> \n    <INPUT TYPE=password NAME=passwd SIZE=15 MAXLENGTH=10>\n    </TD>\n</TR>\n<TR><TD>&nbsp;</TD></TR>\n<TR><TD ALIGN=center VALIGN=middle>\n    <INPUT TYPE=submit VALUE=' 삭제하기 '>\n    <INPUT TYPE=button NAME=exitBtn VALUE=' 취소 '><br><br>\n    <font size=2 color=RED>주의 : 답변이 있는 글은 답변까지 모두 지워집니다.</font>\n    </TD>\n</TR>\n</TABLE>\n</body>\n</html>\n";
}
开发者ID:puchon,项目名称:php4-book,代码行数:31,代码来源:delete.php

示例12: header

if (!$idx) {
    header("Location: {$URL['list']}\n\n");
    exit;
}
// 데이타 확인
$dbh = dbconnect();
$query = "select nc_index,nc_id from namecard where nc_index={$idx}";
$sth = dbquery($dbh, $query);
if (!$sth) {
    print_alert(mysql_error(), 'back');
}
list($nc_index, $nc_id) = dbselect($sth);
// 존재하지 않을때
if (!$nc_index) {
    print_alert("데이터가 존재하지 않습니다.", 'stop');
    exit;
}
// 등록한 사람이 아닐때
if ($mem_id != $nc_id) {
    print_alert("명함을 등록한 사람만 수정할수있습니다.   ", 'back');
    exit;
}
$query = "update namecard set " . "nc_group='{$nc_group}'," . "nc_name='{$nc_name}'," . "nc_company='{$nc_company}'," . "nc_depart='{$nc_depart}'," . "nc_title='{$nc_title}'," . "nc_tel='{$nc_tel}'," . "nc_fax='{$nc_fax}'," . "nc_hp='{$nc_hp}'," . "nc_email='{$nc_email}'," . "nc_url='{$nc_url}'," . "nc_address='{$nc_address}'," . "nc_relation='{$nc_relation}'," . "nc_note='{$nc_note}'," . "nc_pub='{$nc_pub}' " . "where nc_index={$nc_index}";
// Update
$sth = dbquery($dbh, $query);
if (!$sth) {
    print_alert(mysql_error(), 'back');
} else {
    print_alert("수정이 완료되었습니다.   ", "url|{$url}");
}
exit;
开发者ID:puchon,项目名称:php4-book,代码行数:31,代码来源:nc_edit.php

示例13:

<div id="page-wrapper">
	<div class="col-lg-12">
		<h1>Gestión de Continuidad del Negocio</h1>
		<?php
			echo $breadcrumbs;
			$message = "Permite la gestión y elaboración de planes de acción, prevención y recuperación de los servicios del negocio en caso de desastres.";
			print_alert($message);
		?>
	</div>
	<div class="row">
		<!-- <a href="<?php echo site_url('index.php/continuidad/backup') ?>">Respaldar Base de Datos</a> -->
		<div class="col-lg-4 col-lg-offset-4">
			<div class="panel panel-primary">
				<div class="panel-heading">
					<div class="row">
						<div class="col-xs-6">
							<i class="fa fa-save fa-5x"></i>
						</div>
						<div class="col-xs-6 text-center">
							<p class="announcement-text">Respaldar la Base de Datos del Sistema</p>
						</div>
					</div>
				</div>
				<a href="<?php echo site_url('index.php/continuidad/respaldos') ?>">
					<div class="panel-footer announcement-bottom">
						<div class="row">
							<div class="col-xs-6">
								Examinar
							</div>
							<div class="col-xs-6 text-right">
								<i class="fa fa-arrow-circle-right"></i>
开发者ID:kelgwiin,项目名称:tesis,代码行数:31,代码来源:descripcion.php

示例14: header

            $success = true;
            header('location: index.php?setup=success');
        } else {
            foreach ($_POST as $key => $val) {
                ${$key} = $val;
            }
        }
    }
}
print "<div class='setup'>";
print "<form action='index.php?step=" . $step . "' method='post'>\n\t\t\t\t<div class='setup-head'>\n\t\t\t\t\t<i class='icon-setup'></i>SETUP\n\t\t\t\t</div><!-- /.setup-head -->\n\t\t\t\t<div class='setup-content'>";
if (isset($alert)) {
    print print_alert('error', 'Speichervorgang fehlgeschlagen', 'Der Eintrag wurde nicht gespeichert.');
}
if (isset($success)) {
    print print_alert('success', 'Speichervorgang erfolgreich', 'Der Eintrag wurde erfolgreich gespeichert.');
}
if ($step == 1) {
    $formdata['db_dbname'] = array('type' => 'text', 'label' => 'Datenbankname', 'label_after' => '(Name der Datenbank)', 'style' => array('class' => "col-3_of_7"), 'settings' => array('attributes' => array('autofocus' => 'autofocus')));
    $formdata['db_user'] = array('type' => 'text', 'label' => 'Benutzername', 'label_after' => '(MySQL Benutzername)', 'style' => array('class' => "col-3_of_7"));
    $formdata['db_password'] = array('type' => 'password', 'label' => 'Passwort', 'label_after' => '(MySQL Passwort)', 'style' => array('class' => "col-3_of_7"));
    $formdata['db_host'] = array('type' => 'text', 'label' => 'Datenbank Host', 'label_after' => '(z.B. localhost oder IP/Domain)', 'value' => 'localhost', 'style' => array('class' => "col-3_of_7"));
} elseif ($step == 2) {
    $formdata['username'] = array('type' => 'text', 'label' => 'Benutzername', 'style' => array('class' => "col-3_of_7"));
    $formdata['password'] = array('type' => 'password', 'label' => 'Passwort', 'style' => array('class' => "col-3_of_7"));
    $formdata['first_name'] = array('type' => 'text', 'label' => 'Vorname', 'style' => array('class' => "col-3_of_7"));
    $formdata['last_name'] = array('type' => 'text', 'label' => 'Nachname', 'style' => array('class' => "col-3_of_7"));
    $formdata['street'] = array('type' => 'text', 'label' => 'Stra&szlig;e/Hausnummer', 'parent_class' => 'free_space', 'style' => array('width' => '292'));
    $formdata['street_number'] = array('type' => 'text', 'style' => array('class' => "align-right", 'width' => '56'));
    $formdata['zip'] = array('type' => 'text', 'label' => 'Postleitzahl/Ort', 'parent_class' => 'free_space', 'style' => array('width' => '196'));
    $formdata['city'] = array('type' => 'text', 'style' => array('width' => '152'));
开发者ID:entire-media,项目名称:comator,代码行数:31,代码来源:setup.php

示例15: print_form


//.........这里部分代码省略.........
            }
            if (!isset($data['id'])) {
                $data['id'] = $key;
            }
            if (!isset($data['class'])) {
                $data['class'] = $key;
            }
            $data['style']['id'] = $data['id'];
            if (isset($data['style']['class'])) {
                $data['style']['class'] .= " " . $data['class'];
            } else {
                $data['style']['class'] = $data['class'];
            }
            if ($data['type'] != 'hidden') {
                print "<div class='form_element ";
                if (isset($data['parent_class'])) {
                    print $data['parent_class'] . " ";
                }
                if (isset($data['settings']['alert'])) {
                    if (is_array($data['settings']['alert'])) {
                        print $data['settings']['alert']['type'] . " ";
                    } else {
                        print $data['settings']['alert'] . " ";
                    }
                }
                print "'>";
                if (isset($data['label'])) {
                    print "\n\t\t\t\t\t<div class='form_field_label'>\n\t\t\t\t\t\t<label for='" . $data['id'] . "'>" . $data['label'] . "</label>\n\t\t\t\t\t</div>";
                }
                print "<div class='form_field'>";
            }
            if (isset($data['label_before'])) {
                print "<div class='form_label_before'>" . $data['label_before'] . "</div>";
            }
            if (!isset($data['settings'])) {
                $data['settings'] = NULL;
            }
            switch ($data['type']) {
                case 'hidden':
                    print form_hidden($key, $data['style'], $data['value']);
                    break;
                case 'int':
                    print form_text($key, $data['style'], $data['value'], $data['settings']);
                    break;
                case 'text':
                    print form_text($key, $data['style'], $data['value'], $data['settings']);
                    break;
                case 'textarea':
                    print form_textarea($key, $data['style'], $data['value'], $data['settings']);
                    break;
                case 'checkbox':
                    print form_checkbox($key, $data['style'], $data['value'], $data['settings']);
                    break;
                case 'select':
                    print form_select($key, $data['style'], $data['value'], $data['settings']);
                    break;
                case 'radio':
                    print form_radiogroup($key, $data['style'], $data['value'], $data['settings']);
                    break;
                case 'password':
                    print form_password($key, $data['style'], $data['value'], $data['settings']);
                    break;
                case 'filter-date':
                    filter_date($data['value'], $data['settings']);
                    break;
                case 'datepicker':
                    datepicker($data['value'], $data['settings']);
                    break;
                case 'input_add':
                    print form_text("key_" . $key, $data['style'], $data['value']['key'], $data['settings']);
                    print form_text("value_" . $key, $data['style'], $data['value']['value'], $data['settings']);
                    if (isset($data['settings']['number'])) {
                        print "<i class='icon-inputadd' id='" . $data['settings']['number'] . "'></i>";
                    }
                    break;
                case 'upload':
                    print form_upload($key);
                    break;
            }
            if (isset($data['label_after'])) {
                print "<div class='form_label_after'>" . $data['label_after'] . "</div>";
            }
            if ($data['type'] != 'hidden') {
                print "\n\t\t\t\t\t</div>\n\t\t\t\t</div>";
                if (isset($data['settings']['alert'])) {
                    if (is_array($data['settings']['alert'])) {
                        if (isset($data['settings']['alert']['text'])) {
                            print print_alert($data['settings']['alert']['type'], $data['settings']['alert']['label'], $data['settings']['alert']['text']);
                        } else {
                            print print_alert($data['settings']['alert']['type'], v('CMT_HEADLINE_' . $data['settings']['alert']['label'] . '_ERROR'), v('CMT_TEXT_' . $data['settings']['alert']['label'] . '_ERROR'));
                        }
                    } else {
                        print print_alert($data['settings']['alert'], v('CMT_HEADLINE_REQUIRED_ERROR'), v('CMT_TEXT_REQUIRED_ERROR'));
                    }
                }
            }
        }
        print "</div>";
    }
}
开发者ID:entire-media,项目名称:comator,代码行数:101,代码来源:form.inc.php


注:本文中的print_alert函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。