<? require_once("inc/header.php"); ?>
<?
-$dat_dir = '/tmp/testimonials';
-
+$dat_dir = '/var/www/testimonials';
+$upload_dir = '/var/www/bacula';
+$password='';
+// 0 No
+// 1 Yes
$org_type_lst = array(
'empty' => "SELECT ONE",
- '15' => "Church / Religious Organization",
- '3' => "Corporation",
- '14' => "Educational Institution",
- '5' => "Government",
- '6' => "Military",
- '13' => "Non-Profit Organization",
- '10' => "Other",
- '4' => "Small Business"
+ '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(
'empty' => "SELECT ONE",
- '1' => "1.36.x",
- '2' => "1.38.x",
- '3' => "2.0.x",
- '4' => "2.2.x",
- '5' => "SVN version"
+ '200' => "1.36.x",
+ '201' => "1.38.x",
+ '202' => "2.0.x",
+ '203' => "2.2.x",
+ '204' => "SVN version"
);
$catalog_lst = array(
'empty' => "SELECT ONE",
- '1' => "MySQL",
- '2' => "PostgreSQL",
- '3' => "SqLite"
+ '300' => "MySQL",
+ '301' => "PostgreSQL",
+ '303' => "SqLite"
);
$org_industry_lst = array(
- 'empty' => '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(
- 'empty' => '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(
- 'empty' => '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'
);
+admin_link();
+
if ($_REQUEST['action'] == 'Add' or $_REQUEST['action'] == 'Modify')
{
<tr><td></td><td>
<?
if ($_REQUEST['action'] == 'Modify') {
- echo "<input type='text' title='testimonial id' id='id' name='id' class='ItemValue' value=''>";
+ echo "<input type='hidden' title='testimonial id' id='id' name='id' class='ItemValue' value=''>";
echo "<input type='submit' name='action' class='ItemValue' 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>";
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['action'] == 'Review Profile Submission') {
$form = load_formul($filename);
if ($form['org_logo'] && file_exists($form['org_logo'])) {
- unlink($form['org_logo']);
+ unlink($upload_dir + $form['org_logo']);
}
if (file_exists($filename)) {
unlink($filename);
} elseif ($_REQUEST['action'] == 'Admin' && is_admin()) {
+ view_all();
- $pass = $_REQUEST['passwd']; // passwd is clean
- $waiting = $_REQUEST['waiting'];
-
- if ($waiting) {
- print '<a href="?page=testimonial&action=Admin&passwd=' . $pass . '"> View all</a><br>';
- print "<h1>View all waiting testimonials</h1>";
- } else {
- print '<a href="?page=testimonial&action=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&action=Accept&hide=1&passwd=" . $pass . "&id=" . $form['id'] . "\"> Hide </a> | \n";
- } else {
- print "<a href=\"?page=testimonial&action=Accept&passwd=" . $pass . "&id=" . $form['id'] . "\"> Accept </a> | \n";
- }
- print "<a href=\"?page=testimonial&action=Modify&id=" . $form['id'] . "\"> Modify </a> | \n";
- print "<a href=\"?page=testimonial&action=AdminExport&passwd=" . $pass . "&id=" . $form['id'] . "\"> Export </a><br><br>\n";
+ echo "<br><br><a href='?page=testimonial&action=Add'>Add a testimonial</a><br><br>";
+ view_all();
- }
- }
- }
- closedir($handle);
- }
+} elseif ($_REQUEST['action'] == 'AdminExport' && is_admin()) {
-} elseif (!$_REQUEST['action'] || $_REQUEST['action'] == 'ViewAll') {
+ $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:10;
+ $offset = is_numeric($offset)?$offset:0;
+ $max = $offset + $limit;
$admin = is_admin();
-
if ($limit > 20) { $limit = 20 ;}
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)) {
+ print_formul_file("$dat_dir/$file",$admin);
+ }
+ if ($i > $max) {
+ break;
}
- }
- closedir($handle);
+ $i++;
+ }
+ }
+ 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>";
}
- echo "<br><br><a href='?page=testimonial&action=Add'>Add a testimonial</a><br><br>";
-
-} elseif ($_REQUEST['action'] == 'AdminExport' && is_admin()) {
-
- $file = get_file_from_id();
- if (!$file) {
- return 0;
- }
- $form = load_formul($file);
- if ($form) {
- export_form($form);
- }
-} else {
- print "Invalid action <br>";
}
function export_form($formul)
$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) {
function get_formul()
{
+ global $upload_dir;
global $dat_dir;
$formul = array();
$attribs = array('contact_name','email_address', 'org_name');
$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])) {
$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/>";
$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['passwd'];
- 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['passwd'];
+ $waiting = $_REQUEST['waiting'];
+ $password = "&passwd=$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&action=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 $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst;
+?>
+ 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,
+ website text,
+ month_gb int,
+ number_files bigint,
+ number_dir int,
+ number_fd int,
+ number_sd int,
+ org_size int,
+ id text,
+ publish_contact bool,
+ publish_email bool,
+ publish_website bool,
+ publish_orgname bool,
+ publish_orgsize bool,
+ bacula_version int,
+ contry_id int,
+ orgindustry_id int,
+ orgtype_id int,
+ redundant_setup bool,
+ catalog_id int,
+ support bool,
+ comments text,
+ hardware_comments text
+ );
+<?
+ $a = array($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";
+ }
+ }
+ }
}
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(DATE_RFC822, $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>