Menu

[2eb2a2]: / search_scripts_store_cookies.php  Maximize  Restore  History

Download this file

161 lines (127 with data), 6.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php session_start();?>
<html>
<head>
<title>deltasql - Searching ...</title>
<link rel="stylesheet" type="text/css" href="deltasql.css">
<link rel="shortcut icon" href="pictures/favicon.ico" />
</head>
<body>
<?php
include("head.inc.php");
include("utils/utils.inc.php");
if (!isset($_SESSION["userid"])) $userid="NULL"; else $userid=$_SESSION["userid"];
$filtertitle=$_POST['title'];
$filtercomment=$_POST['comments'];
$filterscript=$_POST['script'];
$authorid=$_POST['authorid'];
$moduleid=$_POST['moduleid'];
$branchid=$_POST['branchid'];
if (!isset($_POST['frmisaview'])) $frmisaview=""; else $frmisaview=$_POST['frmisaview'];
if (!isset($_POST['frmisapackage'])) $frmisapackage=""; else $frmisapackage=$_POST['frmisapackage'];
$fromversion=$_POST['fromversion'];
$toversion=$_POST['toversion'];
$fromdata=$_POST['fromdata'];
$todata=$_POST['todata'];
$frmprojectid=$_POST['frmprojectid'];
if (!isset($_POST['frmtextlistoutput'])) $textoutput=0; else $textoutput=$_POST['frmtextlistoutput'];
if (!isset($_POST['frmmodified'])) $modified=0; else $modified=$_POST['frmmodified'];
$scriptoffset = 0;
$_SESSION["scriptoffset"] = $scriptoffset;
$_SESSION["search_title"] = $filtertitle;
$_SESSION["search_comments"] = $filtercomment;
$_SESSION["search_script"] = $filterscript;
$_SESSION["search_authorid"] = $authorid;
$_SESSION["search_moduleid"] = $moduleid;
$_SESSION["search_branchid"] = $branchid;
$_SESSION["search_frmisaview"] = $frmisaview;
$_SESSION["search_frmisapackage"] = $frmisapackage;
$_SESSION["search_fromversion"] = $fromversion;
$_SESSION["search_toversion"] = $toversion;
$_SESSION["search_fromdata"] = $fromdata;
$_SESSION["search_todata"] = $todata;
$_SESSION["search_modified"] = $modified;
$_SESSION["search_projectid"] = $frmprojectid;
$link=mysql_connect($dbserver, $username, $password);
@mysql_select_db($database) or die("Unable to select database");
// adapting empty field to NULL database terminology
if ($fromdata=="") $ins_fromdata="NULL"; else $ins_fromdata="'$fromdata'";
if ($todata=="") $ins_todata="NULL"; else $ins_todata="'$todata'";
if ($authorid=="") $ins_authorid="NULL"; else $ins_authorid=$authorid;
if ($moduleid=="") $ins_moduleid="NULL"; else $ins_moduleid=$moduleid;
if ($frmprojectid=="") $ins_projectid="NULL"; else $ins_projectid=$frmprojectid;
if ($branchid=="") $ins_branchid="NULL"; else $ins_branchid=$branchid;
if ($frmisaview=="") $ins_isaview="NULL"; else $ins_isaview=$frmisaview;
if ($frmisapackage=="") $ins_isapackage="NULL"; else $ins_isapackage=$frmisapackage;
if ($fromversion=="") $ins_fromversion="NULL"; else $ins_fromversion=$fromversion;
if ($toversion=="") $ins_toversion="NULL"; else $ins_toversion=$toversion;
// we insert the query first
$query="INSERT INTO tbsearchquery (id, title, content, comments, fromdate, todate, author_id, module_id, project_id, branch_id, isaview, isapackage, fromversion, toversion, modifiedscripts, textlistoutput, user_id, insertdate)
VALUES('','$filtertitle','$filterscript','$filtercomment',$ins_fromdata,$ins_todata,$ins_authorid,$ins_moduleid,$ins_projectid,$ins_branchid,$ins_isaview,$ins_isapackage,$ins_fromversion,$ins_toversion,$modified,$textoutput,$userid,NOW());";
//echo $query;
mysql_query($query);
// now we give a meaningful name to the query
// we retrieve the id first
$queryid="select max(id) from tbsearchquery";
$resid=mysql_query($queryid);
$id=mysql_result($resid, 0, "max(id)");
$queryupdate1="update tbsearchquery set queryname='' where id=$id ";
mysql_query($queryupdate1);
$queryupdate2="update tbsearchquery set queryname=CONCAT(queryname,'title: ',title) where id=$id and title is not null and title<>''";
mysql_query($queryupdate2);
$queryupdate3="update tbsearchquery set queryname=CONCAT(queryname,' content: ',content) where id=$id and content is not null and content<>''";
mysql_query($queryupdate3);
$queryupdate4="update tbsearchquery set queryname=CONCAT(queryname,' comments: ',comments) where id=$id and comments is not null and comments<>''";
mysql_query($queryupdate4);
$queryupdate5="update tbsearchquery set queryname=CONCAT(queryname,' from ',DATE_FORMAT(fromdate, '%d.%m.%Y')) where id=$id and fromdate is not null";
mysql_query($queryupdate5);
$queryupdate6="update tbsearchquery set queryname=CONCAT(queryname,' to ',DATE_FORMAT(todate, '%d.%m.%Y')) where id=$id and todate is not null";
mysql_query($queryupdate6);
if ($ins_authorid!="NULL") {
$queryupdate7="update tbsearchquery set queryname=CONCAT(queryname,' author: ',(select username from tbuser where id=$ins_authorid)) where id=$id";
mysql_query($queryupdate7);
}
if ($ins_moduleid!="NULL") {
$queryupdate8="update tbsearchquery set queryname=CONCAT(queryname,' module: ',(select name from tbmodule where id=$ins_moduleid)) where id=$id";
mysql_query($queryupdate8);
}
if ($ins_projectid!="NULL") {
$queryupdate9="update tbsearchquery set queryname=CONCAT(queryname,' project: ',(select name from tbproject where id=$ins_projectid)) where id=$id";
mysql_query($queryupdate9);
}
if ($ins_branchid!="NULL") {
$queryupdate10="update tbsearchquery set queryname=CONCAT(queryname,' branch: ',(select name from tbbranch where id=$ins_branchid)) where id=$id";
mysql_query($queryupdate10);
}
if ($ins_isaview=="1") {
$queryupdate11="update tbsearchquery set queryname=CONCAT(queryname,' isview') where id=$id";
mysql_query($queryupdate11);
}
if ($ins_isapackage=="1") {
$queryupdate12="update tbsearchquery set queryname=CONCAT(queryname,' ispackage') where id=$id";
mysql_query($queryupdate12);
}
if ($ins_fromversion!="NULL") {
$queryupdate13="update tbsearchquery set queryname=CONCAT(queryname,' from $ins_fromversion') where id=$id";
mysql_query($queryupdate13);
}
if ($ins_toversion!="NULL") {
$queryupdate14="update tbsearchquery set queryname=CONCAT(queryname,' to $ins_toversion') where id=$id";
mysql_query($queryupdate14);
}
if ($modified=="1") {
$queryupdate15="update tbsearchquery set queryname=CONCAT(queryname,' modified') where id=$id";
mysql_query($queryupdate15);
}
if ($textoutput=="1") {
$queryupdate16="update tbsearchquery set queryname=CONCAT(queryname,' text') where id=$id";
mysql_query($queryupdate16);
}
mysql_close();
if ($textoutput==1) {
js_redirect("list_scripts.php?textoutput=1&showall=1");
} else {
js_redirect("list_scripts.php");
}
?>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.