init web ems all
This commit is contained in:
190
wxc2_omc/sysDefine/wizardParam/comm_func.php
Executable file
190
wxc2_omc/sysDefine/wizardParam/comm_func.php
Executable file
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
$MAX_STEP_COUNT=24;
|
||||
function GetMibSystem()
|
||||
{
|
||||
$mibSystem[SystemCount]=0;
|
||||
$sql="select T1.sysTypeNo,T2.sysTypeName,T1.entryOid,T2.maxSysNum,T2.maxSubSysNum from OMC_PUB.sysMibConf as T1, OMC_PUB.sysConf as T2 where T1.isEnable=1 and T1.sysTypeNo=T2.sysTypeNo ";
|
||||
//echo "$sql<br>";
|
||||
$res=mysqli_query($pubConn,$sql);
|
||||
$mibSystem[SystemCount]=mysqli_num_rows($res);
|
||||
if($mibSystem[SystemCount] == 0)
|
||||
return $mibSystem;
|
||||
|
||||
for($i=0;$i<$mibSystem[SystemCount];$i++)
|
||||
{
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$mibSystem[$i][SysTypeNo]=$row[sysTypeNo]+0;
|
||||
$mibSystem[$i][SysTypeName]=$row[sysTypeName];
|
||||
$mibSystem[$i][EntryOID]=$row[entryOid];
|
||||
$mibSystem[$i][MaxSysNum]=$row[maxSysNum];
|
||||
$mibSystem[$i][MaxSubSysNum]=$row[maxSubSysNum];
|
||||
}
|
||||
return $mibSystem;
|
||||
}
|
||||
|
||||
function getLevelWhere($objIdStr)
|
||||
{
|
||||
$levelArr=explode('.',$objIdStr);
|
||||
for($j=0;$j<sizeof($levelArr);$j++){
|
||||
$levelNo=$j+1;
|
||||
${"level_$levelNo"}=$levelArr[$j];
|
||||
if($DEBUG) echo "<BR>levelArr[$j]={$levelArr[$j]}";
|
||||
if($j == 0){
|
||||
$levelWhere ="level_$levelNo='${"level_$levelNo"}'";
|
||||
}else{
|
||||
$levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'";
|
||||
}
|
||||
}
|
||||
return($levelWhere);
|
||||
}
|
||||
|
||||
function getOIDByRow($row)
|
||||
{
|
||||
$oid="";
|
||||
for($i=1;$i<=10;$i++)
|
||||
{
|
||||
$level="level_".$i;
|
||||
if($row[$level] == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$oid.=$row[$level].".";
|
||||
}
|
||||
}
|
||||
$oid=substr($oid,0,strlen($oid)-1);
|
||||
return $oid;
|
||||
}
|
||||
|
||||
function adjustTableName($name)
|
||||
{
|
||||
$len=strlen($name);
|
||||
$result="";
|
||||
|
||||
if($name[0]>='a' && $name[0]<='z')
|
||||
$result.=chr(ord($name[0])-32);
|
||||
for($i=1;$i<$len;$i++)
|
||||
{
|
||||
if($i != 1)
|
||||
if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z')
|
||||
$result.=" ";
|
||||
|
||||
if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z')
|
||||
$result.=" ";
|
||||
|
||||
$result.=$name[$i];
|
||||
|
||||
if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9'))
|
||||
$result.=" ";
|
||||
if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9'))
|
||||
$result.=" ";
|
||||
}
|
||||
|
||||
$result=str_replace("Table","",$result);
|
||||
$result=str_replace("Entry","",$result);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function GetTabConf($sysTypeNo)
|
||||
{
|
||||
$sql="select * from OBJ_{$sysTypeNo}.paramConf where maxAccess=0 and name_2 <> 'parameter' order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=@mysqli_num_rows($res);
|
||||
//echo "$sql<br>";
|
||||
for($i=0;$i<$num;$i++)
|
||||
{
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$tabConf[$i][Name]=adjustTableName($row[name_2]);
|
||||
$tabConf[$i][OID]=getOIDByRow($row);
|
||||
|
||||
$checkoid=$tabConf[$i][OID].".1.1.0";
|
||||
$checkwhere=getLevelWhere($checkoid);
|
||||
$checksql="select desc_2 from OBJ_{$sysTypeNo}.paramConf where $checkwhere";
|
||||
$checkres=@mysqli_query($pubConn,$checksql);
|
||||
$checknum=@mysqli_num_rows($checkres);
|
||||
if($checknum == 1)
|
||||
{
|
||||
$checkrow=@mysqli_fetch_array($checkres);
|
||||
$desc=$checkrow[desc_2];
|
||||
if(strstr($desc,"Name:"))
|
||||
{
|
||||
$new_name=explode("Name:",$desc);
|
||||
$tabConf[$i][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if($num == 0)
|
||||
return 0;
|
||||
return $tabConf;
|
||||
}
|
||||
|
||||
function GetWizardList()
|
||||
{
|
||||
$sql="select * from WIZARD_DB.wizardList order by instance ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=@mysqli_num_rows($res);
|
||||
$wizardList[WizardCount]=$num;
|
||||
if($wizardList[WizardCount] == 0)
|
||||
return $wizardList;
|
||||
for($i=0;$i<$num;$i++)
|
||||
{
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$wizardList[$i][WizardTitle]=$row[func_title];
|
||||
$wizardList[$i][WizardInstance]=$row[instance];
|
||||
}
|
||||
return $wizardList;
|
||||
}
|
||||
|
||||
function GetWizard($wizard_instance)
|
||||
{
|
||||
$sql="select * from WIZARD_DB.wizardList where instance=$wizard_instance ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=@mysqli_num_rows($res);
|
||||
if($num == 0)
|
||||
return 0;
|
||||
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$wizard[WizardTitle]=$row[func_title];
|
||||
$wizard[WizardDescription]=$row[func_desc];
|
||||
|
||||
return $wizard;
|
||||
}
|
||||
|
||||
function GetStepList($wizard_instance)
|
||||
{
|
||||
$sql="select * from WIZARD_DB.stepList where wizard_instance={$wizard_instance} order by step_order ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=@mysqli_num_rows($res);
|
||||
$stepList[StepCount]=$num;
|
||||
if($stepList[StepCount] == 0)
|
||||
return $stepList;
|
||||
for($i=0;$i<$num;$i++)
|
||||
{
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$stepList[$i][StepIndex]=$row[step_order]+1;
|
||||
$stepList[$i][StepTitle]=$row[step_title];
|
||||
$stepList[$i][StepDesc]=$row[step_desc];
|
||||
$stepList[$i][RelatedSystemTypeNo]=$row[related_system]+0;
|
||||
$stepList[$i][RelatedTableOID]=$row[related_table];
|
||||
}
|
||||
return $stepList;
|
||||
}
|
||||
|
||||
function discardReturn($content)
|
||||
{
|
||||
$tmpstr=$content;
|
||||
$tmplen=strlen($tmpstr);
|
||||
$newstr="";
|
||||
for($j=0;$j< $tmplen;$j++)
|
||||
{
|
||||
if(ord($tmpstr[$j]) != 10 && ord($tmpstr[$j]) != 13)
|
||||
$newstr.=$tmpstr[$j];
|
||||
}
|
||||
return $newstr;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
17
wxc2_omc/sysDefine/wizardParam/get_table_list.php
Executable file
17
wxc2_omc/sysDefine/wizardParam/get_table_list.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
require("../../inc/lib.inc");
|
||||
require("./comm_func.php");
|
||||
?>
|
||||
|
||||
<?php
|
||||
$tabConf=GetTabConf($sysTypeNo);
|
||||
$tabCount=count($tabConf);
|
||||
$response="$step_pos,";
|
||||
for($i=0;$i<$tabCount;$i++)
|
||||
{
|
||||
$response.=$tabConf[$i][OID].",";
|
||||
$response.=$tabConf[$i][Name].",";
|
||||
}
|
||||
$response=substr($response,0,strlen($response)-1);
|
||||
echo $response;
|
||||
?>
|
||||
260
wxc2_omc/sysDefine/wizardParam/wizard_param_add.php
Executable file
260
wxc2_omc/sysDefine/wizardParam/wizard_param_add.php
Executable file
@@ -0,0 +1,260 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
require("./comm_func.php");
|
||||
?>
|
||||
|
||||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
|
||||
<script language="javascript">
|
||||
var step_index=0;
|
||||
|
||||
function create_new_step()
|
||||
{
|
||||
document.getElementById('step_id_'+step_index).style.display='';
|
||||
document.getElementById('delete_step_id').style.display='';
|
||||
step_index++;
|
||||
document.getElementById('step_count').value++;
|
||||
if(step_index == 24)
|
||||
document.getElementById('create_step_id').style.display='none';
|
||||
}
|
||||
|
||||
function delete_step()
|
||||
{
|
||||
document.getElementById('step_id_'+(step_index-1)).style.display='none';
|
||||
document.getElementById('create_step_id').style.display='';
|
||||
step_index--;
|
||||
document.getElementById('step_count').value--;
|
||||
if(step_index == 0)
|
||||
document.getElementById('delete_step_id').style.display='none';
|
||||
}
|
||||
|
||||
function create_wizard()
|
||||
{
|
||||
if(document.getElementById('wizard_title').value.length == 0)
|
||||
{
|
||||
alert("Please input the wizard title");
|
||||
return;
|
||||
}
|
||||
var tmpi=document.getElementById('step_count').value-0;
|
||||
if(tmpi == 0)
|
||||
{
|
||||
alert("Please add one step at least");
|
||||
return;
|
||||
}
|
||||
for(i=0;i<tmpi;i++)
|
||||
{
|
||||
if(document.getElementById('step_title_'+i).value.length == 0)
|
||||
{
|
||||
alert("Please input the title of step-"+(i+1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
document.getElementById('create_wizard_flag').value=1;
|
||||
document.myform.submit();
|
||||
}
|
||||
|
||||
function getTableList(step_i)
|
||||
{
|
||||
var sysTypeNo=document.getElementById('step_related_system_'+step_i).value;
|
||||
var fixurl="./get_table_list.php?sysTypeNo="+sysTypeNo+"&step_pos="+step_i;
|
||||
var browserr = navigator.appName;
|
||||
if(browserr == "Microsoft Internet Explorer")
|
||||
{
|
||||
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
else
|
||||
{
|
||||
request_oo = new XMLHttpRequest();
|
||||
}
|
||||
request_oo.open("GET",fixurl,"false");
|
||||
|
||||
request_oo.onreadystatechange=function()
|
||||
{
|
||||
getResponse();
|
||||
}
|
||||
request_oo.send(null);
|
||||
}
|
||||
|
||||
function getResponse()
|
||||
{
|
||||
if(request_oo.readyState == 3)
|
||||
{
|
||||
//alert("not finish");
|
||||
}
|
||||
if(request_oo.readyState == 4)
|
||||
{
|
||||
var response = request_oo.responseText;
|
||||
|
||||
var items=response.split(',');
|
||||
var step_pos=items[0].replace(/(^\s*)|(\s*$)/g, "");
|
||||
//alert(response);
|
||||
var sel_obj=document.getElementById('step_related_table_'+step_pos);
|
||||
for(i=sel_obj.length-1;i>=0;i--)
|
||||
{
|
||||
sel_obj[i]=null;
|
||||
}
|
||||
var opt_len=0;
|
||||
for(i=1;i<items.length;i++)
|
||||
{
|
||||
var oid=items[i].replace(/(^\s*)|(\s*$)/g, "");
|
||||
i++;
|
||||
var nam=items[i].replace(/(^\s*)|(\s*$)/g, "");
|
||||
sel_obj[opt_len]=new Option(nam,oid);
|
||||
opt_len++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
adjust_head();
|
||||
|
||||
adjust_title_head();
|
||||
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"50%\">";
|
||||
echo "Template > Function Wizard";
|
||||
echo "</td>";
|
||||
echo "<td width=\"50%\" align=\"right\">";
|
||||
echo " ";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"50%\"> </td>";
|
||||
echo "<td width=\"50%\" align=right>";
|
||||
echo " ";
|
||||
echo "<a href=\"./wizard_param_mng.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
adjust_title_tail();
|
||||
adjust_content_head();
|
||||
echo "<br>";
|
||||
|
||||
$mibSystem=GetMibSystem();
|
||||
//echo "<pre>";
|
||||
//print_r($mibSystem);
|
||||
//echo "</pre>";
|
||||
|
||||
$tabConf=GetTabConf($mibSystem[0][SysTypeNo]);
|
||||
$tabCount=count($tabConf);
|
||||
//echo "<pre>";
|
||||
//print_r($tabConf);
|
||||
//echo "</pre>";
|
||||
|
||||
echo "<form name=\"myform\" action=\"./wizard_param_mng.php\" method=\"post\">";
|
||||
echo "<table border=0 cellspacing=0 cellpadding=0 width=100%>";
|
||||
|
||||
//Wizard Title
|
||||
echo "<tr>";
|
||||
echo "<td width=20%>";
|
||||
echo "Function Title:";
|
||||
echo "</td>";
|
||||
echo "<td width=80%>";
|
||||
echo "<input type=edit class=text size=64 name=\"wizard_title\">";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Wizard Description
|
||||
echo "<tr>";
|
||||
echo "<td style=\"vertical-align:top;\">";
|
||||
echo "Function Description:";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<textarea class=text cols=63 rows=5 name=\"wizard_desc\">";
|
||||
echo "</textarea>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
echo "<input type=hidden name=\"step_count\" value=0>";
|
||||
|
||||
echo "<input type=hidden name=\"create_wizard_flag\" value=0>";
|
||||
echo "<input type=hidden name=\"delete_wizard_flag\" value=0>";
|
||||
echo "<input type=hidden name=\"modify_wizard_flag\" value=0>";
|
||||
|
||||
for($i=0;$i<$MAX_STEP_COUNT;$i++)
|
||||
{
|
||||
echo "<div id=\"step_id_$i\" style=\"display:none;\">";
|
||||
echo "<hr width=68% align=left size=5>";
|
||||
|
||||
echo "<b>Step ".($i+1)."</b><br>";
|
||||
echo "<table border=0 cellspacing=0 cellpadding=0 width=100%>";
|
||||
|
||||
//Step Title
|
||||
echo "<tr>";
|
||||
echo "<td width=20%>";
|
||||
echo "Title:";
|
||||
echo "</td>";
|
||||
echo "<td width=80%>";
|
||||
echo "<input type=edit class=text size=64 name=\"step_title_$i\">";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Step Description
|
||||
echo "<tr>";
|
||||
echo "<td style=\"vertical-align:top;\">";
|
||||
echo "Function Description:";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<textarea class=text cols=63 rows=5 name=\"step_desc_$i\">";
|
||||
echo "</textarea>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Related System
|
||||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo "Related System:";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<select name=\"step_related_system_$i\" onchange=\"javascript:getTableList('$i');\">";
|
||||
for($j=0;$j<$mibSystem[SystemCount];$j++)
|
||||
{
|
||||
echo "<option value=\"{$mibSystem[$j][SysTypeNo]}\">";
|
||||
echo "{$mibSystem[$j][SysTypeName]}";
|
||||
echo "</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Related table
|
||||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo "Related Table:";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<select name=\"step_related_table_$i\">";
|
||||
for($j=0;$j<$tabCount;$j++)
|
||||
{
|
||||
echo "<option value=\"{$tabConf[$j][OID]}\">";
|
||||
echo "{$tabConf[$j][Name]}";
|
||||
echo "</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
|
||||
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
//Button
|
||||
echo "<br>";
|
||||
echo "<input id=\"create_step_id\" type=button class=button value=\"Create Step\" onclick=\"javascript:create_new_step();\">";
|
||||
echo " ";
|
||||
echo "<input id=\"delete_step_id\" type=button class=button value=\"Delete Step\" onclick=\"javascript:delete_step();\" style=\"display:none;\">";
|
||||
echo " ";
|
||||
echo "<input type=button class=button value=\"Create Wizard\" onclick=\"javascript:create_wizard();\">";
|
||||
|
||||
|
||||
|
||||
|
||||
echo "</form>";
|
||||
adjust_content_tail();
|
||||
?>
|
||||
|
||||
324
wxc2_omc/sysDefine/wizardParam/wizard_param_edit.php
Executable file
324
wxc2_omc/sysDefine/wizardParam/wizard_param_edit.php
Executable file
@@ -0,0 +1,324 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
require("./comm_func.php");
|
||||
?>
|
||||
|
||||
<?php
|
||||
$stepList=GetStepList($wizard_instance);
|
||||
?>
|
||||
|
||||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
|
||||
<script language="javascript">
|
||||
var step_index=<?php echo $stepList[StepCount];?>;
|
||||
|
||||
function init()
|
||||
{
|
||||
for(var i=0;i<step_index;i++)
|
||||
{
|
||||
var prev_val=document.getElementById('step_related_table_'+i).value;
|
||||
getTableList(i);
|
||||
|
||||
var sel_obj=document.getElementById('step_related_table_'+i);
|
||||
|
||||
|
||||
for(var j=0;j<sel_obj.length;j++)
|
||||
{
|
||||
//alert(prev_val+' '+sel_obj.options[j].value);
|
||||
if(prev_val == sel_obj.options[j].value)
|
||||
{
|
||||
sel_obj.options[j].selected=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function create_new_step()
|
||||
{
|
||||
document.getElementById('step_id_'+step_index).style.display='';
|
||||
document.getElementById('delete_step_id').style.display='';
|
||||
step_index++;
|
||||
document.getElementById('step_count').value++;
|
||||
if(step_index == 24)
|
||||
document.getElementById('create_step_id').style.display='none';
|
||||
}
|
||||
|
||||
function delete_step()
|
||||
{
|
||||
document.getElementById('step_id_'+(step_index-1)).style.display='none';
|
||||
document.getElementById('create_step_id').style.display='';
|
||||
step_index--;
|
||||
document.getElementById('step_count').value--;
|
||||
if(step_index == 0)
|
||||
document.getElementById('delete_step_id').style.display='none';
|
||||
}
|
||||
|
||||
function create_wizard()
|
||||
{
|
||||
if(document.getElementById('wizard_title').value.length == 0)
|
||||
{
|
||||
alert("Please input the wizard title");
|
||||
return;
|
||||
}
|
||||
var tmpi=document.getElementById('step_count').value-0;
|
||||
if(tmpi == 0)
|
||||
{
|
||||
alert("Please add one step at least");
|
||||
return;
|
||||
}
|
||||
for(i=0;i<tmpi;i++)
|
||||
{
|
||||
if(document.getElementById('step_title_'+i).value.length == 0)
|
||||
{
|
||||
alert("Please input the title of step-"+(i+1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('modify_wizard_flag').value=1;
|
||||
document.myform.submit();
|
||||
}
|
||||
|
||||
function detele_wizard(w_instance)
|
||||
{
|
||||
document.getElementById('delete_wizard_flag').value=1;
|
||||
document.myform.submit();
|
||||
}
|
||||
|
||||
function getTableList(step_i)
|
||||
{
|
||||
var sysTypeNo=document.getElementById('step_related_system_'+step_i).value;
|
||||
var fixurl="./get_table_list.php?sysTypeNo="+sysTypeNo+"&step_pos="+step_i;
|
||||
var browserr = navigator.appName;
|
||||
if(browserr == "Microsoft Internet Explorer")
|
||||
{
|
||||
request_oo = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
else
|
||||
{
|
||||
request_oo = new XMLHttpRequest();
|
||||
}
|
||||
request_oo.open("GET",fixurl,"false");
|
||||
|
||||
request_oo.onreadystatechange=function()
|
||||
{
|
||||
getResponse();
|
||||
}
|
||||
request_oo.send(null);
|
||||
}
|
||||
|
||||
function getResponse()
|
||||
{
|
||||
if(request_oo.readyState == 3)
|
||||
{
|
||||
//alert("not finish");
|
||||
}
|
||||
if(request_oo.readyState == 4)
|
||||
{
|
||||
var response = request_oo.responseText;
|
||||
|
||||
var items=response.split(',');
|
||||
var step_pos=items[0].replace(/(^\s*)|(\s*$)/g, "");
|
||||
//alert(response);
|
||||
var sel_obj=document.getElementById('step_related_table_'+step_pos);
|
||||
for(i=sel_obj.length-1;i>=0;i--)
|
||||
{
|
||||
sel_obj[i]=null;
|
||||
}
|
||||
var opt_len=0;
|
||||
for(i=1;i<items.length;i++)
|
||||
{
|
||||
var oid=items[i].replace(/(^\s*)|(\s*$)/g, "");
|
||||
i++;
|
||||
var nam=items[i].replace(/(^\s*)|(\s*$)/g, "");
|
||||
sel_obj[opt_len]=new Option(nam,oid);
|
||||
opt_len++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<?php
|
||||
adjust_head();
|
||||
|
||||
adjust_title_head();
|
||||
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"50%\">";
|
||||
echo "Template > Function Wizard";
|
||||
echo "</td>";
|
||||
echo "<td width=\"50%\" align=\"right\">";
|
||||
echo " ";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"50%\"> </td>";
|
||||
echo "<td width=\"50%\" align=right>";
|
||||
echo " ";
|
||||
echo "<a href=\"./wizard_param_mng.php\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
adjust_title_tail();
|
||||
adjust_content_head();
|
||||
echo "<br>";
|
||||
|
||||
if(0)
|
||||
echo "wizard_instance=$wizard_instance<br>";
|
||||
|
||||
$the_wizard=GetWizard($wizard_instance);
|
||||
|
||||
$mibSystem=GetMibSystem();
|
||||
//echo "<pre>";
|
||||
//print_r($mibSystem);
|
||||
//echo "</pre>";
|
||||
|
||||
$tabConf=GetTabConf($mibSystem[0][SysTypeNo]);
|
||||
$tabCount=count($tabConf);
|
||||
//echo "<pre>";
|
||||
//print_r($tabConf);
|
||||
//echo "</pre>";
|
||||
|
||||
echo "<form name=\"myform\" action=\"./wizard_param_mng.php\" method=\"post\">";
|
||||
echo "<table border=0 cellspacing=0 cellpadding=0 width=100%>";
|
||||
|
||||
//Wizard Title
|
||||
echo "<tr>";
|
||||
echo "<td width=20%>";
|
||||
echo "Function Title:";
|
||||
echo "</td>";
|
||||
echo "<td width=80%>";
|
||||
echo "<input type=edit class=text size=64 name=\"wizard_title\" value=\"{$the_wizard[WizardTitle]}\">";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Wizard Description
|
||||
echo "<tr>";
|
||||
echo "<td style=\"vertical-align:top;\">";
|
||||
echo "Function Description:";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<textarea class=text cols=63 rows=5 name=\"wizard_desc\">";
|
||||
echo "{$the_wizard[WizardDescription]}";
|
||||
echo "</textarea>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
echo "<input type=hidden name=\"step_count\" value=\"{$stepList[StepCount]}\">";
|
||||
//echo "StepCount={$stepList[StepCount]}<br>";
|
||||
echo "<input type=hidden name=\"wizard_instance\" value=\"{$wizard_instance}\">";
|
||||
|
||||
echo "<input type=hidden name=\"create_wizard_flag\" value=0>";
|
||||
echo "<input type=hidden name=\"delete_wizard_flag\" value=0>";
|
||||
echo "<input type=hidden name=\"modify_wizard_flag\" value=0>";
|
||||
|
||||
for($i=0;$i<$MAX_STEP_COUNT;$i++)
|
||||
{
|
||||
if($i < $stepList[StepCount])
|
||||
echo "<div id=\"step_id_$i\">";
|
||||
else
|
||||
echo "<div id=\"step_id_$i\" style=\"display:none;\">";
|
||||
echo "<hr width=68% align=left size=5>";
|
||||
|
||||
echo "<b>Step ".($i+1)."</b><br>";
|
||||
echo "<table border=0 cellspacing=0 cellpadding=0 width=100%>";
|
||||
|
||||
//Step Title
|
||||
echo "<tr>";
|
||||
echo "<td width=20%>";
|
||||
echo "Title:";
|
||||
echo "</td>";
|
||||
echo "<td width=80%>";
|
||||
if($i < $stepList[StepCount])
|
||||
echo "<input type=edit class=text size=64 name=\"step_title_$i\" value=\"{$stepList[$i][StepTitle]}\">";
|
||||
else
|
||||
echo "<input type=edit class=text size=64 name=\"step_title_$i\">";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Step Description
|
||||
echo "<tr>";
|
||||
echo "<td style=\"vertical-align:top;\">";
|
||||
echo "Function Description:";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<textarea class=text cols=63 rows=5 name=\"step_desc_$i\">";
|
||||
if($i < $stepList[StepCount])
|
||||
{
|
||||
echo "{$stepList[$i][StepDesc]}";
|
||||
}
|
||||
echo "</textarea>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Related System
|
||||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo "Related System:";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<select name=\"step_related_system_$i\" onchange=\"javascript:getTableList('$i');\">";
|
||||
for($j=0;$j<$mibSystem[SystemCount];$j++)
|
||||
{
|
||||
if($i < $stepList[StepCount] && $stepList[$i][RelatedSystemTypeNo]==$mibSystem[$j][SysTypeNo])
|
||||
echo "<option value=\"{$mibSystem[$j][SysTypeNo]}\" selected>";
|
||||
else
|
||||
echo "<option value=\"{$mibSystem[$j][SysTypeNo]}\">";
|
||||
echo "{$mibSystem[$j][SysTypeName]}";
|
||||
echo "</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Related table
|
||||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo "Related Table:";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "<select name=\"step_related_table_$i\">";
|
||||
for($j=0;$j<$tabCount;$j++)
|
||||
{
|
||||
if($i < $stepList[StepCount] && strcmp($stepList[$i][RelatedTableOID],$tabConf[$j][OID]) == 0)
|
||||
echo "<option value=\"{$tabConf[$j][OID]}\" selected>";
|
||||
else
|
||||
echo "<option value=\"{$tabConf[$j][OID]}\">";
|
||||
echo "{$tabConf[$j][Name]}";
|
||||
echo "</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
|
||||
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
//Button
|
||||
echo "<br>";
|
||||
echo "<input id=\"create_step_id\" type=button class=button value=\"Create Step\" onclick=\"javascript:create_new_step();\">";
|
||||
echo " ";
|
||||
echo "<input id=\"delete_step_id\" type=button class=button value=\"Delete Step\" onclick=\"javascript:delete_step();\">";
|
||||
echo " ";
|
||||
echo "<input type=button class=button value=\"Save Wizard\" onclick=\"javascript:create_wizard();\">";
|
||||
echo " ";
|
||||
echo "<input type=button class=button value=\"Delete Wizard\" onclick=\"javascript:detele_wizard('{$wizard_instance}');\">";
|
||||
|
||||
|
||||
|
||||
echo "</form>";
|
||||
adjust_content_tail();
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
init();
|
||||
</script>
|
||||
|
||||
149
wxc2_omc/sysDefine/wizardParam/wizard_param_mng.php
Executable file
149
wxc2_omc/sysDefine/wizardParam/wizard_param_mng.php
Executable file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
require("./comm_func.php");
|
||||
?>
|
||||
|
||||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
<?php
|
||||
adjust_head();
|
||||
|
||||
adjust_title_head();
|
||||
echo "<form name=\"statusForm\" method=\"post\">";
|
||||
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"50%\">";
|
||||
echo "Template > Function Wizard";
|
||||
echo "</td>";
|
||||
echo "<td width=\"50%\" align=\"right\">";
|
||||
echo " ";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"50%\"> </td>";
|
||||
echo "<td width=\"50%\" align=right>";
|
||||
echo " ";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
adjust_title_tail();
|
||||
adjust_content_head();
|
||||
|
||||
if($create_wizard_flag == 1)
|
||||
{
|
||||
$wizard_desc=discardReturn($wizard_desc);
|
||||
$sql="insert into WIZARD_DB.wizardList(func_title,func_desc) values('$wizard_title','$wizard_desc') ";
|
||||
@mysqli_query($pubConn,$sql);
|
||||
|
||||
$sql="select instance from WIZARD_DB.wizardList where func_title='$wizard_title' ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=@mysqli_num_rows($res);
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$wizard_instance=$row[instance];
|
||||
for($j=0;$j<$step_count;$j++)
|
||||
{
|
||||
$param="step_title_".$j;
|
||||
$step_title=$$param;
|
||||
$param="step_desc_".$j;
|
||||
$step_desc=$$param;
|
||||
$step_desc=discardReturn($step_desc);
|
||||
$param="step_related_system_".$j;
|
||||
$step_related_system=$$param;
|
||||
$param="step_related_table_".$j;
|
||||
$step_related_table=$$param;
|
||||
$sql="insert into WIZARD_DB.stepList(step_order,step_title,step_desc,related_system,related_table,wizard_instance) values($j,'$step_title','$step_desc',$step_related_system,'$step_related_table',$wizard_instance) ";
|
||||
@mysqli_query($pubConn,$sql);
|
||||
}
|
||||
|
||||
|
||||
if(0)
|
||||
{
|
||||
echo "wizard_title=$wizard_title<br>";
|
||||
echo "wizard_desc=$wizard_desc<br>";
|
||||
echo "step_count=$step_count<br>";
|
||||
for($j=0;$j<$step_count;$j++)
|
||||
{
|
||||
$param="step_title_".$j;
|
||||
echo "step_title_{$j}={$$param},";
|
||||
$param="step_desc_".$j;
|
||||
echo "step_desc_{$j}={$$param},";
|
||||
$param="step_related_system_".$j;
|
||||
echo "step_related_system_{$j}={$$param},";
|
||||
$param="step_related_table_".$j;
|
||||
echo "step_related_table_{$j}={$$param}<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($delete_wizard_flag == 1)
|
||||
{
|
||||
$sql="delete from WIZARD_DB.stepList where wizard_instance={$wizard_instance} ";
|
||||
@mysqli_query($pubConn,$sql);
|
||||
|
||||
$sql="delete from WIZARD_DB.wizardList where instance={$wizard_instance} ";
|
||||
@mysqli_query($pubConn,$sql);
|
||||
//echo "wizard_instance=$wizard_instance<br>";
|
||||
|
||||
//delete the related wizard record
|
||||
$sql="select instance from WIZARD_DB.wizardRecordList where wizard_instance={$wizard_instance} ";
|
||||
$res=@mysqli_query($pubConn,$sql);
|
||||
$num=@mysqli_num_rows($res);
|
||||
if($num > 0)
|
||||
{
|
||||
for($i=0;$i<$num;$i++)
|
||||
{
|
||||
$row=@mysqli_fetch_array($res);
|
||||
$tmpi=$row[instance]+0;
|
||||
$delsql="delete from WIZARD_DB.stepRecordList where record_instance={$tmpi} ";
|
||||
@mysqli_query($pubConn,$delsql);
|
||||
}
|
||||
}
|
||||
$delsql="delete from WIZARD_DB.wizardRecordList where wizard_instance={$wizard_instance} ";
|
||||
@mysqli_query($pubConn,$delsql);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if($modify_wizard_flag == 1)
|
||||
{
|
||||
$wizard_desc=discardReturn($wizard_desc);
|
||||
$sql="update WIZARD_DB.wizardList set func_title='$wizard_title',func_desc='$wizard_desc' where instance={$wizard_instance} ";
|
||||
@mysqli_query($pubConn,$sql);
|
||||
|
||||
$sql="delete from WIZARD_DB.stepList where wizard_instance=$wizard_instance ";
|
||||
@mysqli_query($pubConn,$sql);
|
||||
|
||||
for($j=0;$j<$step_count;$j++)
|
||||
{
|
||||
$param="step_title_".$j;
|
||||
$step_title=$$param;
|
||||
$param="step_desc_".$j;
|
||||
$step_desc=$$param;
|
||||
$step_desc=discardReturn($step_desc);
|
||||
$param="step_related_system_".$j;
|
||||
$step_related_system=$$param;
|
||||
$param="step_related_table_".$j;
|
||||
$step_related_table=$$param;
|
||||
$sql="insert into WIZARD_DB.stepList(step_order,step_title,step_desc,related_system,related_table,wizard_instance) values($j,'$step_title','$step_desc',$step_related_system,'$step_related_table',$wizard_instance) ";
|
||||
@mysqli_query($pubConn,$sql);
|
||||
}
|
||||
}
|
||||
|
||||
echo "<br>";
|
||||
echo "<a href=\"./wizard_param_add.php?type=new\">Create New Function Wizard<a/>";
|
||||
|
||||
$wizardList=GetWizardList();
|
||||
|
||||
echo "<ul>";
|
||||
|
||||
for($i=0;$i<$wizardList[WizardCount];$i++)
|
||||
{
|
||||
echo "<li>";
|
||||
echo "<a href=\"./wizard_param_edit.php?wizard_instance={$wizardList[$i][WizardInstance]}\">{$wizardList[$i][WizardTitle]}</a>";
|
||||
echo "</li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
|
||||
adjust_content_tail();
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user