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