




已阅读5页,还剩33页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
深入PHP与jQuery开发源代码下载(Pro PHP and jQuery source code) 看完这本书后觉得内容挺不错的,书中的代码基本上都能实现,为方便广大同仁更好的学习和参考,能以我个人的能力给大家做点贡献我也觉得非常荣幸,欢迎大家踊跃下载!本想免费供大家下载的,可是为了同时也能让我下载更多的学习资料,所以还是决定跟大家要点财富值吧,嘿嘿!下面是这个项目的目录结构!下面是运行效果图:首先是app目录下的admin.php文件,代码如下:displayForm(); ?下面是confirmdelete.php文件:confirmDelete($id);/* Output the header*/$page_title = View Event;$css_files = array(style.css, admin.css);include_once assets/common/header.inc.php;?Index.phpbuildCalendar();?Login.php Please Log In Username Password input type=hidden name=token value= / or cancel View.phpdisplayEvent($id) ?« Back to the calendar下面是app目录assets目录下文件:首先是Commen目录:Footer.inc.phpheader.inc.phplink rel=stylesheet type=text/css media=screen,projectionhref=assets/css/ /Css目录:Admin.cssfieldset border: 0;legend font-size: 24px;font-weight: bold;inputtype=text,inputtype=password,label display: 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-shadow: 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 #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;font-family: georgia, serif;text-transform: uppercase;font-weight: bold;font-size: 14px;text-shadow: 0px 0px 1px #fff;.admin-options text-align: center;.admin-options form,.admin-options p display: inline;a.admin,a.linkdisplay: 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 1px 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: uppercase;font-weight: bold;font-size: 14px;text-shadow: 0px 0px 1px #fff;Ajax.css.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;padding: 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: 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;Style.css body background-color: #789;font-family: georgia, serif;font-size: 13px;#content display: block;width: 812px;margin: 40px 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: 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 solid 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 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;display: 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: #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目录:首先是ajax.inc.php $val )define($name, $val); $actions = array( event_view = array( object = Calendar, method = displayEvent ), edit_event = array( object = Calendar, method = displayForm ), event_edit = array( object = Calendar, method = processForm ), delete_event = array( object = Calendar, method = confirmDelete ), confirm_delete = array( object = Calendar, method = confirmDelete ) );if ( isset($actions$_POSTaction) )$use_array = $actions$_POSTaction;$obj = new $use_arrayobject($dbo); if ( isset($_POSTevent_id) ) $id = (int) $_POSTevent_id; else $id = NULL; echo $obj-$use_arraymethod($id);function _autoload($class_name)$filename = ./././system/class/class. strtolower($class_name) . .inc.php;if ( file_exists($filename) )include_once $filename;?Process.inc.php $val ) define($name, $val); $actions = array( event_edit = array( object = Calendar, method = processForm, header = Location: ././ ), user_login = array( object = Admin, method = processLoginForm, header = Location: ././ ), 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 ( $_POSTtoken=$_SESSIONtoken& isset($actions$_POSTaction) ) $use_array = $actions$_POSTaction; $obj = new $use_arrayobject($dbo); if (TRUE = $msg=$obj-$use_arraymethod() header($use_arrayheader); exit; else die ( $msg ); else / 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目录:Init.jsjQuery(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 $() .hide() .addClass(modal-window) .appendTo(body); else return $(.modal-window); , boxin : function(data, modal) $() .hide() .addClass(modal-overlay) .click(function(event) / Removes event fx.boxout(event); ) .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 $(.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 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) /?-?|?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 cdata = $(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); / 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-digit days day = day.length=1 ? 0+day : day; $() .hide() .attr(href, view.php?event_id=+data) .text(entry.event_title) .insertAfter($(strong:contains(+day+) .delay(1000) .fadeIn(slow); , deserialize : 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; / Second 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 decodeURIComponent(converted); ; $(lia).live(click, function(event) event.preventDefault(); $(this).addClass(active); var data = $(this) .attr(href) .replace(/.+?(.*)$/, $1), modal = fx.initModal(); $() .attr(href, #) .addClass(modal-close-btn) .html(×) .click(function(event) / Prevent the default action fx.boxout(event); ) .appendTo(modal); $.ajax( type: POST, url: processFile, data: action=event_view& + data, success: function(data) fx.boxin(data, modal); , error: function(msg) modal.append(msg); ); ); $(.admin-options form,.admin).live(click, function(event) / Prevents the form from submitting event.preventDefault(); / Loads the action for the processing file var action = $(event.target).attr(name) | ed
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 多渠道代收代付服务合作协议
- 电商平台用户行为分析合作协议
- 主题公园场地租赁与游乐设施运营协议
- 科技园区场地租赁合同行政备案及支持措施
- 修理费合同模板
- 沿海牧场污染防控策略-洞察及研究
- 儿科护理安全风险管理-洞察及研究
- 能效管理平台开发-洞察及研究
- 土壤动物多样性维持-洞察及研究
- 新媒体艺术批判-洞察及研究
- 2025年山东省高考招生统一考试高考真题化学试卷(真题+答案)
- 2025至2030年中国月子中心行业竞争格局分析及市场前景趋势报告
- 2025年山煤国际招聘笔试冲刺题(带答案解析)
- 2024-2025学年初中英语七年级下册期末考试综合测试卷及参考答案
- 2025年山东省济南市长清区中考二模道德与法治试题(含答案)
- 冠心病的规范化诊培训课件
- 未来中国检测市场发展趋势简析(精)
- 2025年AI+赋能中小企业:出海营销的创新与发展
- 2025年福建省粮食行业职业技能竞赛(粮油保管员)备赛试题库(含答案)
- 四川电网新建电源并网服务指南(2025年)
- 2024北森图表分析题库
评论
0/150
提交评论