int GenerateUpgradeAsp(webs_t wp)
{
FILE *fp;
unsigned long ulReadSize;
int fdFW = -1,checklen=0;
char pBuf[64]={0},pChecksum[128]={0};
unsigned short int crcsum;
{
FILE *fp;
unsigned long ulReadSize;
int fdFW = -1,checklen=0;
char pBuf[64]={0},pChecksum[128]={0};
unsigned short int crcsum;
fp=fopen("/tmp/webs/man_upgrade.asp","w+");
if(!fp)
{
//formErrMsg(wp,"This man_upgrade.asp error!.");
return EZL_TF_FAIL;
}
checklen = AscStrToHexStr(pChecksum,FirmFlag,16);
pChecksum[checklen] = '\0';
float totalSize = (float)FileSize(EZL_CPFW_NAME)/(1024*1024);
fputs("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"<A href='http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n",fp'>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n",fp);
fputs("<html>\n",fp);
fputs("<head>\n",fp);
fputs( "<META HTTP-EQUIV=\"expires\" CONTENT=\"0\">\n",fp);
fputs("<META HTTP-EQUIV=\"pragma\" CONTENT=\"no-cache\">\n",fp);
fputs("<META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"no-cache, must-revalidate\">\n",fp);
if(!fp)
{
//formErrMsg(wp,"This man_upgrade.asp error!.");
return EZL_TF_FAIL;
}
checklen = AscStrToHexStr(pChecksum,FirmFlag,16);
pChecksum[checklen] = '\0';
float totalSize = (float)FileSize(EZL_CPFW_NAME)/(1024*1024);
fputs("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"<A href='http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n",fp'>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n",fp);
fputs("<html>\n",fp);
fputs("<head>\n",fp);
fputs( "<META HTTP-EQUIV=\"expires\" CONTENT=\"0\">\n",fp);
fputs("<META HTTP-EQUIV=\"pragma\" CONTENT=\"no-cache\">\n",fp);
fputs("<META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"no-cache, must-revalidate\">\n",fp);
fputs("<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"./css/style.css\" />\n",fp);
fputs("<title>sysmanage configuration</title>\n",fp);
fputs("<style>\n",fp);
fputs("<title>sysmanage configuration</title>\n",fp);
fputs("<style>\n",fp);
fputs(".tt{ \n",fp);
fputs("margin-left: 100;\n",fp);
fputs("margin-top:100;\n",fp);
fputs("margin-right:100;\n",fp);
fputs("}\n",fp);
fputs("</style>\n",fp);
fputs("</head>\n",fp);
fputs("<BODY class=\"bodyContainer\" >\n",fp);
fputs("<div id=\"maincontainer\">\n",fp);
fputs(" <div id=\"maincontent\">\n",fp);
fputs("margin-left: 100;\n",fp);
fputs("margin-top:100;\n",fp);
fputs("margin-right:100;\n",fp);
fputs("}\n",fp);
fputs("</style>\n",fp);
fputs("</head>\n",fp);
fputs("<BODY class=\"bodyContainer\" >\n",fp);
fputs("<div id=\"maincontainer\">\n",fp);
fputs(" <div id=\"maincontent\">\n",fp);
fputs("<h2> \n",fp);
fputs(" <a id=\"content\" name=\"content\">Flash Firmware - Verify</a>\n",fp);
fputs(" </h2>\n",fp);
fputs("<br/>\n",fp);
fputs(" The flash image was uploaded.\n",fp);
fputs(" Below is the checksum and file size listed,\n",fp);
fputs(" compare them with the original file to ensure data integrity.\n",fp);
fputs(" Click \"Proceed\" below to start the flash procedure. \n",fp);
fputs("<br/>\n",fp);
fputs(" <a id=\"content\" name=\"content\">Flash Firmware - Verify</a>\n",fp);
fputs(" </h2>\n",fp);
fputs("<br/>\n",fp);
fputs(" The flash image was uploaded.\n",fp);
fputs(" Below is the checksum and file size listed,\n",fp);
fputs(" compare them with the original file to ensure data integrity.\n",fp);
fputs(" Click \"Proceed\" below to start the flash procedure. \n",fp);
fputs("<br/>\n",fp);
fputs("<form action=/goform/formFlashfirmware enctype=\"multipart/form-data\" method=POST name=\"man_upgrade\">\n",fp);
fputs("</fieldset>\n",fp);
fputs(" <div> \n",fp);
fputs(" <ul> \n",fp);
sprintf(pBuf,"<li>Checksum:%s </li> \n",pChecksum);
fputs(pBuf,fp);
sprintf(pBuf,"<li>Size: %.3lf MB </li> \n",totalSize);
fputs(pBuf,fp);
if(keep_flag)
{
fputs(" <li>Note: Configuration files will be erased. </li>\n",fp);
}
else{
fputs(" <li>Configuration files will be kept. </li>\n",fp);
}
fputs(" </ul> \n",fp);
fputs(" </div>\n",fp);
fputs("</fieldset>\n",fp);
fputs(" <div class=\"cbi-value-field\">\n",fp);//cbi-value-field
fputs(" \n",fp);
fputs(" \n",fp);
fputs(" \n",fp);
fputs(" \n",fp);
fputs(" \n",fp);
fputs(" \n",fp);
fputs(" <input class=\"cbi-button cbi-button-apply\" type=\"button\" οnclick=\"history.go (-1)\" value=\"Cancel\" name=\"OK\">\n",fp);
fputs(" <input class=\"cbi-button cbi-button-apply\" type=\"submit\" name=\"man_upgrade_apply\" value=\"Proceed\"/>\n",fp);
fputs(" <script type=\"text/javascript\">cbi_d_update();</script>\n",fp);
fputs(" </div>\n",fp);
fputs("</form> \n",fp);
fputs("<div class=\"clear\"></div>\n",fp);
fputs("</div>\n",fp);
fputs("</div>\n",fp);
fputs("</body>\n",fp);
fputs("</html>\n",fp);
fputs("</fieldset>\n",fp);
fputs(" <div> \n",fp);
fputs(" <ul> \n",fp);
sprintf(pBuf,"<li>Checksum:%s </li> \n",pChecksum);
fputs(pBuf,fp);
sprintf(pBuf,"<li>Size: %.3lf MB </li> \n",totalSize);
fputs(pBuf,fp);
if(keep_flag)
{
fputs(" <li>Note: Configuration files will be erased. </li>\n",fp);
}
else{
fputs(" <li>Configuration files will be kept. </li>\n",fp);
}
fputs(" </ul> \n",fp);
fputs(" </div>\n",fp);
fputs("</fieldset>\n",fp);
fputs(" <div class=\"cbi-value-field\">\n",fp);//cbi-value-field
fputs(" \n",fp);
fputs(" \n",fp);
fputs(" \n",fp);
fputs(" \n",fp);
fputs(" \n",fp);
fputs(" \n",fp);
fputs(" <input class=\"cbi-button cbi-button-apply\" type=\"button\" οnclick=\"history.go (-1)\" value=\"Cancel\" name=\"OK\">\n",fp);
fputs(" <input class=\"cbi-button cbi-button-apply\" type=\"submit\" name=\"man_upgrade_apply\" value=\"Proceed\"/>\n",fp);
fputs(" <script type=\"text/javascript\">cbi_d_update();</script>\n",fp);
fputs(" </div>\n",fp);
fputs("</form> \n",fp);
fputs("<div class=\"clear\"></div>\n",fp);
fputs("</div>\n",fp);
fputs("</div>\n",fp);
fputs("</body>\n",fp);
fputs("</html>\n",fp);
fclose(fp);
return EZL_TF_OK;
}
}