-<? require_once("inc/header.php"); ?>
-<?
-$dat_dir = '/testimonials';
-
+<?
+require_once("inc/header.php");
+
+$dat_dir = '/var/www/testimonials';
+$upload_dir = '/var/www/bacula';
+$password='';
+// 0 No
+// 1 Yes
$org_type_lst = array(
- '0' => "SELECT ONE",
- '15' => "Church / Religious Organization",
- '3' => "Corporation",
- '14' => "Educational Institution",
- '5' => "Government",
- '6' => "Military",
- '13' => "Non-Profit Organization",
- '10' => "Other",
- '4' => "Small Business"
+ 'empty' => "SELECT ONE",
+ '100' => "Church / Religious Organization",
+ '101' => "Corporation",
+ '102' => "Educational Institution",
+ '103' => "Government",
+ '104' => "Military",
+ '105' => "Non-Profit Organization",
+ '107' => "Small Business",
+ '106' => "Other"
);
$version_lst = array(
- '0' => "SELECT ONE",
- '1' => "1.36.x",
- '2' => "1.38.x",
- '3' => "2.0.x",
- '4' => "2.2.x",
- '5' => "SVN version"
+ 'empty' => "SELECT ONE",
+ '200' => "1.36.x",
+ '201' => "1.38.x",
+ '202' => "2.0.x",
+ '203' => "2.2.x",
+ '206' => "2.4.x",
+ '206' => "3.0.x",
+ '204' => "GIT master version"
);
$catalog_lst = array(
- '0' => "SELECT ONE",
- '1' => "MySQL",
- '2' => "PostgreSQL",
- '3' => "SqLite"
+ 'empty' => "SELECT ONE",
+ '300' => "MySQL",
+ '301' => "PostgreSQL",
+ '303' => "SqLite"
);
$org_industry_lst = array(
- '0' => 'SELECT ONE', '25' => 'Aerospace / Aeronautical',
- '11' => 'Agriculture / Farming', '38' => 'Architecture / Design',
- '44' => 'Arts', '5' => 'ASP',
- '54' => 'Banking',
- '42' => 'Church / Religious Organization', '45' => 'Coaching',
- '10' => 'Construction', '22' => 'Consulting (General)',
- '21' => 'Consulting (Information Technology)', '31' => 'Defense Industry',
- '51' => 'Education / Training', '37' => 'Energy Industry',
- '46' => 'Engineering', '35' => 'Entertainment (Film)',
- '34' => 'Entertainment (Music)', '36' => 'Entertainment (Other)',
- '47' => 'Event Management / Conferences', '7' => 'Finance / Banking / Accounting',
- '12' => 'Food Service Industry', '29' => 'Government',
- '3' => 'Healthcare / Medicine', '8' => 'Higher Education',
- '6' => 'Insurance', '4' => 'Internet Service Provider',
- '2' => 'K-12 Education', '48' => 'Law Enforcement / Emergency Management',
- '14' => 'Legal', '24' => 'Manufacturing (Computer Equipment)',
- '23' => 'Manufacturing (General)', '53' => 'Media (Publishing, Broadcasting, etc)',
- '30' => 'Military', '9' => 'Mining',
- '18' => 'Natural Resources / Environment', '15' => 'Pharmaceuticals',
- '49' => 'Public Relations / Advertising', '13' => 'Real Estate',
- '41' => 'Retail / Consumer Goods', '52' => 'Sales / Marketing',
- '32' => 'Scientific Research', '33' => 'Sports / Recreation',
- '43' => 'Technical College / Trade School', '40' => 'Telecommunications',
- '27' => 'Transportation Industry (Air)', '28' => 'Transportation Industry (General)',
- '26' => 'Transportation Industry (Marine)', '50' => 'Travel / Tourism / Lodging',
- '17' => 'Travel Industry', '39' => 'Utilities / Public Works',
- '16' => 'Other'
+ 'empty' => 'SELECT ONE', '400' => 'Aerospace / Aeronautical',
+ '401' => 'Agriculture / Farming', '402' => 'Architecture / Design',
+ '403' => 'Arts', '404' => 'ASP',
+ '405' => 'Banking',
+ '406' => 'Church / Religious Organization', '407' => 'Coaching',
+ '408' => 'Construction', '409' => 'Consulting (General)',
+ '410' => 'Consulting (Information Technology)','411' => 'Defense Industry',
+ '412' => 'Education / Training', '413' => 'Energy Industry',
+ '414' => 'Engineering', '415' => 'Entertainment (Film)',
+ '416' => 'Entertainment (Music)', '417' => 'Entertainment (Other)',
+ '418' => 'Event Management / Conferences', '419' => 'Finance / Banking / Accounting',
+ '420' => 'Food Service Industry', '421' => 'Government',
+ '422' => 'Healthcare / Medicine', '423' => 'Higher Education',
+ '424' => 'Insurance', '425' => 'Internet Service Provider',
+ '426' => 'K-12 Education', '427' => 'Law Enforcement / Emergency Management',
+ '428' => 'Legal', '429' => 'Manufacturing (Computer Equipment)',
+ '430' => 'Manufacturing (General)', '431' => 'Media (Publishing, Broadcasting, etc)',
+ '432' => 'Military', '433' => 'Mining',
+ '434' => 'Natural Resources / Environment', '435' => 'Pharmaceuticals',
+ '436' => 'Public Relations / Advertising', '437' => 'Real Estate',
+ '438' => 'Retail / Consumer Goods', '439' => 'Sales / Marketing',
+ '440' => 'Scientific Research', '441' => 'Sports / Recreation',
+ '442' => 'Technical College / Trade School', '443' => 'Telecommunications',
+ '444' => 'Transportation Industry (Air)', '445' => 'Transportation Industry (General)',
+ '446' => 'Transportation Industry (Marine)', '447' => 'Travel / Tourism / Lodging',
+ '448' => 'Travel Industry', '449' => 'Utilities / Public Works',
+ '450' => 'Other'
);
$os_lst = array(
- '0' => 'SELECT ONE', '20' => 'AIX',
- '21' => 'FreeBSD', '14' => 'HP-UX',
- '2' => 'Linux (Debian)', '27' => 'Linux (Fedora)',
- '25' => 'Linux (Gentoo)', '4' => 'Linux (Mandrake)',
- '5' => 'Linux (Other)', '1' => 'Linux (RedHat)',
- '26' => 'Linux (Slackware)', '3' => 'Linux (Suse)',
- '18' => 'Mac OS X', '22' => 'NetBSD',
- '23' => 'OpenBSD', '24' => 'Other',
- '13' => 'Solaris', '15' => 'Windows 2000',
- '16' => 'Windows 2003', '17' => 'Windows XP'
+ 'empty' => 'SELECT ONE', '500' => 'AIX',
+ '501' => 'FreeBSD', '502' => 'HP-UX',
+ '503' => 'Linux (Debian)', '504' => 'Linux (Fedora)',
+ '505' => 'Linux (Gentoo)', '506' => 'Linux (Mandriva)',
+ '507' => 'Linux (Other)', '508' => 'Linux (RedHat)',
+ '509' => 'Linux (Slackware)', '510' => 'Linux (Suse)',
+ '511' => 'Mac OS X', '512' => 'NetBSD',
+ '513' => 'OpenBSD', '514' => 'Other',
+ '515' => 'Solaris', '516' => 'Windows 2000',
+ '517' => 'Windows 2003', '518' => 'Windows XP',
+ '519' => 'Windows Vista'
);
$country_lst = array(
- '0' => 'SELECT ONE', '1' => 'Afghanistan',
- '2' => 'Albania', '3' => 'Algeria',
- '4' => 'American Samoa', '5' => 'Andorra',
- '6' => 'Angola', '7' => 'Anguilla',
- '8' => 'Antarctica', '9' => 'Antigua and Barbuda',
- '10' => 'Argentina', '11' => 'Armenia',
- '12' => 'Aruba', '13' => 'Australia',
- '14' => 'Austria', '15' => 'Azerbaijan',
- '16' => 'Bahamas', '17' => 'Bahrain',
- '18' => 'Bangladesh', '19' => 'Barbados',
- '20' => 'Belarus', '21' => 'Belgium',
- '22' => 'Belize', '23' => 'Benin',
- '24' => 'Bermuda', '25' => 'Bhutan',
- '26' => 'Bolivia', '27' => 'Bosnia and Herzegovina',
- '28' => 'Botswana', '29' => 'Bouvet Island',
- '30' => 'Brazil', '31' => 'Brunei Darussalam',
- '32' => 'Bulgaria', '33' => 'Burkina Faso',
- '34' => 'Burundi', '35' => 'Cambodia',
- '36' => 'Cameroon', '37' => 'Canada',
- '38' => 'Cape Verde', '39' => 'Cayman Islands',
- '40' => 'Central African Republic','41' => 'Chad',
- '42' => 'Chile', '43' => 'China',
- '44' => 'Christmas Island', '45' => 'Colombia',
- '46' => 'Comoros', '47' => 'Congo',
- '48' => 'Cook Islands', '49' => 'Costa Rica',
- '54' => "Ivory Coast", '50' => 'Croatia',
- '51' => 'Cuba', '52' => 'Cyprus',
- '53' => 'Czech Republic', '55' => 'Denmark',
- '56' => 'Djibouti', '57' => 'Dominica',
- '58' => 'Dominican Republic', '59' => 'East Timor',
- '60' => 'Ecuador', '61' => 'Egypt',
- '62' => 'El Salvador', '63' => 'Equatorial Guinea',
- '64' => 'Eritrea', '65' => 'Estonia',
- '66' => 'Ethiopia', '67' => 'Falkland Islands',
- '68' => 'Faroe Islands', '69' => 'Fiji',
- '70' => 'Finland', '71' => 'France',
- '72' => 'French Guiana', '73' => 'French Polynesia',
- '74' => 'Gabon', '75' => 'Gambia',
- '76' => 'Georgia', '77' => 'Germany',
- '78' => 'Ghana', '79' => 'Gibraltar',
- '80' => 'Greece', '81' => 'Greenland',
- '82' => 'Grenada', '83' => 'Guadeloupe',
- '84' => 'Guam', '85' => 'Guatemala',
- '86' => 'Guinea', '87' => 'Guinea-Bissau',
- '88' => 'Guyana', '89' => 'Haiti',
- '90' => 'Honduras', '91' => 'Hong Kong',
- '92' => 'Hungary', '93' => 'Iceland',
- '94' => 'India', '95' => 'Indonesia',
- '96' => 'Iran', '97' => 'Iraq',
- '98' => 'Ireland', '99' => 'Israel',
- '100' => 'Italy', '101' => 'Jamaica',
- '102' => 'Japan', '103' => 'Jordan',
- '104' => 'Kazakstan', '105' => 'Kenya',
- '106' => 'Kiribati', '107' => 'Kuwait',
- '108' => 'Kyrgystan', '109' => 'Lao',
- '110' => 'Latvia', '111' => 'Lebanon',
- '112' => 'Lesotho', '113' => 'Liberia',
- '232' => 'Libya', '114' => 'Liechtenstein',
- '115' => 'Lithuania', '116' => 'Luxembourg',
- '117' => 'Macau', '118' => 'Macedonia (FYR)',
- '119' => 'Madagascar', '120' => 'Malawi',
- '121' => 'Malaysia', '122' => 'Maldives',
- '123' => 'Mali', '124' => 'Malta',
- '125' => 'Marshall Islands', '126' => 'Martinique',
- '127' => 'Mauritania', '128' => 'Mauritius',
- '129' => 'Mayotte', '130' => 'Mexico',
- '131' => 'Micronesia', '132' => 'Moldova',
- '133' => 'Monaco', '134' => 'Mongolia',
- '135' => 'Montserrat', '136' => 'Morocco',
- '137' => 'Mozambique', '138' => 'Myanmar',
- '139' => 'Namibia', '140' => 'Nauru',
- '141' => 'Nepal', '142' => 'Netherlands',
- '143' => 'Netherlands Antilles', '144' => 'Neutral Zone',
- '145' => 'New Caledonia', '146' => 'New Zealand',
- '147' => 'Nicaragua', '148' => 'Niger',
- '149' => 'Nigeria', '150' => 'Niue',
- '151' => 'Norfolk Island', '152' => 'North Korea',
- '153' => 'Northern Mariana Islands','154' => 'Norway',
- '155' => 'Oman', '156' => 'Pakistan',
- '157' => 'Palau', '158' => 'Panama',
- '159' => 'Papua New Guinea', '160' => 'Paraguay',
- '161' => 'Peru', '162' => 'Philippines',
- '163' => 'Pitcairn', '164' => 'Poland',
- '165' => 'Portugal', '166' => 'Puerto Rico',
- '167' => 'Qatar', '168' => 'Reunion',
- '169' => 'Romania', '170' => 'Russian Federation',
- '171' => 'Rwanda', '172' => 'Saint Helena',
- '173' => 'Saint Kitts and Nevis', '174' => 'Saint Lucia',
- '175' => 'Saint Pierre and Miquelon','231' => 'Saint Vincent and the Grenadines',
- '176' => 'Samoa', '177' => 'San Marino',
- '178' => 'Sao Tome and Principe', '179' => 'Saudi Arabia',
- '180' => 'Senegal', '227' => 'Serbia and Montenegro',
- '181' => 'Seychelles', '182' => 'Sierra Leone',
- '183' => 'Singapore', '184' => 'Slovakia',
- '185' => 'Slovenia', '186' => 'Solomon Islands',
- '187' => 'Somalia', '188' => 'South Africa',
- '189' => 'South Georgia', '190' => 'South Korea',
- '191' => 'Spain', '192' => 'Sri Lanka',
- '193' => 'Sudan', '194' => 'Suriname',
- '195' => 'Swaziland', '196' => 'Sweden',
- '197' => 'Switzerland', '198' => 'Syria',
- '199' => 'Taiwan', '200' => 'Tajikistan',
- '201' => 'Tanzania', '202' => 'Thailand',
- '203' => 'Togo', '204' => 'Tokelau',
- '205' => 'Tonga', '206' => 'Trinidad and Tobago',
- '207' => 'Tunisia', '208' => 'Turkey',
- '209' => 'Turkmenistan', '210' => 'Turks and Caicos Islands',
- '211' => 'Tuvalu', '212' => 'Uganda',
- '213' => 'Ukraine', '214' => 'United Arab Emirates',
- '215' => 'United Kingdom', '216' => 'United States of America',
- '217' => 'Uruguay', '218' => 'Uzbekistan',
- '219' => 'Vanuatu', '233' => 'Vatican City',
- '220' => 'Venezuela', '221' => 'Vietnam',
- '222' => 'Virgin Islands (British)','223' => 'Virgin Islands (U.S.)',
- '224' => 'Wallis and Futuna Islands','225' => 'Western Sahara',
- '226' => 'Yemen', '228' => 'Zaire',
- '229' => 'Zambia', '230' => 'Zimbabwe'
+ 'empty' => 'SELECT ONE', '1001' => 'Afghanistan',
+ '1002' => 'Albania', '1003' => 'Algeria',
+ '1004' => 'American Samoa', '1005' => 'Andorra',
+ '1006' => 'Angola', '1007' => 'Anguilla',
+ '1008' => 'Antarctica', '1009' => 'Antigua and Barbuda',
+ '1010' => 'Argentina', '1011' => 'Armenia',
+ '1012' => 'Aruba', '1013' => 'Australia',
+ '1014' => 'Austria', '1015' => 'Azerbaijan',
+ '1016' => 'Bahamas', '1017' => 'Bahrain',
+ '1018' => 'Bangladesh', '1019' => 'Barbados',
+ '1020' => 'Belarus', '1021' => 'Belgium',
+ '1022' => 'Belize', '1023' => 'Benin',
+ '1024' => 'Bermuda', '1025' => 'Bhutan',
+ '1026' => 'Bolivia', '1027' => 'Bosnia and Herzegovina',
+ '1028' => 'Botswana', '1029' => 'Bouvet Island',
+ '1030' => 'Brazil', '1031' => 'Brunei Darussalam',
+ '1032' => 'Bulgaria', '1033' => 'Burkina Faso',
+ '1034' => 'Burundi', '1035' => 'Cambodia',
+ '1036' => 'Cameroon', '1037' => 'Canada',
+ '1038' => 'Cape Verde', '1039' => 'Cayman Islands',
+ '1040' => 'Central African Republic','1041' => 'Chad',
+ '1042' => 'Chile', '1043' => 'China',
+ '1044' => 'Christmas Island', '1045' => 'Colombia',
+ '1046' => 'Comoros', '1047' => 'Congo',
+ '1048' => 'Cook Islands', '1049' => 'Costa Rica',
+ '1054' => "Ivory Coast", '1050' => 'Croatia',
+ '1051' => 'Cuba', '1052' => 'Cyprus',
+ '1053' => 'Czech Republic', '1055' => 'Denmark',
+ '1056' => 'Djibouti', '1057' => 'Dominica',
+ '1058' => 'Dominican Republic', '1059' => 'East Timor',
+ '1060' => 'Ecuador', '1061' => 'Egypt',
+ '1062' => 'El Salvador', '1063' => 'Equatorial Guinea',
+ '1064' => 'Eritrea', '1065' => 'Estonia',
+ '1066' => 'Ethiopia', '1067' => 'Falkland Islands',
+ '1068' => 'Faroe Islands', '1069' => 'Fiji',
+ '1070' => 'Finland', '1071' => 'France',
+ '1072' => 'French Guiana', '1073' => 'French Polynesia',
+ '1074' => 'Gabon', '1075' => 'Gambia',
+ '1076' => 'Georgia', '1077' => 'Germany',
+ '1078' => 'Ghana', '1079' => 'Gibraltar',
+ '1080' => 'Greece', '1081' => 'Greenland',
+ '1082' => 'Grenada', '1083' => 'Guadeloupe',
+ '1084' => 'Guam', '1085' => 'Guatemala',
+ '1086' => 'Guinea', '1087' => 'Guinea-Bissau',
+ '1088' => 'Guyana', '1089' => 'Haiti',
+ '1090' => 'Honduras', '1091' => 'Hong Kong',
+ '1092' => 'Hungary', '1093' => 'Iceland',
+ '1094' => 'India', '1095' => 'Indonesia',
+ '1096' => 'Iran', '1097' => 'Iraq',
+ '1098' => 'Ireland', '1099' => 'Israel',
+ '1100' => 'Italy', '1101' => 'Jamaica',
+ '1102' => 'Japan', '1103' => 'Jordan',
+ '1104' => 'Kazakstan', '1105' => 'Kenya',
+ '1106' => 'Kiribati', '1107' => 'Kuwait',
+ '1108' => 'Kyrgystan', '1109' => 'Lao',
+ '1110' => 'Latvia', '1111' => 'Lebanon',
+ '1112' => 'Lesotho', '1113' => 'Liberia',
+ '1232' => 'Libya', '1114' => 'Liechtenstein',
+ '1115' => 'Lithuania', '1116' => 'Luxembourg',
+ '1117' => 'Macau', '1118' => 'Macedonia (FYR)',
+ '1119' => 'Madagascar', '1120' => 'Malawi',
+ '1121' => 'Malaysia', '1122' => 'Maldives',
+ '1123' => 'Mali', '1124' => 'Malta',
+ '1125' => 'Marshall Islands', '1126' => 'Martinique',
+ '1127' => 'Mauritania', '1128' => 'Mauritius',
+ '1129' => 'Mayotte', '1130' => 'Mexico',
+ '1131' => 'Micronesia', '1132' => 'Moldova',
+ '1133' => 'Monaco', '1134' => 'Mongolia',
+ '1135' => 'Montserrat', '1136' => 'Morocco',
+ '1137' => 'Mozambique', '1138' => 'Myanmar',
+ '1139' => 'Namibia', '1140' => 'Nauru',
+ '1141' => 'Nepal', '1142' => 'Netherlands',
+ '1143' => 'Netherlands Antilles', '1144' => 'Neutral Zone',
+ '1145' => 'New Caledonia', '1146' => 'New Zealand',
+ '1147' => 'Nicaragua', '1148' => 'Niger',
+ '1149' => 'Nigeria', '1150' => 'Niue',
+ '1151' => 'Norfolk Island', '1152' => 'North Korea',
+ '1153' => 'Northern Mariana Islands', '1154' => 'Norway',
+ '1155' => 'Oman', '1156' => 'Pakistan',
+ '1157' => 'Palau', '1158' => 'Panama',
+ '1159' => 'Papua New Guinea', '1160' => 'Paraguay',
+ '1161' => 'Peru', '1162' => 'Philippines',
+ '1163' => 'Pitcairn', '1164' => 'Poland',
+ '1165' => 'Portugal', '1166' => 'Puerto Rico',
+ '1167' => 'Qatar', '1168' => 'Reunion',
+ '1169' => 'Romania', '1170' => 'Russian Federation',
+ '1171' => 'Rwanda', '1172' => 'Saint Helena',
+ '1173' => 'Saint Kitts and Nevis', '1174' => 'Saint Lucia',
+ '1175' => 'Saint Pierre and Miquelon','1231' => 'Saint Vincent and the Grenadines',
+ '1176' => 'Samoa', '1177' => 'San Marino',
+ '1178' => 'Sao Tome and Principe', '1179' => 'Saudi Arabia',
+ '1180' => 'Senegal', '1227' => 'Serbia and Montenegro',
+ '1181' => 'Seychelles', '1182' => 'Sierra Leone',
+ '1183' => 'Singapore', '1184' => 'Slovakia',
+ '1185' => 'Slovenia', '1186' => 'Solomon Islands',
+ '1187' => 'Somalia', '1188' => 'South Africa',
+ '1189' => 'South Georgia', '1190' => 'South Korea',
+ '1191' => 'Spain', '1192' => 'Sri Lanka',
+ '1193' => 'Sudan', '1194' => 'Suriname',
+ '1195' => 'Swaziland', '1196' => 'Sweden',
+ '1197' => 'Switzerland', '1198' => 'Syria',
+ '1199' => 'Taiwan', '1200' => 'Tajikistan',
+ '1201' => 'Tanzania', '1202' => 'Thailand',
+ '1203' => 'Togo', '1204' => 'Tokelau',
+ '1205' => 'Tonga', '1206' => 'Trinidad and Tobago',
+ '1207' => 'Tunisia', '1208' => 'Turkey',
+ '1209' => 'Turkmenistan', '1210' => 'Turks and Caicos Islands',
+ '1211' => 'Tuvalu', '1212' => 'Uganda',
+ '1213' => 'Ukraine', '1214' => 'United Arab Emirates',
+ '1215' => 'United Kingdom', '1216' => 'United States of America',
+ '1217' => 'Uruguay', '1218' => 'Uzbekistan',
+ '1219' => 'Vanuatu', '1233' => 'Vatican City',
+ '1220' => 'Venezuela', '1221' => 'Vietnam',
+ '1222' => 'Virgin Islands (British)', '1223' => 'Virgin Islands (U.S.)',
+ '1224' => 'Wallis and Futuna Islands','1225' => 'Western Sahara',
+ '1226' => 'Yemen', '1228' => 'Zaire',
+ '1229' => 'Zambia', '1230' => 'Zimbabwe'
);
-if ($_REQUEST['btnSubmit'] == 'Add' or $_REQUEST['btnSubmit'] == 'Modify')
+admin_link();
+
+if ($_REQUEST['action'] == 'Add' or $_REQUEST['action'] == 'Modify')
{
?>
+
+<script type="text/javascript" language="JavaScript">
+
+function validate_testimonial (form) {
+ var alertstr = '';
+ var invalid = 0;
+ var invalid_fields = new Array();
+ var ok;
+ // email: standard text, hidden, password, or textarea box
+ var email = form.elements['email_address'].value;
+ if (email == null || ! email.match(/^[\w\-\+\._]+\@[a-zA-Z0-9][-a-zA-Z0-9\.]*\.[a-zA-Z]+$/)) {
+ alertstr += '- Invalid entry for the "Email" field\n';
+ invalid++;
+ invalid_fields.push('email_address');
+ }
+
+ // contact_name: standard text, hidden, password, or textarea box
+ var contact_name = form.elements['contact_name'].value;
+ if (contact_name == null || ! contact_name.match(/^[a-zA-Z]+[- ]?[a-zA-Z]+\s*,?([a-zA-Z]+|[a-zA-Z]+\.)?$/)) {
+ alertstr += '- Invalid entry for the "Contact Name" field\n';
+ invalid++;
+ invalid_fields.push('contact_name');
+ }
+
+ // org_name: standard text, hidden, password, or textarea box
+ var org_name = form.elements['org_name'].value;
+ if (org_name == null || ! org_name.match(/^[a-zA-Z0-9();@%, :!\/]+$/)) {
+ alertstr += '- Invalid entry for the "Organization Name" field\n';
+ invalid++;
+ invalid_fields.push('org_name');
+ }
+ var number = form.elements['orgtype_id'].value;
+ if (number == null || ! number.match(/^[0-9]+$/)) {
+ alertstr += '- Choose one of the "Organization type" options\n';
+ invalid_fields.push('orgtype_id');
+ invalid++;
+ }
+ number = form.elements['orgindustry_id'].value;
+ if (number == null || ! number.match(/^[0-9]+$/)) {
+ alertstr += '- Choose one of the "Organization industry type" options\n';
+ invalid_fields.push('orgindustry_id');
+ invalid++;
+ }
+ var org_size = form.elements['org_size'].value;
+ if (org_size == null || ! org_size.match(/^[0-9,\.]+$/)) {
+ alertstr += '- Invalid entry for the "Organization size" field\n';
+ invalid_fields.push('org_size');
+ invalid++;
+ }
+
+ var bacula_version = form.elements['bacula_version'].value;
+ if (bacula_version == null || ! bacula_version.match(/^[0-9]+$/)) {
+ alertstr += '- Invalid entry for the "Bacula version" field\n';
+ invalid_fields.push('bacula_version');
+ invalid++;
+ }
+ var ostype = form.elements['ostype_id'].value;
+ if (ostype == null || ! ostype.match(/^[0-9]+$/)) {
+ alertstr += '- Choose one of the "Director OS" field\n';
+ invalid_fields.push('ostype_id');
+ invalid++;
+ }
+ var catalog = form.elements['catalog_id'].value;
+ if (catalog == null || ! catalog.match(/^[0-9]+$/)) {
+ alertstr += '- Choose one of the "Catalog type" field\n';
+ invalid_fields.push('catalog_id');
+ invalid++;
+ }
+ var number = form.elements['number_fd'].value;
+ if (number == null || ! number.match(/^[0-9,\.]+$/)) {
+ alertstr += '- Invalid entry for the "Number of Client" field\n';
+ invalid_fields.push('number_fd');
+ invalid++;
+ }
+ number = form.elements['number_sd'].value;
+ if (number == null || ! number.match(/^[0-9,\.]+$/)) {
+ alertstr += '- Invalid entry for the "Number of Storage" field\n';
+ invalid_fields.push('number_sd');
+ invalid++;
+ }
+ number = form.elements['number_dir'].value;
+ if (number == null || ! number.match(/^[0-9,\.]+$/)) {
+ alertstr += '- Invalid entry for the "Number of Director" field\n';
+ invalid_fields.push('number_dir');
+ invalid++;
+ }
+ number = form.elements['month_gb'].value;
+ if (number == null || ! number.match(/^[0-9,\.]+$/)) {
+ alertstr += '- Invalid entry for the "Number GB/month" field\n';
+ invalid_fields.push('month_gb');
+ invalid++;
+ }
+ number = form.elements['number_files'].value;
+ if (number == null || ! number.match(/^[0-9,\.]+$/)) {
+ alertstr += '- Invalid entry for the "File number" field\n';
+ invalid_fields.push('number_files');
+ invalid++;
+ }
+ if (invalid > 0 || alertstr != '') {
+ if (! invalid) invalid = 'The following'; // catch for programmer error
+ alert(''+invalid+' error(s) were encountered with your submission:'+'\n\n'
+ +alertstr+'\n'+'Please correct these fields and try again.');
+ return false;
+ }
+ return true; // all checked ok
+}
+
+</script>
<table>
<tr>
<td class="contentTopic">
- <? echo $_REQUEST['btnSubmit'] ?> Testimonial
+ <? echo $_REQUEST['action'] ?> Testimonial
</td>
</tr>
<tr>
<tr>
<td class="content">
-<form enctype="multipart/form-data" method='post' action='?page=testimonial'>
+<form name='form1' enctype="multipart/form-data" method='post' action='?page=testimonial'>
<input type='hidden' name='page' value='testimonial'>
<table border='0' class='Content'>
</select></td>
</tr>
+<tr><td class='ItemName'><font color='red'>*</font>Number of Director (Running bacula-dir):</td>
+<td class='ItemValue'>
+<input type='text' class='ItemValue' id='number_dir' name='number_dir'
+ size='5' maxlength='10' value=''></td>
+</tr>
+
<tr><td class='ItemName'><font color='red'>*</font>Number of Clients (Running bacula-fd):</td>
<td class='ItemValue'>
<input type='text' class='ItemValue' id='number_fd' name='number_fd'
maxlength='10' value=''></td>
</tr>
-<tr><td class='ItemName'><font color='red'>*</font>Total # of GB saved every month:</td>
+<tr><td class='ItemName' title="See bellow how to get this information"><font color='red'>*</font>Total # of GB saved every month:</td>
<td class='ItemValue'><input type='text' class='ItemValue' name='month_gb' size='5'
id='month_gb' maxlength='10' value=''></td>
</tr>
-<tr><td class='ItemName'><font color='red'>*</font>Number # of Files:</td>
+<tr><td class='ItemName' title='See bellow how to get this information'><font color='red'>*</font>Number # of Files:</td>
<td class='ItemValue'><input type='text' class='ItemValue' name='number_files'
- id='number_files' title='select count(1) from File;' size='10' maxlength='15' value=''></td>
+ id='number_files' size='10' maxlength='15' value=''></td>
</tr>
<tr>
<tr><td></td><td>
<?
- if ($_REQUEST['btnSubmit'] == 'Modify') {
- echo "<input type='text' title='testimonial id' id='id' name='id' class='ItemValue' value=''>";
- echo "<input type='submit' name='btnSubmit' class='ItemValue' value='Save'>";
- echo "<input type='submit' name='btnSubmit' class='ItemValue' onclick='confirm(\"Are you sure ?\");' value='Delete'><br>";
+ if ($_REQUEST['action'] == 'Modify') {
+ echo "<input type='hidden' title='testimonial id' id='id' name='id' class='ItemValue' value=''>";
+ echo "<input type='submit' name='action' class='ItemValue' onclick='return validate_testimonial(this);' value='Save'>";
+ echo "<input type='submit' name='action' class='ItemValue' onclick='confirm(\"Are you sure ?\");' value='Delete'><br>";
echo "<input type='hidden' name='page' class='ItemValue' value='testimonial'><br>";
} else {
- echo "<input type='submit' name='btnSubmit' class='ItemValue' value='Review Profile Submission'>";
+ echo "<input type='submit' name='action' class='ItemValue' onclick='return validate_testimonial(this);' value='Review Profile Submission'>";
}
?>
</tr>
<tr>
+ <td class="content">
+ <h3 style="padding: 5px; border-bottom: 1px dotted #002244"> Getting backup information </h3>
+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)
+<pre>
+bacula@yourdir:~$ bconsole
+*sql
+SELECT sum(JobBytes)/1073741824 FROM Job WHERE StartTime > '2008-02-07' AND Type = 'B'
+</pre>
+
+To know how many files are in your catalog, you can run this:
+<pre>
+bacula@yourdir:~$ bconsole
+*sql
+SELECT sum(JobFiles) FROM Job WHERE Type = 'B'
+</pre>
+ </td>
+</tr>
+<tr>
<td class="content">
<h3 style="padding: 5px; border-bottom: 1px dotted #002244"> Privacy Notice </h3>
</table>
<?
-
}
-
-if ($_REQUEST['btnSubmit'] == 'Modify') {
+if ($_REQUEST['action'] == 'Modify') {
$filename = get_file_from_id();
if (!$filename) {
echo "<script type='text/javascript' language='JavaScript'>\n";
$attribs = array('contact_name','email_address', 'org_name','title','website',
- 'month_gb','number_files', 'number_fd','number_sd',
- 'org_size','comments', 'hardware_comments', 'id');
+ 'month_gb','number_files', 'number_dir','number_fd','number_sd',
+ 'org_size','id');
foreach ($attribs as $arr) {
form_set_value($formul, $arr);
}
form_set_selection($formul, $arr);
}
+ $attribs = array('comments', 'hardware_comments');
+ foreach ($attribs as $arr) {
+ form_set_text($formul, $arr);
+ }
+
+
echo "</script>\n";
-} elseif ($_REQUEST['btnSubmit'] == 'Review Profile Submission') {
+} elseif ($_REQUEST['action'] == 'Review Profile Submission') {
$form = get_formul();
if (!$form) {
- echo "Sorry, something is missing, I cannot accept your submission";
+ echo "Sorry, something is missing, I can't accept your submission";
} else {
$token = uniqid(md5(rand()), true);
$filename = "$dat_dir/profile.$token";
$form['filename'] = $filename;
$form['id'] = $token;
+ $form['visible']=0;
save_formul($form);
- send_email($form['id'], $form['email_address']);
- echo "You can modify your profile <a href='?page=testimonial&btnSubmit=Modify&id=" . $form['id'] . "'>here</a> (keep this link as bookmark)<br><br>";
+ send_email($form['id'], $form['contact_name'], $form['email_address']);
+ echo "You can modify your profile <a href='?page=testimonial&action=Modify&id=" . $form['id'] . "'>here</a> (keep this link as bookmark)<br><br>";
print_formul($form);
}
-} elseif ($_REQUEST['btnSubmit'] == 'View') {
+} elseif ($_REQUEST['action'] == 'View') {
$file = get_file_from_id();
print_formul_file($filename,true);
}
-} elseif ($_REQUEST['btnSubmit'] == 'Delete') {
+} elseif ($_REQUEST['action'] == 'Delete') {
$filename = get_file_from_id();
$form = load_formul($filename);
if ($form['org_logo'] && file_exists($form['org_logo'])) {
- unlink($form['org_logo']);
+ rename($upload_dir + $form['org_logo'], 'removed.' + $upload_dir + $form['org_logo']);
}
if (file_exists($filename)) {
- unlink($filename);
+ rename($filename, "$filename-removed");
echo "Profile deleted";
}
-} elseif ($_REQUEST['btnSubmit'] == 'Accept' && is_admin()) {
+} elseif ($_REQUEST['action'] == 'Accept' && is_admin()) {
$filename = get_file_from_id();
echo $form['id'] . " is now " . ($hide?"un":"") . "visible";
print_formul($form);
-} elseif ($_REQUEST['btnSubmit'] == 'Save') {
+} elseif ($_REQUEST['action'] == 'Save') {
$filename = get_file_from_id();
echo "Your profile has been modified.<br>";
print_formul($form);
-} elseif ($_REQUEST['btnSubmit'] == 'Admin' && is_admin()) {
+} elseif ($_REQUEST['action'] == 'Admin' && is_admin()) {
+ view_all();
- $pass = $_REQUEST['passwd']; // passwd is clean
- $waiting = $_REQUEST['waiting'];
-
- if ($waiting) {
- print '<a href="?page=testimonial&btnSubmit=Admin&passwd=' . $pass . '"> View all</a><br>';
- print "<h1>View all waiting testimonials</h1>";
- } else {
- print '<a href="?page=testimonial&btnSubmit=Admin&waiting=1&passwd=' . $pass . '"> View Waiting</a><br>';
- print "<h1>View all testimonials</h1>";
- }
+} elseif (!$_REQUEST['action'] || $_REQUEST['action'] == 'ViewAll') {
- if ($handle = opendir($dat_dir)) {
- /* Ceci est la facon correcte de traverser un dossier. */
- while (false !== ($file = readdir($handle))) {
- if (preg_match("/profile.[a-z0-9\.]+/", $file)) {
- $form = load_formul("$dat_dir/$file") ;
- // on affiche ceux qui sont en attente ou bien tous
- if (!$waiting || !$form['visible']) {
- print_formul($form);
- if ($form['visible']) {
- print "<a href=\"?page=testimonial&btnSubmit=Accept&hide=1&passwd=" . $pass . "&id=" . $form['id'] . "\"> Hide </a> | \n";
- } else {
- print "<a href=\"?page=testimonial&btnSubmit=Accept&passwd=" . $pass . "&id=" . $form['id'] . "\"> Accept </a> | \n";
- }
- print "<a href=\"?page=testimonial&btnSubmit=Modify&id=" . $form['id'] . "\"> Modify </a> | \n";
- print "<a href=\"?page=testimonial&btnSubmit=AdminExport&passwd=" . $pass . "&id=" . $form['id'] . "\"> Export </a><br><br>\n";
-
- }
- }
- }
- closedir($handle);
- }
+ echo "<a href='?page=testimonial&action=Add'>Add your testimonial</a><br><br>";
+ view_all();
-} elseif (!$_REQUEST['btnSubmit'] || $_REQUEST['btnSubmit'] == 'ViewAll') {
+} elseif ($_REQUEST['action'] == 'AdminExport' && is_admin()) {
+
+ $file = get_file_from_id();
+ if (!$file) {
+ return 0;
+ }
+ $form = load_formul($file);
+ if ($form) {
+ export_form($form);
+ }
+} elseif ($_REQUEST['action'] == 'sql') {
+ print "<pre>";
+ dump_sql();
+ print "</pre>";
+}
+
+function view_all()
+{
+ global $dat_dir;
+ global $password;
$limit = $_REQUEST['limit'];
$offset = $_REQUEST['offset'];
- $limit = is_int($limit)?$limit:10;
- $offset = is_int($offset)?$limit:0;
+ $limit = is_numeric($limit)?$limit:5;
+ $offset = is_numeric($offset)?$offset:0;
+ $max = $offset + $limit;
$admin = is_admin();
-
if ($limit > 20) { $limit = 20 ;}
- echo "<a href='?page=testimonial&btnSubmit=Add'>Add a testimonial</a><br><br>";
-
if ($handle = opendir($dat_dir)) {
/* Ceci est la facon correcte de traverser un dossier. */
- $i = 0 ;
- while (false !== ($file = readdir($handle))) {
- if (preg_match("/profile.[a-z0-9\.]+/", $file)) {
- if ($i >= $offset && $i < ($offset + $limit)) {
- $i += print_formul_file("$dat_dir/$file",$admin);
- }
-
- if ($i > ($offset + $limit)) {
- break;
- }
+ $i = 0 ;
+ while (false !== ($file = readdir($handle))) {
+ if (preg_match("/^profile.[a-z0-9\.]+$/", $file)) {
+ if (($i >= $offset) && ($i < $max)) {
+ $i += print_formul_file("$dat_dir/$file",$admin);
+ } else {
+ $i++;
}
- }
- closedir($handle);
+ if ($i > $max) {
+ break;
+ }
+ }
+ }
+ closedir($handle);
+ }
+ if ($offset > 0) {
+ $offset = $offset - $limit;
+ if ($offset < 0) {
+ $offset=0;
+ }
+ echo "<a href='?page=testimonial&offset=$offset&limit=$limit$password'>Prev</a> ";
+ }
+ if ($i >= $max) {
+ $offset = $offset + $limit;
+ echo " <a href='?page=testimonial&offset=$offset&limit=$limit$password'>Next</a><br>";
}
-
-} elseif ($_REQUEST['btnSubmit'] == 'AdminExport' && is_admin()) {
-
- $file = get_file_from_id();
- if (!$file) {
- return 0;
- }
- $form = load_formul($file);
- if ($form) {
- export_form($form);
- }
-} else {
- print "Invalid btnSubmit<br>";
}
function export_form($formul)
{
- global $country_lst, $org_type_lst, $org_industry_lst, $os_lst, $catalog_lst;
+ global $country_lst, $org_type_lst, $org_industry_lst, $os_lst, $catalog_lst, $version_lst;
$attribs = array('contact_name','email_address', 'org_name','title','website',
'hardware_comments','comments',
'publish_contact','publish_email', 'publish_orgname','org_size','redundant_setup',
- 'date','visible', 'support',
+ 'date','visible', 'support','number_dir',
'number_fd','number_sd','month_gb','number_files','publish_orgsize','publish_website');
print "<pre>\n";
foreach ($attribs as $arr) {
return $filename;
}
-function send_email($id, $email)
+function send_email($id, $name, $email)
{
// Your email address
- $from = 'kern@sibbald.com';
-// $from = 'eric@eb.homelinux.org';
+// $from = 'kern@sibbald.com';
+ $from = 'eric@eb.homelinux.org';
// The subject
$subject = "[BACULA] New testimonial";
// The message
$message = "Hello,
-You can modify your new testimonial at http://www.bacula.org/?page=testimonial&btnSubmit=Modify&id=$id
+You can modify your new testimonial at http://www.bacula.org/en/?page=testimonial&action=Modify&id=$id
Best regards.
";
mail($email, $subject, $message, "From: Bacula WebMaster <$from>");
- mail($from, $subject, $message, "From: Bacula WebMaster <$from>");
- mail('eric@eb.homelinux.org', $subject, $message, "From: Bacula WebMaster <$from>");
+
+ $message = "Hello,
+You can review this testimonial at http://www.bacula.org/en/?page=testimonial&action=Modify&id=$id
+
+Best regards.
+";
+
+
+ mail('testimonial@rt.baculasystems.com', $subject, $message, "From: $name <$email>");
echo "The email has been sent for approval.<br/>";
}
function get_formul()
{
+ global $upload_dir;
global $dat_dir;
$formul = array();
$attribs = array('contact_name','email_address', 'org_name');
$formul[$arr] = preg_replace('/[^a-zA-Z0-9!\.?\:\/,;_()@\n -]/', " ", $_REQUEST[$arr]);
}
- $attribs = array('title','website','hardware_comments','comments');
+ $attribs = array('title','website','hardware_comments','comments') ;
foreach ($attribs as $arr) {
- $formul[$arr] = preg_replace('/[^a-zA-Z0-9!\.?\:\/,;_()@ -]/', " ", $_REQUEST[$arr]);
+ $formul[$arr] = preg_replace('/[^a-zA-Z0-9!\.?\:\/,;_()@\n -]/', " ", $_REQUEST[$arr]);
}
$attribs = array('publish_contact','publish_email', 'publish_orgname', 'orgtype_id',
'orgindustry_id','org_size', 'publish_orgsize','publish_website', 'bacula_version',
'country_id','ostype_id', 'redundant_setup','number_fd','number_sd','support',
- 'month_gb','number_files','catalog_id');
+ 'month_gb','number_files','catalog_id','number_dir');
foreach ($attribs as $arr) {
- if (preg_match("/^[0-9]+$/", $_REQUEST[$arr])) {
+ $tmp = $_REQUEST[$arr];
+ $tmp = preg_replace("/[,\.]/", "", $tmp);
+ if (preg_match("/^[0-9]+$/", $tmp)) {
$formul[$arr] = $_REQUEST[$arr];
}
}
$attribs = array('orgtype_id', 'orgindustry_id', 'org_size', 'country_id','bacula_version',
- 'catalog_id', 'ostype_id','number_fd','number_sd', 'month_gb','number_files');
+ 'catalog_id', 'ostype_id','number_fd','number_sd', 'number_dir', 'month_gb','number_files');
foreach ($attribs as $arr) {
if (!$formul[$arr]) {
echo "Can't get $arr<br/>";
if ($_FILES['org_logo']) {
$token = uniqid(md5(rand()), true);
- $image = "upload/$token";
+ $image = "/upload/$token";
if (preg_match("/(jpg|jpeg)$/i", $_FILES['org_logo']['name'])) {
$image = "$image.jpg";
$image = '';
}
if ($image) {
- $ret=move_uploaded_file($_FILES['org_logo']['tmp_name'], $image);
+ $ret=move_uploaded_file($_FILES['org_logo']['tmp_name'], "$upload_dir/$image");
$formul['org_logo'] = $image;
}
}
echo "document.getElementById('${val}_" . $formul[$val] . "').selected =true;\n";
}
+function form_set_text($formul,$val)
+{
+ $temp = $formul[$val];
+ $temp = str_replace(array("\n", "\r"), array("\\n",""), $temp);
+ echo "document.getElementById('$val').value='" . $temp . "';\n";
+}
+
// passwd file must exist in dat directory
function is_admin()
{
- global $dat_dir;
- $id = $_REQUEST['passwd'];
+ global $dat_dir;
+ $id = $_REQUEST['p'];
- if (!ereg('^[a-zA-Z]+$',$id)) {
- return(false) ;
- }
-
- if (file_exists("$dat_dir/$id")) {
- return true;
- } else {
- return false;
- }
+ if (!$id) {
+ return(false);
+ }
+
+ if (!ereg('^[a-zA-Z]+$',$id)) {
+ return(false) ;
+ }
+
+ if (file_exists("$dat_dir/$id")) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+function admin_link()
+{
+ global $password;
+ if (is_admin()) {
+ $pass = $_REQUEST['p'];
+ $waiting = $_REQUEST['waiting'];
+ $password = "&p=$pass";
+ print "Admin: ";
+ if ($waiting) {
+ print "<a href='?page=testimonial&action=Admin$password'> View all</a><br>";
+ } else {
+ print "<a href='?page=testimonial&action=Admin$password'> View all</a> | ";
+ print "<a href='?page=testimonial&action=Admin&waiting=1$password'> View Waiting</a><br>";
+ }
+ print "<hr>";
+ }
}
function load_formul($filename)
{
- if (!file_exists($filename)) {
- return array();
- }
+ if (!file_exists($filename)) {
+ return array();
+ }
- if (!filesize($filename) || filesize($filename) > 10*1024*1024) {
- return undef;
- }
- $fp = fopen($filename, 'r');
- $contents = fread ($fp, filesize ($filename));
- fclose ($fp);
+ if (!filesize($filename) || filesize($filename) > 10*1024*1024) {
+ return undef;
+ }
+ $fp = fopen($filename, 'r');
+ $contents = fread ($fp, filesize ($filename));
+ fclose ($fp);
- $formul = unserialize($contents);
- if (!is_array($formul)) {
- return undef;
- }
+ $formul = unserialize($contents);
+ if (!is_array($formul)) {
+ return undef;
+ }
- return $formul;
+ return $formul;
}
function print_formul_file($filename, $admin) {
+ global $password;
+ $form = load_formul($filename);
+ if (!$form) {
+ return 0;
+ }
+
+ if (!$admin) {
+ if (!$form['visible']) {
+ return 0;
+ }
+ }
+ $waiting = $_REQUEST['waiting'];
+ if ($admin && $waiting && $form['visible']) {
+ return 0;
+ }
- $formul = load_formul($filename);
- if (!$formul) {
- return 0;
- }
-
- if (!$admin) {
- if (!$formul['visible']) {
- return 0;
- }
- } else {
- print "<a href=\"?page=testimonial&btnSubmit=Modify&id=" . $formul['id'] . "\">Modify</a><br>\n";
- }
+ $ret = print_formul($form);
+ if ($admin) {
+ if ($form['visible']) {
+ print "<a href=\"?page=testimonial&action=Accept&hide=1$password&id=" . $form['id'] . "\"> Hide </a> | \n";
+ } else {
+ print "<a href=\"?page=testimonial&action=Accept$password&id=" . $form['id'] . "\"> Accept </a> | \n";
+ }
+ print "<a href=\"?page=testimonial&action=Modify$password&id=" . $form['id'] . "\"> Modify </a> | \n";
+ print "<a href=\"?page=testimonial&action=AdminExport$password&id=" . $form['id'] . "\"> Export </a><br><br>\n";
+ }
+ return $ret;
+}
- return print_formul($formul);
+function dump_sql()
+{
+ global $dat_dir, $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst, $version_lst;
+ if (!is_admin()) {
+ return;
+ }
+?>
+ CREATE TABLE dict (lang text, id int, name text, primary key (lang, id));
+ CREATE TABLE testimonials (
+ contact_name text,
+ email_address text,
+ org_name text,
+ title text DEFAULT '',
+ website text DEFAULT '',
+ filename text DEFAULT '',
+ month_gb int DEFAULT 0,
+ number_files bigint DEFAULT 0,
+ number_dir int DEFAULT 0,
+ number_fd int DEFAULT 0,
+ number_sd int DEFAULT 0,
+ org_size int DEFAULT 0,
+
+ country_id int,
+ ostype_id int,
+ bacula_version int,
+ contry_id int,
+ orgindustry_id int,
+ orgtype_id int,
+ catalog_id int,
+
+ id text,
+ publish_contact int DEFAULT 0,
+ publish_email int DEFAULT 0,
+ publish_website int DEFAULT 0,
+ publish_orgname int DEFAULT 0,
+ publish_orgsize int DEFAULT 0,
+ redundant_setup int DEFAULT 0,
+ support int DEFAULT 0,
+ comments text DEFAULT '',
+ hardware_comments text DEFAULT '',
+ visible int DEFAULT 0,
+ org_logo text DEFAULT '',
+ date int DEFAULT 0,
+ lastmodifed int DEFAULT 0
+ );
+
+ CREATE VIEW reference AS SELECT contact_name,email_address,org_name,title,website,hardware_comments,comments,
+ publish_contact,publish_email,publish_orgname,org_size,publish_orgsize,publish_website,
+ redundant_setup,number_fd,number_sd,support,month_gb,number_files,number_dir,date,visible,filename,t.id,
+ orgtype.name AS orgtype,
+ orgindustry.name AS orgindustry,
+ version.name AS bacula_version,
+ country.name AS country,
+ ostype.name AS ostype,
+ catalog.name AS catalog
+ FROM testimonials AS t, dict AS orgtype, dict AS orgindustry, dict AS version, dict AS country, dict AS ostype,
+ dict AS catalog
+
+ WHERE t.orgtype_id = orgtype.id AND orgtype.lang = 'en'
+ AND t.orgindustry_id = orgindustry.id AND orgindustry.lang = 'en'
+ AND t.bacula_version = version.id AND version.lang = 'en'
+ AND t.country_id = country.id AND country.lang = 'en'
+ AND t.ostype_id = ostype.id AND ostype.lang = 'en'
+ AND t.catalog_id = catalog.id AND catalog.lang = 'en';
+
+
+ INSERT INTO dict (lang, id, name) VALUES ('en', 0, 'no');
+ INSERT INTO dict (lang, id, name) VALUES ('en', 1, 'yes');
+<?
+ $a = array($version_lst, $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst);
+ foreach ($a as $tab) {
+ while(list ($key, $val) = each ($tab))
+ {
+ if ($key != 'empty') {
+ echo "INSERT INTO dict (lang, id, name) VALUES ('en', $key, '$val');\n";
+ }
+ }
+ }
+ if ($handle = opendir($dat_dir)) {
+ /* Ceci est la facon correcte de traverser un dossier. */
+ while (false !== ($file = readdir($handle))) {
+ if (preg_match("/^profile.[a-z0-9\.]+$/", $file)) {
+ $tmpv = array();
+ $tmpk = array();
+ $form = load_formul("$dat_dir/$file");
+ while(list ($key, $val) = each ($form))
+ {
+ array_push($tmpv, "'$val'");
+ array_push($tmpk, $key);
+ }
+ echo "INSERT INTO testimonials (";
+ print join(",", $tmpk);
+ echo ") VALUES (";
+ print join(",", $tmpv);
+ echo ");\n";
+ }
+ }
+ closedir($handle);
+ }
}
function print_formul($formul)
<td>
<b><? echo ($formul['publish_orgname'])?$formul['org_name']:'N/A' ?></b><br>
<table>
+ <tr><td> Date: </td><td><? echo date('d/m/o', $formul['date']) ?> </td></tr>
<tr><td> Location: </td><td><? $a = $formul['country_id'] ; echo $country_lst[$a] ?> </td></tr>
<tr><td> Organization Type: </td><td><? echo $org_type_lst[$formul['orgtype_id']] ?> </td></tr>
<tr><td> Industry/Function: </td><td><? echo $org_industry_lst[$formul['orgindustry_id']] ?> </td></tr>
<? } ?>
<? if ($formul['publish_website']) { ?>
- <tr><td> Website: </td><td><? echo $formul['website'] ?> </td></tr>
+ <tr><td> Website: </td><td><a href="<? echo $formul['website'] ?>"><? echo $formul['website'] ?></a></td></tr>
<? } ?>
<? if ($formul['number_fd'] > 1) { ?>
<? if ($formul['publish_contact']) { ?>
<tr align='right'><td></td><td><i><? echo $formul['contact_name'] ?> </i></td></tr>
<? } ?>
+<!--
</table>
</td>
+-->
+ <tr><td></td>
<td>
<? if ($formul['org_logo']) { ?>
<a href="<? echo $formul['org_logo'] ?>" ><img width='150' src="<? echo $formul['org_logo'] ?>"></a>
<? } ?>
</td>
+ </tr> <!-- added -->
</table>
<?
return 1;