Avatar billede djsteiner Nybegynder
09. oktober 2012 - 12:54 Der er 11 kommentarer og
1 løsning

Parse error

Hej jeg får denne fejbesked:

Parse error: parse error in C:\wamp\www\apartment-rental\cp\block_apartment.php on line 237


her har koden liner 237 er den aller sidste liner:

<?php
include("access.php");
if(isset($_POST['block'])){
    include("../includes/db.conn.php");
    include("../includes/conf.class.php");
    $bookingId = time();
    $sql = mysql_query("INSERT INTO bsi_bookings (booking_id,appmt_id,booking_time, checkin_date, checkout_date, client_id, is_block, payment_success, block_name) values(".$bookingId.",'".$bsiCore->ClearInput($_POST['choose'])."', NOW(),'".mysql_real_escape_string($_POST['checkin'])."', '".mysql_real_escape_string($_POST['checkout'])."', '0', 1, 1, '".mysql_real_escape_string($_POST['block_name'])."')");
    header("location:apartment-blocking.php");
    exit;
}
include("header.php");
if(isset($_POST['submit'])){
    include ('../includes/search.class.php');
    $bsisearch = new bsiSearch();
}
?>
<link rel="stylesheet" type="text/css" href="../css/datepicker.css" />
<link rel="stylesheet" type="text/css" href="../css/jquery.validate.css" />
<div id="container-inside">
<span style="font-size:16px; font-weight:bold">Apartment Blocking Search</span>
<hr />
  <table cellpadding="4" width="100%">
    <tr>
      <td width="25%" valign="top"><form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" id="form1">
          <table cellpadding="0"  cellspacing="7" border="0">
          <?php if($bsiCore->config['conf_rental_type']==1){ ?>
            <tr>
              <td>Check-in Date</td>
              <td><input id="txtFromDate" name="check_in" style="width:68px" type="text" readonly="readonly" AUTOCOMPLETE=OFF />
                <span style="padding-left:3px;"><a id="datepickerImage" href="java script:;"><img src="../images/month.png" height="16px" width="16px" style=" margin-bottom:-4px;" /></a></span></td>
            </tr>
            <tr>
              <td>Check-out Date</td>
              <td><input id="txtToDate" name="check_out" style="width:68px" type="text" readonly="readonly" AUTOCOMPLETE=OFF />
                <span style="padding-left:3px;"><a id="datepickerImage1" href="java script:;"><img src="../images/month.png" height="18px" width="18px" style=" margin-bottom:-4px;" /></a></span></td>
            </tr>
            <?php } elseif($bsiCore->config['conf_rental_type']==2){ ?>
            <tr>
              <td>Check-in Date</td>
              <td><input type="text" name="check_in" id="txtFromDate1" class="home-input" style="width:79px;" readonly="readonly" />
                <span style="padding-left:3px;"><a id="datepickerImage" href="java script:;"><img src="../images/month.png" height="16px" width="16px" style=" margin-bottom:-4px;" /></a></span></td>
            </tr>
            <tr>
              <td>Number of Week:</td>
              <td><select id="weeks" name="weeks" class="home-select">
                      <?php echo $bsiCore->generateWeekMonthddadmin();?>
                  </select>
              </td>
            </tr>
            <?php } elseif($bsiCore->config['conf_rental_type']==3){ ?>
            <tr>
              <td nowrap="nowrap">Check In Month</td>
              <td nowrap="nowrap"><input type="text" name="txtMonthIn" id="txtMonthIn" class="home-input" style="width:110px;" readonly="readonly" />
                <span style="padding-left:3px;"><a id="txtMonthIn1" href="java script:;"><img src="../images/month.png" height="16px" width="16px" style=" margin-bottom:-4px;" /></a></span></td>
            </tr>
            <tr>
              <td nowrap="nowrap">Number of Month</td>
              <td><select id="months" name="months" class="home-select">
                  <?php echo $bsiCore->generateWeekMonthddadmin();?>
                </select></td>
            </tr>
            <?php } ?>
            <tr>
              <td></td>
              <td><input type="submit" value="Search" name="submit" style="background:#e5f9bb; cursor:pointer; cursor:hand;"/></td>
            </tr>
          </table>
        </form></td>
      <td valign="top"><?php if(isset($_POST['submit'])){ echo '<script type="text/javascript" src="../js/apartmentvalidation.js"></script> '; ?>
        <form name="adminsearchresult" id="adminsearchresult" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
          <table cellpadding="4" cellspacing="2" border="0" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; border:#999 solid 1px;" width="450px">
          <input type="hidden" name="checkin" value="<?php echo $bsisearch->mysqlCheckInDate;?>"/>
          <input type="hidden" name="checkout" value="<?php echo $bsisearch->mysqlCheckOutDate;?>"/>
            <tr>
              <th align="left" colspan="2"><b>
                Search Result
                (
                <?php echo $bsisearch->checkInDate;?>
                to
                <?php echo $bsisearch->checkOutDate;?>
                ) =
                <?php echo $bsisearch->nightCount;?>
                Night(s)</b></th>
            </tr>
            <tr>
              <td align="left" >Name/Description</td>
              <td><input type="text" name="block_name" id="block_name" class="required" style="width:230px !important;"/><div id="showmsg"><label class="error" for="block_name" style="color:#F00; display:none;"><strong>Please enter Name/Description</strong></label></div></td>
            </tr>
            <tr><td colspan="2"><hr /></td></tr>
            <tr>
              <th align="left">Apartment Name</th>
              <th align="left">Availablity</th>
            </tr>
            <tr><td colspan="2"><hr /></td></tr>
            <?php
                $gotSearchResult = false;       
                $apartment_result = $bsisearch->getAvailableAppartment();
                if(intval($apartment_result['roomcnt']) > 0) {
                    $gotSearchResult = true;
                    //echo "<pre>";print_r($_SESSION['svars_details']);echo "</pre>";
                    foreach($_SESSION['svars_details'] as $key =>  $value){
                        $apartmentDetails = $bsiCore->getApartmentdetails($key);                               
                ?>
                    <tr>
                      <td><?php echo $apartmentDetails['appmt_name'];?></td>
                      <td><input type="radio" value="<?php echo $apartmentDetails['appmt_id'];?>" name="choose" class="required"/></td>
                    </tr>
                    <?php 
                        }               
                      } 
            if($gotSearchResult){
                echo '<tr>
                  <td><label class="error" for="choose" style="color:#F00; display:none;"><strong>Please Select Apartment.</strong></label></td>
                  <td><input type="submit" id="submitblock" value="Block" name="block" style="background:#e5f9bb; cursor:pointer; cursor:hand;"/></td>
                </tr>';
            }else{
                echo '<tr>
                  <td colspan="2" align="center" style="color:red;"><b>Sorry no Apartment available as your searching criteria.</b></td>
                </tr>';
            }
            ?>
          </table>
        </form>
        <? } ?></td>
    </tr>
  </table>
</div>
<script type="text/javascript" src="../js/jquery-ui.min.js"></script>
<?php if($bsiCore->config['conf_rental_type']==1){ ?>
<script type="text/javascript">
$(document).ready(function(){   
    $.datepicker.setDefaults({ dateFormat: '<?php echo $bsiCore->config['conf_dateformat'];?>' });   
        $( "#txtFromDate, #txtToDate" ).datepicker({
            minDate: 0,
            defaultDate: "+1w",
            changeMonth: true,
            numberOfMonths: 2,
            onSelect: function( selectedDate ) {
                if(this.id == 'txtFromDate'){
                  var dateMin = $('#txtFromDate').datepicker("getDate");
                  var rMin = new Date(dateMin.getFullYear(), dateMin.getMonth(),dateMin.getDate() + 1);
                  var rMax = new Date(dateMin.getFullYear(), dateMin.getMonth(),dateMin.getDate() + 365);
                  $('#txtToDate').datepicker("option","minDate",rMin);
                  $('#txtToDate').datepicker("option","maxDate",rMax);                   
                }
               
            }
        });

$("#datepickerImage").click(function() {
    $("#txtFromDate").datepicker("show");
  });
$("#datepickerImage1").click(function() {
    $("#txtToDate").datepicker("show");
  });
});
</script>
<?php } elseif($bsiCore->config['conf_rental_type']==2){ ?>
<script type="text/javascript">
$(function() {
    $.datepicker.setDefaults({ dateFormat: '<?php echo $bsiCore->config['conf_dateformat'];?>', minDate: new Date(), numberOfMonths: 2 });
        $("#txtFromDate1").datepicker(
       
        { beforeShowDay: function(day) {
            var day = day.getDay();
            if (day == <?php echo $bsiCore->config['conf_week_checkin_day'];?> ) {
                return [true, "somecssclass"]
            } else {
                return [false, "someothercssclass"]
            }
        }
        });
        $("#datepickerImage").click(function() {
    $("#txtFromDate1").datepicker("show");
  });
    });
</script>
<?php } elseif($bsiCore->config['conf_rental_type']==3){ ?>
<script type="text/javascript">
$(document).ready(function() {
    var currentTime = new Date()
       
    var minDate1 = new Date(currentTime.getFullYear(),currentTime.getMonth() +2, -1);
  $('#txtMonthIn').datepicker({
    changeMonth: true,
    changeYear: true,
    dateFormat: 'MM yy',
      showButtonPanel: true,
      minDate: minDate1,
     
    onClose: function() {
        var iMonth = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
        var iYear = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
        $(this).datepicker('setDate', new Date(iYear, iMonth, 1));
    },
     
    beforeShow: function() {
      if ((selDate = $(this).val()).length > 0)
      {
          iYear = selDate.substring(selDate.length - 4, selDate.length);
          iMonth = jQuery.inArray(selDate.substring(0, selDate.length - 5), $(this).datepicker('option', 'monthNames'));
          $(this).datepicker('option', 'defaultDate', new Date(iYear, iMonth, 1));
          $(this).datepicker('setDate', new Date(iYear, iMonth, 1));
      }
    }
  });
 
  $("#txtMonthIn1").click(function() {
    $("#txtMonthIn").datepicker("show");
  });
 
});
</script>
<style>
.ui-datepicker-calendar {
    display: none;
}
.ui-datepicker {
    width: 17em;
    padding: .2em .2em 0;
    display: none;
    font-size:14px;
}
</style>
<?php } ?>
<script type="text/javascript">
    $().ready(function() {
        $("#form1").validate();
        <?php if(isset($_POST['submit'])){
                  echo '$("#adminsearchresult").validate();';
              }
        ?>
    });   
</script>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<?php include("footer.php"); ?>
Avatar billede rix Praktikant
09. oktober 2012 - 13:01 #1
Hva jeg lige kunne finde ud af har du på linje 124 <? ....

du burde nok bruge <?php som du har gjort andre steder

prøv og se om det virker (her er koden hvor det er ændret ^^)


<?php
include("access.php");
if(isset($_POST['block'])){
    include("../includes/db.conn.php");
    include("../includes/conf.class.php");
    $bookingId = time();
    $sql = mysql_query("INSERT INTO bsi_bookings (booking_id,appmt_id,booking_time, checkin_date, checkout_date, client_id, is_block, payment_success, block_name) values(".$bookingId.",'".$bsiCore->ClearInput($_POST['choose'])."', NOW(),'".mysql_real_escape_string($_POST['checkin'])."', '".mysql_real_escape_string($_POST['checkout'])."', '0', 1, 1, '".mysql_real_escape_string($_POST['block_name'])."')");
    header("location:apartment-blocking.php");
    exit;
}
include("header.php");
if(isset($_POST['submit'])){
    include ('../includes/search.class.php');
    $bsisearch = new bsiSearch();
}
?>
<link rel="stylesheet" type="text/css" href="../css/datepicker.css" />
<link rel="stylesheet" type="text/css" href="../css/jquery.validate.css" />
<div id="container-inside">
<span style="font-size:16px; font-weight:bold">Apartment Blocking Search</span>
<hr />
  <table cellpadding="4" width="100%">
    <tr>
      <td width="25%" valign="top"><form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" id="form1">
          <table cellpadding="0"  cellspacing="7" border="0">
          <?php if($bsiCore->config['conf_rental_type']==1){ ?>
            <tr>
              <td>Check-in Date</td>
              <td><input id="txtFromDate" name="check_in" style="width:68px" type="text" readonly="readonly" AUTOCOMPLETE=OFF />
                <span style="padding-left:3px;"><a id="datepickerImage" href="java script:;"><img src="../images/month.png" height="16px" width="16px" style=" margin-bottom:-4px;" /></a></span></td>
            </tr>
            <tr>
              <td>Check-out Date</td>
              <td><input id="txtToDate" name="check_out" style="width:68px" type="text" readonly="readonly" AUTOCOMPLETE=OFF />
                <span style="padding-left:3px;"><a id="datepickerImage1" href="java script:;"><img src="../images/month.png" height="18px" width="18px" style=" margin-bottom:-4px;" /></a></span></td>
            </tr>
            <?php } elseif($bsiCore->config['conf_rental_type']==2){ ?>
            <tr>
              <td>Check-in Date</td>
              <td><input type="text" name="check_in" id="txtFromDate1" class="home-input" style="width:79px;" readonly="readonly" />
                <span style="padding-left:3px;"><a id="datepickerImage" href="java script:;"><img src="../images/month.png" height="16px" width="16px" style=" margin-bottom:-4px;" /></a></span></td>
            </tr>
            <tr>
              <td>Number of Week:</td>
              <td><select id="weeks" name="weeks" class="home-select">
                      <?php echo $bsiCore->generateWeekMonthddadmin();?>
                  </select>
              </td>
            </tr>
            <?php } elseif($bsiCore->config['conf_rental_type']==3){ ?>
            <tr>
              <td nowrap="nowrap">Check In Month</td>
              <td nowrap="nowrap"><input type="text" name="txtMonthIn" id="txtMonthIn" class="home-input" style="width:110px;" readonly="readonly" />
                <span style="padding-left:3px;"><a id="txtMonthIn1" href="java script:;"><img src="../images/month.png" height="16px" width="16px" style=" margin-bottom:-4px;" /></a></span></td>
            </tr>
            <tr>
              <td nowrap="nowrap">Number of Month</td>
              <td><select id="months" name="months" class="home-select">
                  <?php echo $bsiCore->generateWeekMonthddadmin();?>
                </select></td>
            </tr>
            <?php } ?>
            <tr>
              <td></td>
              <td><input type="submit" value="Search" name="submit" style="background:#e5f9bb; cursor:pointer; cursor:hand;"/></td>
            </tr>
          </table>
        </form></td>
      <td valign="top"><?php if(isset($_POST['submit'])){ echo '<script type="text/javascript" src="../js/apartmentvalidation.js"></script> '; ?>
        <form name="adminsearchresult" id="adminsearchresult" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
          <table cellpadding="4" cellspacing="2" border="0" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; border:#999 solid 1px;" width="450px">
          <input type="hidden" name="checkin" value="<?php echo $bsisearch->mysqlCheckInDate;?>"/>
          <input type="hidden" name="checkout" value="<?php echo $bsisearch->mysqlCheckOutDate;?>"/>
            <tr>
              <th align="left" colspan="2"><b>
                Search Result
                (
                <?php echo $bsisearch->checkInDate;?>
                to
                <?php echo $bsisearch->checkOutDate;?>
                ) =
                <?php echo $bsisearch->nightCount;?>
                Night(s)</b></th>
            </tr>
            <tr>
              <td align="left" >Name/Description</td>
              <td><input type="text" name="block_name" id="block_name" class="required" style="width:230px !important;"/><div id="showmsg"><label class="error" for="block_name" style="color:#F00; display:none;"><strong>Please enter Name/Description</strong></label></div></td>
            </tr>
            <tr><td colspan="2"><hr /></td></tr>
            <tr>
              <th align="left">Apartment Name</th>
              <th align="left">Availablity</th>
            </tr>
            <tr><td colspan="2"><hr /></td></tr>
            <?php
                $gotSearchResult = false;     
                $apartment_result = $bsisearch->getAvailableAppartment();
                if(intval($apartment_result['roomcnt']) > 0) {
                    $gotSearchResult = true;
                    //echo "<pre>";print_r($_SESSION['svars_details']);echo "</pre>";
                    foreach($_SESSION['svars_details'] as $key =>  $value){
                        $apartmentDetails = $bsiCore->getApartmentdetails($key);                             
                ?>
                    <tr>
                      <td><?php echo $apartmentDetails['appmt_name'];?></td>
                      <td><input type="radio" value="<?php echo $apartmentDetails['appmt_id'];?>" name="choose" class="required"/></td>
                    </tr>
                    <?php
                        }             
                      }
            if($gotSearchResult){
                echo '<tr>
                  <td><label class="error" for="choose" style="color:#F00; display:none;"><strong>Please Select Apartment.</strong></label></td>
                  <td><input type="submit" id="submitblock" value="Block" name="block" style="background:#e5f9bb; cursor:pointer; cursor:hand;"/></td>
                </tr>';
            }else{
                echo '<tr>
                  <td colspan="2" align="center" style="color:red;"><b>Sorry no Apartment available as your searching criteria.</b></td>
                </tr>';
            }
            ?>
          </table>
        </form>
        <?php } ?></td>
    </tr>
  </table>
</div>
<script type="text/javascript" src="../js/jquery-ui.min.js"></script>
<?php if($bsiCore->config['conf_rental_type']==1){ ?>
<script type="text/javascript">
$(document).ready(function(){ 
    $.datepicker.setDefaults({ dateFormat: '<?php echo $bsiCore->config['conf_dateformat'];?>' }); 
        $( "#txtFromDate, #txtToDate" ).datepicker({
            minDate: 0,
            defaultDate: "+1w",
            changeMonth: true,
            numberOfMonths: 2,
            onSelect: function( selectedDate ) {
                if(this.id == 'txtFromDate'){
                  var dateMin = $('#txtFromDate').datepicker("getDate");
                  var rMin = new Date(dateMin.getFullYear(), dateMin.getMonth(),dateMin.getDate() + 1);
                  var rMax = new Date(dateMin.getFullYear(), dateMin.getMonth(),dateMin.getDate() + 365);
                  $('#txtToDate').datepicker("option","minDate",rMin);
                  $('#txtToDate').datepicker("option","maxDate",rMax);                 
                }
             
            }
        });

$("#datepickerImage").click(function() {
    $("#txtFromDate").datepicker("show");
  });
$("#datepickerImage1").click(function() {
    $("#txtToDate").datepicker("show");
  });
});
</script>
<?php } elseif($bsiCore->config['conf_rental_type']==2){ ?>
<script type="text/javascript">
$(function() {
    $.datepicker.setDefaults({ dateFormat: '<?php echo $bsiCore->config['conf_dateformat'];?>', minDate: new Date(), numberOfMonths: 2 });
        $("#txtFromDate1").datepicker(
     
        { beforeShowDay: function(day) {
            var day = day.getDay();
            if (day == <?php echo $bsiCore->config['conf_week_checkin_day'];?> ) {
                return [true, "somecssclass"]
            } else {
                return [false, "someothercssclass"]
            }
        }
        });
        $("#datepickerImage").click(function() {
    $("#txtFromDate1").datepicker("show");
  });
    });
</script>
<?php } elseif($bsiCore->config['conf_rental_type']==3){ ?>
<script type="text/javascript">
$(document).ready(function() {
    var currentTime = new Date()
     
    var minDate1 = new Date(currentTime.getFullYear(),currentTime.getMonth() +2, -1);
  $('#txtMonthIn').datepicker({
    changeMonth: true,
    changeYear: true,
    dateFormat: 'MM yy',
      showButtonPanel: true,
      minDate: minDate1,
   
    onClose: function() {
        var iMonth = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
        var iYear = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
        $(this).datepicker('setDate', new Date(iYear, iMonth, 1));
    },
   
    beforeShow: function() {
      if ((selDate = $(this).val()).length > 0)
      {
          iYear = selDate.substring(selDate.length - 4, selDate.length);
          iMonth = jQuery.inArray(selDate.substring(0, selDate.length - 5), $(this).datepicker('option', 'monthNames'));
          $(this).datepicker('option', 'defaultDate', new Date(iYear, iMonth, 1));
          $(this).datepicker('setDate', new Date(iYear, iMonth, 1));
      }
    }
  });

  $("#txtMonthIn1").click(function() {
    $("#txtMonthIn").datepicker("show");
  });

});
</script>
<style>
.ui-datepicker-calendar {
    display: none;
}
.ui-datepicker {
    width: 17em;
    padding: .2em .2em 0;
    display: none;
    font-size:14px;
}
</style>
<?php } ?>
<script type="text/javascript">
    $().ready(function() {
        $("#form1").validate();
        <?php if(isset($_POST['submit'])){
                  echo '$("#adminsearchresult").validate();';
              }
        ?>
    }); 
</script>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<?php include("footer.php"); ?>
Avatar billede djsteiner Nybegynder
09. oktober 2012 - 14:24 #2
Hej

Tak for hurtigt svar!

Nu kommer denne fejlbesked:

You don't have permission to access /apartment-rental/cp/java script:; on this server.
Avatar billede rix Praktikant
09. oktober 2012 - 14:35 #3
hmm sådan en fejl medelse har jeg aldrig set før....

Hmmmmm
har du en fil som ligger der eller ??
Avatar billede djsteiner Nybegynder
09. oktober 2012 - 14:55 #4
Ja der ligger java filer i den mappe:

C:\wamp\www\apartment-rental\cp\js


Kan det værre noget min server at gøre?
Avatar billede olebole Juniormester
09. oktober 2012 - 15:20 #5
<ole>

Ja, mon ikke, det er Apache, der smider den fejl? Den har næppe noget med PHP at gøre. Der er øjensynligt nogle problemer med rettighederne på mappen

/mvh
</bole>
Avatar billede djsteiner Nybegynder
09. oktober 2012 - 15:28 #6
Kan det være nogle moduler i server der ikke er installeret?

eller i Apache Configuration filen man skal ændre nogle rettighederr?

rettigheder til stien til mapppen?
Avatar billede olebole Juniormester
09. oktober 2012 - 15:40 #7
Den slags er sat korrekt i en WAMP-installation, så det må være noget, du selv har rykket i. Hvad det præcist er, ved jeg ikke
Avatar billede djsteiner Nybegynder
15. oktober 2012 - 19:00 #8
Hej jeg fik det til at virke da jeg opdaterede min wamp server.
Avatar billede djsteiner Nybegynder
15. oktober 2012 - 19:00 #9
Lukke tid men hvem skal have point?
Avatar billede olebole Juniormester
15. oktober 2012 - 19:58 #10
Jeg samler ikke på point, men tak for tilbudet. Du kan jo spørge rix17172 - og ellers lægger du bare selv et svar og accepterer det, så tråden lukkes  =)
Avatar billede djsteiner Nybegynder
16. oktober 2012 - 13:11 #11
rix17172  vil du have point?
Avatar billede djsteiner Nybegynder
23. oktober 2012 - 12:12 #12
Lukke tid! :)

Tak mange gange til alle
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester