project.php 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <link type="text/css" rel="stylesheet" href="css/style.css"/>
  7. <link type="text/css" rel="stylesheet" href="css/color_day.css" id="colorchange" />
  8. <link type="text/css" rel="stylesheet" href="css/style_mobile.css" media="screen and (max-width:800px)">
  9. </head>
  10. <body>
  11. <?php
  12. //工程文件操作
  13. //建立,
  14. require_once __DIR__.'/../config.php';
  15. require_once __DIR__."/../public/_pdo.php";
  16. require_once __DIR__."/../public/function.php";
  17. require_once __DIR__."/../public/load_lang.php";
  18. require_once __DIR__."/./book_list_en.inc";
  19. require_once __DIR__."/../ucenter/function.php";
  20. require_once __DIR__."/../ucenter/setting_function.php";
  21. require_once __DIR__."/../lang/function.php";
  22. require_once __DIR__."/../redis/function.php";
  23. require_once __DIR__."/../channal/function.php";
  24. require_once __DIR__."/../public/snowflakeid.php";
  25. # 雪花id
  26. $snowflake = new SnowFlakeId();
  27. set_exception_handler(function($e){
  28. echo("error-msg:".$e->getMessage().PHP_EOL);
  29. echo("error-file:".$e->getFile().PHP_EOL);
  30. echo("error-line:".$e->getLine().PHP_EOL);
  31. exit;
  32. });
  33. $user_setting = get_setting();
  34. $sLang["1"] = "pali";
  35. $sLang["2"] = "en";
  36. $sLang["3"] = "sc";
  37. $sLang["4"] = "tc";
  38. if (isset($_POST["op"])) {
  39. $op = $_POST["op"];
  40. }
  41. if (isset($_GET["op"])) {
  42. $op = $_GET["op"];
  43. }
  44. if (isset($_POST["data"])) {
  45. $data = $_POST["data"];
  46. } else if (isset($_GET["data"])) {
  47. $data = $_GET["data"];
  48. }
  49. if ($_COOKIE["uid"]) {
  50. $uid = $_COOKIE["uid"];
  51. $USER_ID = $_COOKIE["userid"];
  52. $USER_NAME = $_COOKIE["username"];
  53. } else {
  54. echo '<a href="../ucenter/index.php" target="_blank">' . $_local->gui->not_login . '</a>';
  55. exit;
  56. }
  57. if(isset($_POST["channal"])){
  58. $channelClass = new Channal(redis_connect());
  59. $channelInfo = $channelClass->getChannal($_POST["channal"]);
  60. }
  61. switch ($op) {
  62. case "create":
  63. //判断单词数量 太大的不能加载
  64. $res = json_decode($data);
  65. $res_book = $res[0]->book;
  66. $paraList = $res[0]->parlist;
  67. $paraList = rtrim($paraList, ",");
  68. $strQueryParaList = str_replace(",", "','", $paraList);
  69. $strQueryParaList = "('" . $strQueryParaList . "')";
  70. PDO_Connect(_FILE_DB_PALITEXT_);
  71. $query = "SELECT sum(lenght) as sum_str FROM "._TABLE_PALI_TEXT_." WHERE book = " . $PDO->quote($res_book) . " AND (paragraph in {$strQueryParaList} ) ";
  72. $Fetch = PDO_FetchAll($query);
  73. if (count($Fetch) > 0) {
  74. if ($Fetch[0]["sum_str"] > 15000) {
  75. echo $_local->gui->oversize_to_load;
  76. exit;
  77. }
  78. }
  79. //判断单词数量 结束
  80. if (isset($_POST["format"]) && $_POST["format"] == "db") {
  81. $res = json_decode($data);
  82. $title = $res[0]->title;
  83. $title_en = pali2english($title);
  84. $book = $res[0]->book;
  85. if (substr($book, 0, 1) == "p") {
  86. $book = substr($book, 1);
  87. }
  88. $paragraph = $res[0]->parNum;
  89. $tag = "[$title]";
  90. $paraList = $res[0]->parlist;
  91. $paraList = rtrim($paraList, ",");
  92. $strQueryParaList = str_replace(",", "','", $paraList);
  93. $strQueryParaList = "('" . $strQueryParaList . "')";
  94. $aParaList = str_getcsv($paraList);
  95. $create_para = $aParaList[0];
  96. echo $strQueryParaList;
  97. echo "<textarea>";
  98. print_r($res);
  99. echo "</textarea>";
  100. $user_title = $_POST["title"];
  101. $doc_head = " <head>\n";
  102. $doc_head .= " <type>pcdsset</type>\n";
  103. $doc_head .= " <mode>package</mode>\n";
  104. $doc_head .= " <ver>1</ver>\n";
  105. $doc_head .= " <toc></toc>\n";
  106. $doc_head .= " <style></style>\n";
  107. $doc_head .= " <doc_title>$user_title</doc_title>\n";
  108. $doc_head .= " <tag>$tag</tag>\n";
  109. $doc_head .= " <lang>{$_POST["lang"]}</lang>\n";
  110. $doc_head .= " <book>$book</book>\n";
  111. $doc_head .= " <paragraph>$paragraph</paragraph>\n";
  112. $doc_head .= " </head>\n";
  113. for ($iRes = 0; $iRes < count($res); $iRes++) {
  114. $get_res_type = $res[$iRes]->type;
  115. echo "iRes: $iRes,type:$get_res_type<br/>";
  116. $res_album_id = $res[$iRes]->album_id;
  117. $res_book = $res[$iRes]->book;
  118. $get_par_begin = $res[$iRes]->parNum;
  119. $language = $res[$iRes]->language;
  120. $author = $res[$iRes]->author;
  121. $res_album_guid = UUID::v4();
  122. $res_album_owner = 0;
  123. switch ($get_res_type) {
  124. case "6": //逐词译模板
  125. {
  126. $album_guid = UUID::v4();
  127. $album_title = "title";
  128. $album_author = "VRI";
  129. $album_type = $get_res_type;
  130. //获取段落层级和标题
  131. $para_title = array();
  132. PDO_Connect(_FILE_DB_PALITEXT_);
  133. $query = "SELECT * FROM "._TABLE_PALI_TEXT_." WHERE book = " . $PDO->quote($res_book) . " AND ( paragraph in {$strQueryParaList} ) AND level>0 AND level<9";
  134. $sth = $PDO->prepare($query);
  135. $sth->execute();
  136. while ($result = $sth->fetch(PDO::FETCH_ASSOC)) {
  137. $paragraph = $result["paragraph"];
  138. $para_title["{$paragraph}"][0] = $result["level"];
  139. $para_title["{$paragraph}"][1] = $result["text"];
  140. }
  141. $db_file = _DIR_PALICANON_TEMPLET_ . "/p" . $res_book . "_tpl.db3";
  142. PDO_Connect(_FILE_DB_PALICANON_TEMPLET_);
  143. foreach ($aParaList as $iPar) {
  144. $query = "SELECT * FROM "._TABLE_PALICANON_TEMPLET_." WHERE ( book = ".$PDO->quote($res_book)." AND paragraph = " . $PDO->quote($iPar) . " ) ";
  145. $sth = $PDO->prepare($query);
  146. $sth->execute();
  147. {
  148. if (isset($para_title["{$iPar}"])) {
  149. $level = $para_title["{$iPar}"][0];
  150. $title = $para_title["{$iPar}"][1];
  151. } else {
  152. $level = 100;
  153. $title = "";
  154. }
  155. $block_id = UUID::v4();
  156. $trans_block_id = UUID::v4();
  157. $snowId = $snowflake->id();
  158. $block_data[] = array
  159. (
  160. $snowId,
  161. $block_id,
  162. "",
  163. $_POST["channal"],
  164. $_COOKIE['userid'],
  165. $_COOKIE['uid'],
  166. $book,
  167. $iPar,
  168. "_none_",
  169. $channelInfo["lang"],
  170. $channelInfo["status"],
  171. mTime(),
  172. mTime()
  173. );
  174. $block_list[] = array("channal" => $_POST["channal"],
  175. "type" => 6, //word by word
  176. "book" => $res_book,
  177. "paragraph" => $iPar,
  178. "block_id" => $block_id,
  179. "readonly" => false,
  180. );
  181. /*
  182. $block_list[] = array("channal"=>$_POST["channal"],
  183. "type"=>2,//translation
  184. "book"=>$res_book,
  185. "paragraph"=>$iPar,
  186. "readonly"=>false
  187. );*/
  188. while ($result = $sth->fetch(PDO::FETCH_ASSOC)) {
  189. if ($result["gramma"] == "?") {
  190. $wGrammar = "";
  191. } else {
  192. $wGrammar = $result["gramma"];
  193. }
  194. $strXml = "<word>";
  195. $strXml .= "<pali>{$result["word"]}</pali>";
  196. $strXml .= "<real>{$result["real"]}</real>";
  197. $wordid = "p{$result["book"]}-{$result["paragraph"]}-{$result["wid"]}";
  198. $strXml .= "<id>{$wordid}</id>";
  199. $strXml .= "<type s=\"0\">{$result["type"]}</type>";
  200. $strXml .= "<gramma s=\"0\">{$wGrammar}</gramma>";
  201. $strXml .= "<mean s=\"0\"></mean>";
  202. $strXml .= "<org s=\"0\">" . mb_strtolower($result["part"], 'UTF-8') . "</org>";
  203. $strXml .= "<om s=\"0\"></om>";
  204. $strXml .= "<case s=\"0\">{$result["type"]}#{$wGrammar}</case>";
  205. $strXml .= "<style>{$result["style"]}</style>";
  206. $strXml .= "<status>0</status>";
  207. $strXml .= "</word>";
  208. $wbw_data[] = array
  209. (
  210. $snowflake->id(),
  211. UUID::v4(),
  212. $block_id,
  213. $book,
  214. $iPar,
  215. $result["wid"],
  216. $result["real"],
  217. $strXml,
  218. mTime(),
  219. mTime(),
  220. 0,
  221. $_COOKIE['userid'],
  222. $_COOKIE['uid']
  223. );
  224. }
  225. }
  226. }
  227. //写入数据库
  228. // 开始一个事务,关闭自动提交
  229. PDO_Connect(_FILE_DB_USER_WBW_,_DB_USERNAME_,_DB_PASSWORD_);
  230. $PDO->beginTransaction();
  231. $query = "INSERT INTO "._TABLE_USER_WBW_BLOCK_."
  232. (
  233. id,
  234. uid ,
  235. parent_id ,
  236. channel_uid ,
  237. creator_uid ,
  238. editor_id,
  239. book_id ,
  240. paragraph ,
  241. style ,
  242. lang ,
  243. status ,
  244. create_time ,
  245. modify_time
  246. )
  247. VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)";
  248. $stmt = $PDO->prepare($query);
  249. foreach ($block_data as $oneParam) {
  250. $stmt->execute($oneParam);
  251. }
  252. // 提交更改
  253. $PDO->commit();
  254. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  255. $error = PDO_ErrorInfo();
  256. echo "error - $error[2] <br>";
  257. } else {
  258. $count = count($block_data);
  259. echo "updata $count recorders.";
  260. }
  261. // 开始一个事务,关闭自动提交
  262. $PDO->beginTransaction();
  263. $query = "INSERT INTO "._TABLE_USER_WBW_."
  264. (
  265. id,
  266. uid ,
  267. block_uid ,
  268. book_id ,
  269. paragraph ,
  270. wid ,
  271. word ,
  272. data ,
  273. create_time ,
  274. modify_time ,
  275. status ,
  276. creator_uid ,
  277. editor_id
  278. )
  279. VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)";
  280. $stmt = $PDO->prepare($query);
  281. foreach ($wbw_data as $oneParam) {
  282. $stmt->execute($oneParam);
  283. }
  284. // 提交更改
  285. $PDO->commit();
  286. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  287. $error = PDO_ErrorInfo();
  288. echo "error - $error[2] <br>";
  289. } else {
  290. $count = count($block_data);
  291. echo "updata $count recorders.";
  292. }
  293. //服务器端文件列表
  294. $PDO_File = new PDO(_FILE_DB_FILEINDEX_,_DB_USERNAME_,_DB_PASSWORD_,array(PDO::ATTR_PERSISTENT=>true));
  295. $PDO_File->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  296. $queryInsert = "INSERT INTO \""._TABLE_FILEINDEX_."\"
  297. (
  298. id,
  299. uid,
  300. parent_id,
  301. user_id,
  302. book,
  303. paragraph,
  304. channal,
  305. file_name,
  306. title,
  307. tag,
  308. status,
  309. file_size,
  310. share,
  311. doc_info,
  312. doc_block,
  313. create_time,
  314. modify_time,
  315. accese_time,
  316. accesed_at,
  317. updated_at,
  318. created_at)
  319. VALUES (? , ? , ? , ? , ?, ? ,? , ? , ? , ?, ? ,? , ? , ? , ?, ? ,? , ? , ? , ?, ? )";
  320. $stmtDEST = $PDO_File->prepare($queryInsert);
  321. $doc_id = UUID::v4();
  322. $file_name = $book . '_' . $create_para;
  323. $created_at = date("Y-m-d H:i:s.",mTime()/1000).(mTime()%1000)." UTC";
  324. $commitData = array(
  325. $snowflake->id(),
  326. $doc_id,
  327. null,
  328. $uid,
  329. $book,
  330. $create_para,
  331. $_POST["channal"],
  332. $file_name,
  333. $user_title,
  334. $tag,
  335. 1,
  336. 0,
  337. 0,
  338. $doc_head,
  339. json_encode($block_list, JSON_UNESCAPED_UNICODE),
  340. mTime(),
  341. mTime(),
  342. mTime(),
  343. $created_at,
  344. $created_at,
  345. $created_at
  346. );
  347. try{
  348. $stmtDEST->execute($commitData);
  349. echo "成功新建一个文件.";
  350. echo "<a href=\"editor.php?op=opendb&doc_id={$doc_id}\">{$_local->gui->open}</a>";
  351. }catch(PDOException $e){
  352. echo($e->getMessage().PHP_EOL);
  353. echo "<pre>";
  354. print_r($commitData);
  355. echo "</pre>";
  356. exit;
  357. }
  358. }
  359. break;
  360. }
  361. }
  362. } else {
  363. if (!isset($data)) {
  364. $dl_file_name = $dir_user_base . $USER_ID . "/dl.json";
  365. $data = file_get_contents($dl_file_name);
  366. }
  367. $res = json_decode($data);
  368. $title = $res[0]->title;
  369. $title_en = pali2english($title);
  370. $book = $res[0]->book;
  371. if (substr($book, 0, 1) == "p") {
  372. $book = substr($book, 1);
  373. }
  374. $paragraph = $res[0]->parNum;
  375. $tag = "[$title]";
  376. $paraList = $res[0]->parlist;
  377. $paraList = rtrim($paraList, ",");
  378. $strQueryParaList = str_replace(",", "','", $paraList);
  379. $strQueryParaList = "('" . $strQueryParaList . "')";
  380. $aParaList = str_getcsv($paraList);
  381. echo "<div style='display:none;'>";
  382. echo $strQueryParaList;
  383. echo "<textarea>";
  384. print_r($res);
  385. echo "</textarea>";
  386. echo "</div>";
  387. if (!isset($_POST["title"])) {
  388. $thisFileName = basename(__FILE__);
  389. echo "<div class='fun_block'>";
  390. echo "<h2>{$_local->gui->new_project}</h2>";
  391. echo "<form action=\"{$thisFileName}\" method=\"post\">";
  392. echo "<input type='hidden' name='op' value='{$op}'/>";
  393. echo "<input type='hidden' name='data' value='{$data}'/>";
  394. echo "<fieldset>";
  395. echo "<legend>{$_local->gui->title} ({$_local->gui->required})</legend>";
  396. echo "<div>";
  397. echo "<input type='input' name='title' value='{$title}'/>";
  398. echo "</div>";
  399. echo "</fieldset>";
  400. echo "<fieldset>";
  401. echo "<legend>{$_local->gui->channel} ({$_local->gui->required})</legend>";
  402. echo "<div>";
  403. PDO_Connect(_FILE_DB_CHANNAL_,_DB_USERNAME_,_DB_PASSWORD_);
  404. $query = "SELECT uid,name,lang,status,create_time from "._TABLE_CHANNEL_." where owner_uid = ? limit 100";
  405. $Fetch = PDO_FetchAll($query,array($_COOKIE["userid"]));
  406. $i = 0;
  407. foreach ($Fetch as $row) {
  408. echo '<div class="file_list_row" style="padding:5px;">';
  409. echo '<div class="pd-10" style="max-width:2em;flex:1;">';
  410. echo '<input name="channal" value="' . $row["uid"] . '" ';
  411. if ($i == 0) {
  412. echo "checked";
  413. }
  414. echo ' type="radio" />';
  415. echo '</div>';
  416. echo '<div class="title" style="flex:3;padding-bottom:5px;">' . $row["name"] . '</div>';
  417. echo '<div class="title" style="flex:3;padding-bottom:5px;">' . $row["lang"] . '</div>';
  418. echo '<div class="title" style="flex:2;padding-bottom:5px;">';
  419. PDO_Connect( _FILE_DB_USER_WBW_,_DB_USERNAME_,_DB_PASSWORD_);
  420. $query = "SELECT count(*) from "._TABLE_USER_WBW_BLOCK_." where channel_uid = ? and book_id= ? and paragraph in {$strQueryParaList} limit 100";
  421. $FetchWBW = PDO_FetchOne($query,array($row["uid"],$book));
  422. echo '</div>';
  423. echo '<div class="title" style="flex:2;padding-bottom:5px;">';
  424. if ($FetchWBW == 0) {
  425. echo $_local->gui->blank;
  426. echo "&nbsp;<a></a>";//??
  427. } else {
  428. #打开编辑窗口
  429. echo $FetchWBW . $_local->gui->para;
  430. echo "&nbsp;<a href='../studio/editor.php?op=openchannal&book=$book&para={$paraList}&channal={$row["uid"]}'>{$_local->gui->open}</a>";
  431. }
  432. echo '</div>';
  433. echo '<div class="title" style="flex:2;padding-bottom:5px;">';
  434. PDO_Connect( _FILE_DB_SENTENCE_,_DB_USERNAME_,_DB_PASSWORD_);
  435. $query = "SELECT count(*) from "._TABLE_SENTENCE_." where channel_uid = ? and book_id = ? and paragraph in {$strQueryParaList} limit 100";
  436. $FetchWBW = PDO_FetchOne($query,array($row["uid"],$book));
  437. echo '</div>';
  438. echo '<div class="title" style="flex:2;padding-bottom:5px;">';
  439. if ($FetchWBW == 0) {
  440. echo $_local->gui->blank;
  441. } else {
  442. echo $FetchWBW . $_local->gui->para;
  443. }
  444. echo '</div>';
  445. echo '<div class="summary" style="flex:1;padding-bottom:5px;">' . $row["status"] . '</div>';
  446. echo '<div class="author" style="flex:1;padding-bottom:5px;">' . $row["create_time"] . '</div>';
  447. echo '</div>';
  448. $i++;
  449. }
  450. echo '<div class="file_list_row" style="padding:5px;">';
  451. echo '<div class="pd-10" style="max-width:7em;flex:1;">'.$_local->gui->new.'&nbsp;'.$_local->gui->channel.'</div>';
  452. echo '<div class="title" style="flex:3;padding-bottom:5px;display:none;">';
  453. echo '在studio中新建版本风格</div>';
  454. echo '<div class="author" style="flex:1;padding-bottom:5px;"><button>'.$_local->gui->new.'</button></div>';
  455. echo '</div>';
  456. echo "</div>";
  457. echo "</fieldset>";
  458. echo "<fieldset>";
  459. echo "<legend>{$_local->gui->language}</legend>";
  460. echo "<select name='lang'>";
  461. $lang_list = new lang_enum;
  462. foreach ($user_setting['studio.translation.lang'] as $key => $value) {
  463. echo "<option value='{$value}'>" . $lang_list->getName($value)["name"] . "</option>";
  464. }
  465. echo "</select>";
  466. echo "</fieldset>";
  467. echo "<input type=\"submit\" value='{$_local->gui->create_now}'>";
  468. echo "<input type='hidden' name='format' value='db'>";
  469. echo "</form>";
  470. echo "</div>";
  471. echo "</body>";
  472. exit;
  473. }
  474. $user_title = $_POST["title"];
  475. $create_para = $paragraph;
  476. $FileName = $book . "_" . $paragraph . "_" . time() . ".pcs";
  477. $sFullFileName = _DIR_USER_DOC_ . "/" . $USER_ID . _DIR_MYDOCUMENT_ . "/" . $FileName;
  478. echo "filename:" . $sFullFileName;
  479. $myfile = fopen($sFullFileName, "w") or die("Unable to open file!");
  480. $strXml = "<set>\n";
  481. $doc_head = " <head>\n";
  482. $doc_head .= " <type>pcdsset</type>\n";
  483. $doc_head .= " <mode>package</mode>\n";
  484. $doc_head .= " <ver>1</ver>\n";
  485. $doc_head .= " <toc></toc>\n";
  486. $doc_head .= " <style></style>\n";
  487. $doc_head .= " <doc_title>$user_title</doc_title>\n";
  488. $doc_head .= " <tag>$tag</tag>\n";
  489. $doc_head .= " <book>$book</book>\n";
  490. $doc_head .= " <paragraph>$paragraph</paragraph>\n";
  491. $doc_head .= " </head>\n";
  492. $strXml .= $doc_head;
  493. $strXml .= " <dict></dict>\n";
  494. $strXml .= " <message></message>\n";
  495. $strXml .= " <body>\n";
  496. fwrite($myfile, $strXml);
  497. echo "count res:" . count($res) . "<br>";
  498. for ($iRes = 0; $iRes < count($res); $iRes++) {
  499. $get_res_type = $res[$iRes]->type;
  500. echo "iRes: $iRes,type:$get_res_type<br/>";
  501. $res_album_id = $res[$iRes]->album_id;
  502. $res_book = $res[$iRes]->book;
  503. $get_par_begin = $res[$iRes]->parNum;
  504. $language = $res[$iRes]->language;
  505. $author = $res[$iRes]->author;
  506. $res_album_guid = UUID::v4();
  507. $res_album_owner = 0;
  508. switch ($get_res_type) {
  509. case "1": //pali text
  510. {
  511. PDO_Connect(_FILE_DB_PALITEXT_);
  512. $query = "SELECT * FROM "._TABLE_PALI_TEXT_." WHERE \"book\" = " . $PDO->quote($res_book) . " AND (\"paragraph\" in {$strQueryParaList} ) ";
  513. $sth = $PDO->prepare($query);
  514. $sth->execute();
  515. echo $query . "<br/>";
  516. {
  517. while ($result = $sth->fetch(PDO::FETCH_ASSOC)) {
  518. $text = $result["text"];
  519. $paragraph = $result["paragraph"];
  520. $strXml = "<block>";
  521. $strXml .= "<info>";
  522. $strXml .= "<type>palitext</type>";
  523. $strXml .= "<book>{$book}</book>";
  524. $strXml .= "<paragraph>{$result["paragraph"]}</paragraph>";
  525. $strXml .= "<album_id>{$result["album_index"]}</album_id>";
  526. $strXml .= "<album_guid>{$res_album_guid}</album_guid>";
  527. $strXml .= "<author>VRI</author>";
  528. $strXml .= "<language>pali</language>";
  529. $strXml .= "<version>4</version>";
  530. $strXml .= "<edition>CSCD4</edition>";
  531. $strXml .= "<level>{$result["level"]}</level>";
  532. $strXml .= "<id>" . UUID::v4() . "</id>";
  533. $strXml .= "</info>";
  534. $strXml .= "<data><text>{$result["text"]}</text></data>";
  535. $strXml .= "</block>";
  536. fwrite($myfile, $strXml);
  537. if ($result["level"] > 0 && $result["level"] < 9) {
  538. $strXml = "<block>";
  539. $strXml .= "<info>";
  540. $strXml .= "<type>heading</type>";
  541. $strXml .= "<book>{$book}</book>";
  542. $strXml .= "<paragraph>{$result["paragraph"]}</paragraph>";
  543. $strXml .= "<album_id>{$result["album_index"]}</album_id>";
  544. $strXml .= "<album_guid>{$res_album_guid}</album_guid>";
  545. $strXml .= "<author>VRI</author>";
  546. $strXml .= "<language>pali</language>";
  547. $strXml .= "<version>4</version>";
  548. $strXml .= "<edition>CSCD4</edition>";
  549. $strXml .= "<level>{$result["level"]}</level>";
  550. $strXml .= "<id>" . UUID::v4() . "</id>";
  551. $strXml .= "</info>";
  552. $strXml .= "<data><text>{$result["text"]}</text></data>";
  553. $strXml .= "</block>";
  554. fwrite($myfile, $strXml);
  555. } else {
  556. }
  557. }
  558. }
  559. break;
  560. }
  561. case "2": //wbw逐词解析
  562. {
  563. //$res_album_id;
  564. $album_title = "title";
  565. $album_author = $author;
  566. $album_type = $get_res_type;
  567. $db_file = _DIR_PALICANON_WBW_ . "/p{$res_book}_wbw.db3";
  568. $table_info = "p{$res_book}_wbw_info";
  569. $table_data = "p{$res_book}_wbw_data";
  570. PDO_Connect("$db_file");
  571. foreach ($aParaList as $iPar) {
  572. $query = "SELECT * FROM '{$table_info}' WHERE paragraph = " . $PDO->quote($iPar) . " and album_id=" . $PDO->quote($res_album_id);
  573. //$FetchInfo = PDO_FetchAll($query);
  574. echo $query . "<br>";
  575. $sth = $PDO->prepare($query);
  576. $sth->execute();
  577. echo "para:{$iPar} row:" . $sth->rowCount();
  578. if ($result = $sth->fetch(PDO::FETCH_ASSOC)) {
  579. $lang = $sLang["{$result["language"]}"];
  580. $info_id = $result["id"];
  581. $strXml = "<block>";
  582. $strXml .= "<info>";
  583. $strXml .= "<type>wbw</type>";
  584. $strXml .= "<book>{$res_book}</book>";
  585. $strXml .= "<paragraph>{$iPar}</paragraph>";
  586. $strXml .= "<level>{$result["level"]}</level>";
  587. $strXml .= "<title>{$result["title"]}</title>";
  588. $strXml .= "<album_id>{$res_album_id}</album_id>";
  589. $strXml .= "<album_guid>{$res_album_guid}</album_guid>";
  590. $strXml .= "<author>{$result["author"]}</author>";
  591. $strXml .= "<language>{$lang}</language>";
  592. $strXml .= "<version>{$result["version"]}</version>";
  593. $strXml .= "<edition>{$result["edition"]}</edition>";
  594. $strXml .= "<id>" . UUID::v4() . "</id>";
  595. $strXml .= "</info>\n";
  596. $strXml .= "<data>";
  597. fwrite($myfile, $strXml);
  598. $query = "SELECT * FROM \"{$table_data}\" WHERE info_id=" . $PDO->quote($info_id);
  599. $sth = $PDO->prepare($query);
  600. $sth->execute();
  601. while ($result = $sth->fetch(PDO::FETCH_ASSOC)) {
  602. $wid = "p{$res_book}-{$iPar}-{$result["sn"]}";
  603. $strXml = "<word>";
  604. $strXml .= "<pali>{$result["word"]}</pali>";
  605. $strXml .= "<real>{$result["real"]}</real>";
  606. $strXml .= "<id>{$wid}</id>";
  607. $strXml .= "<type>{$result["type"]}</type>";
  608. $strXml .= "<gramma>{$result["gramma"]}</gramma>";
  609. $strXml .= "<mean>{$result["mean"]}</mean>";
  610. $strXml .= "<note>{$result["note"]}</note>";
  611. $strXml .= "<org>{$result["part"]}</org>";
  612. $strXml .= "<om>{$result["partmean"]}</om>";
  613. $strXml .= "<case>{$result["type"]}#{$result["gramma"]}</case>";
  614. $strXml .= "<style>{$result["style"]}</style>";
  615. $strXml .= "<enter>{$result["enter"]}</enter>";
  616. $strXml .= "<status>0</status>";
  617. $strXml .= "</word>\n";
  618. fwrite($myfile, $strXml);
  619. }
  620. $strXml = "</data>\n</block>";
  621. fwrite($myfile, $strXml);
  622. }
  623. }
  624. break;
  625. }
  626. case "3": //translate
  627. {
  628. #已经废弃
  629. //打开翻译数据文件
  630. $db_file = _DIR_PALICANON_TRAN_ . "/p{$book}_translate.db3";
  631. PDO_Connect("$db_file");
  632. $table = "p{$book}_translate_info";
  633. //部分段落
  634. $query = "SELECT * FROM {$table} WHERE paragraph in {$strQueryParaList} and album_id=$res_album_id";
  635. echo $query . "<br/>";
  636. //查询翻译经文内容
  637. $FetchText = PDO_FetchAll($query);
  638. $iFetchText = count($FetchText);
  639. echo "iFetchText:{$iFetchText}<br/>";
  640. if ($iFetchText > 0) {
  641. for ($i = 0; $i < $iFetchText; $i++) {
  642. $currParNo = $FetchText[$i]["paragraph"];
  643. $language = $FetchText[$i]["language"];
  644. $language = $sLang["{$language}"];
  645. if ($res_album_owner == $UID) {
  646. $power = "write";
  647. } else {
  648. $power = "read";
  649. }
  650. //输出数据头
  651. $strXml = "<block>";
  652. $strXml .= "<info>";
  653. $strXml .= "<type>translate</type>";
  654. $strXml .= "<book>{$res_book}</book>";
  655. $strXml .= "<paragraph>{$currParNo}</paragraph>";
  656. $strXml .= "<album_id>{$res_album_id}</album_id>";
  657. $strXml .= "<album_guid>{$res_album_guid}</album_guid>";
  658. $strXml .= "<author>{$FetchText[$i]["author"]}</author>";
  659. $strXml .= "<editor>{$FetchText[$i]["editor"]}</editor>";
  660. $strXml .= "<language>{$language}</language>";
  661. $strXml .= "<version>{$FetchText[$i]["version"]}</version>";
  662. $strXml .= "<edition>{$FetchText[$i]["edition"]}</edition>";
  663. $strXml .= "<level>{$FetchText[$i]["level"]}</level>";
  664. $strXml .= "<readonly>0</readonly>";
  665. $strXml .= "<power>{$power}</power>";
  666. $strXml .= "<id>" . UUID::v4() . "</id>";
  667. $strXml .= "</info>";
  668. $strXml .= "<data>";
  669. fwrite($myfile, $strXml);
  670. //查另一个表,获取段落文本。一句一条记录。有些是一段一条记录
  671. $table_data = "p{$book}_translate_data";
  672. $query = "SELECT * FROM '{$table_data}' WHERE info_id={$FetchText[$i]["id"]}";
  673. $aParaText = PDO_FetchAll($query);
  674. //输出数据内容
  675. $par_text = "";
  676. foreach ($aParaText as $sent) {
  677. $par_text .= "<sen><begin>{$sent["begin"]}</begin><end>{$sent["end"]}</end><text>{$sent["text"]}</text></sen>";
  678. }
  679. fwrite($myfile, $par_text);
  680. //段落块结束
  681. $strXml = "</data></block>";
  682. fwrite($myfile, $strXml);
  683. //获取段落文本结束。
  684. }
  685. }
  686. break;
  687. }
  688. case "4": //note
  689. break;
  690. case "5":
  691. break;
  692. case "6": //逐词译模板
  693. {
  694. $album_guid = UUID::v4();
  695. $album_title = "title";
  696. $album_author = "VRI";
  697. $album_type = $get_res_type;
  698. //获取段落层级和标题
  699. $para_title = array();
  700. PDO_Connect(_FILE_DB_PALITEXT_);
  701. $query = "SELECT * FROM "._TABLE_PALI_TEXT_." WHERE book\" = " . $PDO->quote($res_book) . " AND (\"paragraph\" in {$strQueryParaList} ) AND level>0 AND level<9";
  702. $sth = $PDO->prepare($query);
  703. $sth->execute();
  704. while ($result = $sth->fetch(PDO::FETCH_ASSOC)) {
  705. $paragraph = $result["paragraph"];
  706. $para_title["{$paragraph}"][0] = $result["level"];
  707. $para_title["{$paragraph}"][1] = $result["text"];
  708. }
  709. $db_file = _DIR_PALICANON_TEMPLET_ . "/p" . $res_book . "_tpl.db3";
  710. PDO_Connect(_FILE_DB_PALICANON_TEMPLET_);
  711. foreach ($aParaList as $iPar) {
  712. $query = "SELECT * FROM "._TABLE_PALICANON_TEMPLET_." WHERE ( book = ".$PDO->quote($res_book)." AND paragraph = " . $PDO->quote($iPar) . " ) ";
  713. $sth = $PDO->prepare($query);
  714. $sth->execute();
  715. {
  716. if (isset($para_title["{$iPar}"])) {
  717. $level = $para_title["{$iPar}"][0];
  718. $title = $para_title["{$iPar}"][1];
  719. } else {
  720. $level = 100;
  721. $title = "";
  722. }
  723. $strXml = "<block>";
  724. $strXml .= "<info>";
  725. $strXml .= "<type>wbw</type>";
  726. $strXml .= "<book>{$book}</book>";
  727. $strXml .= "<paragraph>{$iPar}</paragraph>";
  728. $strXml .= "<level>{$level}</level>";
  729. $strXml .= "<title>{$title}</title>";
  730. $strXml .= "<album_id>-1</album_id>";
  731. $strXml .= "<album_guid>{$album_guid}</album_guid>";
  732. $strXml .= "<author>{$USER_NAME}</author>";
  733. $strXml .= "<editor>{$USER_NAME}</editor>";
  734. $strXml .= "<language>en</language>";
  735. $strXml .= "<version>1</version>";
  736. $strXml .= "<edition></edition>";
  737. $strXml .= "<splited>0</splited>";
  738. $strXml .= "<id>" . UUID::v4() . "</id>";
  739. $strXml .= "</info>\n";
  740. $strXml .= "<data>";
  741. fwrite($myfile, $strXml);
  742. while ($result = $sth->fetch(PDO::FETCH_ASSOC)) {
  743. if ($result["gramma"] == "?") {
  744. $wGrammar = "";
  745. } else {
  746. $wGrammar = $result["gramma"];
  747. }
  748. $strXml = "<word>";
  749. $strXml .= "<pali>{$result["word"]}</pali>";
  750. $strXml .= "<real>{$result["real"]}</real>";
  751. $strXml .= "<id>{$result["wid"]}</id>";
  752. $strXml .= "<type status=\"0\">{$result["type"]}</type>";
  753. $strXml .= "<gramma status=\"0\">{$wGrammar}</gramma>";
  754. $strXml .= "<mean status=\"0\">?</mean>";
  755. $strXml .= "<org status=\"0\">" . mb_strtolower($result["part"], 'UTF-8') . "</org>";
  756. $strXml .= "<om status=\"0\">?</om>";
  757. $strXml .= "<case status=\"0\">{$result["type"]}#{$wGrammar}</case>";
  758. $strXml .= "<style>{$result["style"]}</style>";
  759. $strXml .= "<status>0</status>";
  760. $strXml .= "</word>";
  761. fwrite($myfile, $strXml);
  762. }
  763. $strXml = "</data>\n</block>";
  764. fwrite($myfile, $strXml);
  765. }
  766. }
  767. break;
  768. }
  769. }
  770. /*查询结束*/
  771. }
  772. /*
  773. 自动新建译文
  774. */
  775. if (isset($_POST["new_tran"])) {
  776. $new_tran = $_POST["new_tran"];
  777. if ($new_tran == "on") {
  778. $album_guid = UUID::v4();
  779. foreach ($aParaList as $iPar) {
  780. $strXml = "<block>";
  781. $strXml .= "<info>";
  782. $strXml .= "<album_id>-1</album_id>";
  783. $strXml .= "<album_guid>{$album_guid}</album_guid>";
  784. $strXml .= "<type>translate</type>";
  785. $strXml .= "<paragraph>{$iPar}</paragraph>";
  786. $strXml .= "<book>{$book}</book>";
  787. $strXml .= "<author>{$author}</author>";
  788. $strXml .= "<language>en</language>";
  789. $strXml .= "<version>0</version>";
  790. $strXml .= "<edition>0</edition>";
  791. $strXml .= "<id>" . UUID()::v4 . "</id>";
  792. $strXml .= "</info>";
  793. $strXml .= "<data>";
  794. $strXml .= "<sen><begin></begin><end></end><text>new translate</text></sen>";
  795. $strXml .= "</data>";
  796. $strXml .= "</block>\n";
  797. fwrite($myfile, $strXml);
  798. }
  799. }
  800. }
  801. $strXml = " </body>\n";
  802. $strXml .= "</set>\n";
  803. fwrite($myfile, $strXml);
  804. fclose($myfile);
  805. echo "<p>save ok</p>";
  806. $filesize = filesize($sFullFileName);
  807. //服务器端文件列表
  808. PDO_Connect(_FILE_DB_FILEINDEX_);
  809. $query = "INSERT INTO "._TABLE_FILEINDEX_." (
  810. 'id',
  811. 'uid',
  812. 'parent_id',
  813. 'user_id',
  814. 'book',
  815. 'paragraph',
  816. 'file_name',
  817. 'title',
  818. 'tag',
  819. 'status',
  820. 'create_time',
  821. 'modify_time',
  822. 'accese_time',
  823. 'file_size',
  824. 'share',
  825. 'doc_info',
  826. 'doc_block'
  827. )
  828. VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  829. $stmt = $PDO->prepare($query);
  830. $doc_id = UUID::v4();
  831. $newData = array(
  832. $snowflake->id(),
  833. $doc_id,
  834. "",
  835. $uid,
  836. $book,
  837. $create_para,
  838. $FileName,
  839. $user_title,
  840. $tag,
  841. 1,
  842. mTime(),
  843. mTime(),
  844. mTime(),
  845. $filesize,
  846. 0,
  847. "",
  848. "",
  849. );
  850. $stmt->execute($newData);
  851. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  852. $error = PDO_ErrorInfo();
  853. echo "error - $error[2] <br>";
  854. } else {
  855. echo "updata 1 recorders.";
  856. }
  857. echo "<a href=\"editor.php?op=open&fileid={$doc_id}\">正在跳转</a>";
  858. echo "<script>";
  859. echo "window.location.assign(\"editor.php?op=open&fileid={$doc_id}\");";
  860. echo "</script>";
  861. break;
  862. }
  863. case "open":
  864. {
  865. /*打开工程文件
  866. 三种情况
  867. 1.自己的文档
  868. 2.别人的共享文档,自己以前没有打开过。复制到自己的空间,再打开。
  869. 3.别人的共享文档,自己以前打开过。直接打开
  870. */
  871. if ($_COOKIE["uid"]) {
  872. $uid = $_COOKIE["uid"];
  873. } else {
  874. echo "<h3><a href='../ucenter/index.php?op=login'>{$_local->gui->login}</a>后才可以打开文档</h3>";
  875. exit;
  876. }
  877. PDO_Connect(_FILE_DB_FILEINDEX_);
  878. if (isset($_GET["doc_id"])) {
  879. $doc_id = $_GET["doc_id"];
  880. $query = "SELECT * from "._TABLE_FILEINDEX_." where uid=? ";
  881. $Fetch = PDO_FetchAll($query,array($doc_id));
  882. $iFetch = count($Fetch);
  883. if ($iFetch > 0) {
  884. //文档信息
  885. $owner = $Fetch[0]["user_id"];
  886. $filename = $Fetch[0]["file_name"];
  887. $title = $Fetch[0]["title"];
  888. $tag = $Fetch[0]["tag"];
  889. $mbook = $Fetch[0]["book"];
  890. $paragraph = $Fetch[0]["paragraph"];
  891. $doc_head = $Fetch[0]["doc_info"];
  892. if ($owner == $uid) {
  893. //自己的文档
  894. echo "<h3>{$_local->gui->my_document}</h3>";
  895. $my_doc_id = $doc_id;
  896. echo "<a href=\"editor.php?op=opendb&fileid={$doc_id}\">{$_local->gui->open_doc}</a>";
  897. echo "<script>";
  898. echo "window.location.assign(\"editor.php?op=opendb&fileid={$doc_id}\");";
  899. echo "</script>";
  900. } else {
  901. //别人的文档
  902. //查询自己是否以前打开过
  903. $query = "SELECT * from "._TABLE_FILEINDEX_." where parent_id=? and user_id=? ";
  904. $FetchSelf = PDO_FetchAll($query,array($doc_id,$uid));
  905. $iFetchSelf = count($FetchSelf);
  906. if ($iFetchSelf > 0) {
  907. //以前打开过
  908. echo "已经复制的文档 Already Copy";
  909. $my_doc_id = $FetchSelf[0]["uid"];
  910. echo "<a href='../studio/editor.php?op=opendb&fileid={$my_doc_id}'>{$_local->gui->edit_now}</a>";
  911. echo "<script>";
  912. echo "window.location.assign(\"editor.php?op=opendb&fileid={$my_doc_id}\");";
  913. echo "</script>";
  914. } else {
  915. //以前没打开过
  916. //询问是否打开
  917. if (isset($_GET["openin"])) {
  918. $open_in = $_GET["openin"];
  919. } else {
  920. ?>
  921. <p><?php echo $_local->gui->co_doc ?>,<?php echo $_local->gui->open ?>?</p>
  922. <div>
  923. 文档信息:
  924. <ul>
  925. <?php
  926. $book_name = $book["p" . $mbook];
  927. echo "<li>Owner:" . ucenter_get($owner) . "</li>";
  928. echo "<li>Title:{$title}</li>";
  929. echo "<li>Book:{$book_name}</li>";
  930. ?>
  931. </ul>
  932. </div>
  933. <p><?php echo $_local->gui->open_with ?>:</p>
  934. <ul>
  935. <li style="display:none;">
  936. <a href="../reader/?file=<?php echo $doc_id; ?>"><?php echo $_local->gui->reader; ?>(<?php echo $_local->gui->read_only; ?>)</a>
  937. </li>
  938. <?php
  939. if (empty($doc_head)) {
  940. echo '<li><a href="../studio/project.php?op=open&doc_id=' . $doc_id . '&openin=editor">复制到我的空间用编辑器打开</a></li>';
  941. } else {
  942. echo '<li>' . $_local->gui->pcd_studio . '<a href="../doc/fork.php?doc_id=' . $doc_id . '">' . $_local->gui->folk . $_local->gui->and . $_local->gui->edit . '</a></li>';
  943. }
  944. ?>
  945. </ul>
  946. <?php
  947. exit;
  948. }
  949. if ($open_in == "editor") {
  950. //获取文件路径
  951. echo "共享的文档,复制并打开...";
  952. PDO_Connect(_FILE_DB_USERINFO_);
  953. $query = "SELECT userid from "._TABLE_USER_INFO_." where id='$owner'";
  954. $FetchUid = PDO_FetchOne($query);
  955. if ($FetchUid) {
  956. $source = _DIR_USER_DOC_ . "/" . $FetchUid . _DIR_MYDOCUMENT_ . "/" . $filename;
  957. $dest = _DIR_USER_DOC_ . "/" . $_COOKIE["userid"] . _DIR_MYDOCUMENT_ . "/" . $filename;
  958. }
  959. echo "<div>源文件{$source}</div>";
  960. echo "<div>目标文件{$dest}</div>";
  961. if (copy($source, $dest)) {
  962. echo "复制文件成功";
  963. $my_file_name = $filename;
  964. //插入记录到文件索引
  965. $filesize = filesize($dest);
  966. //服务器端文件列表
  967. PDO_Connect(_FILE_DB_FILEINDEX_);
  968. //$query="INSERT INTO fileindex ('id','userid','parent_id','doc_id','book','paragraph','file_name','title','tag','create_time','modify_time','accese_time','file_size')
  969. // VALUES (NULL,?,?,?,?,?,?,?,?,?,?,?,?)";
  970. //$stmt = $PDO->prepare($query);
  971. //$newData=array($uid,$doc_id,UUID::v4(),$mbook,$paragraph,$filename,$title,$tag,time(),time(),time(),$filesize);
  972. $query = "INSERT INTO "._TABLE_FILEINDEX_." (
  973. 'id',
  974. 'uid',
  975. 'parent_id',
  976. 'user_id',
  977. 'book',
  978. 'paragraph',
  979. 'file_name',
  980. 'title',
  981. 'tag',
  982. 'status',
  983. 'create_time',
  984. 'modify_time',
  985. 'accese_time',
  986. 'file_size',
  987. 'share',
  988. 'doc_info',
  989. 'doc_block'
  990. )
  991. VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  992. $stmt = $PDO->prepare($query);
  993. $newdoc_id = UUID::v4();
  994. $newData = array(
  995. $snowflake->id(),
  996. $newdoc_id,
  997. $doc_id,
  998. $uid,
  999. $mbook,
  1000. $paragraph,
  1001. $filename,
  1002. $title,
  1003. $tag,
  1004. 1,
  1005. mTime(),
  1006. mTime(),
  1007. mTime(),
  1008. $filesize,
  1009. 0,
  1010. "",
  1011. "",
  1012. );
  1013. $stmt->execute($newData);
  1014. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  1015. $error = PDO_ErrorInfo();
  1016. echo "error - $error[2] <br>";
  1017. $my_doc_id = "";
  1018. } else {
  1019. $my_doc_id = newdoc_id;
  1020. echo "updata 1 recorders.";
  1021. }
  1022. } else {
  1023. echo "复制文件失败";
  1024. $my_doc_id = "";
  1025. }
  1026. } else {
  1027. echo "错误-无法识别的操作:open in:{$open_in}";
  1028. $my_doc_id = "";
  1029. }
  1030. }
  1031. }
  1032. /*
  1033. if($my_doc_id!=""){
  1034. echo "<script>";
  1035. echo "window.location.assign(\"editor.php?op=open&fileid={$my_doc_id}\");";
  1036. echo "</script>";
  1037. }
  1038. */
  1039. } else {
  1040. echo "未知的文档。可能该文件已经被删除。";
  1041. }
  1042. }
  1043. }
  1044. break;
  1045. case "openfile":
  1046. break;
  1047. case "save":
  1048. break;
  1049. }
  1050. ?>
  1051. </body>