Show
Ignore:
Timestamp:
03/10/10 14:31:35 (2 years ago)
Author:
Hugo
Message:

idnsOrg/vOrg: replaced funcMetaParam

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/unxsBind/interfaces/org/resource.c

    r1099 r1221  
    393393{ 
    394394        //This function will display the extra parameter inputs based on RRType 
    395          
    396         if(!strcmp(cRRType,"SRV")) 
    397         { 
    398                 fprintf(fp,"<tr><td><a class=inputLink href=\"#\" onClick=\"javascript:window.open('" 
    399                         "?gcPage=Glossary&cLabel=%s','Glossary','height=600,width=500,status=yes,toolbar=no," 
    400                         "menubar=no,location=no,scrollbars=1')\"><strong>%s</strong></a>\n</td>" 
    401                         "<td><input title='%s' type=text name=cParam2 value='%s' size=40 maxlength=255 class=%s></td>" 
    402                         "</tr>\n" 
    403                         "<tr><td><a class=inputLink href=\"#\" onClick=\"javascript:window.open('?gcPage=Glossary&cLabel=%s'," 
    404                         "'Glossary','height=600,width=500,status=yes,toolbar=no,menubar=no,location=no,scrollbars=1')\">" 
    405                         "<strong>%s</strong></a>\n</td>" 
    406                         "<td><input title='%s' type=text name=cParam3 value='%s' size=40 maxlength=255 class=%s></td>" 
    407                         "</tr>\n" 
    408                         "<tr><td><a class=inputLink href=\"#\" onClick=\"javascript:window.open('?gcPage=Glossary&cLabel=%s'," 
    409                         "'Glossary','height=600,width=500,status=yes,toolbar=no,menubar=no,location=no,scrollbars=1')\">" 
    410                         "<strong>%s</strong></a>\n</td>" 
    411                         "<td><input title='%s' type=text name=cParam4 value='%s' size=40 maxlength=255 class=%s></td>" 
    412                         "</tr>\n", 
    413                                 cParam2Label 
    414                                 ,cParam2Label 
    415                                 ,cParam2Tip 
    416                                 ,cParam2 
    417                                 ,cParam2Style 
    418                                 ,cParam3Label 
    419                                 ,cParam3Label 
    420                                 ,cParam3Tip 
    421                                 ,cParam3 
    422                                 ,cParam3Style 
    423                                 ,cParam4Label 
    424                                 ,cParam4Label 
    425                                 ,cParam4Tip 
    426                                 ,cParam4 
    427                                 ,cParam4Style 
    428                         ); 
    429         } 
    430         else if(strcmp(cRRType,"SRV") && strcmp(cParam2Label,"Not Used")) 
    431         { 
    432                 fprintf(fp,"<tr><td><a class=inputLink href=\"#\" onClick=\"javascript:window.open('?gcPage=Glossary&cLabel=%s'," 
    433                         "'Glossary','height=600,width=500,status=yes,toolbar=no,menubar=no,location=no,scrollbars=1')\">" 
    434                         "<strong>%s</strong></a>\n</td><td><input title='%s' type=text name=cParam2 value='%s' size=40 maxlength=255 " 
    435                         "class=%s></td></tr>\n", 
    436                         cParam2Label 
    437                         ,cParam2Label 
    438                         ,cParam2Tip 
    439                         ,cParam2 
    440                         ,cParam2Style 
    441                         ); 
    442         } 
     395        MYSQL_RES *res; 
     396        MYSQL_ROW field; 
     397 
     398        struct t_template template; 
     399        unsigned uParam2=0; 
     400        unsigned uParam3=0; 
     401        unsigned uParam4=0; 
     402 
     403        sprintf(gcQuery,"SELECT uParam2,uParam3,uParam4 FROM tRRType WHERE cLabel='%s'",TextAreaSave(cRRType)); 
     404        mysql_query(&gMysql,gcQuery); 
     405        if(mysql_errno(&gMysql)) 
     406                htmlPlainTextError(mysql_error(&gMysql)); 
     407        res=mysql_store_result(&gMysql); 
     408        if((field=mysql_fetch_row(res))) 
     409        { 
     410                sscanf(field[0],"%u",&uParam2); 
     411                sscanf(field[1],"%u",&uParam3); 
     412                sscanf(field[2],"%u",&uParam4); 
     413        } 
     414        mysql_free_result(res); 
     415 
     416        template.cpName[0]="cParam2Label"; 
     417        template.cpValue[0]=cParam2Label; 
     418 
     419        template.cpName[1]="cParam2Tip"; 
     420        template.cpValue[1]=cParam2Tip; 
     421 
     422        template.cpName[2]="cParam2"; 
     423        template.cpValue[2]=cParam2; 
     424         
     425        template.cpName[3]="cParam2Style"; 
     426        template.cpValue[3]=cParam2Style; 
     427 
     428        template.cpName[4]="cParam3Label"; 
     429        template.cpValue[4]=cParam3Label; 
     430 
     431        template.cpName[5]="cParam3Tip"; 
     432        template.cpValue[5]=cParam3Tip; 
     433 
     434        template.cpName[6]="cParam3"; 
     435        template.cpValue[6]=cParam3; 
     436         
     437        template.cpName[7]="cParam3Style"; 
     438        template.cpValue[7]=cParam3Style; 
     439         
     440        template.cpName[8]="cParam4Label"; 
     441        template.cpValue[8]=cParam4Label; 
     442 
     443        template.cpName[9]="cParam4Tip"; 
     444        template.cpValue[9]=cParam4Tip; 
     445 
     446        template.cpName[10]="cParam4"; 
     447        template.cpValue[10]=cParam4; 
     448         
     449        template.cpName[11]="cParam4Style"; 
     450        template.cpValue[11]=cParam4Style; 
     451         
     452        template.cpName[12]="gcInputStatus"; 
     453        template.cpValue[12]=gcInputStatus; 
     454         
     455        template.cpName[13]=""; 
     456 
     457        if(uParam2) 
     458                fpTemplate(fp,"InputParam2",&template); 
     459         
     460        if(uParam3) 
     461                fpTemplate(fp,"InputParam3",&template); 
     462         
     463        if(uParam4) 
     464                fpTemplate(fp,"InputParam4",&template); 
     465 
    443466}//void funcMetaParam(FILE *fp) 
    444467