版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、-作者xxxx-日期xxxx深入PHP与jQuery开发源代码下载(Pro PHP and jQuery source code)【精品文档】深入PHP与jQuery开发源代码下载(Pro PHP and jQuery source code) 看完这本书后觉得内容挺不错的,书中的代码基本上都能实现,为方便广大同仁更好的学习和参考,能以我个人的能力给大家做点贡献我也觉得非常荣幸,欢迎大家踊跃下载!本想免费供大家下载的,可是为了同时也能让我下载更多的学习资料,所以还是决定跟大家要点财富值吧,嘿嘿!下面是这个项目的目录结构!下面是运行效果图:首先是app目录下的文件,代码如下:<?php/*
2、 * Created on 2012-4-24 by xiongxuebing */ include_once './system/core/init.inc.php' if ( !isset($_SESSION'user') ) header("Location: ./"); exit; /* Output the header*/$page_title = "Add/Edit Event"$css_files = array("style.css","admin.css");in
3、clude_once 'assets/common/header.inc.php'/* Load the calendar*/$cal = new Calendar($dbo);?><div id="content"><?php echo $cal->displayForm(); ?></div><!- end #content -><?php/* Output the footer*/include_once 'assets/common/footer.inc.php'?&g
4、t;下面是文件:<?php/* * Created on 2012-4-24 by xiongxuebing */include_once './system/core/init.inc.php' /* Make sure the event ID was passed*/if ( isset($_POST'event_id')&& isset($_SESSION'user') )/* Collect the event ID from the URL string*/$id = (int) $_POST'event
5、_id'else/* Send the user to the main page if no ID is supplied*/header("Location: ./");exit;$cal = new Calendar($dbo);$markup = $cal->confirmDelete($id);/* Output the header*/$page_title = "View Event"$css_files = array("style.css", "admin.css");include
6、_once 'assets/common/header.inc.php'?><div id="content"><?php echo $markup; ?></div><!- end #content -><?php/* Output the footer*/include_once 'assets/common/footer.inc.php'?>I<?php/* * Created on 2012-4-24 by xiongxuebing */ /* Include n
7、ecessary files*/include_once './system/core/init.inc.php'/* Load the calendar for January*/$cal = new Calendar($dbo, "2012-04-01 12:00:00");$page_title = "Events Calendar"$css_files = array('style.css','admin.css','ajax.css');include_once 'asse
8、ts/common/header.inc.php'?><div id="content"><?phpecho $cal->buildCalendar();?></div><!- end #content -><p><?phpecho isset($_SESSION'user') ? "欢迎您,".$_SESSION'user''name'."!" : "还未登录!"?><
9、/p><?php/* Include the footer*/include_once 'assets/common/footer.inc.php'?>L<?php/* * Created on 2012-4-25 by xiongxuebing */* Include necessary files*/include_once './system/core/init.inc.php'/* Output the header*/$page_title = "Please Log In"$css_files = arra
10、y("style.css", "admin.css");include_once 'assets/common/header.inc.php'?> <div id="content"> <form action="assets/inc/process.inc.php" method="post"> <fieldset> <legend>Please Log In</legend> <label for=&qu
11、ot;uname">Username</label> <input type="text" name="uname" id="uname" value="" /> <label for="pword">Password</label> <input type="password" name="pword" id="pword" value="" /
12、> <input type="hidden" name="token" value="<?php echo $_SESSION'token' ?>" /> <input type="hidden" name="action" value="user_login" /> <input type="submit" name="login_submit" value="
13、Log In" /> or <a href="./">cancel</a> </fieldset> </form> </div><!- end #content -><?php/* Output the footer*/include_once 'assets/common/footer.inc.php'?>V<?php/* * Created on 2012-4-24 by xiongxuebing */ if ( isset($_GET'ev
14、ent_id') ) $id = preg_replace('/0-9/', '', $_GET'event_id'); if ( empty($id) ) header("Location: ./"); exit; else header("Location: ./"); exit; include_once './system/core/init.inc.php' $page_title = "View Event" $css_files = array(&q
15、uot;style.css","admin.css"); include_once 'assets/common/header.inc.php' $cal = new Calendar($dbo);?><div id="content"><?php echo $cal->displayEvent($id) ?><a href="./">« Back to the calendar</a></div><!- end
16、 #content -><?phpinclude_once 'assets/common/footer.inc.php'?>下面是app目录assets目录下文件:首先是Commen目录:F<script type="text/javascript" src="assets/js/jquery-1.7.2.js"></script><script type="text/javascript" src="assets/js/valid-date.js"&
17、gt;</script><script type="text/javascript" src="assets/js/init.js"></script></body></html><!DOCTYPE htmlPUBLIC "-/W3C/DTD XHTML 1.0 Strict/EN""/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http:/www.
18、/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type"content="text/html;charset=utf-8" /><title><?php echo $page_title; ?></title><?php foreach ( $css_files as $css ): ?><link rel="
19、stylesheet" type="text/css" media="screen,projection"href="assets/css/<?php echo $css; ?>" /><?php endforeach; ?></head><body>Css目录:Afieldset border: 0;legend font-size: 24px;font-weight: bold;inputtype=text,inputtype=password,label displ
20、ay: block;width: 70%;font-weight: bold;textarea width: 99%;height: 200px;inputtype=text,inputtype=password,textarea border: 1px solid #123;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius: 6px;-moz-box-shadow: inset 1px 2px 4px #789;-webkit-box-shadow: inset 1px 2px 4px #789;box-shad
21、ow: inset 1px 2px 4px #789;padding: 4px;margin: 0 0 4px;font-size: 16px;font-family: georgia, serif;inputtype=submit margin: 4px 0;padding: 4px;border: 1px solid #123;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius: 6px;-moz-box-shadow: inset -2px -1px 3px #345,inset 1px 1px 3px #BC
22、F,1px 2px 6px #789;-webkit-box-shadow: inset -2px -1px 3px #345,inset 1px 1px 3px #BCF,1px 2px 6px #789;box-shadow: inset -2px -1px 3px #345,inset 1px 1px 3px #BCF,1px 2px 6px #789;background-color: #789;font-family: georgia, serif;text-transform: uppercase;font-weight: bold;font-size: 14px;text-sha
23、dow: 0px 0px 1px #fff;.admin-options text-align: center;.admin-options form,.admin-options p display: inline;display: inline-block;margin: 4px 0;padding: 4px;border: 1px solid #123;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius: 6px;-moz-box-shadow: inset -2px -1px 3px #345,inset 1
24、px 1px 3px #BCF,1px 2px 6px #789;-webkit-box-shadow: inset -2px -1px 3px #345,inset 1px 1px 3px #BCF,1px 2px 6px #789;box-shadow: inset -2px -1px 3px #345,inset 1px 1px 3px #BCF,1px 2px 6px #789;background-color: #789;color: black;text-decoration: none;font-family: georgia, serif;text-transform: upp
25、ercase;font-weight: bold;font-size: 14px;text-shadow: 0px 0px 1px #fff;A.modal-overlay position: fixed;top: 0;left: 0;bottom: 0;width: 100%;height: 100%;background-color: rgba(0,0,0,.5);z-index: 4;.modal-window position: absolute;top: 140px;left: 50%;width: 300px;height: auto;margin-left: -150px;pad
26、ding: 20px;border: 2px solid #000;background-color: #FFF;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius: 6px;-moz-box-shadow: 0 0 14px #123;-webkit-box-shadow: 0 0 14px #123;box-shadow: 0 0 14px #123;z-index: 5;.modal-close-btn position: absolute;top: 0;right: 4px;margin: 0;padding
27、: 0;text-decoration: none;color: black;font-size: 16px;.modal-close-btn:before position: relative;top: -1px;content: "Close"text-transform: uppercase;font-size: 10px;S body background-color: #789;font-family: georgia, serif;font-size: 13px;#content display: block;width: 812px;margin: 40px
28、auto 10px;padding: 10px;background-color: #FFF;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius: 6px;border:2px solid black;-moz-box-shadow: 0 0 14px #123;-webkit-box-shadow: 0 0 14px #123;box-shadow: 0 0 14px #123;h2,p margin: 0 auto 14px;text-align: center;ul display: block;clear:
29、left;height: 82px;width: 812px;margin: 0 auto;padding: 0;list-style: none;background-color: #FFF;text-align: center;border: 1px solid black;border-top: 0;border-bottom: 2px solid black;li position: relative;float: left;margin: 0;padding: 20px 2px 2px;border-left: 1px solid black;border-right: 1px so
30、lid black;width: 110px;height: 60px;overflow: hidden;background-color: white;li:hover background-color: #FCB;z-index: 1;-moz-box-shadow: 0 0 10px #789;-webkit-box-shadow: 0 0 10px #789;box-shadow: 0 0 10px #789;.weekdays height: 20px;border-top: 2px solid black;.weekdays li height: 16px;padding: 2px
31、 2px;background-color: #BCF;.fill background-color: #BCD;.weekdays li:hover,li.fill:hover background-color: #BCD;-moz-box-shadow: none;-webkit-box-shadow: none;box-shadow: none;.weekdays li:hover,.today background-color: #BCF;li strong position: absolute;top: 2px;right: 2px;li a position: relative;d
32、isplay: block;border: 1px dotted black;margin: 2px;padding: 2px;font-size: 11px;background-color: #DEF;text-align: left;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius: 6px;z-index: 1;text-decoration: none;color: black;font-weight: bold;font-style: italic;li a:hover background-color
33、: #BCF;z-index: 2;-moz-box-shadow: 0 0 6px #789;-webkit-box-shadow: 0 0 6px #789;box-shadow: 0 0 6px #789;下面是inc目录:首先是<?php/* * Created on 2012-4-25 by xiongxuebing */ /* Enable sessions*/session_start();/* Include necessary files*/include_once './././system/config/db-cred.inc.php'/* Defi
34、ne constants for config info*/foreach ( $C as $name => $val )define($name, $val); $actions = array( 'event_view' => array( 'object' => 'Calendar', 'method' => 'displayEvent' ), 'edit_event' => array( 'object' => 'Calendar&
35、#39;, 'method' => 'displayForm' ), 'event_edit' => array( 'object' => 'Calendar', 'method' => 'processForm' ), 'delete_event' => array( 'object' => 'Calendar', 'method' => 'confirmDelete&
36、#39; ), 'confirm_delete' => array( 'object' => 'Calendar', 'method' => 'confirmDelete' ) );if ( isset($actions$_POST'action') )$use_array = $actions$_POST'action'$obj = new $use_array'object'($dbo); if ( isset($_POST'event_
37、id') ) $id = (int) $_POST'event_id' else $id = NULL; echo $obj->$use_array'method'($id);function _autoload($class_name)$filename = './././system/class/class.'. strtolower($class_name) . '.inc.php'if ( file_exists($filename) )include_once $filename;?>P<?ph
38、p/* * Created on 2012-4-25 by xiongxuebing */ session_start();/* Include necessary files*/ include_once './././system/config/db-cred.inc.php'/* Define constants for config info*/ foreach ( $C as $name => $val ) define($name, $val); $actions = array( 'event_edit' => array( '
39、object' => 'Calendar', 'method' => 'processForm', 'header' => 'Location: ././' ), 'user_login' => array( 'object' => 'Admin', 'method' => 'processLoginForm', 'header' => 'Location: ./
40、./' ), 'user_logout' => array( 'object' => 'Admin', 'method' => 'processLogout', 'header' => 'Location: ././') );/* Make sure the anti-CSRF token was passed and that the* requested action exists in the lookup array*/ if ( $_POST
41、'token'=$_SESSION'token'&& isset($actions$_POST'action') ) $use_array = $actions$_POST'action' $obj = new $use_array'object'($dbo); if (TRUE = $msg=$obj->$use_array'method'() header($use_array'header'); exit; else die ( $msg ); else
42、/ Redirect to the main index if the token/action is invalid header("Location: ././"); exit; function _autoload($class_name) $filename = './././system/class/class.'.strtolower($class_name) . '.inc.php' if ( file_exists($filename) ) include_once $filename; ?>下面是js目录:IjQuer
43、y(function($) var processFile = "assets/inc/ajax.inc.php", fx = "initModal" : function() / If no elements are matched, the length / property will return 0 if ( $(".modal-window").length=0 ) / Creates a div, adds a class, and / appends it to the body tag return $("&
44、lt;div>") .hide() .addClass("modal-window") .appendTo("body"); else return $(".modal-window"); , "boxin" : function(data, modal) $("<div>") .hide() .addClass("modal-overlay") .click(function(event) / Removes event fx.boxout(ev
45、ent); ) .appendTo("body"); modal .hide() .append(data) .appendTo("body"); / Fades in the modal window and overlay $(".modal-window,.modal-overlay") .fadeIn("slow"); , "removeevent" : function() / Removes any event with the class "active" $(
46、".active") .fadeOut("slow", function() $(this).remove(); );, "boxout" : function(event) / If an event was triggered by the element / that called this function, prevents the / default action from firing if ( event!=undefined ) event.preventDefault(); / Removes the active
47、 class from all links $("a").removeClass("active"); / Fades out the modal window, then removes / it from the DOM entirely $(".modal-window,.modal-overlay") .fadeOut("slow", function() $(this).remove(); ); , "addevent" : function(data, formData) /?
48、61;ã?£¤¨¨¡¥¡é?-?|?2¨¨?¡é?a?¡¥1¨¨¡À? var entry = fx.deserialize(formData); cal = new Date(NaN), / Makes a date object for the new event event = new Date(NaN), / Extracts the calendar month from the H2 ID cd
49、ata = $("h2").attr("id").split('-'), / Extracts the event day, month, and year date = entry.event_start.split(' ')0, / Splits the event data into pieces edata = date.split('-'); / Sets the date for the calendar date object cal.setFullYear(cdata1, cdata2, 1
50、); / Sets the date for the event date object event.setFullYear(edata0, edata1, edata2); event.setMinutes(1); if ( cal.getFullYear()=event.getFullYear() && cal.getMonth()=event.getMonth() ) / Gets the day of the month for event var day = String(event.getDate(); / Adds a leading zero to 1-digi
51、t days day = day.length=1 ? "0"+day : day; $("<a>") .hide() .attr("href", "view.php?event_id="+data) .text(entry.event_title) .insertAfter($("strong:contains("+day+")") .delay(1000) .fadeIn("slow"); , "deserialize"
52、 : function(str) var data = str.split("&"), / Declares variables for use in the loop pairs=, entry=, key, val; / Loops through each name-value pair for ( x in data ) / Splits each pair into an array pairs = datax.split("="); / The first element is the name key = pairs0; / Sec
53、ond element is the value val = pairs1; / Stores each value as an object property entrykey = fx.urldecode(val); return entry; , "urldecode" : function(str) / Converts plus signs to spaces var converted = str.replace(/+/g, ' '); / Converts any encoded entities back return decodeURICo
54、mponent(converted); ; $("li>a").live("click", function(event) event.preventDefault(); $(this).addClass("active"); var data = $(this) .attr("href") .replace(/.+?(.*)$/, "$1"), modal = fx.initModal(); $("<a>") .attr("href", "#") .addClass("modal-close-btn") .html("×"
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年沧州市农村信用社联合社秋季校园招聘笔试备考题库(浓缩500题)及答案详解(基础+提升)
- 黄冈市农村信用社联合社秋季校园招聘笔试备考题库(浓缩500题)及答案详解(全优)
- 铜仁地区农村信用社联合社秋季校园招聘笔试备考题库(浓缩500题)及答案详解(必刷)
- 彭水苗族土家族自治县农村信用社联合社秋季校园招聘笔试备考题库(浓缩500题)及参考答案详解
- 大同市农村信用社联合社秋季校园招聘笔试备考题库(浓缩500题)及答案详解(夺冠系列)
- 南充市农村信用社联合社秋季校园招聘笔试备考题库(浓缩500题)含答案详解(能力提升)
- 湖南省农村信用社联合社秋季校园招聘笔试备考题库(浓缩500题)及答案详解参考
- 蚌埠市农村信用社联合社秋季校园招聘笔试备考题库(浓缩500题)含答案详解(综合卷)
- 林芝地区农村信用社联合社秋季校园招聘笔试备考题库(浓缩500题)附答案详解
- 许昌市农村信用社联合社秋季校园招聘笔试备考题库(浓缩500题)(含答案详解)
- 人教版二年级数学上册期中测试卷(带答案)
- 实验室仪器设备培训考试题及答案
- 云南民族大学附属高级中学2026届高三联考卷(二)化学(含答案)
- 【初中生物】动物的生殖和发育(第1课时)课件-2025-2026学年北师大版生物八年级上册
- 2025年海南省中小学教师招聘考试教育综合知识试题及答案解析
- 教师教学反思记录模板及范例
- 应急预案寺院
- 2025年时事政治热点题库考试试题库及完整答案详解(历年真题)
- 幼儿日常活动安全培训课件
- +规矩之下方有自由主题班会(课件)
- 土石坝除险加固设计规范(2025版)
评论
0/150
提交评论