PageRenderTime 57ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/php_demo/index.php

http://xgcalendar.googlecode.com/
PHP | 307 lines | 280 code | 14 blank | 13 comment | 21 complexity | 6b90ada404e9c5f51fe529237609e54b MD5 | raw file
Possible License(s): GPL-3.0, Apache-2.0
  1. <?php
  2. ob_start();
  3. require_once ("includes/commons.inc");
  4. require_once ("resources/i18n.php");
  5. ob_end_flush();
  6. ?>
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <title><?php echo msg("title");?> </title>
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  12. <link href="static/theme/Default/main.css"" rel="stylesheet" type="text/css" />
  13. <link href="static/theme/Default/dailog.css" rel="stylesheet" type="text/css" />
  14. <link href="static/theme/Default/calendar.css" rel="stylesheet" type="text/css" />
  15. <link href="static/theme/Default/dp.css" rel="stylesheet" type="text/css" />
  16. <link href="static/theme/Default/alert.css" rel="stylesheet" type="text/css" />
  17. <link href="static/theme/Shared/blackbird.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body>
  20. <div>
  21. <div id="calhead" style="padding-left:1px;padding-right:1px;">
  22. <div class="cHead"><div class="ftitle"><?php echo ucfmsg("title") ?></div>
  23. <div id="loadingpannel" class="ptogtitle loadicon" style="display: none;"><?php echo ucfmsg("loaddatamsg"); ?></div>
  24. <div id="errorpannel" class="ptogtitle loaderror" style="display: none;"><?php echo ucfmsg("defaulterrormsg"); ?></div>
  25. </div>
  26. <div id="caltoolbar" class="ctoolbar">
  27. <div id="faddbtn" class="fbutton">
  28. <div><span title='<?php echo ucfmsg("new_event_title") ?>' class="addcal">
  29. <?php echo ucfmsg("new_event"); ?>
  30. </span></div>
  31. </div>
  32. <div class="btnseparator"></div>
  33. <div id="showtodaybtn" class="fbutton">
  34. <div><span title='<?php echo ucfmsg("today_title") ;?> ' class="showtoday">
  35. <?php echo ucfmsg("today") ; ?></span></div>
  36. </div>
  37. <div class="btnseparator"></div>
  38. <div id="showdaybtn" class="fbutton">
  39. <div><span title='<?php echo ucfmsg("day") ?>' class="showdayview"><?php echo ucfmsg("day") ; ?></span></div>
  40. </div>
  41. <div id="showweekbtn" class="fbutton fcurrent">
  42. <div><span title='<?php echo ucfmsg("week") ?>' class="showweekview"><?php echo ucfmsg("week") ; ?></span></div>
  43. </div>
  44. <div id="showmonthbtn" class="fbutton">
  45. <div><span title='<?php echo ucfmsg("month") ?>' class="showmonthview"><?php echo ucfmsg("month"); ?></span></div>
  46. </div>
  47. <div class="btnseparator"></div>
  48. <div id="showreflashbtn" class="fbutton">
  49. <div><span title='<?php echo ucfmsg("refresh_title") ?>' class="showdayflash"><?php echo ucfmsg("refresh"); ?></span></div>
  50. </div>
  51. <div class="btnseparator"></div>
  52. <div id="sfprevbtn" title="<?php echo ucfmsg("prev_title") ; ?>" class="fbutton">
  53. <span class="fprev"></span>
  54. </div>
  55. <div id="sfnextbtn" title="<?php echo ucfmsg("next_title") ; ?>" class="fbutton">
  56. <span class="fnext"></span>
  57. </div>
  58. <div class="fshowdatep fbutton">
  59. <div>
  60. <input type="hidden" name="txtshow" id="hdtxtshow" />
  61. <span id="txtdatetimeshow">Loading</span>
  62. </div>
  63. </div>
  64. <div class="btnseparator"></div>
  65. <div id="changetochinese" class="fbutton">
  66. <div><span title='<?php echo ucfmsg("chinese") ; ?>' class="chinese"><?php echo ucfmsg("chinese") ; ?></span></div>
  67. </div>
  68. <div id="changetoenglish" class="fbutton">
  69. <div><span title='<?php echo ucfmsg("english"); ?>' class="english"><?php echo ucfmsg("english"); ?></span></div>
  70. </div>
  71. <div id="changetoenglishau" class="fbutton">
  72. <div><span title='<?php echo ucfmsg("english"); ?>' class="english_au"><?php echo ucfmsg("english") ; ?></span></div>
  73. </div>
  74. <div class="btnseparator"></div>
  75. <div class="clear"></div>
  76. </div>
  77. </div>
  78. <div style="padding:1px;">
  79. <div class="t1 chromeColor">
  80. &nbsp;</div>
  81. <div class="t2 chromeColor">
  82. &nbsp;</div>
  83. <div id="dvCalMain" class="calmain printborder">
  84. <div id="gridcontainer" style="overflow-y: visible;">
  85. </div>
  86. </div>
  87. <div class="t2 chromeColor">
  88. &nbsp;</div>
  89. <div class="t1 chromeColor">
  90. &nbsp;
  91. </div>
  92. </div>
  93. </div>
  94. <script src="static/javascripts/jquery.min.js" type="text/javascript"></script>
  95. <script src="static/javascripts/Common.js" type="text/javascript"></script>
  96. <script src="static/javascripts/lib/blackbird.js" type="text/javascript"></script>
  97. <script src="<?php echo msg("datepicker_langpack_url"); ?>" type="text/javascript"></script>
  98. <script src="static/javascripts/Plugins/jquery.datepicker.js" type="text/javascript"></script>
  99. <script src="static/javascripts/Plugins/jquery.alert.js" type="text/javascript"></script>
  100. <script src="static/javascripts/Plugins/jquery.ifrmdailog.js" defer="defer" type="text/javascript"></script>
  101. <script src="<?php echo msg("calendar_langpack_url"); ?>" type="text/javascript"></script>
  102. <script src="static/javascripts/Plugins/xgcalendar.js?v=1.2.0.4" type="text/javascript"></script>
  103. <script type="text/javascript">
  104. $(document).ready(function() {
  105. //[id,title,start,end??????????,????,theme,'','']
  106. var view="week";
  107. <?php include("_part.php"); ?>
  108. var op = {
  109. view: view,
  110. theme:3,
  111. showday: new Date(),
  112. EditCmdhandler:Edit,
  113. DeleteCmdhandler:Delete,
  114. ViewCmdhandler:View,
  115. onWeekOrMonthToDay:wtd,
  116. onBeforeRequestData: cal_beforerequest,
  117. onAfterRequestData: cal_afterrequest,
  118. onRequestDataError: cal_onerror,
  119. url: "calendar.php?mode=get" ,
  120. quickAddUrl: "calendar.php?mode=quickadd" ,
  121. quickUpdateUrl: "calendar.php?mode=quickupdate" ,
  122. quickDeleteUrl: "calendar.php?mode=quickdelete" //???????
  123. /* timeFormat:" hh:mm t", //t????????,h ??12???????H??24??????,m????
  124. tgtimeFormat:"ht" //?? */
  125. };
  126. var $dv = $("#calhead");
  127. var _MH = document.documentElement.clientHeight;
  128. var dvH = $dv.height() + 2;
  129. op.height = _MH - dvH;
  130. op.eventItems =__CURRENTDATA;
  131. var p = $("#gridcontainer").bcalendar(op).BcalGetOp();
  132. if (p && p.datestrshow) {
  133. $("#txtdatetimeshow").text(p.datestrshow);
  134. }
  135. $("#caltoolbar").noSelect();
  136. $("#hdtxtshow").datepicker({ picker: "#txtdatetimeshow", showtarget: $("#txtdatetimeshow"),
  137. onReturn:function(r){
  138. var p = $("#gridcontainer").BCalGoToday(r).BcalGetOp();
  139. if (p && p.datestrshow) {
  140. $("#txtdatetimeshow").text(p.datestrshow);
  141. }
  142. }
  143. });
  144. function cal_beforerequest(type)
  145. {
  146. var t="<?php echo ucfmsg("loaddatamsg")?>";
  147. switch(type)
  148. {
  149. case 1:
  150. t="<?php echo ucfmsg("loaddatamsg"); ?>";
  151. break;
  152. case 2:
  153. case 3:
  154. case 4:
  155. t="<?php echo ucfmsg("processdatamsg"); ?>";
  156. break;
  157. }
  158. $("#errorpannel").hide();
  159. $("#loadingpannel").html(t).show();
  160. }
  161. function cal_afterrequest(type)
  162. {
  163. switch(type)
  164. {
  165. case 1:
  166. $("#loadingpannel").hide();
  167. break;
  168. case 2:
  169. case 3:
  170. case 4:
  171. $("#loadingpannel").html("<?php echo ucfmsg("successmsg"); ?>");
  172. window.setTimeout(function(){ $("#loadingpannel").hide();},2000);
  173. break;
  174. }
  175. }
  176. function cal_onerror(type,data)
  177. {
  178. $("#errorpannel").show();
  179. }
  180. function Edit(data)
  181. {
  182. var eurl="";
  183. if(data)
  184. {
  185. var url = StrFormat(eurl,data);
  186. OpenModelWindow(url,{ width: 600, height: 400, caption:"<?php echo ucfmsg("editcalendar"); ?>",onclose:function(){
  187. $("#gridcontainer").BCalReload();
  188. }});
  189. }
  190. }
  191. function View(data)
  192. {
  193. var vurl="";
  194. if(data)
  195. {
  196. var url = StrFormat(vurl,data);
  197. OpenModelWindow(url,{ width: 600, height: 400, caption: "<?php echo ucfmsg("viewcalendar");?>"});
  198. }
  199. }
  200. function Delete(data,callback)
  201. {
  202. $.alerts.okButton="<?php echo ucfmsg("ok"); ?>";
  203. $.alerts.cancelButton="<?php echo ucfmsg("cancel") ; ?>";
  204. hiConfirm("<?php echo ucfmsg("deleteconfirm") ; ?>", '<?php echo ucfmsg("confirm"); ?>',function(r){ r && callback(0);});
  205. }
  206. function wtd(p)
  207. {
  208. if (p && p.datestrshow) {
  209. $("#txtdatetimeshow").text(p.datestrshow);
  210. }
  211. $("#caltoolbar div.fcurrent").each(function() {
  212. $(this).removeClass("fcurrent");
  213. })
  214. $("#showdaybtn").addClass("fcurrent");
  215. }
  216. //?????
  217. $("#showdaybtn").click(function(e) {
  218. //document.location.href="#day";
  219. $("#caltoolbar div.fcurrent").each(function() {
  220. $(this).removeClass("fcurrent");
  221. })
  222. $(this).addClass("fcurrent");
  223. var p = $("#gridcontainer").BCalSwtichview("day").BcalGetOp();
  224. if (p && p.datestrshow) {
  225. $("#txtdatetimeshow").text(p.datestrshow);
  226. }
  227. });
  228. //?????
  229. $("#showweekbtn").click(function(e) {
  230. //document.location.href="#week";
  231. $("#caltoolbar div.fcurrent").each(function() {
  232. $(this).removeClass("fcurrent");
  233. })
  234. $(this).addClass("fcurrent");
  235. var p = $("#gridcontainer").BCalSwtichview("week").BcalGetOp();
  236. if (p && p.datestrshow) {
  237. $("#txtdatetimeshow").text(p.datestrshow);
  238. }
  239. });
  240. //?????
  241. $("#showmonthbtn").click(function(e) {
  242. //document.location.href="#month";
  243. $("#caltoolbar div.fcurrent").each(function() {
  244. $(this).removeClass("fcurrent");
  245. })
  246. $(this).addClass("fcurrent");
  247. var p = $("#gridcontainer").BCalSwtichview("month").BcalGetOp();
  248. if (p && p.datestrshow) {
  249. $("#txtdatetimeshow").text(p.datestrshow);
  250. }
  251. });
  252. $("#showreflashbtn").click(function(e){
  253. $("#gridcontainer").BCalReload();
  254. });
  255. //??????
  256. $("#faddbtn").click(function(e) {
  257. var url ="";
  258. OpenModelWindow(url,{ width: 500, height: 400, caption: "<?php echo ucfmsg("addcalendar"); ?>"});
  259. });
  260. //??????
  261. $("#showtodaybtn").click(function(e) {
  262. var p = $("#gridcontainer").BCalGoToday().BcalGetOp();
  263. if (p && p.datestrshow) {
  264. $("#txtdatetimeshow").text(p.datestrshow);
  265. }
  266. });
  267. //???
  268. $("#sfprevbtn").click(function(e) {
  269. var p = $("#gridcontainer").BCalPrev().BcalGetOp();
  270. if (p && p.datestrshow) {
  271. $("#txtdatetimeshow").text(p.datestrshow);
  272. }
  273. });
  274. //???
  275. $("#sfnextbtn").click(function(e) {
  276. var p = $("#gridcontainer").BCalNext().BcalGetOp();
  277. if (p && p.datestrshow) {
  278. $("#txtdatetimeshow").text(p.datestrshow);
  279. }
  280. });
  281. $("#changetochinese").click(function(e){
  282. location.href="?lang=zh-cn";
  283. });
  284. $("#changetoenglish").click(function(e){
  285. location.href="?lang=en-us";
  286. });
  287. $("#changetoenglishau").click(function(e){
  288. location.href="?lang=en-au";
  289. });
  290. });
  291. </script>
  292. </body>
  293. </html>