通达OA 常用代码整理(陆续补充)

来源:互联网 发布:手机关屏幕软件 编辑:程序博客网 时间:2024/06/06 04:11

2015版获取用户id

<?phpinclude_once( "inc/auth.inc.php" );?><script>window.location="list.php?userId=<?php echo $_SESSION["LOGIN_USER_ID"]; ?>"</script>

2015查询数据库

$query = "select * from table"$cursor = exequery( TD::conn( ), $query );$hadDate = false;while( $ROW = mysql_fetch_array( $cursor ) ){$hasDate = true;$RUN_ID = $ROW['RUN_ID'];               //流水号}

表单中引用iframe页面

document.onreadystatechange=init;function init(){  if(document.readyState=="complete"){     var Request = new Object(); Request = GetRequest(); var runId; runId = Request["run_id"];       document.getElementById("frameB").src='http://www.tongda.biz?runid='+ runId;  }}function GetRequest() {    var url = location.search; //获取url中"?"符后的字串   var theRequest = new Object();   if (url.indexOf("?") != -1) {      var str = url.substr(1);      strs = str.split("&");      for(var i = 0; i < strs.length; i ++) {         theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);      }   }   return theRequest;}

mysql:

数据表增加列

alter table flow_process add column X_Mon tinyint(1)  null default 0;


存储过程控制数据操作

set autocommit=0;start TRANSACTION;insert INTO news (news_id,SUBJECT) values (17, "hello");insert INTO news (news_id,SUBJECT) values (16, "hello");COMMIT;End;insert INTO news (news_id,SUBJECT) values (17, "hello");

调试写入文件

$file = fopen("d:\\log.txt","w");  echo fwrite($file,$query);  fclose($file);  

细线表格

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> table {border-collapse:collapse; } 
<table cellpadding="1" id="table"   border="1" cellspacing="0" bordercolor="#000000" style="border-collapse:collapse;">

0 0
原创粉丝点击