PageRenderTime 48ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/addimages2.php

https://github.com/prsolans/secondstreetcottages
PHP | 909 lines | 886 code | 20 blank | 3 comment | 83 complexity | 97a8140177e7e1f05810e81a02192043 MD5 | raw file
  1. <?php
  2. require_once("../master/config/config.php");
  3. ?>
  4. <?php
  5. // This page below get's a little hairy
  6. if ($_SESSION['controller'] == true) {
  7. ?>
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <?php
  12. include($docroot . "/master/includes/meta.inc.php");
  13. ?>
  14. </head>
  15. <body id="adminbody">
  16. <?php
  17. // include administration header
  18. include($docroot . "/master/includes/header.admin.inc.php");
  19. ?>
  20. <?php
  21. // include administration left navigation
  22. include($docroot . "/master/includes/leftnav.admin.inc.php");
  23. ?>
  24. <div id="adminrightcolumn">
  25. <h1>Process for uploading files</h1>
  26. <p>This is where the process to upload the file's is going to be completed.</p>
  27. <?php
  28. // get id of property
  29. echo "UPLOAD STATUS"; // name program
  30. // prepare variables
  31. $id = "3"; // grab/clean variables
  32. $target = $docroot . "/images/db_images/"; // prepare target url
  33. $file1 = $_FILES['file1'];
  34. $file2 = $_FILES['file2'];
  35. $file3 = $_FILES['file3'];
  36. $file4 = $_FILES['file4'];
  37. $file5 = $_FILES['file5'];
  38. $file6 = $_FILES['file6'];
  39. $file7 = $_FILES['file7'];
  40. $file8 = $_FILES['file8'];
  41. $file9 = $_FILES['file9'];
  42. $file10 = $_FILES['file10'];
  43. $file11 = $_FILES['file11'];
  44. $file12 = $_FILES['file12'];
  45. $file13 = $_FILES['file13'];
  46. $file14 = $_FILES['file14'];
  47. $file15 = $_FILES['file15'];
  48. $file16 = $_FILES['file16'];
  49. $file17 = $_FILES['file17'];
  50. $file18 = $_FILES['file18'];
  51. $file19 = $_FILES['file19'];
  52. $file20 = $_FILES['file20'];
  53. $file21 = $_FILES['file21'];
  54. $file22 = $_FILES['file22'];
  55. $file23 = $_FILES['file23'];
  56. $file24 = $_FILES['file24'];
  57. $file25 = $_FILES['file25'];
  58. $file26 = $_FILES['file26'];
  59. $file27 = $_FILES['file27'];
  60. $file28 = $_FILES['file28'];
  61. $file29 = $_FILES['file29'];
  62. $file30 = $_FILES['file30'];
  63. $file31 = $_FILES['file31'];
  64. $file32 = $_FILES['file32'];
  65. echo "<hr />";
  66. echo "Status on File 1";
  67. echo "<br />";
  68. if (!empty($file1['name'])) {
  69. $tmp_name1 = $file1['tmp_name'];
  70. $name1 = $id . "_" . $file1['name'];
  71. $target1 = $target . $name1;
  72. if (file_exists($target1)) {
  73. echo "File 1 already exists.<br />";
  74. }else {
  75. if (move_uploaded_file($tmp_name1, $target1)) {
  76. echo "File was uploaded successfully.<br />";
  77. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name1')";
  78. if (mysql_query($insert)) {
  79. echo "It was also uploaded into the database successfully.<br />";
  80. }else {
  81. echo "Problem's inserting it into database though.<br />";
  82. }
  83. }else {
  84. echo "There was a problem uploading this specific file.<br />";
  85. }
  86. }
  87. } else {
  88. echo "File1 does not exist.<br />";
  89. }
  90. echo "<hr />";
  91. echo "Status on File 2";
  92. echo "<br />";
  93. if (!empty($file2['name'])) {
  94. $tmp_name2 = $file2['tmp_name'];
  95. $name2 = $id . "_" . $file2['name'];
  96. $target2 = $target . $name2;
  97. if (file_exists($target2)) {
  98. echo "File 2 already exists.<br />";
  99. }else {
  100. if (move_uploaded_file($tmp_name2, $target2)) {
  101. echo "File was uploaded successfully.<br />";
  102. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name2')";
  103. if (mysql_query($insert)) {
  104. echo "It was also uploaded into the database successfully.<br />";
  105. }else {
  106. echo "Problem's inserting it into database though.<br />";
  107. }
  108. }else {
  109. echo "There was a problem uploading this specific file.<br />";
  110. }
  111. }
  112. } else {
  113. echo "File2 does not exist.<br />";
  114. }
  115. echo "<hr />";
  116. echo "Status on File 3";
  117. echo "<br />";
  118. if (!empty($file3['name'])) {
  119. $tmp_name3 = $file3['tmp_name'];
  120. $name3 = $id . "_" . $file3['name'];
  121. $target3 = $target . $name3;
  122. if (file_exists($target3)) {
  123. echo "File 3 already exists.<br />";
  124. }else {
  125. if (move_uploaded_file($tmp_name3, $target3)) {
  126. echo "File was uploaded successfully.<br />";
  127. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name3')";
  128. if (mysql_query($insert)) {
  129. echo "It was also uploaded into the database successfully.<br />";
  130. }else {
  131. echo "Problem's inserting it into database though.<br />";
  132. }
  133. }else {
  134. echo "There was a problem uploading this specific file.<br />";
  135. }
  136. }
  137. } else {
  138. echo "File3 does not exist.<br />";
  139. }
  140. echo "<hr />";
  141. echo "Status on File 4";
  142. echo "<br />";
  143. if (!empty($file4['name'])) {
  144. $tmp_name4 = $file4['tmp_name'];
  145. $name4 = $id . "_" . $file4['name'];
  146. $target4 = $target . $name4;
  147. if (file_exists($target4)) {
  148. echo "File 4 already exists.<br />";
  149. }else {
  150. if (move_uploaded_file($tmp_name4, $target4)) {
  151. echo "File was uploaded successfully.<br />";
  152. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name4')";
  153. if (mysql_query($insert)) {
  154. echo "It was also uploaded into the database successfully.<br />";
  155. }else {
  156. echo "Problem's inserting it into database though.<br />";
  157. }
  158. }else {
  159. echo "There was a problem uploading this specific file.<br />";
  160. }
  161. }
  162. } else {
  163. echo "File4 does not exist.<br />";
  164. }
  165. echo "<hr />";
  166. echo "Status on File 5";
  167. echo "<br />";
  168. if (!empty($file5['name'])) {
  169. $tmp_name5 = $file5['tmp_name'];
  170. $name5 = $id . "_" . $file5['name'];
  171. $target5 = $target . $name5;
  172. if (file_exists($target5)) {
  173. echo "File 5 already exists.<br />";
  174. }else {
  175. if (move_uploaded_file($tmp_name5, $target5)) {
  176. echo "File was uploaded successfully.<br />";
  177. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name5')";
  178. if (mysql_query($insert)) {
  179. echo "It was also uploaded into the database successfully.<br />";
  180. }else {
  181. echo "Problem's inserting it into database though.<br />";
  182. }
  183. }else {
  184. echo "There was a problem uploading this specific file.<br />";
  185. }
  186. }
  187. } else {
  188. echo "File5 does not exist.<br />";
  189. }
  190. echo "<hr />";
  191. echo "Status on File 6";
  192. echo "<br />";
  193. if (!empty($file6['name'])) {
  194. $tmp_name6 = $file6['tmp_name'];
  195. $name6 = $id . "_" . $file6['name'];
  196. $target6 = $target . $name6;
  197. if (file_exists($target6)) {
  198. echo "File 6 already exists.<br />";
  199. }else {
  200. if (move_uploaded_file($tmp_name6, $target6)) {
  201. echo "File was uploaded successfully.<br />";
  202. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name6')";
  203. if (mysql_query($insert)) {
  204. echo "It was also uploaded into the database successfully.<br />";
  205. }else {
  206. echo "Problem's inserting it into database though.<br />";
  207. }
  208. }else {
  209. echo "There was a problem uploading this specific file.<br />";
  210. }
  211. }
  212. } else {
  213. echo "File6 does not exist.<br />";
  214. }
  215. echo "<hr />";
  216. echo "Status on File 7";
  217. echo "<br />";
  218. if (!empty($file7['name'])) {
  219. $tmp_name7 = $file7['tmp_name'];
  220. $name7 = $id . "_" . $file7['name'];
  221. $target7 = $target . $name7;
  222. if (file_exists($target7)) {
  223. echo "File 7 already exists.<br />";
  224. }else {
  225. if (move_uploaded_file($tmp_name7, $target7)) {
  226. echo "File was uploaded successfully.<br />";
  227. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name7')";
  228. if (mysql_query($insert)) {
  229. echo "It was also uploaded into the database successfully.<br />";
  230. }else {
  231. echo "Problem's inserting it into database though.<br />";
  232. }
  233. }else {
  234. echo "There was a problem uploading this specific file.<br />";
  235. }
  236. }
  237. } else {
  238. echo "File7 does not exist.<br />";
  239. }
  240. echo "<hr />";
  241. echo "Status on File 8";
  242. echo "<br />";
  243. if (!empty($file8['name'])) {
  244. $tmp_name8 = $file8['tmp_name'];
  245. $name8 = $id . "_" . $file8['name'];
  246. $target8 = $target . $name8;
  247. if (file_exists($target8)) {
  248. echo "File 8 already exists.<br />";
  249. }else {
  250. if (move_uploaded_file($tmp_name8, $target8)) {
  251. echo "File was uploaded successfully.<br />";
  252. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name8')";
  253. if (mysql_query($insert)) {
  254. echo "It was also uploaded into the database successfully.<br />";
  255. }else {
  256. echo "Problem's inserting it into database though.<br />";
  257. }
  258. }else {
  259. echo "There was a problem uploading this specific file.<br />";
  260. }
  261. }
  262. } else {
  263. echo "File8 does not exist.<br />";
  264. }
  265. echo "<hr />";
  266. echo "Status on File 9";
  267. echo "<br />";
  268. if (!empty($file9['name'])) {
  269. $tmp_name9 = $file9['tmp_name'];
  270. $name9 = $id . "_" . $file9['name'];
  271. $target9 = $target . $name9;
  272. if (file_exists($target9)) {
  273. echo "File 9 already exists.<br />";
  274. }else {
  275. if (move_uploaded_file($tmp_name9, $target9)) {
  276. echo "File was uploaded successfully.<br />";
  277. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name9')";
  278. if (mysql_query($insert)) {
  279. echo "It was also uploaded into the database successfully.<br />";
  280. }else {
  281. echo "Problem's inserting it into database though.<br />";
  282. }
  283. }else {
  284. echo "There was a problem uploading this specific file.<br />";
  285. }
  286. }
  287. } else {
  288. echo "File9 does not exist.<br />";
  289. }
  290. echo "<hr />";
  291. echo "Status on File 10";
  292. echo "<br />";
  293. if (!empty($file10['name'])) {
  294. $tmp_name10 = $file10['tmp_name'];
  295. $name10 = $id . "_" . $file10['name'];
  296. $target10 = $target . $name10;
  297. if (file_exists($target10)) {
  298. echo "File 10 already exists.<br />";
  299. }else {
  300. if (move_uploaded_file($tmp_name10, $target10)) {
  301. echo "File was uploaded successfully.<br />";
  302. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name10')";
  303. if (mysql_query($insert)) {
  304. echo "It was also uploaded into the database successfully.<br />";
  305. }else {
  306. echo "Problem's inserting it into database though.<br />";
  307. }
  308. }else {
  309. echo "There was a problem uploading this specific file.<br />";
  310. }
  311. }
  312. } else {
  313. echo "File10 does not exist.<br />";
  314. }
  315. echo "<hr />";
  316. echo "Status on File 11";
  317. echo "<br />";
  318. if (!empty($file11['name'])) {
  319. $tmp_name11 = $file11['tmp_name'];
  320. $name11 = $id . "_" . $file11['name'];
  321. $target11 = $target . $name11;
  322. if (file_exists($target11)) {
  323. echo "File 11 already exists.<br />";
  324. }else {
  325. if (move_uploaded_file($tmp_name11, $target11)) {
  326. echo "File was uploaded successfully.<br />";
  327. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name11')";
  328. if (mysql_query($insert)) {
  329. echo "It was also uploaded into the database successfully.<br />";
  330. }else {
  331. echo "Problem's inserting it into database though.<br />";
  332. }
  333. }else {
  334. echo "There was a problem uploading this specific file.<br />";
  335. }
  336. }
  337. } else {
  338. echo "File11 does not exist.<br />";
  339. }
  340. echo "<hr />";
  341. echo "Status on File 12";
  342. echo "<br />";
  343. if (!empty($file12['name'])) {
  344. $tmp_name12 = $file12['tmp_name'];
  345. $name12 = $id . "_" . $file12['name'];
  346. $target12 = $target . $name12;
  347. if (file_exists($target12)) {
  348. echo "File 12 already exists.<br />";
  349. }else {
  350. if (move_uploaded_file($tmp_name12, $target12)) {
  351. echo "File was uploaded successfully.<br />";
  352. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name12')";
  353. if (mysql_query($insert)) {
  354. echo "It was also uploaded into the database successfully.<br />";
  355. }else {
  356. echo "Problem's inserting it into database though.<br />";
  357. }
  358. }else {
  359. echo "There was a problem uploading this specific file.<br />";
  360. }
  361. }
  362. } else {
  363. echo "File12 does not exist.<br />";
  364. }
  365. echo "<hr />";
  366. echo "Status on File 13";
  367. echo "<br />";
  368. if (!empty($file13['name'])) {
  369. $tmp_name13 = $file13['tmp_name'];
  370. $name13 = $id . "_" . $file13['name'];
  371. $target13 = $target . $name13;
  372. if (file_exists($target13)) {
  373. echo "File 13 already exists.<br />";
  374. }else {
  375. if (move_uploaded_file($tmp_name13, $target13)) {
  376. echo "File was uploaded successfully.<br />";
  377. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name13')";
  378. if (mysql_query($insert)) {
  379. echo "It was also uploaded into the database successfully.<br />";
  380. }else {
  381. echo "Problem's inserting it into database though.<br />";
  382. }
  383. }else {
  384. echo "There was a problem uploading this specific file.<br />";
  385. }
  386. }
  387. } else {
  388. echo "File13 does not exist.<br />";
  389. }
  390. echo "<hr />";
  391. echo "Status on File 14";
  392. echo "<br />";
  393. if (!empty($file14['name'])) {
  394. $tmp_name14 = $file14['tmp_name'];
  395. $name14 = $id . "_" . $file14['name'];
  396. $target14 = $target . $name14;
  397. if (file_exists($target14)) {
  398. echo "File 14 already exists.<br />";
  399. }else {
  400. if (move_uploaded_file($tmp_name14, $target14)) {
  401. echo "File was uploaded successfully.<br />";
  402. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name14')";
  403. if (mysql_query($insert)) {
  404. echo "It was also uploaded into the database successfully.<br />";
  405. }else {
  406. echo "Problem's inserting it into database though.<br />";
  407. }
  408. }else {
  409. echo "There was a problem uploading this specific file.<br />";
  410. }
  411. }
  412. } else {
  413. echo "File14 does not exist.<br />";
  414. }
  415. echo "<hr />";
  416. echo "Status on File 15";
  417. echo "<br />";
  418. if (!empty($file15['name'])) {
  419. $tmp_name15 = $file15['tmp_name'];
  420. $name15 = $id . "_" . $file15['name'];
  421. $target15 = $target . $name15;
  422. if (file_exists($target15)) {
  423. echo "File 15 already exists.<br />";
  424. }else {
  425. if (move_uploaded_file($tmp_name15, $target15)) {
  426. echo "File was uploaded successfully.<br />";
  427. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name15')";
  428. if (mysql_query($insert)) {
  429. echo "It was also uploaded into the database successfully.<br />";
  430. }else {
  431. echo "Problem's inserting it into database though.<br />";
  432. }
  433. }else {
  434. echo "There was a problem uploading this specific file.<br />";
  435. }
  436. }
  437. } else {
  438. echo "File15 does not exist.<br />";
  439. }
  440. echo "<hr />";
  441. echo "Status on File 16";
  442. echo "<br />";
  443. if (!empty($file16['name'])) {
  444. $tmp_name16 = $file16['tmp_name'];
  445. $name16 = $id . "_" . $file16['name'];
  446. $target16 = $target . $name16;
  447. if (file_exists($target16)) {
  448. echo "File 16 already exists.<br />";
  449. }else {
  450. if (move_uploaded_file($tmp_name16, $target16)) {
  451. echo "File was uploaded successfully.<br />";
  452. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name16')";
  453. if (mysql_query($insert)) {
  454. echo "It was also uploaded into the database successfully.<br />";
  455. }else {
  456. echo "Problem's inserting it into database though.<br />";
  457. }
  458. }else {
  459. echo "There was a problem uploading this specific file.<br />";
  460. }
  461. }
  462. } else {
  463. echo "File16 does not exist.<br />";
  464. }
  465. echo "<hr />";
  466. echo "Status on File 17";
  467. echo "<br />";
  468. if (!empty($file17['name'])) {
  469. $tmp_name17 = $file17['tmp_name'];
  470. $name17 = $id . "_" . $file17['name'];
  471. $target17 = $target . $name17;
  472. if (file_exists($target17)) {
  473. echo "File 17 already exists.<br />";
  474. }else {
  475. if (move_uploaded_file($tmp_name17, $target17)) {
  476. echo "File was uploaded successfully.<br />";
  477. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name17')";
  478. if (mysql_query($insert)) {
  479. echo "It was also uploaded into the database successfully.<br />";
  480. }else {
  481. echo "Problem's inserting it into database though.<br />";
  482. }
  483. }else {
  484. echo "There was a problem uploading this specific file.<br />";
  485. }
  486. }
  487. } else {
  488. echo "File17 does not exist.<br />";
  489. }
  490. echo "<hr />";
  491. echo "Status on File 18";
  492. echo "<br />";
  493. if (!empty($file18['name'])) {
  494. $tmp_name18 = $file18['tmp_name'];
  495. $name18 = $id . "_" . $file18['name'];
  496. $target18 = $target . $name18;
  497. if (file_exists($target18)) {
  498. echo "File 18 already exists.<br />";
  499. }else {
  500. if (move_uploaded_file($tmp_name18, $target18)) {
  501. echo "File was uploaded successfully.<br />";
  502. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name18')";
  503. if (mysql_query($insert)) {
  504. echo "It was also uploaded into the database successfully.<br />";
  505. }else {
  506. echo "Problem's inserting it into database though.<br />";
  507. }
  508. }else {
  509. echo "There was a problem uploading this specific file.<br />";
  510. }
  511. }
  512. } else {
  513. echo "File18 does not exist.<br />";
  514. }
  515. echo "<hr />";
  516. echo "Status on File 19";
  517. echo "<br />";
  518. if (!empty($file19['name'])) {
  519. $tmp_name19 = $file19['tmp_name'];
  520. $name19 = $id . "_" . $file19['name'];
  521. $target19 = $target . $name19;
  522. if (file_exists($target19)) {
  523. echo "File 19 already exists.<br />";
  524. }else {
  525. if (move_uploaded_file($tmp_name19, $target19)) {
  526. echo "File was uploaded successfully.<br />";
  527. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name19')";
  528. if (mysql_query($insert)) {
  529. echo "It was also uploaded into the database successfully.<br />";
  530. }else {
  531. echo "Problem's inserting it into database though.<br />";
  532. }
  533. }else {
  534. echo "There was a problem uploading this specific file.<br />";
  535. }
  536. }
  537. } else {
  538. echo "File19 does not exist.<br />";
  539. }
  540. echo "<hr />";
  541. echo "Status on File 20";
  542. echo "<br />";
  543. if (!empty($file20['name'])) {
  544. $tmp_name20 = $file20['tmp_name'];
  545. $name20 = $id . "_" . $file20['name'];
  546. $target20 = $target . $name20;
  547. if (file_exists($target20)) {
  548. echo "File 20 already exists.<br />";
  549. }else {
  550. if (move_uploaded_file($tmp_name20, $target20)) {
  551. echo "File was uploaded successfully.<br />";
  552. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name20')";
  553. if (mysql_query($insert)) {
  554. echo "It was also uploaded into the database successfully.<br />";
  555. }else {
  556. echo "Problem's inserting it into database though.<br />";
  557. }
  558. }else {
  559. echo "There was a problem uploading this specific file.<br />";
  560. }
  561. }
  562. } else {
  563. echo "File20 does not exist.<br />";
  564. }
  565. echo "<hr />";
  566. echo "Status on File 21";
  567. echo "<br />";
  568. if (!empty($file21['name'])) {
  569. $tmp_name21 = $file21['tmp_name'];
  570. $name21 = $id . "_" . $file21['name'];
  571. $target21 = $target . $name21;
  572. if (file_exists($target21)) {
  573. echo "File 21 already exists.<br />";
  574. }else {
  575. if (move_uploaded_file($tmp_name21, $target21)) {
  576. echo "File was uploaded successfully.<br />";
  577. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name21')";
  578. if (mysql_query($insert)) {
  579. echo "It was also uploaded into the database successfully.<br />";
  580. }else {
  581. echo "Problem's inserting it into database though.<br />";
  582. }
  583. }else {
  584. echo "There was a problem uploading this specific file.<br />";
  585. }
  586. }
  587. } else {
  588. echo "File21 does not exist.<br />";
  589. }
  590. echo "<hr />";
  591. echo "Status on File 22";
  592. echo "<br />";
  593. if (!empty($file22['name'])) {
  594. $tmp_name22 = $file22['tmp_name'];
  595. $name22 = $id . "_" . $file22['name'];
  596. $target22 = $target . $name22;
  597. if (file_exists($target22)) {
  598. echo "File 22 already exists.<br />";
  599. }else {
  600. if (move_uploaded_file($tmp_name22, $target22)) {
  601. echo "File was uploaded successfully.<br />";
  602. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name22')";
  603. if (mysql_query($insert)) {
  604. echo "It was also uploaded into the database successfully.<br />";
  605. }else {
  606. echo "Problem's inserting it into database though.<br />";
  607. }
  608. }else {
  609. echo "There was a problem uploading this specific file.<br />";
  610. }
  611. }
  612. } else {
  613. echo "File22 does not exist.<br />";
  614. }
  615. echo "<hr />";
  616. echo "Status on File 23";
  617. echo "<br />";
  618. if (!empty($file23['name'])) {
  619. $tmp_name23 = $file23['tmp_name'];
  620. $name23 = $id . "_" . $file23['name'];
  621. $target23 = $target . $name23;
  622. if (file_exists($target23)) {
  623. echo "File 23 already exists.<br />";
  624. }else {
  625. if (move_uploaded_file($tmp_name23, $target23)) {
  626. echo "File was uploaded successfully.<br />";
  627. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name23')";
  628. if (mysql_query($insert)) {
  629. echo "It was also uploaded into the database successfully.<br />";
  630. }else {
  631. echo "Problem's inserting it into database though.<br />";
  632. }
  633. }else {
  634. echo "There was a problem uploading this specific file.<br />";
  635. }
  636. }
  637. } else {
  638. echo "File23 does not exist.<br />";
  639. }
  640. echo "<hr />";
  641. echo "Status on File 24";
  642. echo "<br />";
  643. if (!empty($file24['name'])) {
  644. $tmp_name24 = $file24['tmp_name'];
  645. $name24 = $id . "_" . $file24['name'];
  646. $target24 = $target . $name24;
  647. if (file_exists($target24)) {
  648. echo "File 24 already exists.<br />";
  649. }else {
  650. if (move_uploaded_file($tmp_name24, $target24)) {
  651. echo "File was uploaded successfully.<br />";
  652. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name24')";
  653. if (mysql_query($insert)) {
  654. echo "It was also uploaded into the database successfully.<br />";
  655. }else {
  656. echo "Problem's inserting it into database though.<br />";
  657. }
  658. }else {
  659. echo "There was a problem uploading this specific file.<br />";
  660. }
  661. }
  662. } else {
  663. echo "File24 does not exist.<br />";
  664. }
  665. echo "<hr />";
  666. echo "Status on File 25";
  667. echo "<br />";
  668. if (!empty($file25['name'])) {
  669. $tmp_name25 = $file25['tmp_name'];
  670. $name25 = $id . "_" . $file25['name'];
  671. $target25 = $target . $name25;
  672. if (file_exists($target25)) {
  673. echo "File 25 already exists.<br />";
  674. }else {
  675. if (move_uploaded_file($tmp_name25, $target25)) {
  676. echo "File was uploaded successfully.<br />";
  677. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name25')";
  678. if (mysql_query($insert)) {
  679. echo "It was also uploaded into the database successfully.<br />";
  680. }else {
  681. echo "Problem's inserting it into database though.<br />";
  682. }
  683. }else {
  684. echo "There was a problem uploading this specific file.<br />";
  685. }
  686. }
  687. } else {
  688. echo "File25 does not exist.<br />";
  689. }
  690. echo "<hr />";
  691. echo "Status on File 26";
  692. echo "<br />";
  693. if (!empty($file26['name'])) {
  694. $tmp_name26 = $file26['tmp_name'];
  695. $name26 = $id . "_" . $file26['name'];
  696. $target26 = $target . $name26;
  697. if (file_exists($target26)) {
  698. echo "File 26 already exists.<br />";
  699. }else {
  700. if (move_uploaded_file($tmp_name26, $target26)) {
  701. echo "File was uploaded successfully.<br />";
  702. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name26')";
  703. if (mysql_query($insert)) {
  704. echo "It was also uploaded into the database successfully.<br />";
  705. }else {
  706. echo "Problem's inserting it into database though.<br />";
  707. }
  708. }else {
  709. echo "There was a problem uploading this specific file.<br />";
  710. }
  711. }
  712. } else {
  713. echo "File26 does not exist.<br />";
  714. }
  715. echo "<hr />";
  716. echo "Status on File 27";
  717. echo "<br />";
  718. if (!empty($file27['name'])) {
  719. $tmp_name27 = $file27['tmp_name'];
  720. $name27 = $id . "_" . $file27['name'];
  721. $target27 = $target . $name27;
  722. if (file_exists($target27)) {
  723. echo "File 27 already exists.<br />";
  724. }else {
  725. if (move_uploaded_file($tmp_name27, $target27)) {
  726. echo "File was uploaded successfully.<br />";
  727. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name27')";
  728. if (mysql_query($insert)) {
  729. echo "It was also uploaded into the database successfully.<br />";
  730. }else {
  731. echo "Problem's inserting it into database though.<br />";
  732. }
  733. }else {
  734. echo "There was a problem uploading this specific file.<br />";
  735. }
  736. }
  737. } else {
  738. echo "File27 does not exist.<br />";
  739. }
  740. echo "<hr />";
  741. echo "Status on File 28";
  742. echo "<br />";
  743. if (!empty($file28['name'])) {
  744. $tmp_name28 = $file28['tmp_name'];
  745. $name28 = $id . "_" . $file28['name'];
  746. $target28 = $target . $name28;
  747. if (file_exists($target28)) {
  748. echo "File 28 already exists.<br />";
  749. }else {
  750. if (move_uploaded_file($tmp_name28, $target28)) {
  751. echo "File was uploaded successfully.<br />";
  752. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name28')";
  753. if (mysql_query($insert)) {
  754. echo "It was also uploaded into the database successfully.<br />";
  755. }else {
  756. echo "Problem's inserting it into database though.<br />";
  757. }
  758. }else {
  759. echo "There was a problem uploading this specific file.<br />";
  760. }
  761. }
  762. } else {
  763. echo "File28 does not exist.<br />";
  764. }
  765. echo "<hr />";
  766. echo "Status on File 29";
  767. echo "<br />";
  768. if (!empty($file29['name'])) {
  769. $tmp_name29 = $file29['tmp_name'];
  770. $name29 = $id . "_" . $file29['name'];
  771. $target29 = $target . $name29;
  772. if (file_exists($target29)) {
  773. echo "File 29 already exists.<br />";
  774. }else {
  775. if (move_uploaded_file($tmp_name29, $target29)) {
  776. echo "File was uploaded successfully.<br />";
  777. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name29')";
  778. if (mysql_query($insert)) {
  779. echo "It was also uploaded into the database successfully.<br />";
  780. }else {
  781. echo "Problem's inserting it into database though.<br />";
  782. }
  783. }else {
  784. echo "There was a problem uploading this specific file.<br />";
  785. }
  786. }
  787. } else {
  788. echo "File29 does not exist.<br />";
  789. }
  790. echo "<hr />";
  791. echo "Status on File 30";
  792. echo "<br />";
  793. if (!empty($file30['name'])) {
  794. $tmp_name30 = $file30['tmp_name'];
  795. $name30 = $id . "_" . $file30['name'];
  796. $target30 = $target . $name30;
  797. if (file_exists($target30)) {
  798. echo "File 30 already exists.<br />";
  799. }else {
  800. if (move_uploaded_file($tmp_name30, $target30)) {
  801. echo "File was uploaded successfully.<br />";
  802. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name30')";
  803. if (mysql_query($insert)) {
  804. echo "It was also uploaded into the database successfully.<br />";
  805. }else {
  806. echo "Problem's inserting it into database though.<br />";
  807. }
  808. }else {
  809. echo "There was a problem uploading this specific file.<br />";
  810. }
  811. }
  812. } else {
  813. echo "File30 does not exist.<br />";
  814. }
  815. echo "<hr />";
  816. echo "Status on File 31";
  817. echo "<br />";
  818. if (!empty($file31['name'])) {
  819. $tmp_name31 = $file31['tmp_name'];
  820. $name31 = $id . "_" . $file31['name'];
  821. $target31 = $target . $name31;
  822. if (file_exists($target31)) {
  823. echo "File 31 already exists.<br />";
  824. }else {
  825. if (move_uploaded_file($tmp_name31, $target31)) {
  826. echo "File was uploaded successfully.<br />";
  827. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name31')";
  828. if (mysql_query($insert)) {
  829. echo "It was also uploaded into the database successfully.<br />";
  830. }else {
  831. echo "Problem's inserting it into database though.<br />";
  832. }
  833. }else {
  834. echo "There was a problem uploading this specific file.<br />";
  835. }
  836. }
  837. } else {
  838. echo "File31 does not exist.<br />";
  839. }
  840. echo "<hr />";
  841. echo "Status on File 32";
  842. echo "<br />";
  843. if (!empty($file32['name'])) {
  844. $tmp_name32 = $file32['tmp_name'];
  845. $name32 = $id . "_" . $file32['name'];
  846. $target32 = $target . $name32;
  847. if (file_exists($target32)) {
  848. echo "File 32 already exists.<br />";
  849. }else {
  850. if (move_uploaded_file($tmp_name32, $target32)) {
  851. echo "File was uploaded successfully.<br />";
  852. $insert = "INSERT INTO images(propertynumber, filename) VALUES('$id', '$name32')";
  853. if (mysql_query($insert)) {
  854. echo "It was also uploaded into the database successfully.<br />";
  855. }else {
  856. echo "Problem's inserting it into database though.<br />";
  857. }
  858. }else {
  859. echo "There was a problem uploading this specific file.<br />";
  860. }
  861. }
  862. } else {
  863. echo "File32 does not exist.<br />";
  864. }
  865. ?>
  866. </div>
  867. </body>
  868. </html>
  869. <?php
  870. }else {
  871. header("Location: login.php");
  872. }
  873. ?>