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