User talk:SeekingHispleasure
<?PHP Function ZeroPad($str, $iSize) { $ZeroPad = String($iSize - strlen($str), "0") . Trim($str); } Function displaycharacter($link1) { for ($c=65;$c<=90;$c++) { $str=$str." <a href='$link1?letter=".chr($c)."' class='bluetextnopad'>".chr($c)."</a> "; } $str=$str." <a href='$link1?number=0-9' class='bluetextnopad'>0-9</a> "; return $str; }
Function displayalphabets($link1) { //$link=link1; $putSpace=""; for ($c=65;$c<=90;$c++) { echo "$putSpace <a href='".$link1."?letter=".chr($c)."' class='lnkblue'>".chr($c)."</a>"; $putSpace=" "; } return $str; }
Function displayalphabets2($link1,$op1,$op1_val) { //$link=link1; $putSpace=""; for ($c=65;$c<=90;$c++) { echo $putSpace?><a href="<?PHP echo $link1;?>?letter=<?PHP echo chr($c);?><?PHP if($op1!=) { ?>&<?PHP echo $op1;?>=<?PHP echo $op1_val;?><?PHP }?>" class="lnkblue"><?PHP echo chr($c);?></a> <?PHP $putSpace=" "; } return $str; }
Function ListCountry ($C) { //Dim $OP[250)
$OP[ 0 ] = "Select Country"; $OP[ 1 ] = "USA"; $OP[ 2 ] = "Afghanistan"; $OP[ 3 ] = "Albania"; $OP[ 4 ] = "Algeria"; $OP[ 5 ] = "American Samoa"; $OP[ 6 ] = "Andorra"; $OP[ 7 ] = "Angola"; $OP[ 8 ] = "Anguilla"; $OP[ 9 ] = "Antarctica"; $OP[ 10 ] = "Antigua and Barbuda"; $OP[ 11 ] = "Argentina"; $OP[ 12 ] = "Armenia"; $OP[ 13 ] = "Aruba"; $OP[ 14 ] = "Australia"; $OP[ 15 ] = "Austria"; $OP[ 16 ] = "Azerbaijan"; $OP[ 17 ] = "Bahamas"; $OP[ 18 ] = "Bahrain"; $OP[ 19 ] = "Bangladesh"; $OP[ 20 ] = "Barbados"; $OP[ 21 ] = "Belarussia"; $OP[ 22 ] = "Belgium"; $OP[ 23 ] = "Belize"; $OP[ 24 ] = "Benin"; $OP[ 25 ] = "Bermuda"; $OP[ 26 ] = "Bhutan"; $OP[ 27 ] = "Bolivia"; $OP[ 28 ] = "Bosnia and Herzegovina"; $OP[ 30 ] = "Botswana"; $OP[ 31 ] = "Bouvet Island"; $OP[ 32 ] = "Brazil"; $OP[ 33 ] = "British Indian Ocean Territory"; $OP[ 34 ] = "Brunei Darussalam"; $OP[ 35 ] = "Bulgaria"; $OP[ 36 ] = "Burkina Faso"; $OP[ 37 ] = "Burma"; $OP[ 38 ] = "Burundi"; $OP[ 39 ] = "Cambodia"; $OP[ 40 ] = "Cameroon"; $OP[ 41 ] = "Canada"; $OP[ 42 ] = "Canton and Enderbury Islands"; $OP[ 43 ] = "Cape Verde"; $OP[ 44 ] = "Cayman Islands"; $OP[ 45 ] = "Central African Republic"; $OP[ 46 ] = "Chad"; $OP[ 47 ] = "Chile"; $OP[ 48 ] = "China"; $OP[ 49 ] = "Christmas Island"; $OP[ 50 ] = "Cocos (Keeling) Islands"; $OP[ 51 ] = "Colombia"; $OP[ 52 ] = "Comoros"; $OP[ 53 ] = "Congo"; $OP[ 54 ] = "Cook Islands"; $OP[ 55 ] = "Costa Rica"; $OP[ 56 ] = "Cote D'Ivoire"; $OP[ 57 ] = "Croatia (Hrvatska)"; $OP[ 58 ] = "Cuba"; $OP[ 59 ] = "Cyprus"; $OP[ 60 ] = "Czech Republic"; $OP[ 61 ] = "Democratic Yemen"; $OP[ 62 ] = "Denmark"; $OP[ 63 ] = "Djibouti"; $OP[ 64 ] = "Dominica"; $OP[ 65 ] = "Dominican Republic"; $OP[ 66 ] = "Dronning Maud Land"; $OP[ 67 ] = "East Timor"; $OP[ 68 ] = "Ecuador"; $OP[ 69 ] = "Egypt"; $OP[ 70 ] = "El Salvador"; $OP[ 71 ] = "Equatorial Guinea"; $OP[ 72 ] = "Eritrea"; $OP[ 73 ] = "Estonia"; $OP[ 74 ] = "Ethiopia"; $OP[ 75 ] = "Falkland Islands (Malvinas)"; $OP[ 76 ] = "Faroe Islands"; $OP[ 77 ] = "Fiji"; $OP[ 78 ] = "Finland"; $OP[ 79 ] = "France"; $OP[ 80 ] = "France, Metropolitan"; $OP[ 81 ] = "French Guiana"; $OP[ 82 ] = "French Polynesia"; $OP[ 83 ] = "French Southern Territories"; $OP[ 84 ] = "Gabon"; $OP[ 85 ] = "Gambia"; $OP[ 86 ] = "Georgia"; $OP[ 87 ] = "Germany"; $OP[ 88 ] = "Ghana"; $OP[ 89 ] = "Gibraltar"; $OP[ 90 ] = "Greece"; $OP[ 91 ] = "Greenland"; $OP[ 92 ] = "Grenada"; $OP[ 93 ] = "Guadeloupe"; $OP[ 94 ] = "Guam"; $OP[ 95 ] = "Guatemala"; $OP[ 96 ] = "Guinea"; $OP[ 97 ] = "Guinea-bisseu"; $OP[ 98 ] = "Guyana"; $OP[ 99 ] = "Haiti"; $OP[ 100 ] = "Heard and Mc Donald Islands"; $OP[ 101 ] = "Honduras"; $OP[ 102 ] = "Hong Kong"; $OP[ 103 ] = "Hungary"; $OP[ 104 ] = "Iceland"; $OP[ 105 ] = "India"; $OP[ 106 ] = "Indonesia"; $OP[ 107 ] = "Iran(Islamic Republic of)"; $OP[ 108 ] = "Iraq"; $OP[ 109 ] = "Ireland"; $OP[ 110 ] = "Israel"; $OP[ 111 ] = "Italy"; $OP[ 112 ] = "Ivory Coast"; $OP[ 113 ] = "Jamaica"; $OP[ 114 ] = "Japan"; $OP[ 115 ] = "Johnston Island"; $OP[ 116 ] = "Jordan"; $OP[ 117 ] = "Kazakstan"; $OP[ 118 ] = "Kenya"; $OP[ 119 ] = "Kiribati"; $OP[ 120 ] = "Korea"; $OP[ 121 ] = "Kuwait"; $OP[ 122 ] = "Kyrgyzstan"; $OP[ 123 ] = "Latvia"; $OP[ 124 ] = "Lebanon"; $OP[ 125 ] = "Lesotho"; $OP[ 126 ] = "Liberia"; $OP[ 127 ] = "Libyan Arab Jamahiriya"; $OP[ 128 ] = "Liechtenstein"; $OP[ 129 ] = "Lithuania"; $OP[ 130 ] = "Luxembourg"; $OP[ 131 ] = "Macau"; $OP[ 132 ] = "Macedonia"; $OP[ 133 ] = "Madagascar"; $OP[ 134 ] = "Malawi"; $OP[ 135 ] = "Malaysia"; $OP[ 136 ] = "Maldives"; $OP[ 137 ] = "Mali"; $OP[ 138 ] = "Malta"; $OP[ 139 ] = "Marshall Islands"; $OP[ 140 ] = "Martinique"; $OP[ 141 ] = "Mauritania"; $OP[ 142 ] = "Mauritius"; $OP[ 143 ] = "Mayotte"; $OP[ 144 ] = "Mexico"; $OP[ 146 ] = "Midway Islands"; $OP[ 147 ] = "Moldova, Republic of"; $OP[ 148 ] = "Monaco"; $OP[ 149 ] = "Mongolia"; $OP[ 150 ] = "Montserrat"; $OP[ 151 ] = "Morocco"; $OP[ 152 ] = "Mozambique"; $OP[ 153 ] = "Myanmar"; $OP[ 154 ] = "Namibia"; $OP[ 155 ] = "Nauru"; $OP[ 156 ] = "Nepal"; $OP[ 157 ] = "Netherlands"; $OP[ 158 ] = "Netherlands Antilles"; $OP[ 159 ] = "Neutral Zone"; $OP[ 160 ] = "New Calidonia"; $OP[ 161 ] = "New Zealand"; $OP[ 162 ] = "Nicaragua"; $OP[ 163 ] = "Niger"; $OP[ 164 ] = "Nigeria"; $OP[ 165 ] = "Niue"; $OP[ 166 ] = "Norfolk Island"; $OP[ 167 ] = "Northern Mariana Islands"; $OP[ 168 ] = "Norway"; $OP[ 169 ] = "Oman"; $OP[ 170 ] = "Pacific Islands"; $OP[ 171 ] = "Pakistan"; $OP[ 172 ] = "Palau"; $OP[ 173 ] = "Panama"; $OP[ 174 ] = "Papua New Guinea"; $OP[ 175 ] = "Paraguay"; $OP[ 176 ] = "Peru"; $OP[ 177 ] = "Philippines"; $OP[ 178 ] = "Pitcairn Island"; $OP[ 179 ] = "Poland"; $OP[ 180 ] = "Portugal"; $OP[ 181 ] = "Puerto Rico"; $OP[ 182 ] = "Qatar"; $OP[ 183 ] = "Reunion"; $OP[ 184 ] = "Romania"; $OP[ 185 ] = "Russian Federation"; $OP[ 186 ] = "Rwanda"; $OP[ 187 ] = "S. Georgia and S. Sandwich Isls."; $OP[ 188 ] = "Saint Lucia"; $OP[ 189 ] = "Saint Vincent/Grenadines"; $OP[ 190 ] = "Samoa"; $OP[ 191 ] = "San Marino"; $OP[ 192 ] = "Sao Tome and Principe"; $OP[ 193 ] = "Saudi Arabia"; $OP[ 194 ] = "Senegal"; $OP[ 195 ] = "Seychelles"; $OP[ 196 ] = "Sierra Leone"; $OP[ 197 ] = "Singapore"; $OP[ 198 ] = "Slovakia (Slovak Republic)"; $OP[ 199 ] = "Slovenia"; $OP[ 200 ] = "Solomon Islands"; $OP[ 201 ] = "Somalia"; $OP[ 202 ] = "South Africa"; $OP[ 203 ] = "Spain"; $OP[ 204 ] = "Sri Lanka"; $OP[ 205 ] = "St. Helena"; $OP[ 206 ] = "St. Kitts Nevis Anguilla"; $OP[ 207 ] = "St. Pierre and Miquelon"; $OP[ 208 ] = "Sudan"; $OP[ 209 ] = "Suriname"; $OP[ 210 ] = "Svalbard and Jan Mayen Islands"; $OP[ 211 ] = "Swaziland"; $OP[ 212 ] = "Sweden"; $OP[ 213 ] = "Switzerland"; $OP[ 214 ] = "Syran Arab Republic"; $OP[ 215 ] = "Taiwan "; $OP[ 216 ] = "Tajikistan"; $OP[ 217 ] = "Tanzania, United Republic of "; $OP[ 218 ] = "Thailand"; $OP[ 219 ] = "Togo"; $OP[ 220 ] = "Tokelau"; $OP[ 221 ] = "Tonga"; $OP[ 222 ] = "Trinidad and Tobago"; $OP[ 223 ] = "Tunisia"; $OP[ 224 ] = "Turkey"; $OP[ 225 ] = "Turkmenistan"; $OP[ 226 ] = "Turks and Caicos Islands"; $OP[ 227 ] = "Tuvalu"; $OP[ 228 ] = "US Minor Outlying Islands"; $OP[ 229 ] = "Uganda"; $OP[ 230 ] = "Ukraine"; $OP[ 231 ] = "United Arab Emirates"; $OP[ 232 ] = "United Kingdom";
// '$OP[ 233 ] = "United States";
$OP[ 233 ] = "United States Pacific Islands"; $OP[ 234 ] = "Upper Volta"; $OP[ 235 ] = "Uruguay"; $OP[ 236 ] = "Uzbekistan"; $OP[ 237 ] = "Vanuatu"; $OP[ 238 ] = "Vatican City State"; $OP[ 239 ] = "Venezuela"; $OP[ 240 ] = "VietNam"; $OP[ 241 ] = "Virgin Islands, British"; $OP[ 242 ] = "Virgin Islands, Unites States "; $OP[ 243 ] = "Wake Island"; $OP[ 244 ] = "Wallis and Futuma Islands"; $OP[ 245 ] = "Western Sahara"; $OP[ 246 ] = "Yemen"; $OP[ 247 ] = "Yugoslavia"; $OP[ 248 ] = "Zaire"; $OP[ 249 ] = "Zambia"; $OP[ 250 ] = "Zimbabwe";
for ($i=0;$i<=250;$i++) { If ($OP[$i]<>"") { $CC=$CC. "<option value='". $i ."' "; if (strCmp($i,$C)==0) { $CC=$CC ." SELECTED "; } $CC=$CC .">". $OP[$i] ."</Option>"; } } return $CC; }
Function CountryName ($C) { //Dim $OP[250)
$OP[ 0 ] = "Select Country"; $OP[ 1 ] = "USA"; $OP[ 2 ] = "Afghanistan";
$OP[ 3 ] = "Albania"; $OP[ 4 ] = "Algeria"; $OP[ 5 ] = "American Samoa"; $OP[ 6 ] = "Andorra"; $OP[ 7 ] = "Angola"; $OP[ 8 ] = "Anguilla"; $OP[ 9 ] = "Antarctica"; $OP[ 10 ] = "Antigua and Barbuda"; $OP[ 11 ] = "Argentina"; $OP[ 12 ] = "Armenia"; $OP[ 13 ] = "Aruba"; $OP[ 14 ] = "Australia"; $OP[ 15 ] = "Austria"; $OP[ 16 ] = "Azerbaijan"; $OP[ 17 ] = "Bahamas"; $OP[ 18 ] = "Bahrain"; $OP[ 19 ] = "Bangladesh"; $OP[ 20 ] = "Barbados"; $OP[ 21 ] = "Belarussia"; $OP[ 22 ] = "Belgium"; $OP[ 23 ] = "Belize"; $OP[ 24 ] = "Benin"; $OP[ 25 ] = "Bermuda"; $OP[ 26 ] = "Bhutan"; $OP[ 27 ] = "Bolivia"; $OP[ 28 ] = "Bosnia and Herzegovina"; $OP[ 30 ] = "Botswana"; $OP[ 31 ] = "Bouvet Island"; $OP[ 32 ] = "Brazil"; $OP[ 33 ] = "British Indian Ocean Territory"; $OP[ 34 ] = "Brunei Darussalam"; $OP[ 35 ] = "Bulgaria"; $OP[ 36 ] = "Burkina Faso"; $OP[ 37 ] = "Burma"; $OP[ 38 ] = "Burundi"; $OP[ 39 ] = "Cambodia"; $OP[ 40 ] = "Cameroon"; $OP[ 41 ] = "Canada"; $OP[ 42 ] = "Canton and Enderbury Islands"; $OP[ 43 ] = "Cape Verde"; $OP[ 44 ] = "Cayman Islands"; $OP[ 45 ] = "Central African Republic"; $OP[ 46 ] = "Chad"; $OP[ 47 ] = "Chile"; $OP[ 48 ] = "China"; $OP[ 49 ] = "Christmas Island"; $OP[ 50 ] = "Cocos (Keeling) Islands"; $OP[ 51 ] = "Colombia"; $OP[ 52 ] = "Comoros"; $OP[ 53 ] = "Congo"; $OP[ 54 ] = "Cook Islands"; $OP[ 55 ] = "Costa Rica"; $OP[ 56 ] = "Cote D'Ivoire"; $OP[ 57 ] = "Croatia (Hrvatska)"; $OP[ 58 ] = "Cuba"; $OP[ 59 ] = "Cyprus"; $OP[ 60 ] = "Czech Republic"; $OP[ 61 ] = "Democratic Yemen"; $OP[ 62 ] = "Denmark"; $OP[ 63 ] = "Djibouti"; $OP[ 64 ] = "Dominica"; $OP[ 65 ] = "Dominican Republic"; $OP[ 66 ] = "Dronning Maud Land"; $OP[ 67 ] = "East Timor"; $OP[ 68 ] = "Ecuador"; $OP[ 69 ] = "Egypt"; $OP[ 70 ] = "El Salvador"; $OP[ 71 ] = "Equatorial Guinea"; $OP[ 72 ] = "Eritrea"; $OP[ 73 ] = "Estonia"; $OP[ 74 ] = "Ethiopia"; $OP[ 75 ] = "Falkland Islands (Malvinas)"; $OP[ 76 ] = "Faroe Islands"; $OP[ 77 ] = "Fiji"; $OP[ 78 ] = "Finland"; $OP[ 79 ] = "France"; $OP[ 80 ] = "France, Metropolitan"; $OP[ 81 ] = "French Guiana"; $OP[ 82 ] = "French Polynesia"; $OP[ 83 ] = "French Southern Territories"; $OP[ 84 ] = "Gabon"; $OP[ 85 ] = "Gambia"; $OP[ 86 ] = "Georgia"; $OP[ 87 ] = "Germany"; $OP[ 88 ] = "Ghana"; $OP[ 89 ] = "Gibraltar"; $OP[ 90 ] = "Greece"; $OP[ 91 ] = "Greenland"; $OP[ 92 ] = "Grenada"; $OP[ 93 ] = "Guadeloupe"; $OP[ 94 ] = "Guam"; $OP[ 95 ] = "Guatemala"; $OP[ 96 ] = "Guinea"; $OP[ 97 ] = "Guinea-bisseu"; $OP[ 98 ] = "Guyana"; $OP[ 99 ] = "Haiti"; $OP[ 100 ] = "Heard and Mc Donald Islands"; $OP[ 101 ] = "Honduras"; $OP[ 102 ] = "Hong Kong"; $OP[ 103 ] = "Hungary"; $OP[ 104 ] = "Iceland"; $OP[ 105 ] = "India"; $OP[ 106 ] = "Indonesia"; $OP[ 107 ] = "Iran(Islamic Republic of)"; $OP[ 108 ] = "Iraq"; $OP[ 109 ] = "Ireland"; $OP[ 110 ] = "Israel"; $OP[ 111 ] = "Italy"; $OP[ 112 ] = "Ivory Coast"; $OP[ 113 ] = "Jamaica"; $OP[ 114 ] = "Japan"; $OP[ 115 ] = "Johnston Island"; $OP[ 116 ] = "Jordan"; $OP[ 117 ] = "Kazakstan"; $OP[ 118 ] = "Kenya"; $OP[ 119 ] = "Kiribati"; $OP[ 120 ] = "Korea"; $OP[ 121 ] = "Kuwait"; $OP[ 122 ] = "Kyrgyzstan"; $OP[ 123 ] = "Latvia"; $OP[ 124 ] = "Lebanon"; $OP[ 125 ] = "Lesotho"; $OP[ 126 ] = "Liberia"; $OP[ 127 ] = "Libyan Arab Jamahiriya"; $OP[ 128 ] = "Liechtenstein"; $OP[ 129 ] = "Lithuania"; $OP[ 130 ] = "Luxembourg"; $OP[ 131 ] = "Macau"; $OP[ 132 ] = "Macedonia"; $OP[ 133 ] = "Madagascar"; $OP[ 134 ] = "Malawi"; $OP[ 135 ] = "Malaysia"; $OP[ 136 ] = "Maldives"; $OP[ 137 ] = "Mali"; $OP[ 138 ] = "Malta"; $OP[ 139 ] = "Marshall Islands"; $OP[ 140 ] = "Martinique"; $OP[ 141 ] = "Mauritania"; $OP[ 142 ] = "Mauritius"; $OP[ 143 ] = "Mayotte"; $OP[ 144 ] = "Mexico"; $OP[ 146 ] = "Midway Islands"; $OP[ 147 ] = "Moldova, Republic of"; $OP[ 148 ] = "Monaco"; $OP[ 149 ] = "Mongolia"; $OP[ 150 ] = "Montserrat"; $OP[ 151 ] = "Morocco"; $OP[ 152 ] = "Mozambique"; $OP[ 153 ] = "Myanmar"; $OP[ 154 ] = "Namibia"; $OP[ 155 ] = "Nauru"; $OP[ 156 ] = "Nepal"; $OP[ 157 ] = "Netherlands"; $OP[ 158 ] = "Netherlands Antilles"; $OP[ 159 ] = "Neutral Zone"; $OP[ 160 ] = "New Calidonia"; $OP[ 161 ] = "New Zealand"; $OP[ 162 ] = "Nicaragua"; $OP[ 163 ] = "Niger"; $OP[ 164 ] = "Nigeria"; $OP[ 165 ] = "Niue"; $OP[ 166 ] = "Norfolk Island"; $OP[ 167 ] = "Northern Mariana Islands"; $OP[ 168 ] = "Norway"; $OP[ 169 ] = "Oman"; $OP[ 170 ] = "Pacific Islands"; $OP[ 171 ] = "Pakistan"; $OP[ 172 ] = "Palau"; $OP[ 173 ] = "Panama"; $OP[ 174 ] = "Papua New Guinea"; $OP[ 175 ] = "Paraguay"; $OP[ 176 ] = "Peru"; $OP[ 177 ] = "Philippines"; $OP[ 178 ] = "Pitcairn Island"; $OP[ 179 ] = "Poland"; $OP[ 180 ] = "Portugal"; $OP[ 181 ] = "Puerto Rico"; $OP[ 182 ] = "Qatar"; $OP[ 183 ] = "Reunion"; $OP[ 184 ] = "Romania"; $OP[ 185 ] = "Russian Federation"; $OP[ 186 ] = "Rwanda"; $OP[ 187 ] = "S. Georgia and S. Sandwich Isls."; $OP[ 188 ] = "Saint Lucia"; $OP[ 189 ] = "Saint Vincent/Grenadines"; $OP[ 190 ] = "Samoa"; $OP[ 191 ] = "San Marino"; $OP[ 192 ] = "Sao Tome and Principe"; $OP[ 193 ] = "Saudi Arabia"; $OP[ 194 ] = "Senegal"; $OP[ 195 ] = "Seychelles"; $OP[ 196 ] = "Sierra Leone"; $OP[ 197 ] = "Singapore"; $OP[ 198 ] = "Slovakia (Slovak Republic)"; $OP[ 199 ] = "Slovenia"; $OP[ 200 ] = "Solomon Islands"; $OP[ 201 ] = "Somalia"; $OP[ 202 ] = "South Africa"; $OP[ 203 ] = "Spain"; $OP[ 204 ] = "Sri Lanka"; $OP[ 205 ] = "St. Helena"; $OP[ 206 ] = "St. Kitts Nevis Anguilla"; $OP[ 207 ] = "St. Pierre and Miquelon"; $OP[ 208 ] = "Sudan"; $OP[ 209 ] = "Suriname"; $OP[ 210 ] = "Svalbard and Jan Mayen Islands"; $OP[ 211 ] = "Swaziland"; $OP[ 212 ] = "Sweden"; $OP[ 213 ] = "Switzerland"; $OP[ 214 ] = "Syran Arab Republic"; $OP[ 215 ] = "Taiwan "; $OP[ 216 ] = "Tajikistan"; $OP[ 217 ] = "Tanzania, United Republic of "; $OP[ 218 ] = "Thailand"; $OP[ 219 ] = "Togo"; $OP[ 220 ] = "Tokelau"; $OP[ 221 ] = "Tonga"; $OP[ 222 ] = "Trinidad and Tobago"; $OP[ 223 ] = "Tunisia"; $OP[ 224 ] = "Turkey"; $OP[ 225 ] = "Turkmenistan"; $OP[ 226 ] = "Turks and Caicos Islands"; $OP[ 227 ] = "Tuvalu"; $OP[ 228 ] = "US Minor Outlying Islands"; $OP[ 229 ] = "Uganda"; $OP[ 230 ] = "Ukraine"; $OP[ 231 ] = "United Arab Emirates"; $OP[ 232 ] = "United Kingdom";
// '$OP[ 233 ] = "United States";
$OP[ 233 ] = "United States Pacific Islands"; $OP[ 234 ] = "Upper Volta"; $OP[ 235 ] = "Uruguay"; $OP[ 236 ] = "Uzbekistan"; $OP[ 237 ] = "Vanuatu"; $OP[ 238 ] = "Vatican City State"; $OP[ 239 ] = "Venezuela"; $OP[ 240 ] = "VietNam"; $OP[ 241 ] = "Virgin Islands, British"; $OP[ 242 ] = "Virgin Islands, Unites States "; $OP[ 243 ] = "Wake Island"; $OP[ 244 ] = "Wallis and Futuma Islands"; $OP[ 245 ] = "Western Sahara"; $OP[ 246 ] = "Yemen"; $OP[ 247 ] = "Yugoslavia"; $OP[ 248 ] = "Zaire"; $OP[ 249 ] = "Zambia"; $OP[ 250 ] = "Zimbabwe";
return $OP[$C];
}
Function LCountryName ($C) { //Dim $OP[250)
$OP[ 0 ] = "Select Country"; $OP[ 1 ] = "USA"; $OP[ 2 ] = "AF";
$OP[ 3 ] = "Albania"; $OP[ 4 ] = "Algeria"; $OP[ 5 ] = "American Samoa"; $OP[ 6 ] = "Andorra"; $OP[ 7 ] = "Angola"; $OP[ 8 ] = "Anguilla"; $OP[ 9 ] = "Antarctica"; $OP[ 10 ] = "Antigua and Barbuda"; $OP[ 11 ] = "Argentina"; $OP[ 12 ] = "Armenia"; $OP[ 13 ] = "Aruba"; $OP[ 14 ] = "Australia"; $OP[ 15 ] = "Austria"; $OP[ 16 ] = "Azerbaijan"; $OP[ 17 ] = "Bahamas"; $OP[ 18 ] = "Bahrain"; $OP[ 19 ] = "Bangladesh"; $OP[ 20 ] = "Barbados"; $OP[ 21 ] = "Belarussia"; $OP[ 22 ] = "Belgium"; $OP[ 23 ] = "Belize"; $OP[ 24 ] = "Benin"; $OP[ 25 ] = "Bermuda"; $OP[ 26 ] = "Bhutan"; $OP[ 27 ] = "Bolivia"; $OP[ 28 ] = "Bosnia and Herzegovina"; $OP[ 30 ] = "Botswana"; $OP[ 31 ] = "Bouvet Island"; $OP[ 32 ] = "Brazil"; $OP[ 33 ] = "British Indian Ocean Territory"; $OP[ 34 ] = "Brunei Darussalam"; $OP[ 35 ] = "Bulgaria"; $OP[ 36 ] = "Burkina Faso"; $OP[ 37 ] = "Burma"; $OP[ 38 ] = "Burundi"; $OP[ 39 ] = "Cambodia"; $OP[ 40 ] = "Cameroon"; $OP[ 41 ] = "Canada"; $OP[ 42 ] = "Canton and Enderbury Islands"; $OP[ 43 ] = "Cape Verde"; $OP[ 44 ] = "Cayman Islands"; $OP[ 45 ] = "Central African Republic"; $OP[ 46 ] = "Chad"; $OP[ 47 ] = "Chile"; $OP[ 48 ] = "China"; $OP[ 49 ] = "Christmas Island"; $OP[ 50 ] = "Cocos (Keeling) Islands"; $OP[ 51 ] = "Colombia"; $OP[ 52 ] = "Comoros"; $OP[ 53 ] = "Congo"; $OP[ 54 ] = "Cook Islands"; $OP[ 55 ] = "Costa Rica"; $OP[ 56 ] = "Cote D'Ivoire"; $OP[ 57 ] = "Croatia (Hrvatska)"; $OP[ 58 ] = "Cuba"; $OP[ 59 ] = "Cyprus"; $OP[ 60 ] = "Czech Republic"; $OP[ 61 ] = "Democratic Yemen"; $OP[ 62 ] = "Denmark"; $OP[ 63 ] = "Djibouti"; $OP[ 64 ] = "Dominica"; $OP[ 65 ] = "Dominican Republic"; $OP[ 66 ] = "Dronning Maud Land"; $OP[ 67 ] = "East Timor"; $OP[ 68 ] = "Ecuador"; $OP[ 69 ] = "Egypt"; $OP[ 70 ] = "El Salvador"; $OP[ 71 ] = "Equatorial Guinea"; $OP[ 72 ] = "Eritrea"; $OP[ 73 ] = "Estonia"; $OP[ 74 ] = "Ethiopia"; $OP[ 75 ] = "Falkland Islands (Malvinas)"; $OP[ 76 ] = "Faroe Islands"; $OP[ 77 ] = "Fiji"; $OP[ 78 ] = "Finland"; $OP[ 79 ] = "France"; $OP[ 80 ] = "France, Metropolitan"; $OP[ 81 ] = "French Guiana"; $OP[ 82 ] = "French Polynesia"; $OP[ 83 ] = "French Southern Territories"; $OP[ 84 ] = "Gabon"; $OP[ 85 ] = "Gambia"; $OP[ 86 ] = "Georgia"; $OP[ 87 ] = "Germany"; $OP[ 88 ] = "Ghana"; $OP[ 89 ] = "Gibraltar"; $OP[ 90 ] = "Greece"; $OP[ 91 ] = "Greenland"; $OP[ 92 ] = "Grenada"; $OP[ 93 ] = "Guadeloupe"; $OP[ 94 ] = "Guam"; $OP[ 95 ] = "Guatemala"; $OP[ 96 ] = "Guinea"; $OP[ 97 ] = "Guinea-bisseu"; $OP[ 98 ] = "Guyana"; $OP[ 99 ] = "Haiti"; $OP[ 100 ] = "Heard and Mc Donald Islands"; $OP[ 101 ] = "Honduras"; $OP[ 102 ] = "Hong Kong"; $OP[ 103 ] = "Hungary"; $OP[ 104 ] = "Iceland"; $OP[ 105 ] = "India"; $OP[ 106 ] = "Indonesia"; $OP[ 107 ] = "Iran(Islamic Republic of)"; $OP[ 108 ] = "Iraq"; $OP[ 109 ] = "Ireland"; $OP[ 110 ] = "Israel"; $OP[ 111 ] = "Italy"; $OP[ 112 ] = "Ivory Coast"; $OP[ 113 ] = "Jamaica"; $OP[ 114 ] = "Japan"; $OP[ 115 ] = "Johnston Island"; $OP[ 116 ] = "Jordan"; $OP[ 117 ] = "Kazakstan"; $OP[ 118 ] = "Kenya"; $OP[ 119 ] = "Kiribati"; $OP[ 120 ] = "Korea"; $OP[ 121 ] = "Kuwait"; $OP[ 122 ] = "Kyrgyzstan"; $OP[ 123 ] = "Latvia"; $OP[ 124 ] = "Lebanon"; $OP[ 125 ] = "Lesotho"; $OP[ 126 ] = "Liberia"; $OP[ 127 ] = "Libyan Arab Jamahiriya"; $OP[ 128 ] = "Liechtenstein"; $OP[ 129 ] = "Lithuania"; $OP[ 130 ] = "Luxembourg"; $OP[ 131 ] = "Macau"; $OP[ 132 ] = "Macedonia"; $OP[ 133 ] = "Madagascar"; $OP[ 134 ] = "Malawi"; $OP[ 135 ] = "Malaysia"; $OP[ 136 ] = "Maldives"; $OP[ 137 ] = "Mali"; $OP[ 138 ] = "Malta"; $OP[ 139 ] = "Marshall Islands"; $OP[ 140 ] = "Martinique"; $OP[ 141 ] = "Mauritania"; $OP[ 142 ] = "Mauritius"; $OP[ 143 ] = "Mayotte"; $OP[ 144 ] = "Mexico"; $OP[ 146 ] = "Midway Islands"; $OP[ 147 ] = "Moldova, Republic of"; $OP[ 148 ] = "Monaco"; $OP[ 149 ] = "Mongolia"; $OP[ 150 ] = "Montserrat"; $OP[ 151 ] = "Morocco"; $OP[ 152 ] = "Mozambique"; $OP[ 153 ] = "Myanmar"; $OP[ 154 ] = "Namibia"; $OP[ 155 ] = "Nauru"; $OP[ 156 ] = "Nepal"; $OP[ 157 ] = "Netherlands"; $OP[ 158 ] = "Netherlands Antilles"; $OP[ 159 ] = "Neutral Zone"; $OP[ 160 ] = "New Calidonia"; $OP[ 161 ] = "New Zealand"; $OP[ 162 ] = "Nicaragua"; $OP[ 163 ] = "Niger"; $OP[ 164 ] = "Nigeria"; $OP[ 165 ] = "Niue"; $OP[ 166 ] = "Norfolk Island"; $OP[ 167 ] = "Northern Mariana Islands"; $OP[ 168 ] = "Norway"; $OP[ 169 ] = "Oman"; $OP[ 170 ] = "Pacific Islands"; $OP[ 171 ] = "Pakistan"; $OP[ 172 ] = "Palau"; $OP[ 173 ] = "Panama"; $OP[ 174 ] = "Papua New Guinea"; $OP[ 175 ] = "Paraguay"; $OP[ 176 ] = "Peru"; $OP[ 177 ] = "Philippines"; $OP[ 178 ] = "Pitcairn Island"; $OP[ 179 ] = "Poland"; $OP[ 180 ] = "Portugal"; $OP[ 181 ] = "Puerto Rico"; $OP[ 182 ] = "Qatar"; $OP[ 183 ] = "Reunion"; $OP[ 184 ] = "Romania"; $OP[ 185 ] = "Russian Federation"; $OP[ 186 ] = "Rwanda"; $OP[ 187 ] = "S. Georgia and S. Sandwich Isls."; $OP[ 188 ] = "Saint Lucia"; $OP[ 189 ] = "Saint Vincent/Grenadines"; $OP[ 190 ] = "Samoa"; $OP[ 191 ] = "San Marino"; $OP[ 192 ] = "Sao Tome and Principe"; $OP[ 193 ] = "Saudi Arabia"; $OP[ 194 ] = "Senegal"; $OP[ 195 ] = "Seychelles"; $OP[ 196 ] = "Sierra Leone"; $OP[ 197 ] = "Singapore"; $OP[ 198 ] = "Slovakia (Slovak Republic)"; $OP[ 199 ] = "Slovenia"; $OP[ 200 ] = "Solomon Islands"; $OP[ 201 ] = "Somalia"; $OP[ 202 ] = "South Africa"; $OP[ 203 ] = "Spain"; $OP[ 204 ] = "Sri Lanka"; $OP[ 205 ] = "St. Helena"; $OP[ 206 ] = "St. Kitts Nevis Anguilla"; $OP[ 207 ] = "St. Pierre and Miquelon"; $OP[ 208 ] = "Sudan"; $OP[ 209 ] = "Suriname"; $OP[ 210 ] = "Svalbard and Jan Mayen Islands"; $OP[ 211 ] = "Swaziland"; $OP[ 212 ] = "Sweden"; $OP[ 213 ] = "Switzerland"; $OP[ 214 ] = "Syran Arab Republic"; $OP[ 215 ] = "Taiwan "; $OP[ 216 ] = "Tajikistan"; $OP[ 217 ] = "Tanzania, United Republic of "; $OP[ 218 ] = "Thailand"; $OP[ 219 ] = "Togo"; $OP[ 220 ] = "Tokelau"; $OP[ 221 ] = "Tonga"; $OP[ 222 ] = "Trinidad and Tobago"; $OP[ 223 ] = "Tunisia"; $OP[ 224 ] = "Turkey"; $OP[ 225 ] = "Turkmenistan"; $OP[ 226 ] = "Turks and Caicos Islands"; $OP[ 227 ] = "Tuvalu"; $OP[ 228 ] = "US Minor Outlying Islands"; $OP[ 229 ] = "Uganda"; $OP[ 230 ] = "Ukraine"; $OP[ 231 ] = "United Arab Emirates"; $OP[ 232 ] = "United Kingdom";
// '$OP[ 233 ] = "United States";
$OP[ 233 ] = "United States Pacific Islands"; $OP[ 234 ] = "Upper Volta"; $OP[ 235 ] = "Uruguay"; $OP[ 236 ] = "Uzbekistan"; $OP[ 237 ] = "Vanuatu"; $OP[ 238 ] = "Vatican City State"; $OP[ 239 ] = "Venezuela"; $OP[ 240 ] = "VietNam"; $OP[ 241 ] = "Virgin Islands, British"; $OP[ 242 ] = "Virgin Islands, Unites States "; $OP[ 243 ] = "Wake Island"; $OP[ 244 ] = "Wallis and Futuma Islands"; $OP[ 245 ] = "Western Sahara"; $OP[ 246 ] = "Yemen"; $OP[ 247 ] = "Yugoslavia"; $OP[ 248 ] = "Zaire"; $OP[ 249 ] = "Zambia"; $OP[ 250 ] = "Zimbabwe";
return $OP[$C];
}
Function StateList($st)
{
$s = "";
$sel = "";
if (Trim($st) == "Select State")
{
$sel = " Selected";
}
$s = $s . "<option value =" . $sel .">Select State</option>";
$sel = "";
if (Trim($st) == "Alabama")
{
$sel = " Selected";
}
$s = $s . "<option value ='Alabama'" . $sel .">Alabama</option>";
$sel = "";
if (Trim($st) == "Alaska") { $sel = " Selected";}
$s = $s ."<option value ='Alaska'". $sel .">Alaska</option>";
$sel = "";
if (Trim($st) == "Arkansas") { $sel = " Selected";}
$s = $s ."<option value ='Arkansas'". $sel .">Arkansas</option>";
$sel = "";
//if (Trim($st)== "American Samoa") { $sel = " Selected";}
//$s = $s ."<option value =American Samoa". $sel .">American Samoa</option>";
//$sel = "";
if (Trim($st) == "Arizona") { $sel = " Selected";}
$s = $s ."<option value ='Arizona'". $sel .">Arizona</option>";
$sel = "";
if (Trim($st) == "California") { $sel = " Selected";}
$s = $s ."<option value ='California'". $sel .">California</option>";
$sel = "";
if (Trim($st) == "Colorado") { $sel = " Selected";}
$s = $s ."<option value ='Colorado'". $sel .">Colorado</option>";
$sel = ""; if (Trim($st) == "Connecticut") { $sel = " Selected";} $s = $s ."<option value ='Connecticut'". $sel .">Connecticut</option>"; $sel = ""; if (Trim($st) == "District of Columbia") { $sel = " Selected";} $s = $s ."<option value ='District of Columbia'". $sel .">District of Columbia</option>"; $sel = ""; if (Trim($st) == "Delaware") { $sel = " Selected";} $s = $s ."<option value ='Delaware'". $sel .">Delaware</option>"; $sel = ""; if (Trim($st) == "Florida") { $sel = " Selected";} $s = $s ."<option value ='Florida'". $sel .">Florida</option>"; $sel = ""; //if (Trim($st) == "Federated States of Micro") { $sel = " Selected";} //$s = $s ."<option value =Federated States of Micro". $sel .">Federated States of Micro</option>"; //$sel = ""; if (Trim($st) == "Georgia") { $sel = " Selected";} $s = $s ."<option value ='Georgia'". $sel .">Georgia</option>"; $sel = ""; //if (Trim($st) == "Guam") { $sel = " Selected";} //$s = $s ."<option value =Guam". $sel .">Guam</option>"; //$sel = ""; if (Trim($st) == "Hawaii") { $sel = " Selected";} $s = $s ."<option value ='Hawaii'". $sel .">Hawaii</option>"; $sel = ""; if (Trim($st) == "Iowa") { $sel = " Selected";} $s = $s ."<option value ='Iowa'". $sel .">Iowa</option>"; $sel = ""; if (Trim($st) == "Idaho") { $sel = " Selected";} $s = $s ."<option value ='Idaho'". $sel .">Idaho</option>"; $sel = ""; if (Trim($st) == "Illinois") { $sel = " Selected";} $s = $s ."<option value ='Illinois'". $sel .">Illinois</option>"; $sel = ""; if (Trim($st) == "Indiana") { $sel = " Selected";} $s = $s ."<option value ='Indiana'". $sel .">Indiana</option>"; $sel = ""; if (Trim($st) == "Kansas") { $sel = " Selected";} $s = $s ."<option value ='Kansas'". $sel .">Kansas</option>"; $sel = ""; if (Trim($st) == "Kentucky") { $sel = " Selected";} $s = $s ."<option value ='Kentucky'". $sel .">Kentucky</option>"; $sel = ""; if (Trim($st) == "Louisiana") { $sel = " Selected";} $s = $s ."<option value ='Louisiana'". $sel .">Louisiana</option>"; $sel = ""; if (Trim($st) == "Massachusetts") { $sel = " Selected";} $s = $s ."<option value ='Massachusetts'". $sel .">Massachusetts</option>"; $sel = ""; if (Trim($st) == "Maryland") { $sel = " Selected";} $s = $s ."<option value ='Maryland' ". $sel .">Maryland</option>"; $sel = ""; if (Trim($st) == "Maine") { $sel = " Selected";} $s = $s ."<option value ='Maine'". $sel .">Maine</option>"; $sel = ""; //if (Trim($st) == "Marshall Islands") { $sel = " $selected";} //$s = $s ."<option value =Marshall Islands". $sel .">Marshall Islands</option>"; //$sel = ""; if (Trim($st) == "Michigan") { $sel = " selected";} $s = $s ."<option value ='Michigan'". $sel .">Michigan</option>"; $sel = ""; if (Trim($st) == "Minnesota") { $sel = " Selected";} $s = $s ."<option value ='Minnesota'". $sel .">Minnesota</option>"; $sel = ""; if (Trim($st) == "Missouri") { $sel = " Selected";} $s = $s ."<option value ='Missouri'". $sel .">Missouri</option>"; $sel = ""; if (Trim($st) == "Mississippi") { $sel = " selected";} $s = $s ."<option value ='Mississippi'". $sel .">Mississippi</option>"; $sel = ""; if (Trim($st) == "Montana") { $sel = " Selected";} $s = $s ."<option value ='Montana'". $sel .">Montana</option>"; $sel = ""; if (Trim($st) == "North Carolina") { $sel = " Selected";} $s = $s ."<option value ='North Carolina'". $sel .">North Carolina</option>"; $sel = ""; if (Trim($st) == "North Dakota") { $sel = " Selected";} $s = $s ."<option value ='North Dakota'". $sel .">North Dakota</option>"; $sel = ""; if (Trim($st) == "Nebraska") { $sel = " Selected";} $s = $s ."<option value ='Nebraska'". $sel .">Nebraska</option>"; $sel = ""; if (Trim($st) == "New Hampshire") { $sel = " Selected";} $s = $s ."<option value ='New Hampshire'". $sel .">New Hampshire</option>"; $sel = ""; if (Trim($st) == "New Jersey") { $sel = " Selected";} $s = $s ."<option value ='New Jersey'". $sel .">New Jersey</option>"; $sel = ""; if (Trim($st) == "New Mexico") { $sel = " Selected";} $s = $s ."<option value ='New Mexico'". $sel .">New Mexico</option>"; $sel = ""; if (Trim($st) == "Nevada") { $sel = " Selected";} $s = $s ."<option value ='Nevada'". $sel .">Nevada</option>"; $sel = ""; if (Trim($st) == "New York") { $sel = " Selected";} $s = $s ."<option value ='New York'". $sel .">New York</option>"; $sel = ""; if (Trim($st) == "Ohio") { $sel = " Selected";} $s = $s ."<option value ='Ohio'". $sel .">Ohio</option>"; $sel = ""; if (Trim($st) == "Oklahoma") { $sel = " Selected";} $s = $s ."<option value ='Oklahoma'". $sel .">Oklahoma</option>"; $sel = ""; if (Trim($st) == "Oregon") { $sel = " Selected";} $s = $s ."<option value ='Oregon'". $sel .">Oregon</option>"; $sel = ""; if (Trim($st) == "Pennsylvania") { $sel = " Selected";} $s = $s ."<option value ='Pennsylvania'". $sel .">Pennsylvania</option>"; $sel = ""; if (Trim($st) == "Rhode Island") { $sel = " Selected";} $s = $s ."<option value ='Rhode Island'". $sel .">Rhode Island</option>"; $sel = ""; if (Trim($st) == "South Carolina") { $sel = " Selected";} $s = $s ."<option value ='South Carolina'". $sel .">South Carolina</option>"; $sel = ""; if (Trim($st) == "South Dakota") { $sel = " Selected";} $s = $s ."<option value ='South Dakota'". $sel .">South Dakota</option>"; $sel = ""; if (Trim($st) == "Tennessee") { $sel = " Selected";} $s = $s ."<option value ='Tennessee'". $sel .">Tennessee</option>"; $sel = ""; if (Trim($st) == "Texas") { $sel = " Selected";} $s = $s ."<option value ='Texas'". $sel .">Texas</option>"; $sel = ""; if (Trim($st) == "Utah") { $sel = " Selected";} $s = $s ."<option value ='Utah'". $sel .">Utah</option>"; $sel = ""; if (Trim($st) == "Vermont") { $sel = " Selected";} $s = $s ."<option value ='Vermont'". $sel .">Vermont</option>"; $sel = ""; if (Trim($st) == "Virginia") { $sel = " Selected";} $s = $s ."<option value ='Virginia'". $sel .">Virginia</option>"; $sel = ""; if (Trim($st) == "Washington") { $sel = " Selected";} $s = $s ."<option value ='Washington'". $sel .">Washington</option>"; $sel = ""; if (Trim($st) == "Wisconsin") { $sel = " Selected";} $s = $s ."<option value ='Wisconsin'". $sel .">Wisconsin</option>"; $sel = ""; if (Trim($st) == "West Virginia") { $sel = " Selected";} $s = $s ."<option value ='West Virginia'". $sel .">West Virginia</option>"; $sel = ""; if (Trim($st) == "Wyoming") { $sel = " Selected";} $s = $s ."<option value ='Wyoming'". $sel .">Wyoming</option>";
return $s;
}
function imageResize($width, $height, $target)
{
if ($width > $height) { $percentage = ($target / $width); } else { $percentage = ($target / $height); } $width = round($width * $percentage); $height = round($height * $percentage); //echo "".$width; return "width=\"$width\" height=\"$height\""; }
function sendauthemail($fromname,$fromaddr,$toaddr,$ccaddr,$subject,$bodymsg,$attachfilepath,$attachfilename,$levelint) { //error_reporting(E_ALL); if ($levelint==0) { require_once('./include/htmlMimeMailroot.php'); } elseif ($levelint==1) { require_once('../include/htmlMimeMail.php'); } $mail = new htmlMimeMail();
/* $sender_server='mail.image-specialists.com'; $smtp_username='mailer@image-specialists.com'; $smtp_password='drftgyhu'; */
$sender_server='mail.truckcerts.com'; $smtp_username='mailer@truckcerts.com'; $smtp_password='drftgyhu';
$mail->setHtml($bodymsg);
$mail->setFrom(.$fromname.' <'.$fromaddr.'>'); $mail->setSubject($subject); $mail->setHeader('X-Mailer', 'HTML Mime mail class'); $mail->setHeader('Date', date('D, d M y H:i O'));
$mail->setSMTPParams(.$sender_server., 25, .$sender_server.,True,.$smtp_username.,.$smtp_password.);
if ($attachfilename!="") { $attachment = $mail->getFile($attachfilepath);
/* $handle=fopen($attachfilepath, 'rb'); $f_contents=fread($handle, filesize($attachfilepath)); $f_contents=chunk_split(base64_encode($f_contents)); //Encode The Data For Transition using base64_encode(); fclose($handle); $msg .= "--".$mime_boundary.$eol; $msg .= "Content-Type: ".$attachfilepath["content_type"]."; name=\"".$attachfilename."\"".$eol; $msg .= "Content-Transfer-Encoding: base64".$eol; $msg .= "Content-Disposition: attachment; filename=\"".$attachfilename."\"".$eol.$eol; // !! This line needs TWO end of lines !! IMPORTANT !! $msg .= $f_contents.$eol.$eol;
$attachment = $msg;*/ $mail->addAttachment($attachment, $attachfilename); }
if ($ccaddr !="") { $mail->setCc($ccaddr); }
$mail->setBcc('chirag@pulsesolutions.com');
//print_r($mail)."
";
//exit;
$result = $mail->send(array($toaddr), 'smtp');
// These errors are only set if you're using SMTP to send the message if (!$result) { $str="NOT SEND"; } else { $str="SEND"; } return $str; }
- -----------------------------------------------------------------------------------------
- Genrate SQL Error Mail Body
- USAGE: genratesqlerrormailbody('Project Name','Section Name','SQL Query','Genrate Error')
- ----------------------------------------------------------------------------------------
function genratesqlerrormailbody($projectname,$sectionname,$query,$error_message) {
$str = "
Project Name |
: | $projectname |
Error Details | : | Fail to execute sql query in $sectionname |
Error Description | : | $error_message |
Query | : | $query |
";
return $str; }
function imageuploadxxx($photopath,$vphoto,$vphoto_name,$prefix,$delPrevious)
{
$msg="";
//echo $vphoto . is_file($vphoto)." test ".$vphoto_name."
";
//echo is_file($vphoto);
//echo empty($vphoto_name);
//exit;
if(is_file($vphoto) && !empty($vphoto_name))
{
//echo "in";
//exit;
// Remove Dots from File name
$tmp=explode(".",$vphoto_name);
for($i=0;$i<count($tmp)-1;$i++)
{
$tmp1[]=$tmp[$i];
}
$file=implode("_",$tmp1);
$ext=$tmp[count($tmp)-1];
$vlfname = $file.".".$ext; //-------------------------- if($ext=="jpg" || $ext =="jpeg" || $ext == "gif" || $ext =="JPG" || $ext =="JPEG" || $ext == "GIF") { $vphotofile=$prefix.$file."".date("YmdHis").".".$ext; $ftppath1 = $photopath.$vphotofile; $copy = copy($vphoto, $ftppath1); if(!$copy) { $vphotofile = ; $msg="Image Not Uploaded Successfully !!"; } else { echo "$photopath" . $vphoto_name; if($ext == "gif" || $ext == "GIF") $simg = imagecreatefromgif("$photopath" . $vphoto_name); // Make A New Temporary Image To Create The Thumbanil From else $simg = imagecreatefromjpeg("$photopath" . $vphoto_name); // Make A New Temporary Image To Create The Thumbanil From print $simg; $twidth = "125"; // Maximum Width For Thumbnail Images $theight = "100"; // Maximum Height For Thumbnail Images
$currwidth = imagesx($simg); // Current Image Width $currheight = imagesy($simg); // Current Image Height if ($currheight > $currwidth) { // If Height Is Greater Than Width $zoom = $twidth / $currheight; // Length Ratio For Width $newheight = $theight; // Height Is Equal To Max Height $newwidth = $currwidth * $zoom; // Creates The New Width } else { // Otherwise, Assume Width Is Greater Than Height (Will Produce Same Result If Width Is Equal To Height) $zoom = $twidth / $currwidth; // Length Ratio For Height $newwidth = $twidth; // Width Is Equal To Max Width $newheight = $currheight * $zoom; // Creates The New Height } $dimg = imagecreate($newwidth, $newheight); // Make New Image For Thumbnail imagetruecolortopalette($simg, false, 256); // Create New Color Pallete $palsize = ImageColorsTotal($simg); for ($i = 0; $i < $palsize; $i++) { // Counting Colors In The Image $colors = ImageColorsForIndex($simg, $i); // Number Of Colors Used ImageColorAllocate($dimg, $colors['red'], $colors['green'], $colors['blue']); // Tell The Server What Colors This Image Will Use } imagecopyresized($dimg, $simg, 0, 0, 0, 0, $newwidth, $newheight, $currwidth, $currheight); // Copy Resized Image To The New Image (So We Can Save It) imagejpeg($dimg, "$photopath" . $vphoto_name); // Saving The Image imagedestroy($simg); // Destroying The Temporary Image imagedestroy($dimg); // Destroying The Other Temporary Image
if (file_exists($delPrevious)) //delete orignal file { unlink($delPrevious); }
//print 'Image thumbnail created successfully.'; // Resize successful $msg="Image Uploaded Successfully !!"; echo $msg; exit; } } else { $vphotofile = ; $msg="Image Type Is Not Valid !!!"; } } //exit; $ret[0] = $vphotofile; $ret[1] = $msg; return $ret; }
function imageupload($uploadboxname,$idir,$tdir,$twidth,$theight,$prefix,$delPrevious) {
$url = $_FILES[$uploadboxname]['name']; // Set $url To Equal The Filename For Later Use if ($_FILES[$uploadboxname]['type'] == "image/jpg" || $_FILES[$uploadboxname]['type'] == "image/jpeg" || $_FILES[$uploadboxname]['type'] == "image/pjpeg" || $_FILES[$uploadboxname]['type'] == "image/gif") {
//$copy = copy($_FILES[$uploadboxname]['tmp_name'], $savefileas); // Move Image From Temporary Location To Permanent Location
$copy = copy($_FILES[$uploadboxname]['tmp_name'], "$idir" . $_FILES[$uploadboxname]['name']); // Move Image From Temporary Location To Permanent Location
if ($copy) { // If The Script Was Able To Copy The Image To It's Permanent Location
//print 'Image uploaded successfully.
'; // Was Able To Successfully Upload Image
//print "$idir" . $url;
if($_FILES[$uploadboxname]['type'] == "image/gif")
$simg = imagecreatefromgif("$idir" . $url); // Make A New Temporary Image To Create The Thumbanil From
else
$simg = imagecreatefromjpeg("$idir" . $url); // Make A New Temporary Image To Create The Thumbanil From
//echo $simg;
$currwidth = imagesx($simg); // Current Image Width
$currheight = imagesy($simg); // Current Image Height
if ($currheight > $currwidth) { // If Height Is Greater Than Width
$zoom = $twidth / $currheight; // Length Ratio For Width
$newheight = $theight; // Height Is Equal To Max Height
$newwidth = $currwidth * $zoom; // Creates The New Width
} else { // Otherwise, Assume Width Is Greater Than Height (Will Produce Same Result If Width Is Equal To Height)
$zoom = $twidth / $currwidth; // Length Ratio For Height
$newwidth = $twidth; // Width Is Equal To Max Width
$newheight = $currheight * $zoom; // Creates The New Height
}
$dimg = imagecreate($newwidth, $newheight); // Make New Image For Thumbnail
imagetruecolortopalette($simg, false, 256); // Create New Color Pallete
$palsize = ImageColorsTotal($simg);
for ($i = 0; $i < $palsize; $i++) { // Counting Colors In The Image
$colors = ImageColorsForIndex($simg, $i); // Number Of Colors Used
ImageColorAllocate($dimg, $colors['red'], $colors['green'], $colors['blue']); // Tell The Server What Colors This Image Will Use
}
imagecopyresized($dimg, $simg, 0, 0, 0, 0, $newwidth, $newheight, $currwidth, $currheight); // Copy Resized Image To The New Image (So We Can Save It)
$tmp=explode(".",$url); for($i=0;$i<count($tmp)-1;$i++) { $tmp1[]=$tmp[$i]; } $file=implode("_",$tmp1); $ext=$tmp[count($tmp)-1];
$savefileas = $prefix.$file."".date("YmdHis").".".$ext;
//imagejpeg($dimg, "$tdir" . $url); // Saving The Image imagejpeg($dimg, "$tdir" . $savefileas); // Saving The Image if (file_exists("$tdir" . $url)) //delete orignal file { unlink("$tdir" . $url); }
imagedestroy($simg); // Destroying The Temporary Image
imagedestroy($dimg); // Destroying The Other Temporary Image
//print 'Image thumbnail created successfully.'; // Resize successful
if (file_exists($delPrevious)) //delete orignal file
{
unlink($delPrevious);
}
//print 'Image thumbnail created successfully.'; // Resize successful $msg="Image Uploaded Successfully !!";
} else { //print 'ERROR: Unable to upload image.'; // Error Message If Upload Failed $vphotofile = ; $msg="Image Not Uploaded Successfully !!"; } } else { /*print 'ERROR: Wrong filetype (has to be a .jpg or .jpeg. Yours is '; // Error Message If Filetype Is Wrong print $file_ext; // Show The Invalid File's Extention print '.'; */ $vphotofile = ; $msg="Image Type Is Not Valid !!!"; } $ret[0] = $savefileas; $ret[1] = $msg; return $ret;
}
function displaydate($date)
{
$dt = date('d-M-y',strtotime($date));
return $dt;
}
function make_price($text) { return number_format($text,2,'.',','); }
function getmonth($m=0) { if($m==0) {
$str_month_name = date('M');
} else {
$str_month_name = date('M', mktime(0,0,0,$m));
} return $str_month_name; }
- -----------------------------------------------------------------------------------------
- Display the Combo For Dyanamic DropDown
- USAGE: DynamicDropDown($fieldId,$arrayname,$selectedID=,$fucntioname=)
$array_page_name = array('About Us','Terms and Conditions'); $array_setting_payjunctionmode = array('Live - charge user credit cards','Test - no credit card charges');
- ----------------------------------------------------------------------------------------
function DynamicDropDown($fieldId,$arrayname,$selectedID=,$fucntioname=){
$dynamic_combo = ""; if($fucntioname==) { $dynamic_combo .= "<select name=\"$fieldId\">"; } else { $fun ="return ".$fucntioname."()"; $dynamic_combo .= "<select name=\"$fieldId\" onChange= \"$fun\">"; }
$dynamic_combo .= "<option value=\"0\">Please Select";
for($i=0;$i<count($arrayname);$i++) { if (trim($selectedID) == trim($arrayname[$i])) { $dynamic_combo .= "<option value=\"" .$arrayname[$i]."\" selected>" .$arrayname[$i]; } else { $dynamic_combo .= "<option value=\"".$arrayname[$i]."\">" . $arrayname[$i]; } } $dynamic_combo .= "</select>"; return $dynamic_combo; }
- -----------------------------------------------------------------------------------------
- ----------------------------------------------------------------------------------------
function DynamicDropDown1($fieldId,$arrayname,$selectedID=,$fucntioname=){
$dynamic_combo = ""; if($fucntioname==) { $dynamic_combo .= "<select name=\"$fieldId\">"; } else { $fun ="return ".$fucntioname."()"; $dynamic_combo .= "<select name=\"$fieldId\" onChange= \"$fun\">"; }
for($i=0;$i<count($arrayname);$i++) {
if (trim($selectedID) == trim($arrayname[$i])) {
$dynamic_combo .= "<option value=\"" .$arrayname[$i]."\" selected>" .$arrayname[$i];
} else {
$dynamic_combo .= "<option value=\"".$arrayname[$i]."\">" . $arrayname[$i];
}
}
$dynamic_combo .= "</select>";
return $dynamic_combo;
}
- -----------------------------------------------------------------------------------------
- -------------------------- For uploading Logo and Signature image START-----------------------##
function uploadImage($uploadboxname,$type,$delPrevious,$logo_sign_path,$userid) { $imgname = ""; $msg = ""; GLOBAL $valid_image_type; $arr_img_upload_result = array();
if($_FILES[$uploadboxname]['name'] !=) { $logo_sign_upload=1; $logo_signimgdimentions = getimagesize($_FILES[$uploadboxname]['tmp_name']); $logo_sign_imgorgname_type = $_FILES[$uploadboxname]['type'] ; $logo_sign_imgorgname_size = $_FILES[$uploadboxname]['size'];
if(!in_array($logo_sign_imgorgname_type ,$valid_image_type))
{
$msg .='Only jpeg, jpg, gif files for '.$type.' image
';
$logo_sign_upload = 0 ;
}
if($logo_sign_imgorgname_size > 3145728 ) //3mb
{
$msg .= 'Only up to 3MB in file size can be uploaded for '.$type.' Image
';
$logo_sign_upload = 0 ;
}
/*if($logo_signimgdimentions[0] > 71 || $logo_signimgdimentions[1] > 71)
{
$msg .= 'Upload image of 71 X 71 size for '.$type.' Image
';
$logo_sign_upload = 0 ;
}*/
if($logo_sign_upload ==1) { $logo_sign_image = $_FILES[$uploadboxname]['name']; $logo_sign_image = str_replace("#","",$logo_sign_image); $logo_sign_image = str_replace("@","",$logo_sign_image); $logo_sign_image = str_replace("'","",$logo_sign_image); $logo_sign_image = str_replace("%","",$logo_sign_image); $logo_sign_image = str_replace("$","",$logo_sign_image); $logo_sign_image = str_replace("_","",$logo_sign_image); $logo_sign_image = str_replace("-","",$logo_sign_image); $logo_sign_image = str_replace(" ","",$logo_sign_image); $logo_sign_image = str_replace("&","",$logo_sign_image);
$logo_sign_imgorgname = $logo_sign_image ; // Real Name Of Image
$photopath = $logo_sign_path ;
//echo $photopath;
//exit;
$vphoto_name = $logo_sign_image ;
$vphoto = $_FILES[$uploadboxname]['tmp_name'];
$prefix=$userid."_".strtolower($type)."_";
//echo "$photopath,$vphoto,$vphoto_name,$prefix
";
//exit;
if(strlen($delPrevious) > 0) $delPrevious = $logo_sign_path.$delPrevious; else $delPrevious = "";
$idir = "../images/logoandsign/"; // Path To Images Directory $tdir = "../images/logoandsign/"; // Path To Thumbnails Directory //$twidth = "71"; // Maximum Width For Thumbnail Images //$theight = "100"; // Maximum Height For Thumbnail Images
if($type == "Logo")
{
// Set a new width, and calculate new height
$new_width = 200;
$theight = $logo_signimgdimentions[0] * ($new_width/$logo_signimgdimentions[0]);
// Or, vice versa $new_height = 300; $twidth = $logo_signimgdimentions[1] * ($new_height/$logo_signimgdimentions[0]); }else { $theight = "25"; // Maximum Height For Thumbnail Images $twidth = "71"; // Maximum Width For Thumbnail Images }
// $err_msg1 = imageupload($photopath,$vphoto,$vphoto_name,$prefix,$delPrevious);
//imageupload($uploadboxname,$idir,$tdir,$twidth,$theight)
$err_msg1 = imageupload($uploadboxname,$photopath,$photopath,$twidth,$theight,$prefix,$delPrevious);
//print_r($err_msg1); //exit;
if($err_msg1[0] ==) { /*$formname="errorform2"; $hiddenfield="error2"; $sql_error_message = "Error while uploading the Listing Image"; $section = 'Product Add: Uploading the Listing Image'; $error_mail_body = genratesqlerrormailbody($error_projectname, $section,$sql,$sql_error_message); $error_subject = "Error while uploading the Listing Image: ".$section.": ".date('d-M-Y h:i:s A'); include "../include/emailcontent/error_email_include.php"; */ $arr_img_upload_result[0] = ""; $arr_img_upload_result[1] = ""; return $arr_img_upload_result; }else{ $logo_sign_image = $err_msg1[0]; $imgname = $logo_sign_image ; // New Name Of Image $arr_img_upload_result[0] = $imgname; $arr_img_upload_result[1] = $msg; return $arr_img_upload_result; } }else { $arr_img_upload_result[0] = $imgname; $arr_img_upload_result[1] = $msg; return $arr_img_upload_result; } } }
- -------------------------- For uploading Logo and Signature image END-----------------------##
- -------------------------------Delete image START------------------------##
function delImage($delimagename) { GLOBAL $logo_sign_path; if (file_exists($logo_sign_path.$delimagename)) { unlink($logo_sign_path.$delimagename); } }
- -------------------------------Delete image END------------------------##
- -------------------------- Counter No. of Users based on parent id START-----------------------##
function returnUserCount($parentuserid) { $sqlUserCount = "select count(*) from usermaster where parent_user_id = " . $parentuserid; $rsUserCount = mysql_query($sqlUserCount); if($rowsUC = mysql_fetch_array($rsUserCount)) { return trim($rowsUC[0]); }else{ return "00"; } }
- -------------------------- Counter No. of Users based on parent id END-----------------------##
- -------------------------- RETURN MEMBERSHIP ACCOUNT TYPE START-----------------------##
function membershipType($type) { $OP[ 1 ] = "Freight Broker"; $OP[ 2 ] = "Motor Carrier"; $OP[ 3 ] = "Insurance Agency"; $OP[ 4 ] = "Managing General Agency"; $OP[ 5 ] = "Insurance Company"; $OP[ 6 ] = "Sub-User";
return $OP[$type];
}
- -------------------------- RETURN MEMBERSHIP ACCOUNT TYPE END-----------------------##
- -------------------------- RETURN US STATES ABBRIVIATION START-----------------------##
function usstatesAbbr($cname) { $state_list = array('Alabama' => "AL", 'Alaska' => "AK", 'Arizona' => "AZ", 'Arkansas' => "AR", 'California' => "CA", 'Colorado' => "CO", 'Connecticut' => "CT", 'Delaware' => "DE", 'District of Columbia' => "DC", 'Florida' => "FL", 'Georgia' => "GA", 'Hawaii' => "HI", 'Idaho' => "ID", 'Illinois' => "IL", 'Indiana' => "IN", 'Iowa' => "IA", 'Kansas' => "KS", 'Kentucky' => "KY", 'Louisiana' => "LA", 'Maine' => "ME", 'Maryland' => "MD", 'Massachusetts' => "MA", 'Michigan' => "MI", 'Minnesota' => "MN", 'Mississippi' => "MS", 'Missouri' => "MO", 'Montana' => "MT", 'Nebraska' => "NE", 'Nevada' => "NV", 'New Hampshire' => "NH", 'New Jersey' => "NJ", 'New Mexico' => "NM", 'New York' => "NY", 'North Carolina'=> "NC", 'North Dakota' => "ND", 'Ohio' => "OH", 'Oklahoma' => "OK", 'Oregon' => "OR", 'Pennsylvania' => "PA", 'Rhode Island' => "RI", 'South Carolina'=> "SC", 'South Dakota' => "SD", 'Tennessee' => "TN", 'Texas' => "TX", 'Utah' => "UT", 'Vermont' => "VT", 'Virginia' => "VA", 'Washington' => "WA", 'West Virginia' => "WV", 'Wisconsin' => "WI", 'Wyoming' => "WY" ); if(strlen($cname) > 0) return $state_list[$cname]; else return ""; }
- -------------------------- RETURN US STATES ABBRIVIATION END-----------------------##
- -------------------------- RETURN US STATES ABBRIVIATION START-----------------------##
function usstatesName($cname) { $state_list = array( 'AL' => "Alabama", 'AK' => "Alaska", 'AZ' => "Arizona", 'AR' => "Arkansas", 'CA' => "California", 'CO' => "Colorado", 'CT' => "Connecticut", 'DE' => "Delaware", 'DC' => "District of Columbia", 'FL' => "Florida", 'GA' => "Georgia", 'HI' => "Hawaii", 'ID' => "Idaho", 'IL' => "Illinois", 'IN' => "Indiana", 'IA' => "Iowa", 'KS' => "Kansas", 'KY' => "Kentucky", 'LA' => "Louisiana", 'ME' => "Maine", 'MD' => "Maryland", 'MA' => "Massachusetts", 'MI' => "Michigan", 'MN' => "Minnesota", 'MS' => "Mississippi", 'MO' => "Missouri", 'MT' => "Montana", 'NE' => "Nebraska", 'NV' => "Nevada", 'NH' => "New Hampshire", 'NJ' => "New Jersey", 'NM' => "New Mexico", 'NY' => "New York", 'NC' => "North Carolina", 'ND' => "North Dakota", 'OH' => "Ohio", 'OK' => "Oklahoma", 'OR' => "Oregon", 'PA' => "Pennsylvania", 'RI' => "Rhode Island", 'SC' => "South Carolina", 'SD' => "South Dakota", 'TN' => "Tennessee", 'TX' => "Texas", 'UT' => "Utah", 'VT' => "Vermont", 'VA' => "Virginia", 'WA' => "Washington", 'WV' => "West Virginia", 'WI' => "Wisconsin", 'WY' => "Wyoming"); if(strlen($cname) > 0) return $state_list[$cname]; else return ""; }
- -------------------------- RETURN US STATES ABBRIVIATION END-----------------------##
function curPageName() {
return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}
- ---------------PAGING START-----------------------##
function printPaging($total, $limit, $page) { if($total > 0 ) { if($page == 0) $page = $page +1;
$numPages = ceil($total / $limit);
?>
if ($page <= 1) // this is the first page - there is no previous page {
?>}else { // not the first page, link to the previous page //echo "<a href=\"managing_general_agencies.php?page=" . ($page - 1) . "\">Previous</a>";
?>}
?>if ($page == $numPages){ // this is the last page - there is no next page
?>}else{
?>}
?><?PHP
} }
- ---------------PAGING END-----------------------##
- ---------------PAGING START-----------------------##
function printAdminPaging($total, $limit, $page,$title) { if($total > 0 ) { if($page == 0) $page = $page +1;
$numPages = ceil($total / $limit);
if ($page <= 1) // this is the first page - there is no previous page { ?> <input type="button" value="|<" name="cmd"/ disabled> <input type="button" value="<<" name="cmd3"/ disabled> <?PHP }else { // not the first page, link to the previous page ?> <input type="button" onclick="javascript:doAdminPost('1');" value="|<" name="cmd"/> <input type="button" onclick="javascript:doAdminPost('<?PHP echo ($page - 1)?>');" value="<<" name="cmd3"/> <?PHP }
?><input readonly="readOnly" align="center" size="35" value="<?PHP echo "Page " . ($page) . " of $numPages";?> (<?PHP echo $total;?> Total <?PHP echo $title;?>)" name="txtstatus" class="textbox3" /> <?PHP
if ($page == $numPages){ // this is the last page - there is no next page ?><input type="button" value=">>" name="cmd2" disabled /> <input type="button" value=">|" name="cmd" disabled><?PHP }else{ ?><input type="button" onclick="javascript:doAdminPost('<?PHP echo ($page +1)?>');" value=">>" name="cmd2"/> <input type="button" onclick="javascript:doAdminPost('<?PHP echo $numPages;?>');" value=">|" name="cmd"><?PHP } ?><?PHP } }
- ---------------PAGING END-----------------------##
- ----------------UPDATE AUDIT LOG TABLE START---------------##
function updateAuditLog($userid,$action,$certid,$search) { $sqlUpdateAL = "insert audit_log (user_id,action_info,logdate,cert_id,search) values ($userid,'$action',CURRENT_TIMESTAMP,$certid,'".addslashes($search)."')"; //echo $sqlUpdateAL; mysql_query($sqlUpdateAL); return mysql_insert_id(); }
- ----------------UPDATE AUDIT LOG TABLE END---------------##
- ------------------POPULATE INSURANCE AGENCY START---------------##
function populateDD($default,$uid,$membershiptype,$todo,$parentid,$editmode) { $sqlIA = "select user_id,business_name from usermaster where membership_type = ".$membershiptype." and account_statusflg = 1 "; if ($membershiptype == $_SESSION['memtype']) $sqlIA .= " and user_id = " . $uid; if(strlen($parentid) > 0 ) $sqlIA .= " and parent_user_id = " . $parentid; $sqlIA .= " order by business_name";
//echo $sqlIA."jack"; $rsIA = mysql_query($sqlIA); #--------------ERROR MAIL SEND AND PAGE REDIRECT TO ERROR PAGE START---------------# /*if(!$rsIA) { $formname="errorform1"; $hiddenfield="error1"; $sql_error_message = mysql_error(); $section = 'Common Function - PopulateDD'; $error_mail_body = genratesqlerrormailbody($error_projectname, $section,$sql,$sql_error_message); $error_subject = "Error on SQL: ".$section.": ".date('d-M-Y h:i:s A'); include "../include/emailcontent/error_email_include.php"; }*/ #--------------ERROR MAIL SEND AND PAGE REDIRECT TO ERROR PAGE END---------------# $out = "<option value=>".$default; if($rowIA = mysql_fetch_array($rsIA)) { do { //echo $out; $out .= "<option value='".trim($rowIA['user_id'])."'"; if(strlen($todo) > 0 && $membershiptype == $_SESSION['memtype']) $out .= " selected "; if(strlen($editmode) > 0 && trim($editmode) == trim($rowIA['user_id'])) $out .= " selected "; $out .= ">". stripslashes(trim($rowIA['business_name'])) ; }while($rowIA = mysql_fetch_array($rsIA)); } return $out; mysql_free_result($rsIA); }
- ------------------POPULATE INSURANCE AGENCY END---------------##
- ------------------POPULATE INSURANCE AGENCY START---------------##
function populateDDAdmin($default,$uid,$membershiptype,$todo,$parentid,$editmode) { $sqlIA = "select user_id,business_name from usermaster where membership_type = ".$membershiptype." and account_statusflg = 1 "; $sqlIA .= " order by business_name";
//echo $sqlIA; $rsIA = mysql_query($sqlIA); #--------------ERROR MAIL SEND AND PAGE REDIRECT TO ERROR PAGE START---------------# /*if(!$rsIA) { $formname="errorform1"; $hiddenfield="error1"; $sql_error_message = mysql_error(); $section = 'Common Function - PopulateDD'; $error_mail_body = genratesqlerrormailbody($error_projectname, $section,$sql,$sql_error_message); $error_subject = "Error on SQL: ".$section.": ".date('d-M-Y h:i:s A'); include "../include/emailcontent/error_email_include.php"; }*/ #--------------ERROR MAIL SEND AND PAGE REDIRECT TO ERROR PAGE END---------------# $out = "<option value=>".$default; if($rowIA = mysql_fetch_array($rsIA)) { do { //echo $out; $out .= "<option value='".trim($rowIA['user_id'])."'"; if(strlen($editmode) > 0 && $editmode == trim($rowIA['user_id'])) $out .= " selected "; $out .= ">". stripslashes(trim($rowIA['business_name'])) ; }while($rowIA = mysql_fetch_array($rsIA)); } return $out; mysql_free_result($rsIA); }
- ------------------POPULATE INSURANCE AGENCY END---------------##
- ------------------CHECKED CHECKBOX IF VALUE FOUND START---------------##
function selectcheckbxcm($val) { if(strlen($val) > 0 && $val != 0) return " checked "; else return ""; }
- ------------------CHECKED CHECKBOX IF VALUE FOUND END---------------##
- ---------------IT WILL RETURN USER ID BASED ON BUSINESS NAME-----START------##
function returnUserId($bname)
{
$sqlUID = "select user_id from usermaster where business_name = '$bname'";
//echo $sqlUID."
";
//exit;
$rsUID = mysql_query($sqlUID);
#--------------ERROR MAIL SEND AND PAGE REDIRECT TO ERROR PAGE START---------------#
if(!$rsUID)
{
$formname="errorform1";
$hiddenfield="error1";
$sql_error_message = mysql_error();
$section = 'Common Function - Print Usre Id';
$error_mail_body = genratesqlerrormailbody($error_projectname, $section,$sql,$sql_error_message);
$error_subject = "Error on SQL: ".$section.": ".date('d-M-Y h:i:s A');
include "../include/emailcontent/error_email_include.php";
}
#--------------ERROR MAIL SEND AND PAGE REDIRECT TO ERROR PAGE END---------------#
if($rowUID = mysql_fetch_array($rsUID)) { return trim($rowUID['user_id']); } mysql_free_result($rsUID); }
- ---------------IT WILL RETURN USER ID BASED ON BUSINESS NAME-----END------##
- ---------------IT WILL RETURN POWERUNIT BASED ON CERTIFICATEID-----START------##
function printPowerUnit($certid) { /*$sqlPU = "select count(b.policy_no) as pcnt from certs_details a, equipment b where a.cert_id = $certid and a.policy_no = b.policy_no ";*/
$sqlPU = "select count(policy_no) as pcnt from equipment where equipment_type = 1 and cert_id = $certid"; //echo $sqlPU; $rsPU = mysql_query($sqlPU); #--------------ERROR MAIL SEND AND PAGE REDIRECT TO ERROR PAGE START---------------# if(!$rsPU) { $formname="errorform1"; $hiddenfield="error1"; $sql_error_message = mysql_error(); $section = 'Common Function - PowerUnit'; $error_mail_body = genratesqlerrormailbody($error_projectname, $section,$sql,$sql_error_message); $error_subject = "Error on SQL: ".$section.": ".date('d-M-Y h:i:s A'); include "../include/emailcontent/error_email_include.php"; } #--------------ERROR MAIL SEND AND PAGE REDIRECT TO ERROR PAGE END---------------#
if($row = mysql_fetch_array($rsPU)) { return trim($row['pcnt']); } mysql_free_result($result); }
- ---------------IT WILL RETURN POWERUNIT BASED ON CERTIFICATEID-----END------##
- ------------FETCH USER'S EMAIL ADDRESS------START ----------##
function printUserEmailAdd($user_id) { $sqlUEmail = "select business_email_addr from usermaster where user_id = $user_id"; $rsUEmail = mysql_query($sqlUEmail); #--------------ERROR MAIL SEND AND PAGE REDIRECT TO ERROR PAGE START---------------# if(!$rsUEmail) { $formname="errorform1"; $hiddenfield="error1"; $sql_error_message = mysql_error(); $section = 'Common Function - Fetch User Email'; $error_mail_body = genratesqlerrormailbody($error_projectname, $section,$sql,$sql_error_message); $error_subject = "Error on SQL: ".$section.": ".date('d-M-Y h:i:s A'); include "../include/emailcontent/error_email_include.php"; } #--------------ERROR MAIL SEND AND PAGE REDIRECT TO ERROR PAGE END---------------#
if($rowUEmail = mysql_fetch_array($rsUEmail)) { return $rowUEmail['business_email_addr']; } }
- ------------FETCH USER'S EMAIL ADDRESS------END ----------##
- -----CONVERT TO MYSQL DATE FROM AMERICAN DATE---------START---##
function AmerDate2SqlDateTime ($strDate) { $err = false; if ((strlen($strDate) >= 8) && (strlen($strDate) <= 10)) { $tempDate = explode('/', $strDate);
// See if we got what we thought we should if (count ($tempDate) == 3) { $month = $tempDate[0] + 0; $daynum = $tempDate[1] + 0; $year = $tempDate[2] + 0; } else $err = true; } else $err = true;
$month = (($month < 10) ? '0' . $month : $month); // prepend ZERO, maybe $daynum = (($daynum < 10) ? '0' . $daynum : $daynum); // prepend ZERO, maybe
if (! $err ) // mm/dd/yyyy return $year. '-' . $month . '-' . $daynum ; else return ;
} // AmerDate2SqlDateTime ()
- -----CONVERT TO MYSQL DATE FROM AMERICAN DATE---------END---##
- ----------CALCULATE AMOUNT FOR CERTIFICATE BASED ON POWER UNIT----START---------##
function calCertCost($powerunit) { $priceOut = 0; if($powerunit >= 1 && $powerunit <= 9) { $priceOut = 20; }else if($powerunit >= 10 && $powerunit <= 99) { $priceOut = 18; }else if($powerunit >= 100 && $powerunit <= 999) { $priceOut = 16; }else if($powerunit >= 1000 && $powerunit <= 9999) { $priceOut = 14; } return $priceOut; }
- ----------CALCULATE AMOUNT FOR CERTIFICATE BASED ON POWER UNIT-----END---------##
- ----COUNT CERTIFICATE ACTIVE AND INACTIVE START--------##
//printActiveDeactCerts(22,1/0,mga) function printActiveDeactCerts($agentid,$mode,$type) { $sqlActive = "select count(*) as act from certificate_master where "; if($type != "insurance_agency"){ $sqlActive .= "(".$type."_a = $agentid or ".$type."_b = $agentid or ".$type."_c = $agentid "; $sqlActive .= "or ".$type."_d = $agentid or ".$type."_e = $agentid)"; }else{ $sqlActive .= " $type = $agentid"; }
if(strlen($mode) > 0) $sqlActive .= " and paid = $mode";
if($type == "insurance_agency"){ $param = "ia"; } if($type == "mga"){ $param = "m"; } if($type == "iac_insurer"){ $param = "ic"; }
//echo $sqlActive; $rsActive = mysql_query($sqlActive); if($rows = mysql_fetch_array($rsActive)) { $out = trim($rows['act']); if($out == 0){ return "-"; }else{ if(strlen($mode) > 0){ if($mode == 0){ return "<A href='certificate_inactive.php?uid=$agentid&t=$param' class='blueb'>$out</a>"; }else{ return "<A href='certificate_active.php?uid=$agentid&t=$param' class='blueb'>$out</a>"; } }else { return "<a href='certificates_view.php?uid=$agentid&t=$param' class='blue11'>$out</a>"; } } } mysql_free_result($rsActive); }
- ----COUNT CERTIFICATE ACTIVE AND INACTIVE END--------##
- ----GENERATE ACTIVE PDF FUNCTION---START----##
//$varPath = getcwd(); //$varURL = "http://tesla/truckcertsv2/include/pdf_acord_cert.php?cid=138"; //user = gereratepdf($varPath,$varURL,""); function gereratepdf($varPath,$varURL,$Orient) { // Define Variables
// PDF Output Folder // $varPath = getcwd();
// EngineToUse (1=IE, 0=Native) $varEngine = 1;
// URL format: "http://www.activepdf.com" or "file://folder/file.htm" // $varURL = "http://www.activepdf.com/support/knowledgebase/view.cfm?kb=11687&code=php"; //$varURL = "http://tesla/truckcertsv2/include/pdf_acord_cert.php?cid=138"; //echo "$varPath
$varURL
$Orient"; // Timeout for various calls $varTimeout = 60; // For local machine use these defaults $varIP = "127.0.0.1"; //$varIP = "208.106.182.40"; $varPort = "64320";
// Set Script Timeout set_time_limit($varTimeout + 1);
// Instantiate Objects $WG = new COM("APWebGrabber.Object"); $APS = new COM("APServer.Object");
// Set activePDF Server properties if(strtolower($Orient)=="yes") $APS->Orientation=2; else $APS->Orientation=1;
$APS->OutputDirectory = $varPath; $APS->PDFTimeout = $varTimeout;
// Must call before DoPrint to pass server settings to WG $WG->Prt2DiskSettings = $APS->ToString();
// Set WebGrabber properties $WG->EngineToUse = $varEngine; $WG->URL = $varURL; $WG->TimeOut = $varTimeout; $WG->PrinterTimeout = $varTimeout; if ($varEngine == 0) { $WG->PrintBackgroundColors = 1; $WG->TopBottomMargin = 150; $WG->LeftRightMargin = 150; }
// Set Email options /* $WG->SMTPServer = "255.255.255.255"; $WG->EMailTo = "John Doe <dreamzz_mazic@yahoo.com>"; $WG->EmailNameFrom = "John Doe"; $WG->EMailIDFrom = "<sales@truckcerts.com>"; $WG->EMailSubject = "WebGrabber Convert and Email Test"; $WG->EMailText = "The converted PDF should be attached to this email.";*/ /* $WG->SMTPServer = $SMTPServer; $WG->EMailTo = "$EMailNameTo <$EMailTo>"; $WG->EmailNameFrom = $EmailNameFrom; $WG->EMailIDFrom = "<$EMailIDFrom>"; $WG->EMailSubject = $EMailSubject; $WG->EMailText = $EMailText;*/
// Start the conversion process $varReturn = $WG->DoPrint($varIP, $varPort); $out = $varReturn; if ($varReturn != '0') { Error("DoPrint", $varReturn); }
// Wait for conversion result $varReturn = $WG->Wait($varIP, $varPort, $varTimeout, ""); $out .= "0-----0".$varReturn; if ($varReturn != '019') { Error("Wait", $varReturn); }
if ($varReturn == "019"){ $APS->FromString($WG->Prt2DiskSettings); $PDFName = $APS->NewUniqueID . ".pdf"; }
// Run WG CleanUp $WG->Cleanup($varIP, $varPort);
// Clear Objects $WG = null; $APS = null;
// Conversion Complete return $PDFName; }
// Error Handling function Error($Method, $varReturn) {
/* echo "'$Method' failed with a '$varReturn'
"; echo "<a href='http://www.activepdf.com/support/kb/?id=10033&tk=ts'>"; echo "WebGrabber Return Codes KB Article</a>";*/ $WG = null; $APS = null;
return "";
exit();
}
- ---GENERATE ACTIVEPDF SCRIPT--END-----##
function printColor($monthid) { $colors = array('1' => "F23456", '2' => "33FF66", '3' => "FF6600", '4' => "3399FF", '5' => "AA99FF", '6' => "009966", '7' => "CC3399", '8' => "FFCC33", '9' => "0000FF", '10' => "f789f7", '11' => "993333", '12' => "CCCC00");
if(strlen($monthid) > 0) return $colors[$monthid]; else return "";
}
//FUNCTION TO ROLLBACK /COMMIT function begin() { @mysql_query("BEGIN"); } function commit() { @mysql_query("COMMIT"); } function rollback() { @mysql_query("ROLLBACK"); }
//JAVASCRIPT ALERT FUNCTION function JavaScript($message,$location,$back) { $sPrint = ""; $sPrint = "<html><script>"; if(strlen(trim($message)) > 0) $sPrint = $sPrint . "alert('" . str_replace("'","\'",$message) . "');";
if(strlen($location) > 0) $sPrint = $sPrint . "window.location.href='" . $location . "';";
if($back == "true") $sPrint = $sPrint . "window.history.back();";
$sPrint = $sPrint . "</script></html>"; echo $sPrint; }
- ---RETURN USER TYPE--START---##
function printUserType($membershipId,$printoption) { $pgTitle= Array(); if(strlen($membershipId) > 0) {
if($membershipId == 1){ $pgTitle[] = "Freight Brokers"; $pgTitle[] = "Freight Brokers"; $pgTitle[] = "fb"; $pgTitle[] = "freight_brokers"; } if($membershipId == 2){ $pgTitle[] = "Motor Carriers (Truckers)"; $pgTitle[] = "Motor Carriers (Truckers)"; $pgTitle[] = "mc"; $pgTitle[] = "motor_carriers"; } if($membershipId == 3){ $pgTitle[] = "Insurance Agency"; $pgTitle[] = "Insurance Agencies"; $pgTitle[] = "ia"; $pgTitle[] = "insurance_agency"; } if($membershipId == 4){ $pgTitle[] = "Managing General Agency"; $pgTitle[] = "Managing General Agencies"; $pgTitle[] = "mga"; $pgTitle[] = "managing_general_agency"; } if($membershipId == 5){ $pgTitle[] = "Insurance Company"; $pgTitle[] = "Insurance Companies"; $pgTitle[] = "ic"; $pgTitle[] = "insurance_company"; } }
return $pgTitle[$printoption]; }
- ---RETURN USER TYPE---END---##
- ---RETURN MEMBER'S FILED VALUE START--##
//echo printMemField("user_id","10","business_email_addr","usermaster","0"); function printMemField($wherefield,$wherecondition,$fieldname,$tablename,$datatype) { $sqlMemFileds = "select $fieldname from $tablename where "; if($datatype == 0) $sqlMemFileds .= "$wherefield = $wherecondition"; if($datatype == 1) $sqlMemFileds .= "$wherefield = '$wherecondition'"; $rsMF = mysql_query($sqlMemFileds); if($rowMF = mysql_fetch_array($rsMF)) { return trim($rowMF[$fieldname]); } }
- ---RETURN MEMBER'S FILED VALUE -END--##
- ---FILL NULL FOR INTEGER---START-----##
function checkIntNull($val) { if(strlen($val) > 0) { return $val; }else { return 'NULL'; } }
- ---FILL NULL FOR INTEGER----END------##
function pringChildList($parentID,$wherefield)
{
$child_users_id_list = 0;
//This will provide info if certs created by child
$child = "select user_id from usermaster where is_child > 0 and parent_user_id = $parentID";
$rsChild = mysql_query($child);
$child_users_id_list = "";
if($rowsChild = mysql_fetch_array($rsChild))
{
do
{
if(strlen($child_users_id_list) == 0)
{
$child_users_id_list = "or ".$wherefield." = " . trim($rowsChild['user_id']);
}else
{
$child_users_id_list .= " or ".$wherefield." = " . trim($rowsChild['user_id']);
}
}while($rowsChild = mysql_fetch_array($rsChild));
}
return $child_users_id_list;
}
?>