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