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