-
Notifications
You must be signed in to change notification settings - Fork 1
/
backupsoftware1.php
233 lines (218 loc) · 8.08 KB
/
backupsoftware1.php
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<?php
session_start();
include ("includes/loginverify.php");
include ("db/db_connect.php");
$username = $_SESSION["username"];
$companyanum = $_SESSION["companyanum"];
$companyname = $_SESSION["companyname"];
date_default_timezone_set('Asia/Calcutta');
$ipaddress = $_SERVER["REMOTE_ADDR"];
$updatedatetime = date('Y-m-d H:i:s');
$errmsg = "";
$bgcolorcode = "";
$colorloopcount = "";
if (isset($_POST["frmflag1"])) { $frmflag1 = $_POST["frmflag1"]; } else { $frmflag1 = ""; }
if ($frmflag1 == 'frmflag1')
{
include ("backupsoftwarecode1.php");
header ("location:backupsoftware1.php?st=success");
exit;
}
if (isset($_REQUEST["st"])) { $st = $_REQUEST["st"]; } else { $st = ""; }
if ($st == 'del')
{
$delanum = $_REQUEST["anum"];
$query3 = "select * from master_backupsoftware where auto_number = '$delanum'";
$exec3 = mysql_query($query3) or die ("Error in Query3".mysql_error());
$res3 = mysql_fetch_array($exec3);
$deletefilename = $res3['backupfilename'];
unlink('zbackupsoftwarefiles/'.$deletefilename.'');
$query3 = "delete from master_backupsoftware where auto_number = '$delanum'";
$exec3 = mysql_query($query3) or die ("Error in Query3".mysql_error());
header ("location:backupsoftware1.php?st=deleted");
exit;
}
if ($st == 'success')
{
$errmsg = "Success. Software Backup Completed. Please Download & Save File From List Given Below For Future Reference.";
$bgcolorcode = 'success';
}
if ($st == 'deleted')
{
$errmsg = "Success. Software Delete Completed.";
$bgcolorcode = 'success';
}
?>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
background-color: #E0E0E0;
}
.bodytext3 { FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #3B3B3C; FONT-FAMILY: Tahoma; text-decoration:none
}
-->
</style>
<link href="datepickerstyle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/adddate.js"></script>
<script type="text/javascript" src="js/adddate2.js"></script>
<style type="text/css">
<!--
.bodytext31 {FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #3b3b3c; FONT-FAMILY: Tahoma
}
-->
</style>
</head>
<script language="javascript">
function funcTakeBackup1()
{
var fRet;
fRet = confirm('Are You Sure Want To Take Software Backup Now?');
//alert(fRet);
if (fRet == true)
{
alert ("Proceeding To Take Software Backup. Please Wait A Moment.");
//return false;
}
if (fRet == false)
{
alert ("Software Backup Not Completed.");
return false;
}
//return false;
}
function funcDeleteBackup1(varDeleteFileName)
{
var varDeleteFileName = varDeleteFileName;
var fRet;
fRet = confirm('Are You Sure Want To Delete Software Backup File '+varDeleteFileName+' ?');
//alert(fRet);
if (fRet == true)
{
alert ("Success. Software Backup Delete Completed");
//return false;
}
if (fRet == false)
{
alert ("Failed. Software Backup Delete Not Completed.");
return false;
}
//return false;
}
/*
function funcDownloadBackup1(varDownloadFileName)
{
var varDownloadFileName = varDownloadFileName;
window.location = "zbackupsoftwarefiles/"+varDownloadFileName+"";
}
*/
</script>
<body>
<table width="101%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="10" bgcolor="#6487DC"><?php include ("includes/alertmessages1.php"); ?></td>
</tr>
<tr>
<td colspan="10" bgcolor="#8CAAE6"><?php include ("includes/title1.php"); ?></td>
</tr>
<tr>
<td colspan="10" bgcolor="#003399"><?php include ("includes/menu1.php"); ?></td>
</tr>
<tr>
<td colspan="10"> </td>
</tr>
<tr>
<td width="1%"> </td>
<td width="2%" valign="top"><?php //include ("includes/menu4.php"); ?>
</td>
<td width="97%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="860"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablebackgroundcolor1">
<tr>
<td><form name="form1" id="form1" method="post" action="backupsoftware1.php">
<table width="600" border="0" align="center" cellpadding="4" cellspacing="0" bordercolor="#666666" id="AutoNumber3" style="border-collapse: collapse">
<tbody>
<tr bgcolor="#011E6A">
<td bgcolor="#CCCCCC" class="bodytext3"><strong>Software Backup - Click Button To Take Backup of Software </strong></td>
</tr>
<tr>
<td align="left" valign="middle"
bgcolor="<?php if ($bgcolorcode == '') { echo '#FFFFFF'; } else if ($bgcolorcode == 'success') { echo '#FFBF00'; } else if ($bgcolorcode == 'failed') { echo '#AAFF00'; } ?>" class="bodytext3"><div align="left"><?php echo $errmsg; ?></div></td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#FFFFFF" class="bodytext3">
<div align="center">
<input type="hidden" name="frmflag1" value="frmflag1" />
<input type="submit" name="Submit" onClick="return funcTakeBackup1()" value="Click To Take Software Backup Now" style="border: 1px solid #001E6A" />
</div></td>
</tr>
<tr>
<td align="middle" > </td>
</tr>
</tbody>
</table>
<table width="600" border="0" align="center" cellpadding="4" cellspacing="0" bordercolor="#666666" id="AutoNumber3" style="border-collapse: collapse">
<tbody>
<tr bgcolor="#011E6A">
<td colspan="4" bgcolor="#CCCCCC" class="bodytext3"><strong>Backup - Existing List </strong></td>
</tr>
<tr bgcolor="#011E6A">
<td bgcolor="#CCCCCC" class="bodytext3"> </td>
<td bgcolor="#CCCCCC" class="bodytext3"><strong>File Name </strong></td>
<td bgcolor="#CCCCCC" class="bodytext3"><strong>File Date Time </strong></td>
<td bgcolor="#CCCCCC" class="bodytext3"><div align="center"><strong>Download </strong></div></td>
</tr>
<?php
$query1 = "select * from master_backupsoftware order by auto_number desc";
$exec1 = mysql_query($query1) or die ("Error in Query1".mysql_error());
while ($res1 = mysql_fetch_array($exec1))
{
$auto_number = $res1["auto_number"];
$backupfilename = $res1["backupfilename"];
$backupfiledate = $res1["backupfiledate"];
$colorloopcount = $colorloopcount + 1;
$showcolor = ($colorloopcount & 1);
if ($showcolor == 0)
{
$colorcode = 'bgcolor="#CBDBFA"';
}
else
{
$colorcode = 'bgcolor="#D3EEB7"';
}
?>
<tr <?php echo $colorcode; ?>>
<td width="6%" align="left" valign="top" class="bodytext3"><div align="center">
<a href="backupsoftware1.php?st=del&&anum=<?php echo $auto_number; ?>" onClick="return funcDeleteBackup1('<?php echo $backupfilename; ?>')">
<img src="images/b_drop.png" width="16" height="16" border="0" /></a></div></td>
<td width="58%" align="left" valign="top" class="bodytext3"><?php echo $backupfilename; ?> </td>
<td width="36%" align="left" valign="top" class="bodytext3"><?php echo $backupfiledate; ?></td>
<td width="36%" align="left" valign="top" class="bodytext3">
<a href="backupsoftwaredownload1.php?filename=<?php echo $backupfilename; ?>">
<div align="center">Download</div></a></td>
</tr>
<?php
}
?>
<tr>
<td align="middle" colspan="4" > </td>
</tr>
</tbody>
</table>
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</table>
<?php include ("includes/footer1.php"); ?>
</body>
</html>