1 <? require_once("inc/header.php"); ?>
3 $dat_dir = '/var/www/testimonials';
4 $upload_dir = '/var/www/bacula';
9 'empty' => "SELECT ONE",
10 '100' => "Church / Religious Organization",
11 '101' => "Corporation",
12 '102' => "Educational Institution",
13 '103' => "Government",
15 '105' => "Non-Profit Organization",
16 '107' => "Small Business",
21 'empty' => "SELECT ONE",
26 '204' => "SVN version"
30 'empty' => "SELECT ONE",
32 '301' => "PostgreSQL",
36 $org_industry_lst = array(
37 'empty' => 'SELECT ONE', '400' => 'Aerospace / Aeronautical',
38 '401' => 'Agriculture / Farming', '402' => 'Architecture / Design',
39 '403' => 'Arts', '404' => 'ASP',
41 '406' => 'Church / Religious Organization', '407' => 'Coaching',
42 '408' => 'Construction', '409' => 'Consulting (General)',
43 '410' => 'Consulting (Information Technology)','411' => 'Defense Industry',
44 '412' => 'Education / Training', '413' => 'Energy Industry',
45 '414' => 'Engineering', '415' => 'Entertainment (Film)',
46 '416' => 'Entertainment (Music)', '417' => 'Entertainment (Other)',
47 '418' => 'Event Management / Conferences', '419' => 'Finance / Banking / Accounting',
48 '420' => 'Food Service Industry', '421' => 'Government',
49 '422' => 'Healthcare / Medicine', '423' => 'Higher Education',
50 '424' => 'Insurance', '425' => 'Internet Service Provider',
51 '426' => 'K-12 Education', '427' => 'Law Enforcement / Emergency Management',
52 '428' => 'Legal', '429' => 'Manufacturing (Computer Equipment)',
53 '430' => 'Manufacturing (General)', '431' => 'Media (Publishing, Broadcasting, etc)',
54 '432' => 'Military', '433' => 'Mining',
55 '434' => 'Natural Resources / Environment', '435' => 'Pharmaceuticals',
56 '436' => 'Public Relations / Advertising', '437' => 'Real Estate',
57 '438' => 'Retail / Consumer Goods', '439' => 'Sales / Marketing',
58 '440' => 'Scientific Research', '441' => 'Sports / Recreation',
59 '442' => 'Technical College / Trade School', '443' => 'Telecommunications',
60 '444' => 'Transportation Industry (Air)', '445' => 'Transportation Industry (General)',
61 '446' => 'Transportation Industry (Marine)', '447' => 'Travel / Tourism / Lodging',
62 '448' => 'Travel Industry', '449' => 'Utilities / Public Works',
67 'empty' => 'SELECT ONE', '500' => 'AIX',
68 '501' => 'FreeBSD', '502' => 'HP-UX',
69 '503' => 'Linux (Debian)', '504' => 'Linux (Fedora)',
70 '505' => 'Linux (Gentoo)', '506' => 'Linux (Mandriva)',
71 '507' => 'Linux (Other)', '508' => 'Linux (RedHat)',
72 '509' => 'Linux (Slackware)', '510' => 'Linux (Suse)',
73 '511' => 'Mac OS X', '512' => 'NetBSD',
74 '513' => 'OpenBSD', '514' => 'Other',
75 '515' => 'Solaris', '516' => 'Windows 2000',
76 '517' => 'Windows 2003', '518' => 'Windows XP',
77 '519' => 'Windows Vista'
81 'empty' => 'SELECT ONE', '1001' => 'Afghanistan',
82 '1002' => 'Albania', '1003' => 'Algeria',
83 '1004' => 'American Samoa', '1005' => 'Andorra',
84 '1006' => 'Angola', '1007' => 'Anguilla',
85 '1008' => 'Antarctica', '1009' => 'Antigua and Barbuda',
86 '1010' => 'Argentina', '1011' => 'Armenia',
87 '1012' => 'Aruba', '1013' => 'Australia',
88 '1014' => 'Austria', '1015' => 'Azerbaijan',
89 '1016' => 'Bahamas', '1017' => 'Bahrain',
90 '1018' => 'Bangladesh', '1019' => 'Barbados',
91 '1020' => 'Belarus', '1021' => 'Belgium',
92 '1022' => 'Belize', '1023' => 'Benin',
93 '1024' => 'Bermuda', '1025' => 'Bhutan',
94 '1026' => 'Bolivia', '1027' => 'Bosnia and Herzegovina',
95 '1028' => 'Botswana', '1029' => 'Bouvet Island',
96 '1030' => 'Brazil', '1031' => 'Brunei Darussalam',
97 '1032' => 'Bulgaria', '1033' => 'Burkina Faso',
98 '1034' => 'Burundi', '1035' => 'Cambodia',
99 '1036' => 'Cameroon', '1037' => 'Canada',
100 '1038' => 'Cape Verde', '1039' => 'Cayman Islands',
101 '1040' => 'Central African Republic','1041' => 'Chad',
102 '1042' => 'Chile', '1043' => 'China',
103 '1044' => 'Christmas Island', '1045' => 'Colombia',
104 '1046' => 'Comoros', '1047' => 'Congo',
105 '1048' => 'Cook Islands', '1049' => 'Costa Rica',
106 '1054' => "Ivory Coast", '1050' => 'Croatia',
107 '1051' => 'Cuba', '1052' => 'Cyprus',
108 '1053' => 'Czech Republic', '1055' => 'Denmark',
109 '1056' => 'Djibouti', '1057' => 'Dominica',
110 '1058' => 'Dominican Republic', '1059' => 'East Timor',
111 '1060' => 'Ecuador', '1061' => 'Egypt',
112 '1062' => 'El Salvador', '1063' => 'Equatorial Guinea',
113 '1064' => 'Eritrea', '1065' => 'Estonia',
114 '1066' => 'Ethiopia', '1067' => 'Falkland Islands',
115 '1068' => 'Faroe Islands', '1069' => 'Fiji',
116 '1070' => 'Finland', '1071' => 'France',
117 '1072' => 'French Guiana', '1073' => 'French Polynesia',
118 '1074' => 'Gabon', '1075' => 'Gambia',
119 '1076' => 'Georgia', '1077' => 'Germany',
120 '1078' => 'Ghana', '1079' => 'Gibraltar',
121 '1080' => 'Greece', '1081' => 'Greenland',
122 '1082' => 'Grenada', '1083' => 'Guadeloupe',
123 '1084' => 'Guam', '1085' => 'Guatemala',
124 '1086' => 'Guinea', '1087' => 'Guinea-Bissau',
125 '1088' => 'Guyana', '1089' => 'Haiti',
126 '1090' => 'Honduras', '1091' => 'Hong Kong',
127 '1092' => 'Hungary', '1093' => 'Iceland',
128 '1094' => 'India', '1095' => 'Indonesia',
129 '1096' => 'Iran', '1097' => 'Iraq',
130 '1098' => 'Ireland', '1099' => 'Israel',
131 '1100' => 'Italy', '1101' => 'Jamaica',
132 '1102' => 'Japan', '1103' => 'Jordan',
133 '1104' => 'Kazakstan', '1105' => 'Kenya',
134 '1106' => 'Kiribati', '1107' => 'Kuwait',
135 '1108' => 'Kyrgystan', '1109' => 'Lao',
136 '1110' => 'Latvia', '1111' => 'Lebanon',
137 '1112' => 'Lesotho', '1113' => 'Liberia',
138 '1232' => 'Libya', '1114' => 'Liechtenstein',
139 '1115' => 'Lithuania', '1116' => 'Luxembourg',
140 '1117' => 'Macau', '1118' => 'Macedonia (FYR)',
141 '1119' => 'Madagascar', '1120' => 'Malawi',
142 '1121' => 'Malaysia', '1122' => 'Maldives',
143 '1123' => 'Mali', '1124' => 'Malta',
144 '1125' => 'Marshall Islands', '1126' => 'Martinique',
145 '1127' => 'Mauritania', '1128' => 'Mauritius',
146 '1129' => 'Mayotte', '1130' => 'Mexico',
147 '1131' => 'Micronesia', '1132' => 'Moldova',
148 '1133' => 'Monaco', '1134' => 'Mongolia',
149 '1135' => 'Montserrat', '1136' => 'Morocco',
150 '1137' => 'Mozambique', '1138' => 'Myanmar',
151 '1139' => 'Namibia', '1140' => 'Nauru',
152 '1141' => 'Nepal', '1142' => 'Netherlands',
153 '1143' => 'Netherlands Antilles', '1144' => 'Neutral Zone',
154 '1145' => 'New Caledonia', '1146' => 'New Zealand',
155 '1147' => 'Nicaragua', '1148' => 'Niger',
156 '1149' => 'Nigeria', '1150' => 'Niue',
157 '1151' => 'Norfolk Island', '1152' => 'North Korea',
158 '1153' => 'Northern Mariana Islands', '1154' => 'Norway',
159 '1155' => 'Oman', '1156' => 'Pakistan',
160 '1157' => 'Palau', '1158' => 'Panama',
161 '1159' => 'Papua New Guinea', '1160' => 'Paraguay',
162 '1161' => 'Peru', '1162' => 'Philippines',
163 '1163' => 'Pitcairn', '1164' => 'Poland',
164 '1165' => 'Portugal', '1166' => 'Puerto Rico',
165 '1167' => 'Qatar', '1168' => 'Reunion',
166 '1169' => 'Romania', '1170' => 'Russian Federation',
167 '1171' => 'Rwanda', '1172' => 'Saint Helena',
168 '1173' => 'Saint Kitts and Nevis', '1174' => 'Saint Lucia',
169 '1175' => 'Saint Pierre and Miquelon','1231' => 'Saint Vincent and the Grenadines',
170 '1176' => 'Samoa', '1177' => 'San Marino',
171 '1178' => 'Sao Tome and Principe', '1179' => 'Saudi Arabia',
172 '1180' => 'Senegal', '1227' => 'Serbia and Montenegro',
173 '1181' => 'Seychelles', '1182' => 'Sierra Leone',
174 '1183' => 'Singapore', '1184' => 'Slovakia',
175 '1185' => 'Slovenia', '1186' => 'Solomon Islands',
176 '1187' => 'Somalia', '1188' => 'South Africa',
177 '1189' => 'South Georgia', '1190' => 'South Korea',
178 '1191' => 'Spain', '1192' => 'Sri Lanka',
179 '1193' => 'Sudan', '1194' => 'Suriname',
180 '1195' => 'Swaziland', '1196' => 'Sweden',
181 '1197' => 'Switzerland', '1198' => 'Syria',
182 '1199' => 'Taiwan', '1200' => 'Tajikistan',
183 '1201' => 'Tanzania', '1202' => 'Thailand',
184 '1203' => 'Togo', '1204' => 'Tokelau',
185 '1205' => 'Tonga', '1206' => 'Trinidad and Tobago',
186 '1207' => 'Tunisia', '1208' => 'Turkey',
187 '1209' => 'Turkmenistan', '1210' => 'Turks and Caicos Islands',
188 '1211' => 'Tuvalu', '1212' => 'Uganda',
189 '1213' => 'Ukraine', '1214' => 'United Arab Emirates',
190 '1215' => 'United Kingdom', '1216' => 'United States of America',
191 '1217' => 'Uruguay', '1218' => 'Uzbekistan',
192 '1219' => 'Vanuatu', '1233' => 'Vatican City',
193 '1220' => 'Venezuela', '1221' => 'Vietnam',
194 '1222' => 'Virgin Islands (British)', '1223' => 'Virgin Islands (U.S.)',
195 '1224' => 'Wallis and Futuna Islands','1225' => 'Western Sahara',
196 '1226' => 'Yemen', '1228' => 'Zaire',
197 '1229' => 'Zambia', '1230' => 'Zimbabwe'
202 if ($_REQUEST['action'] == 'Add' or $_REQUEST['action'] == 'Modify')
207 <script type="text/javascript" language="JavaScript">
209 function validate_testimonial (form) {
212 var invalid_fields = new Array();
214 // email: standard text, hidden, password, or textarea box
215 var email = form.elements['email_address'].value;
216 if (email == null || ! email.match(/^[\w\-\+\._]+\@[a-zA-Z0-9][-a-zA-Z0-9\.]*\.[a-zA-Z]+$/)) {
217 alertstr += '- Invalid entry for the "Email" field\n';
219 invalid_fields.push('email_address');
222 // contact_name: standard text, hidden, password, or textarea box
223 var contact_name = form.elements['contact_name'].value;
224 if (contact_name == null || ! contact_name.match(/^[a-zA-Z]+[- ]?[a-zA-Z]+\s*,?([a-zA-Z]+|[a-zA-Z]+\.)?$/)) {
225 alertstr += '- Invalid entry for the "Contact Name" field\n';
227 invalid_fields.push('contact_name');
230 // org_name: standard text, hidden, password, or textarea box
231 var org_name = form.elements['org_name'].value;
232 if (org_name == null || ! org_name.match(/^[a-zA-Z0-9();@%, :!\/]+$/)) {
233 alertstr += '- Invalid entry for the "Organization Name" field\n';
235 invalid_fields.push('org_name');
237 var number = form.elements['orgtype_id'].value;
238 if (number == null || ! number.match(/^[0-9]+$/)) {
239 alertstr += '- Choose one of the "Organization type" options\n';
240 invalid_fields.push('orgtype_id');
243 number = form.elements['orgindustry_id'].value;
244 if (number == null || ! number.match(/^[0-9]+$/)) {
245 alertstr += '- Choose one of the "Organization industry type" options\n';
246 invalid_fields.push('orgindustry_id');
249 var org_size = form.elements['org_size'].value;
250 if (org_size == null || ! org_size.match(/^[0-9,\.]+$/)) {
251 alertstr += '- Invalid entry for the "Organization size" field\n';
252 invalid_fields.push('org_size');
256 var bacula_version = form.elements['bacula_version'].value;
257 if (bacula_version == null || ! bacula_version.match(/^[0-9]+$/)) {
258 alertstr += '- Invalid entry for the "Bacula version" field\n';
259 invalid_fields.push('bacula_version');
262 var ostype = form.elements['ostype_id'].value;
263 if (ostype == null || ! ostype.match(/^[0-9]+$/)) {
264 alertstr += '- Choose one of the "Director OS" field\n';
265 invalid_fields.push('ostype_id');
268 var catalog = form.elements['catalog_id'].value;
269 if (catalog == null || ! catalog.match(/^[0-9]+$/)) {
270 alertstr += '- Choose one of the "Catalog type" field\n';
271 invalid_fields.push('catalog_id');
274 var number = form.elements['number_fd'].value;
275 if (number == null || ! number.match(/^[0-9,\.]+$/)) {
276 alertstr += '- Invalid entry for the "Number of Client" field\n';
277 invalid_fields.push('number_fd');
280 number = form.elements['number_sd'].value;
281 if (number == null || ! number.match(/^[0-9,\.]+$/)) {
282 alertstr += '- Invalid entry for the "Number of Storage" field\n';
283 invalid_fields.push('number_sd');
286 number = form.elements['number_dir'].value;
287 if (number == null || ! number.match(/^[0-9,\.]+$/)) {
288 alertstr += '- Invalid entry for the "Number of Director" field\n';
289 invalid_fields.push('number_dir');
292 number = form.elements['month_gb'].value;
293 if (number == null || ! number.match(/^[0-9,\.]+$/)) {
294 alertstr += '- Invalid entry for the "Number GB/month" field\n';
295 invalid_fields.push('month_gb');
298 number = form.elements['number_files'].value;
299 if (number == null || ! number.match(/^[0-9,\.]+$/)) {
300 alertstr += '- Invalid entry for the "File number" field\n';
301 invalid_fields.push('number_files');
304 if (invalid > 0 || alertstr != '') {
305 if (! invalid) invalid = 'The following'; // catch for programmer error
306 alert(''+invalid+' error(s) were encountered with your submission:'+'\n\n'
307 +alertstr+'\n'+'Please correct these fields and try again.');
310 return true; // all checked ok
316 <td class="contentTopic">
317 <? echo $_REQUEST['action'] ?> Testimonial
323 Want to let others know you're using Bacula? Submit a user profile! Your
324 submission will be reviewed before being made publicly available. We reserve
325 the right to edit your submission for spelling, grammar, etc. You will receive
326 an email when your profile has been approved for public viewing. Note that
327 while your contact name and email address are required (to verify
328 information if necessary), you can choose to have them not be published along
329 with your profile information.
331 Fields marked with a * are required. Read the privacy notice below for
332 information about how this data will be used.
339 <form name='form1' enctype="multipart/form-data" method='post' onsubmit="return validate_testimonial(this)" action='?page=testimonial'>
340 <input type='hidden' name='page' value='testimonial'>
341 <table border='0' class='Content'>
343 <td class='ItemName'>
344 <font color='red'>*</font>Contact Name:</td>
345 <td class='ItemValue'><input type='text' class='ItemValue' id='contact_name'
346 name='contact_name' size='30' maxlength='100' value=''></td>
347 <td class='ItemName'>Publish Contact Name?</td>
348 <td class='ItemValue'><select name='publish_contact' class='ItemValue'>
349 <option id='publish_contact_0' value='0' SELECTED>No
350 <option id='publish_contact_1' value='1'>Yes
355 <td class='ItemName'><font color='red'>*</font>Email Address:</td>
356 <td class='ItemValue'><input type='text' class='ItemValue' name='email_address'
357 id='email_address' size='30' maxlength='150' value=''></td>
358 <td class='ItemName'>Publish Email Address?</td><td class='ItemValue'>
359 <select name='publish_email' class='ItemValue'>
360 <option value='0' id='publish_email_0' SELECTED>No
361 <option value='1' id='publish_email_1' >Yes
365 <tr><td class='ItemName'>Job Description/Title:</td>
366 <td class='ItemValue'>
367 <input type='text' name='title' id='title' size='30' maxlength='100' value=''></td></tr>
368 <tr><td colspan=4><br></td></tr>
370 <tr><td class='ItemName'><font color='red'>*</font>Organization Name:</td>
371 <td class='ItemValue'>
372 <input type='text' class='ItemValue' name='org_name' id='org_name'
373 size='30' maxlength='100' value=''>
374 </td><td class='ItemName'>Publish Org Name?</td><td class='ItemValue'>
375 <select name='publish_orgname' class='ItemValue'>
376 <option value='0' id='publish_orgname_0' >No
377 <option value='1' id='publish_orgname_1' SELECTED>Yes
381 <tr><td class='ItemName'><font color='red'>*</font>Organization Type:</td>
382 <td class='ItemValue' colspan='3'>
383 <select name='orgtype_id' class='ItemValue'>
386 while(list ($key, $val) = each ($org_type_lst))
388 echo "<option id='orgtype_id_$key' value='$key'>$val\n";
395 <tr><td class='ItemName'><font color='red'>*</font>Organization Industry/Function:</td>
396 <td class='ItemValue' colspan='3'>
397 <select name='orgindustry_id' class='ItemValue'>
400 while(list ($key, $val) = each ($org_industry_lst))
402 echo "<option id='orgindustry_id_$key' value='$key'>$val\n";
409 <tr><td class='ItemName'>
410 <font color='red'>*</font>Approx. Organization Size (# of Users):</td>
411 <td class='ItemValue'>
412 <input type='text' id='org_size' class='ItemValue' name='org_size'
413 size='4' maxlength='6' value=''></td>
414 <td class='ItemName'>Publish Org Size?</td><td class='ItemValue'><select name='publish_orgsize' class='ItemValue'>
415 <option id='publish_orgsize_0' value='0' >No
416 <option id='publish_orgsize_1' value='1' SELECTED>Yes
421 <td class='ItemName'>Website URL:</td>
422 <td class='ItemValue'>
423 <input type='text' class='ItemValue' id='website' name='website' size='30'
424 maxlength='150' value=''></td>
425 <td class='ItemName'>Publish Website?</td><td class='ItemValue'>
426 <select name='publish_website' class='ItemValue'>
427 <option id='publish_website_0' value='0' >No
428 <option id='publish_website_1' value='1' SELECTED>Yes
433 <td class='ItemName'>Organization Logo :</td>
434 <td class='ItemValue'>
435 <input type="file" name="org_logo" title="png, gif or jpeg file only please"/>
436 </td><td><i>max width 150px. png, gif or jpeg only</i></td>
439 <tr><td class='ItemName'><font color='red'>*</font>Country:</td>
440 <td class='ItemValue'>
441 <select name='country_id' class='ItemValue'>
443 while(list ($key, $val) = each ($country_lst))
445 echo "<option id='country_id_$key' value='$key'>$val\n";
452 <tr><td colspan=4><br></td></tr>
453 <tr><td class='ItemName'><font color='red'>*</font>Bacula version:</td>
454 <td class='ItemValue'>
455 <select name='bacula_version' class='ItemValue'>
458 while(list ($key, $val) = each ($version_lst))
460 echo "<option id='bacula_version_$key' value='$key'>$val\n";
466 <tr><td class='ItemName'><font color='red'>*</font>Director OS:</td>
467 <td class='ItemValue'>
468 <select name='ostype_id' class='ItemValue'>
471 while(list ($key, $val) = each ($os_lst))
473 echo "<option id='ostype_id_$key' value='$key'>$val\n";
479 <tr><td class='ItemName'><font color='red'>*</font>Catalog DB:</td>
480 <td class='ItemValue'>
481 <select name='catalog_id' class='ItemValue'>
484 while(list ($key, $val) = each ($catalog_lst))
486 echo "<option id='catalog_id_$key' value='$key'>$val\n";
493 <td class='ItemName'><font color='red'>*</font>Redundant/Failover Backup Setup?</td>
494 <td class='ItemValue'><select name='redundant_setup' class='ItemValue'>
495 <option value='0' id='redundant_setup_0' SELECTED>No
496 <option value='1' id='redundant_setup_1' >Yes
500 <tr><td class='ItemName'><font color='red'>*</font>Number of Director (Running bacula-dir):</td>
501 <td class='ItemValue'>
502 <input type='text' class='ItemValue' id='number_dir' name='number_dir'
503 size='5' maxlength='10' value=''></td>
506 <tr><td class='ItemName'><font color='red'>*</font>Number of Clients (Running bacula-fd):</td>
507 <td class='ItemValue'>
508 <input type='text' class='ItemValue' id='number_fd' name='number_fd'
509 size='5' maxlength='10' value=''></td>
512 <tr><td class='ItemName'>
513 <font color='red'>*</font>Number of Storage Daemons (Running bacula-sd):</td>
514 <td class='ItemValue'>
515 <input type='text' class='ItemValue' id='number_sd' name='number_sd' size='5'
516 maxlength='10' value=''></td>
519 <tr><td class='ItemName' title="See bellow how to get this information"><font color='red'>*</font>Total # of GB saved every month:</td>
520 <td class='ItemValue'><input type='text' class='ItemValue' name='month_gb' size='5'
521 id='month_gb' maxlength='10' value=''></td>
524 <tr><td class='ItemName' title='See bellow how to get this information'><font color='red'>*</font>Number # of Files:</td>
525 <td class='ItemValue'><input type='text' class='ItemValue' name='number_files'
526 id='number_files' size='10' maxlength='15' value=''></td>
530 <td class='ItemName'>Need professional support:</td>
531 <td class='ItemValue'>
532 <select name='support' class='ItemValue'>
533 <option id='support_0' value='0' SELECTED>No
534 <option id='support_1' value='1'>Yes
538 <tr><td colspan=4><br></td></tr>
540 <tr><td class='ItemName' valign='top'>Applicable Hardware and Network Information:</td>
541 <td class='ItemValue' colspan='3'>
542 <textarea name='hardware_comments' wrap='virtual' rows='4' id='hardware_comments'
543 cols='60' class='ItemValue'>Loader Description:
544 Barcode Reader: Yes/No
545 Number of Storage Elements:
546 Number of Import/Export Elements:
553 <tr><td class='ItemName' valign='top'>General Comments:</td>
554 <td class='ItemValue' colspan='3'>
555 <textarea name='comments' id='comments' wrap='virtual' rows='4' cols='60'
556 class='ItemValue'></textarea></tr>
560 if ($_REQUEST['action'] == 'Modify') {
561 echo "<input type='hidden' title='testimonial id' id='id' name='id' class='ItemValue' value=''>";
562 echo "<input type='submit' name='action' class='ItemValue' value='Save'>";
563 echo "<input type='submit' name='action' class='ItemValue' onclick='confirm(\"Are you sure ?\");' value='Delete'><br>";
564 echo "<input type='hidden' name='page' class='ItemValue' value='testimonial'><br>";
567 echo "<input type='submit' name='action' class='ItemValue' value='Review Profile Submission'>";
580 <h3 style="padding: 5px; border-bottom: 1px dotted #002244"> Getting backup information </h3>
581 To get <i>Total # of GB saved every month</i>, you can run this query on you catalog (just adapt the starttime condition and round the result)
583 bacula@yourdir:~$ bconsole
585 SELECT sum(JobBytes)/1073741824 FROM Job WHERE StartTime > '2008-02-07' AND Type = 'B'
588 To know how many files are in your catalog, you can run this:
590 bacula@yourdir:~$ bconsole
592 SELECT sum(JobFiles) FROM Job WHERE Type = 'B'
598 <h3 style="padding: 5px; border-bottom: 1px dotted #002244"> Privacy Notice </h3>
600 The following information is required, but you may choose to not have it
601 published for public viewing if you wish: contact name, email address,
602 organization name. We may use this information to verify the data you submit if
611 if ($_REQUEST['action'] == 'Modify') {
612 $filename = get_file_from_id();
618 $formul = load_formul($filename);
620 echo "<script type='text/javascript' language='JavaScript'>\n";
621 $attribs = array('contact_name','email_address', 'org_name','title','website',
622 'month_gb','number_files', 'number_dir','number_fd','number_sd',
624 foreach ($attribs as $arr) {
625 form_set_value($formul, $arr);
628 $attribs = array('publish_contact','publish_email', 'publish_orgname', 'orgtype_id',
629 'orgindustry_id', 'publish_orgsize','publish_website', 'bacula_version',
630 'country_id','ostype_id', 'redundant_setup', 'catalog_id', 'support');
631 foreach ($attribs as $arr) {
632 form_set_selection($formul, $arr);
635 $attribs = array('comments', 'hardware_comments');
636 foreach ($attribs as $arr) {
637 form_set_text($formul, $arr);
643 } elseif ($_REQUEST['action'] == 'Review Profile Submission') {
645 $form = get_formul();
647 echo "Sorry, something is missing, I can't accept your submission";
649 $token = uniqid(md5(rand()), true);
650 $filename = "$dat_dir/profile.$token";
652 $form['filename'] = $filename;
653 $form['id'] = $token;
657 send_email($form['id'], $form['email_address']);
658 echo "You can modify your profile <a href='?page=testimonial&action=Modify&id=" . $form['id'] . "'>here</a> (keep this link as bookmark)<br><br>";
662 } elseif ($_REQUEST['action'] == 'View') {
664 $file = get_file_from_id();
667 print_formul_file($filename,true);
670 } elseif ($_REQUEST['action'] == 'Delete') {
672 $filename = get_file_from_id();
678 $form = load_formul($filename);
680 if ($form['org_logo'] && file_exists($form['org_logo'])) {
681 unlink($upload_dir + $form['org_logo']);
683 if (file_exists($filename)) {
685 echo "Profile deleted";
688 } elseif ($_REQUEST['action'] == 'Accept' && is_admin()) {
690 $filename = get_file_from_id();
696 $form = load_formul($filename);
698 $hide = $_REQUEST['hide'];
706 echo $form['id'] . " is now " . ($hide?"un":"") . "visible";
709 } elseif ($_REQUEST['action'] == 'Save') {
711 $filename = get_file_from_id();
717 $form = get_formul();
719 $form['filename'] = $filename;
720 $form['id'] = $_REQUEST['id']; // id is clean
721 // $form['visible'] = false;
723 if (!$form['org_logo']) {
724 $form_old = load_formul($filename);
725 $form['org_logo'] = $form_old['org_logo'];
730 echo "Your profile has been modified.<br>";
733 } elseif ($_REQUEST['action'] == 'Admin' && is_admin()) {
737 } elseif (!$_REQUEST['action'] || $_REQUEST['action'] == 'ViewAll') {
739 echo "<a href='?page=testimonial&action=Add'>Add your testimonial</a><br><br>";
742 } elseif ($_REQUEST['action'] == 'AdminExport' && is_admin()) {
744 $file = get_file_from_id();
748 $form = load_formul($file);
752 } elseif ($_REQUEST['action'] == 'sql') {
763 $limit = $_REQUEST['limit'];
764 $offset = $_REQUEST['offset'];
766 $limit = is_numeric($limit)?$limit:5;
767 $offset = is_numeric($offset)?$offset:0;
768 $max = $offset + $limit;
771 if ($limit > 20) { $limit = 20 ;}
773 if ($handle = opendir($dat_dir)) {
774 /* Ceci est la facon correcte de traverser un dossier. */
776 while (false !== ($file = readdir($handle))) {
777 if (preg_match("/profile.[a-z0-9\.]+/", $file)) {
778 if (($i >= $offset) && ($i < $max)) {
779 print_formul_file("$dat_dir/$file",$admin);
790 $offset = $offset - $limit;
794 echo "<a href='?page=testimonial&offset=$offset&limit=$limit$password'>Prev</a> ";
797 $offset = $offset + $limit;
798 echo " <a href='?page=testimonial&offset=$offset&limit=$limit$password'>Next</a><br>";
802 function export_form($formul)
804 global $country_lst, $org_type_lst, $org_industry_lst, $os_lst, $catalog_lst;
806 $attribs = array('contact_name','email_address', 'org_name','title','website',
807 'hardware_comments','comments',
808 'publish_contact','publish_email', 'publish_orgname','org_size','redundant_setup',
809 'date','visible', 'support','number_dir',
810 'number_fd','number_sd','month_gb','number_files','publish_orgsize','publish_website');
812 foreach ($attribs as $arr) {
813 print "$arr = " . $formul[$arr] . "\n";
816 print "orgtype = " . $org_type_lst[$formul['orgtype_id']] . "\n";
817 print "orgindustry = " . $org_industry_lst[$formul['orgindustry_id']] . "\n";
818 print "bacula_version = " . $version_lst[$formul['bacula_version']] . "\n";
819 print "country = " . $country_lst[$formul['country_id']] . "\n";
820 print "ostype = " . $os_lst[$formul['ostype_id']] . "\n";
821 print "catalog = " . $catalog_lst[$formul['catalog_id']] . "\n";
826 function get_file_from_id()
829 $id = $_REQUEST['id'];
831 if (!ereg('^[a-zA-Z0-9\.]+$',$id)) {
835 $filename="$dat_dir/profile.$id";
837 if (!file_exists($filename)) {
838 echo "Can't verify your id";
845 function send_email($id, $email)
847 // Your email address
848 // $from = 'kern@sibbald.com';
849 $from = 'eric@eb.homelinux.org';
852 $subject = "[BACULA] New testimonial";
856 You can modify your new testimonial at http://www.bacula.org/en/?page=testimonial&action=Modify&id=$id
861 mail($email, $subject, $message, "From: Bacula WebMaster <$from>");
862 mail($from, $subject, $message, "From: Bacula WebMaster <$from>");
863 mail('eric@eb.homelinux.org', $subject, $message, "From: Bacula WebMaster <$from>");
865 echo "The email has been sent for approval.<br/>";
868 function save_formul($form)
870 $fp = fopen($form['filename'], 'w');
871 fwrite($fp, serialize($form));
875 function get_formul()
880 $attribs = array('contact_name','email_address', 'org_name');
881 foreach ($attribs as $arr) {
882 if (!$_REQUEST[$arr]) {
883 echo "Can't get $arr<br/>";
886 $formul[$arr] = preg_replace('/[^a-zA-Z0-9!\.?\:\/,;_()@\n -]/', " ", $_REQUEST[$arr]);
889 $attribs = array('title','website','hardware_comments','comments') ;
890 foreach ($attribs as $arr) {
891 $formul[$arr] = preg_replace('/[^a-zA-Z0-9!\.?\:\/,;_()@\n -]/', " ", $_REQUEST[$arr]);
894 $attribs = array('publish_contact','publish_email', 'publish_orgname', 'orgtype_id',
895 'orgindustry_id','org_size', 'publish_orgsize','publish_website', 'bacula_version',
896 'country_id','ostype_id', 'redundant_setup','number_fd','number_sd','support',
897 'month_gb','number_files','catalog_id','number_dir');
898 foreach ($attribs as $arr) {
899 $tmp = $_REQUEST[$arr];
900 $tmp = preg_replace("/[,\.]/", "", $tmp);
901 if (preg_match("/^[0-9]+$/", $tmp)) {
902 $formul[$arr] = $_REQUEST[$arr];
906 $attribs = array('orgtype_id', 'orgindustry_id', 'org_size', 'country_id','bacula_version',
907 'catalog_id', 'ostype_id','number_fd','number_sd', 'number_dir', 'month_gb','number_files');
908 foreach ($attribs as $arr) {
909 if (!$formul[$arr]) {
910 echo "Can't get $arr<br/>";
915 if ($_FILES['org_logo']) {
916 $token = uniqid(md5(rand()), true);
917 $image = "/upload/$token";
919 if (preg_match("/(jpg|jpeg)$/i", $_FILES['org_logo']['name'])) {
920 $image = "$image.jpg";
921 } elseif (preg_match("/png$/i", $_FILES['org_logo']['name'])) {
922 $image = "$image.png";
923 } elseif (preg_match("/gif$/i", $_FILES['org_logo']['name'])) {
924 $image = "$image.gif";
929 $ret=move_uploaded_file($_FILES['org_logo']['tmp_name'], "$upload_dir/$image");
930 $formul['org_logo'] = $image;
933 $formul['date'] = time();
934 $formul['visible'] = false;
939 function form_set_value($formul,$val)
941 echo "document.getElementById('$val').value = '" . $formul[$val] . "';\n";
944 function form_set_selection($formul,$val)
946 echo "document.getElementById('${val}_" . $formul[$val] . "').selected =true;\n";
949 function form_set_text($formul,$val)
951 $temp = $formul[$val];
952 $temp = str_replace(array("\n", "\r"), array("\\n",""), $temp);
953 echo "document.getElementById('$val').value='" . $temp . "';\n";
956 // passwd file must exist in dat directory
960 $id = $_REQUEST['passwd'];
966 if (!ereg('^[a-zA-Z]+$',$id)) {
970 if (file_exists("$dat_dir/$id")) {
977 function admin_link()
981 $pass = $_REQUEST['passwd'];
982 $waiting = $_REQUEST['waiting'];
983 $password = "&passwd=$pass";
986 print "<a href='?page=testimonial&action=Admin$password'> View all</a><br>";
988 print "<a href='?page=testimonial&action=Admin$password'> View all</a> | ";
989 print "<a href='?page=testimonial&action=Admin&waiting=1$password'> View Waiting</a><br>";
995 function load_formul($filename)
997 if (!file_exists($filename)) {
1001 if (!filesize($filename) || filesize($filename) > 10*1024*1024) {
1004 $fp = fopen($filename, 'r');
1005 $contents = fread ($fp, filesize ($filename));
1008 $formul = unserialize($contents);
1009 if (!is_array($formul)) {
1016 function print_formul_file($filename, $admin) {
1018 $form = load_formul($filename);
1024 if (!$form['visible']) {
1028 $waiting = $_REQUEST['waiting'];
1029 if ($admin && $waiting && $form['visible']) {
1033 $ret = print_formul($form);
1035 if ($form['visible']) {
1036 print "<a href=\"?page=testimonial&action=Accept&hide=1$password&id=" . $form['id'] . "\"> Hide </a> | \n";
1038 print "<a href=\"?page=testimonial&action=Accept$password&id=" . $form['id'] . "\"> Accept </a> | \n";
1040 print "<a href=\"?page=testimonial&action=Modify$password&id=" . $form['id'] . "\"> Modify </a> | \n";
1041 print "<a href=\"?page=testimonial&action=AdminExport$password&id=" . $form['id'] . "\"> Export </a><br><br>\n";
1048 global $dat_dir, $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst, $version_lst;
1053 CREATE TABLE dict (lang text, id int, name text, primary key (lang, id));
1054 CREATE TABLE testimonials (
1058 title text DEFAULT '',
1059 website text DEFAULT '',
1060 filename text DEFAULT '',
1061 month_gb int DEFAULT 0,
1062 number_files bigint DEFAULT 0,
1063 number_dir int DEFAULT 0,
1064 number_fd int DEFAULT 0,
1065 number_sd int DEFAULT 0,
1066 org_size int DEFAULT 0,
1077 publish_contact int DEFAULT 0,
1078 publish_email int DEFAULT 0,
1079 publish_website int DEFAULT 0,
1080 publish_orgname int DEFAULT 0,
1081 publish_orgsize int DEFAULT 0,
1082 redundant_setup int DEFAULT 0,
1083 support int DEFAULT 0,
1084 comments text DEFAULT '',
1085 hardware_comments text DEFAULT '',
1086 visible int DEFAULT 0,
1087 org_logo text DEFAULT '',
1089 lastmodifed int DEFAULT 0
1092 CREATE VIEW reference AS SELECT contact_name,email_address,org_name,title,website,hardware_comments,comments,
1093 publish_contact,publish_email,publish_orgname,org_size,publish_orgsize,publish_website,
1094 redundant_setup,number_fd,number_sd,support,month_gb,number_files,number_dir,date,visible,filename,t.id,
1095 orgtype.name AS orgtype,
1096 orgindustry.name AS orgindustry,
1097 version.name AS bacula_version,
1098 country.name AS country,
1099 ostype.name AS ostype,
1100 catalog.name AS catalog
1101 FROM testimonials AS t, dict AS orgtype, dict AS orgindustry, dict AS version, dict AS country, dict AS ostype,
1104 WHERE t.orgtype_id = orgtype.id AND orgtype.lang = 'en'
1105 AND t.orgindustry_id = orgindustry.id AND orgindustry.lang = 'en'
1106 AND t.bacula_version = version.id AND version.lang = 'en'
1107 AND t.country_id = country.id AND country.lang = 'en'
1108 AND t.ostype_id = ostype.id AND ostype.lang = 'en'
1109 AND t.catalog_id = catalog.id AND catalog.lang = 'en';
1112 INSERT INTO dict (lang, id, name) VALUES ('en', 0, 'no');
1113 INSERT INTO dict (lang, id, name) VALUES ('en', 1, 'yes');
1115 $a = array($version_lst, $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst);
1116 foreach ($a as $tab) {
1117 while(list ($key, $val) = each ($tab))
1119 if ($key != 'empty') {
1120 echo "INSERT INTO dict (lang, id, name) VALUES ('en', $key, '$val');\n";
1124 if ($handle = opendir($dat_dir)) {
1125 /* Ceci est la facon correcte de traverser un dossier. */
1126 while (false !== ($file = readdir($handle))) {
1127 if (preg_match("/profile.[a-z0-9\.]+/", $file)) {
1130 $form = load_formul("$dat_dir/$file");
1131 while(list ($key, $val) = each ($form))
1133 array_push($tmpv, "'$val'");
1134 array_push($tmpk, $key);
1136 echo "INSERT INTO testimonials (";
1137 print join(",", $tmpk);
1139 print join(",", $tmpv);
1147 function print_formul($formul)
1149 global $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst;
1154 <b><? echo ($formul['publish_orgname'])?$formul['org_name']:'N/A' ?></b><br>
1156 <tr><td> Date: </td><td><? echo date('d/m/o', $formul['date']) ?> </td></tr>
1157 <tr><td> Location: </td><td><? $a = $formul['country_id'] ; echo $country_lst[$a] ?> </td></tr>
1158 <tr><td> Organization Type: </td><td><? echo $org_type_lst[$formul['orgtype_id']] ?> </td></tr>
1159 <tr><td> Industry/Function: </td><td><? echo $org_industry_lst[$formul['orgindustry_id']] ?> </td></tr>
1161 <? if ($formul['publish_orgsize']) { ?>
1162 <tr><td> Organisation Size: </td><td><? echo $formul['org_size'] ?> </td></tr>
1165 <? if ($formul['publish_website']) { ?>
1166 <tr><td> Website: </td><td><? echo $formul['website'] ?> </td></tr>
1169 <? if ($formul['number_fd'] > 1) { ?>
1170 <tr><td> Number of fd: </td><td><? echo $formul['number_fd'] ?> </td></tr>
1173 <? if ($formul['month_gb'] > 1) { ?>
1174 <tr><td> GB/Month: </td><td><? echo $formul['month_gb'] ?> </td></tr>
1177 <tr><td> Comments: </td><td width='450'><i><? echo $formul['comments'] ?> </i></td></tr>
1178 <? if ($formul['publish_contact']) { ?>
1179 <tr align='right'><td></td><td><i><? echo $formul['contact_name'] ?> </i></td></tr>
1183 <td align='center' valign='center'>
1184 <? if ($formul['org_logo']) { ?>
1185 <a href="<? echo $formul['org_logo'] ?>" ><img width='150' src="<? echo $formul['org_logo'] ?>"></a>
1194 <? require_once("inc/footer.php"); ?>