📄 delsoft.cpp
字号:
#include "cgic.h"
#include "config.h"
#include "mydblib.h"
void Del_Soft_InputID()
{
if(Get_Check_Pass_Power(DelSoft_Power) !=1) return;
char *html1[]= {
"<html>",
"<head>",
"<title>删除软件</title>",
"</head>",
"<body bgcolor=\"#99CCCC\">",
"<p> </p>",
"<p> </p>",
"<p> </p>",
"<p> </p>",
"<form method=\"POST\" action>",
"<input type=hidden name=job value=\"DelSoftHtml\">",
" <p><font face=\"楷体_GB2312\" size=\"5\" color=\"#0000FF\">请输入你要删除的软件ID号:</font><input",
" type=\"text\" name=\"SoftID\" size=\"6\"> <input type=\"submit\" value=\"提交\" name=\"B1\"",
" style=\"font-size: 16\"></p>",
"</form>",
"</body>",
"</html>",
"end_html"
};
cgiHeaderContentType("text/html");
Print_Html(html1);
}
void Del_Soft_Html()
{
if(Get_Check_Pass_Power(DelSoft_Power) !=1) return;
int sid;
cgiFormInteger("SoftID",&sid,0);
if(sid<=0 || db_read(DataFile,DataBZ,DataIndex,sid,
sizeof(Soft_Info),&MySoft.Type,999,Soft_Remark)==0)
{
Print_Error("错误的软件ID号,请重新输入!");
return;
}
char *html1[]={
"<html>",
"<head>",
"<title>删除软件</title>",
"<style>",
"<!--",
"p {font-size: 9pt}",
"table {font-size: 9pt}",
"-->",
"</style>",
"</head>",
"<body bgcolor=\"#99CCCC\">",
"<p> </p>",
"<p align=\"center\"><font face=\"楷体_GB2312\" size=\"6\" color=\"#0000FF\">删除软件</font></p>",
"<div align=\"center\"><center>",
"<table border=\"0\" width=\"71%%\" height=\"210\">",
" <tr>",
" <td width=\"100%%\" height=\"204\"><p>",
"end_html"
};
char *html2[]={
" <input type=\"hidden\" name=\"job\" value=\"DelSoft\">",
" <p><input type=\"submit\" value=\"我就是要杀你!\" name=\"B1\" style=\"font-size: 16\"> <input",
" type=\"button\" value=\"Sorry,搞错了!\" style=\"font-size: 16\" OnClick=\"javascript:history.back()\"></p>",
" </form>",
" </td>",
" </tr>",
"</table>",
"</center></div>",
"</body>",
"</html>",
"end_html"
};
cgiHeaderContentType("text/html");
Print_Html(html1);
fprintf(cgiOut,"软件名称:%s<br>",MySoft.Name);
fprintf(cgiOut,"软件版本:%s<br>",MySoft.Ver);
fprintf(cgiOut,"软件作者:%s<br>",MySoft.ZZ);
fprintf(cgiOut,"软件大小:%dKB<br>",MySoft.Size);
fprintf(cgiOut,"软件简介:<textarea rows=\"6\" name=\"S1\" cols=\"49\" style=\"font-size: 12\">%s</textarea><br>",Soft_Remark);
fprintf(cgiOut,"本站下载:%s<br>",MySoft.Down1);
fprintf(cgiOut,"原始下载:%s<br>",MySoft.Down2);
fprintf(cgiOut,"其他下载:%s</p>",MySoft.Down3);
fprintf(cgiOut,"<form method=\"POST\" action><input type=\"hidden\" name=\"SoftID\" value=\"%u\">",sid);
Print_Html(html2);
}
void Del_Soft()
{
if(Get_Check_Pass_Power(DelSoft_Power) !=1) return;
int sid;
cgiFormInteger("SoftID",&sid,0);
if(sid==0)
{
Print_Error_NoLink("非法操作,错误的软件ID号!");
return;
}
if(db_del(DataIndex,sid)==0)
{
Print_Error_NoLink("操作失败!可能写错误或没有对应ID号!");
}
Del_Soft_InputID();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -