Skip to content
This repository was archived by the owner on Nov 17, 2017. It is now read-only.

Commit

Permalink
img
Browse files Browse the repository at this point in the history
  • Loading branch information
tedgavr committed Nov 4, 2017
1 parent e90c185 commit 8243424
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Buisness/Ad.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ function __toString(){
<tr class = 'tr_ad5'><th class = 'td_ad5'>Price:</th ><th class = 'td_ad5' colspan = '3'>$this->ad_price</th></tr>
<tr class = 'tr_ad5'><th class = 'td_ad5'>Registration Date:</th><th class = 'td_ad5' colspan = '3'>$this->ad_reg_date</th></tr>
<tr class = 'tr_ad5'><th class = 'td_ad5'>Expiration Date:</th><th class = 'td_ad5' colspan = '3'>$this->ad_exp_date</th></tr>
<tr class = 'tr_ad5'><th class = 'td_ad5'>Description:</th><th class = 'td_ad5'colspan='3'> $this->ad_description </th> </tr>;
<tr class = 'tr_ad5'><th class = 'td_ad7' colspan='3'><div class='pAds'>
<img src ='images/".$row['ImagePath']."' >;
<tr class = 'tr_ad5'><th class = 'td_ad5'>Description:</th><th class = 'td_ad5'colspan='3'> $this->ad_description </th> </tr>
<tr class = 'tr_ad5'><th class = 'td_ad7' colspan='3'><div class='ad_image'>
<img src ='images/".$row['ImagePath']."' >
</div></th></tr>";
return $res;
Expand Down
3 changes: 1 addition & 2 deletions css/Ad.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ width:250;
.ad_image {
height: 100%;
width: 100%;
// position: center;
float: center;
// display: inline-block;
display: inline-block;
margin-left: 2%;
background-color: white;
}
33 changes: 31 additions & 2 deletions fileUpload.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
<head>
<link rel="stylesheet" type="text/css" href="css/Ad.css">
<link rel="stylesheet" type="text/css" href="css/index.css">
</head>

<?php // -----------------find////////////////////
require_once 'Buisness/dbconfig.php';
require_once 'Buisness/Ad.cls.php';
require_once 'Buisness/Subcategory.cls.php';
require_once 'Buisness/Images.cls.php';

// https://www.youtube.com/watch?v=Ipa9xAs_nTg

Expand Down Expand Up @@ -33,16 +42,18 @@
<body>
<div id = "content">
<?php
if (isset($_POST['display'])) {
// connect to the database
$db = mysqli_connect("localhost","root","","mydb");
$sql = "Select * from Images";
$result = mysqli_query($db, $sql);
while ($row = mysqli_fetch_array($result)){
echo "<div id='img_div'>";
echo "<img src ='images/".$row['ImagePath']."' >"; // echo "img src ='images/".$row['ImagePath']."' >";
echo "<img src ='images/".$row['ImagePath']."' >";
echo "<p>".$row['fk_ad_id']."</p>";
echo "</div>";
}
}
?>
<form method = 'post' action = 'fileUpload.php' enctype = 'multipart/form-data'>
<input type = "hidden" name = "size" value = "100000">
Expand All @@ -57,5 +68,23 @@
</div>
</form>
</div>

<form method = 'post' action = '#' enctype = 'multipart/form-data'>
<table class='tb_al1'> <tr><td class ='td_ai1' colspan = '2' > Display add images: </td></tr>
<tr><td>Image id : </td><td>
<?php
$image = new Images();
echo "<select name = 'cboImageId'>";
foreach ($image->getPk_image_id($connectionId) as $element) {
echo "<option value= '" . $element . "'>$element</option>";
}
echo "</select>";
?>
</td></tr></table>
<div>
<input type = "submit" name = "display" value = "Display file">
</div>
</form>
</div>
</body>
</html>

0 comments on commit 8243424

Please sign in to comment.