1

Recently I'm working on a site. This one is based on raw php. and codes are working well on live site but when I'm taking a backup getting lots of error on every pages. I check database connection . Most of them are syntex error, How can I solve them ? or is there any method to fix them for entire site

This application based on raw php and developed by old developer

.portfolio-title-2 {
border-top: 1px solid #ddd;
padding: 20px;
height: 95px;
}
.hover-style1, .portfolio {
display: block;
position: relative;
border: 1px solid #ddd;
}
.portfolio-img {
position: relative;
height: 240px;
}
.square {
float:left;
position: relative;
width: 100%;
padding-bottom : 100%; / = width for a 1:1 aspect ratio / 
background-color:#1E1E1E;
overflow:hidden;
}

.content {
position:absolute;
height:90%; / = 100% - 2*5% padding /
width:100%; / = 100% - 2*5% padding /


}
.table{
display:table;
width:100%;
height:100%;
}
.table-cell{
display:table-cell;
vertical-align:middle;
}
/ For list /
ul{
text-align:left;
margin:5% 0 0;
padding:0;
list-style-position:inside;
}
li{
margin: 0 0 0 5%;
padding:0;
}


/ For responsive images /

.content .rs{
width:auto;
height:auto;
max-height:90%;
max-width:100%;
}
/ For responsive images as background /

.bg{
background-position:center center;
background-repeat:no-repeat;
background-size:cover; / you change this to "contain" if you don't want the images to be cropped /
color:#fff;
}
/*
.img1{
background-image: url('https://farm3.staticflickr.com/2827/10384422264_d9c7299146.jpg');
}
.img2{
background-image: url('https://farm7.staticflickr.com/6217/6216951796_e50778255c.jpg');
}
.img3{
background-image: url('https://farm4.staticflickr.com/3794/13893055574_3df0ab636b.jpg');
}
*/
/ following just for the demo /

p{
margin:0;
padding:0;
text-align:left;
}

.numbers{
font-weight:900;
font-size:100px;
}

#bottom {
clear:both;
margin:0 1.66%;
width:89.68%;
padding: 3.5%;
background-color:#1E1E1E;
color: #fff;
}
#bottom p{
text-align:center;
line-height:2em;
}
#bottom a{
color: #000;
text-decoration:none;
border:1px solid #000;
padding:10px 20px 12px;
line-height:70px;
background:#ccc;

-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

#bottom a:hover{
background:#ECECEC;
border:1px solid #fff;
}
<?php
$db1=new DB();
$wid=$_GET['tid'];
if($wid==5){
$sql="SELECT ws.MainImage,wi.LeaderID1,wi.LeaderID2,wi.ID,ws.ID,ws.TypeID,ws.epa, wi.WorkshopID, wi.Location, wi.StartDate, wi.EndDate, wi.Price, wi.listImage, wi.MaxPlaces, wi.PlacesSold, ws.Name, ws.ShortDesc, ws.SEOfriendly, ws.AbilityLevel

FROM ".$_TBL_WORKSHOPINSTANCE." as wi, ".$_TBL_WORKSHOP." as ws

WHERE (ws.TypeID=".$wid. " OR ws.epa='1') AND wi.WorkshopID = ws.ID
AND ws.CanDisplay = '1'
AND wi.Available = '1'
AND wi.StartDate > NOW() order by wi.StartDate asc";
}else{
$sql="SELECT ws.MainImage,wi.LeaderID1,wi.LeaderID2,wi.ID,ws.ID,ws.TypeID, wi.WorkshopID, wi.Location, wi.StartDate, wi.EndDate, wi.Price, wi.listImage, wi.MaxPlaces, wi.PlacesSold, ws.Name, ws.ShortDesc, ws.SEOfriendly, ws.AbilityLevel

FROM ".$_TBL_WORKSHOPINSTANCE." as wi, ".$_TBL_WORKSHOP." as ws

WHERE ws.TypeID=".$wid. " and wi.WorkshopID = ws.ID
AND ws.CanDisplay = '1'
AND wi.Available = '1'
AND wi.StartDate > NOW() order by wi.StartDate asc"; 
}
$db->query($sql);
?>
<!-- portfolio start -->
<div class="portfolio-area ptb-10">
<div class="container">

<div class="row">
<div class="grid">
<?php if($db->numRows()>0){
$ist=0;
while($row=$db->fetchArray()){


$leadFname=$db1->getSingleResult("select FirstName from ".$_TBL_LEADER." where ID=".$row['LeaderID1']);
$leadLname=$db1->getSingleResult("select LastName from ".$_TBL_LEADER." where ID=".$row['LeaderID1']);

$leadFname2=$db1->getSingleResult("select FirstName from ".$_TBL_LEADER." where ID=".$row['LeaderID2']);
$leadLname2=$db1->getSingleResult("select LastName from ".$_TBL_LEADER." where ID=".$row['LeaderID2']);



$date=@explode('-',$row['StartDate']);
$stamp=@mktime(0,0,0,$date[1],$date[2],$date[0]);
$insdate1=date('d-m-Y h:i',$stamp); 

if(!empty($row['EndDate']) and $row['EndDate']!='0000-00-00'){
$date1=@explode('-',$row['EndDate']);
$stamp1=@mktime(0,0,0,$date1[1],$date1[2],$date1[0]);
}


$slugurl=str_replace(' ','-',$row['Name']); 
$slugurl=str_replace("'",'',$slugurl);
$slugurl=str_replace("(",'-',$slugurl); 
$slugurl=str_replace(")",'-',$slugurl);
$slugurl=str_replace(",",'',$slugurl);
$slugurl=str_replace("&",'and',$slugurl); 
$slugurl=str_replace("/",'',$slugurl);
$slugurl=str_replace('"','',$slugurl); 
$Typename=$db1->getSingleResult("select Type from ".$_TBL_WORKSHOPTYPE." where ID=".$row['TypeID']); 

$slugurl2=str_replace(' ','-',$Typename); 
$slugurl2=str_replace("'",'',$slugurl2);
$slugurl2=str_replace("(",'-',$slugurl2); 
$slugurl2=str_replace(")",'-',$slugurl2);
$slugurl2=str_replace(",",'',$slugurl2);
$slugurl2=str_replace("&",'and',$slugurl2); 
$slugurl2=str_replace("/",'',$slugurl2);
$slugurl2=str_replace('"','',$slugurl2);

$placesLeft = ($row[MaxPlaces] - $row[PlacesSold]);
$placesLeft = ($row[MaxPlaces] - $row[PlacesSold]);
$percentageLeft = ($row[PlacesSold]/$row[MaxPlaces]);
$percentageLeft = ($percentageLeft*100);
$percentageLeft = (100-$percentageLeft);

if ($row[MaxPlaces] <= $row[PlacesSold])
{ 
$avl= '<p style="float: left; color: #f8092b;"><a href="'.$_SITE_PATH.'waitlist?abilityLevel='.$abilityLevel.'&workshopID=' .$row['wsID'] .'&instanceID=' .$row['wiID'].'">&nbsp;&nbsp;&nbsp;<b>Join Wait List</b></a></p>
<p style="float: right;color:red;"><b>Fully Booked</b>&nbsp;&nbsp;&nbsp;</p>'; 
//$avl= '<p style="color:red;text-align: center;"><i><b>Fully Booked</i></b></p>';
}
else
{
if ($placesLeft == 1)
{
$avl= '<p style="color:red;text-align: center;"><b>1 place left</b></p>';
}
else
if ($placesLeft == 2)
{
$avl= '<p style="color:red;text-align: center;"><b>2 places left</b></p>';
}
else
if ($placesLeft == 3)
{
$avl= '<p style="color:red;text-align: center;"> <b>3 places left</b></p>';
}
else
if ($percentageLeft < 50)
{ 

$avl= '<p style="color:red;text-align: center;">Last Places</p>'; 
} 
else
if ($workshop[PlacesSold]>0)
{ 
$avl= '<p style="color:green;text-align: center;">Now Booking</p>'; 
}
else
{
$avl= '<p style="color:green;text-align: center;">Now Booking</p>'; 
} 
}


if($ist==3){
echo '</div></div>
<div class="row">
<div class="grid">';
}
?>


<div class="col-md-4 col-sm-12 col-xs-12 grid-item mix3 mb-30"> 

<div class="portfolio hover-style1">
<div class="portfolio-img" id="portfolio-img">
<img src="<?php echo $_SITE_PATH;?>upload/workshops/workshopID<?php echo $row['ID'];?>/<?php echo $row['MainImage'];?>" alt="<?php echo $row['Name'];?>" />
<div class="portfolio-view">
<a href="<?php echo $_SITE_PATH;?>workshop/<?php echo $row['ID'];?>/<?php echo $slugurl2;?>/<?php echo $slugurl;?>.html" id="onclick_box"><?php echo date('d F, Y',$stamp);?><?php if(!empty($row['EndDate']) and $row['EndDate']!='0000-00-00'){?> - <?php echo date('d M, Y',$stamp1);?><?php } ?><br><?php echo $leadFname.' '.$leadLname;?><br /><?php echo $leadFname2.' '.$leadLname2;?><br /></a>
</div>
</div>
<div class="portfolio-title-2 text-center title-color-2">
<h3><a href="<?php echo $_SITE_PATH;?>workshop/<?php echo $row['ID'];?>/<?php echo $slugurl2;?>/<?php echo $slugurl;?>.html"><?php echo $row['Name'];?></a></h3> 
<div class="text-center" align="center"> <?=$avl?></div> 
</div>
</div>
</div>
<script>
$click_img = document.getElementById("portfolio-img");
if($click_img){
$click_img.onclick = function () {
document.getElementById('onclick_box').click();
}
}

</script>
<?php 

$ist=($ist+1);

} 

} 

?> 




</div>

</div>

</div>
</div>
<!-- portfolio start -->

Parse error: syntax error, unexpected end of file in E:\xampp\htdocs\dev\siteadmin\pages\dashboard.php on line 186

  • What is around E:\xampp\htdocs\dev\siteadmin\pages\dashboard.php on line 186? Also, why are you not using prepared statements? SQL injection for everyone! – Alex Barker Aug 29 '19 at 23:12

0 Answers0