$smarty = new Smarty; $smarty->compile_dir ='../templates_c'; $smarty->assign('lang_arr',$_LANG); #獲取網站基本信息 $get_web_basic_info=get_web_basic_info(); $smarty->assign('web_basic_info',get_web_basic_info()); #獲取佈局模組 //check_limit();#檢驗訪問權限 $Modules=get_modules("left_modules",$layout_id=0); $smarty->assign('modules',$Modules); if($_REQUEST['type']=='detail'){ $smarty->assign('list_data',show_data_all()); }else{ $smarty->assign('list_data',show_data()); } $smarty->assign('list_data2',show_school_name()); $smarty->assign('top_menu',get_top_menu());#top單級選單 $smarty->assign('top_multiple_menu_module',get_multiple_menu());#top多級選單 $smarty->assign('marquee_js',get_marquee_modules());#獲取跑馬燈js //$smarty->assign('nav',get_multiple_menu_nav($info_p_id)); function show_school_name(){ global $db,$smarty; $sql="select *from new_ziping_table"; $data = $db->fetch_all_array($sql);
} else { $data['employee_code'] = '<span class="label label-success">○</span>'; } if (!isset($list_emp[$row['person_id']]) || !$list_emp[$row['person_id']]['work_confirmation']) { $data['work_confirmation'] = '<span class="label label-danger">×</span>'; $check = false; } else { $data['work_confirmation'] = '<span class="label label-success">○</span>'; } if ($check) { return true; } return $data; } foreach ($person_list as $row) { $data = show_data($row, $employment_list); if ($data === true) { continue; } ?> <tr> <td><a href="<?php echo \Fuel\Core\Uri::base(); ?> job/employment?person_id=<?php echo $row['person_id']; ?> "><?php echo $row['name']; ?> </a></td>
<?php function show_data($id) { $suzuki = array(1, '鈴木', '平成2年2月2日', '東京都'); $sato = array(2, '佐藤', '平成3年3月3日', null); $yamada = array(3, '山田', '平成4年4月4日', '千葉県'); $member = array($suzuki, $sato, $yamada); return $member[$id - 1]; } $limit = 2; $array = array(1, 2, 3); foreach ($array as $id) { $array_data = show_data($id); foreach ($array_data as $key => $value) { if ($key == 0 || $value == null) { continue; } echo "{$value} <br>"; } if ($id == $limit) { break; } }
case "edit": edit_form(); break; case "save": case "apply": save_form($task); break; case "create_table": case "save_table": create_table($task); break; case "list_data": list_data($task); break; case "show_data": show_data($task); break; case "delete_data": delete_data($task); break; case "publish": case "unpublish": publish($task); break; case "validatelicense": validatelicense($task); break; case "backup_forms": backup_forms(); break; case "restore_forms":
<?php function show_data($id) { $suzuki = array(1, '鈴木', '平成2年2月2日', '東京都'); $sato = array(2, '佐藤', '平成3年3月3日', null); $yamada = array(3, '山田', '平成4年4月4日', '千葉県'); $member = array($suzuki, $sato, $yamada); return $member[$id - 1]; } $limit = 2; $array = array(1, 2, 3); foreach ($array as $id) { foreach (show_data($id) as $key => $value) { if ($key == 0 || $value == null) { continue; } echo "{$value} <br>"; } if ($id == $limit) { break; } }
?> </select> </td></tr> <tr><td>Calls more than</td><td><input name="callcount" value='<?php echo $callcount; ?> ' type="text"></td></tr> <tr><td>Show Numbers</td><td><input type="checkbox" name="shownum" /> <tr colspan=2><td><input type="submit"></td></tr> <tr colspan=2><td><button onclick="openWindow()">Show Detailed Data</button></td></tr> </table> <hr> </form> <?php include 'function.php'; show_data($conn, $_REQUEST, 0); } ?> <div id="chartContainer" style="height: 600px; width: 100%;"> <!--</table>--> <script> var opt = { Chart:{ }, title:{ text: "Text" }, axis:{}, data: [
<?php if (!isset($_SESSION["settings"]) or isset($_SESSION["data_written"])) { echo "<h3> Bitte beginnen Sie von vorne! </h3>"; print_button("index.php", "button_check_data", "zurück"); echo create_footer(""); exit(0); } ?> <h3>2. Schritt: Daten eingeben</h3> <div align='left' id='datainputdiv'> <?php if (isset($_POST["button_check_data"])) { if ($check["value"] == 0 and !isset($_POST["button_change_data"])) { show_data(); echo "<table border='0'><tr><td>"; print_button($_SERVER['PHP_SELF'], "button_change_data", "Ändern"); echo "</td><td>"; print_button($nextpage, "button_check_data", "Daten sind vom Lehrer überprüft"); echo "</td><td>"; print_button($_SERVER['PHP_SELF'], "data_input", "zurück"); echo "</td></tr></table>"; } else { echo $check["msg"]; print_data_input_formular($_SERVER['PHP_SELF'], $classes, $lastpage); //print_button($lastpage, "data_input", "zurück"); } } else { print_data_input_formular($_SERVER['PHP_SELF'], $classes, $lastpage); //print_button($lastpage, "data_input", "zurück");
<?php function show_data() { $id = 1; $name = '鈴木'; $birthday = '平成2年2月2日'; $address = '東京都'; return array($id, $name, $birthday, $address); } $results = show_data(); foreach ($results as $key => $value) { if ($key == 0) { continue; } echo "{$value} <br>"; }
// Close Element case "closeupdat": if ($_SESSION['ticket_user_is_admin'] > 0) { print "<!-- Closing the selected Element -->"; close_element($id, $action, $GLOBALS['MAIN_TABLE']); //,$page); } else { do_title(ucfirst($action) . "ing " . $GLOBALS['ELEMENT'] . " "); // . $temp_trailing); print '<p class="severity_high">You are not allowed to Add nor Modify existing information'; } break; case '': // Show entry print "<!-- Showing the selected Element -->"; require_once 'functions03.inc'; $i = show_data($id, $GLOBALS['MAIN_TABLE'], $title, $page, $start_id); // List Option from current Element $SQL_option = " AND `{$linking_field}` = {$id} "; mysql_open("{$mysql_db}", "{$mysql_user}", "{$mysql_passwd}"); edit_option("", "add", $id); mysql_open_next("{$mysql_db_next}", "{$mysql_user_next}", "{$mysql_passwd_next}"); do_title($GLOBALS['OPTION'] . "s belonging to this " . $GLOBALS['ELEMENT'] . ". Click on date to edit action", 0); // Do not generate HTML headers (the "0") list_option($SQL_option); break; } } powered(); // Print "Powered by" and end the HTML page die;
} $result = mysql_query($query) or do_error('search.php', 'search query <br>"' . $query . '"<br>failed, possibly illegal syntax', mysql_error()); if ($debug) { print '<br>mysql_num_rows($result) ="' . mysql_num_rows($result) . "\" \n "; } switch (mysql_num_rows($result)) { case 0: // No tickets found print '<H3>No matching tickets found.</H3>'; //do_title('No matching tickets found with query: "'.$_POST[frm_query].'"'); break; case 1: // display ticket in whole if just one returned $row = mysql_fetch_array($result); //show_ticket($row[id]); show_data($row[id], $GLOBALS['MAIN_TABLE'], $GLOBALS['ELEMENT'], $page, $start_id = 0); //add_footer($row[id]); powered(); exit; break; default: do_title('Search results for "' . $_POST[frm_query] . '"'); $result_fields = array("Ticket", "Date", "Severity", "Description", "Affected", "Owner", "Closed?"); $ticket_found = 1; print '<TABLE BORDER="0"><TR>'; for ($i = 0; $i < sizeof($result_fields); $i++) { print '<TD CLASS="td_header">' . $result_field[$i] . '</TD>'; } print "</TR> \n "; while ($row = mysql_fetch_array($result)) { print '<TR><TD><A HREF="' . $GLOBALS['MAIN_PAGE'] . '.php?id=' . $row[id] . '">#' . $row[id] . ' </A></TD>' . " \n ";
<?php function show_data($id) { $suzuki = array(1, '鈴木', '平成2年2月2日', '東京都'); $sato = array(2, '佐藤', '平成3年3月3日', '埼玉県'); $yamada = array(3, '山田', '平成4年4月4日', '千葉県'); $member = array($suzuki, $sato, $yamada); return $member[$id - 1]; } $results = show_data(1); foreach ($results as $key => $value) { if ($key == 0) { continue; } echo "{$value} <br>"; }
累乗<input type="radio" name="keisan" value="累乗"> <input type="submit" name="btn" value="計算"> <br><br> </form> <body> <?php //function 関数名($引数1,$引数2,$引数3=デフォルト値) function show_data($num, $secondnum, $type = false) { if ($type === false) { echo $num * $secondnum; } if ($type === true) { echo $num * $secondnum * ($num * $secondnum); } } if (isset($_POST['keisan']) && ($_POST['keisan'] == "掛け算" || $_POST['keisan'] == "累乗")) { if ($_POST['keisan'] == "掛け算") { echo $_POST['no1'] . '×' . $_POST['no2'] . '='; show_data($_POST['no1'], $_POST['no2'], false); } elseif ($_POST['keisan'] == "累乗") { echo '(' . $_POST['no1'] . '×' . $_POST['no2'] . ')' . '×' . '(' . $_POST['no1'] . '×' . $_POST['no2'] . ')' . '='; show_data($_POST['no1'], $_POST['no2'], true); } } ?> </body> </html>
$pdf->Cell(10, $ht, '', 'BR', 1, 'L'); function show_data($pdf, $label, $value = '', $uc = true) { $pdf->Cell(1, 0); $pdf->Cell(7, $pdf->ht, $label, 'BLR', 0, 'L'); if ($uc) { $value = strtoupper($value); } $pdf->Cell(10, $pdf->ht, $value, 'RB', 1, 'L'); } show_data($pdf, 'Established Year', Parish::get()->est_year); show_data($pdf, 'Name of the Parish Priest', $pp->fullname); show_data($pdf, 'No. of Catholics', $members); show_data($pdf, 'No. of Families', $families); show_data($pdf, 'Telephone No.', Parish::get()->phone); show_data($pdf, 'Mobile No.', $pp->mobile); show_data($pdf, 'Email ID', $pp->email, false); show_data($pdf, 'Fax No.'); show_data($pdf, 'Web Site:', Parish::get()->website, false); foreach ($apps as $app) { show_data($pdf, 'Name of the Assistant Parish Priest', $app->fullname); show_data($pdf, 'Mobile No.', $app->mobile); show_data($pdf, 'Email', $app->email, false); } $pdf->SetFont("times", "B", 12); $y = 27; $pdf->Text(2, $y, 'Date:'); $pdf->Text(10, $y, 'Seal'); $pdf->Text(15, $y, 'Signature & Name'); $pdf->Output("parish-profile-{$year}.pdf", "I"); Yii::app()->end();