Help Needed In Weeding Out Errors In PHP

Hello, I’m unable to find out a solution to some ‘Undefined index Notice’ & ‘Undefined Variable’ errors in some of the pages of my website. I did solve many of them by using ‘isset’ function as advised on various sites on internet, but just couldn’t get around on two instances and being an absolute noob in all the web programming languages didn’t help the matter. I’m including the code of both the pages,the page I’m executing & the page the Unindexed errors are pointed to.

The following is the code of the file to which the errors are being pointed to, I’ve highlighted the error lines in ‘bold’ letters & made a comment on the line itself on what error I’m getting.

<?php
 
 class bsiSearch
 {
 public $checkInDate = '';
 public $checkOutDate = ''; 
 public $mysqlCheckInDate = '';
 public $mysqlCheckOutDate = '';
 public $currency = '';
 public $guestsPerRoom = 0;
 public $childPerRoom = 0;
 public $extrabedPerRoom = false;
 public $nightCount = 0;
 public $fullDateRange;
 public $roomType = array(); 
 public $multiCapacity = array();
 public $searchCode = "SUCCESS";
 const SEARCH_CODE = "SUCCESS";
 function bsiSearch() { 
 $this->setRequestParams();
 $this->getNightCount();
 $this->checkSearchEngine(); 
 if($this->searchCode == self::SEARCH_CODE){
 $this->loadMultiCapacity(); 
 $this->loadRoomTypes();
 $this->fullDateRange = $this->getDateRangeArray($this->mysqlCheckInDate, $this->mysqlCheckOutDate);
 $this->setMySessionVars();
 } 
 }
 private function setRequestParams() { 
 global $bsiCore;
 $tmpVar = isset($_POST['check_in'])? $_POST['check_in'] : $_SESSION['sv_checkindate'];
 $this->setMyParamValue($this->checkInDate, $bsiCore->ClearInput($tmpVar), NULL, true);
 $tmpVar = isset($_POST['check_out'])? $_POST['check_out'] : $_SESSION['sv_checkoutdate'];
 $this->setMyParamValue($this->checkOutDate, $bsiCore->ClearInput($tmpVar), NULL, true);
 $tmpVar = isset($_POST['capacity'])? $_POST['capacity'] : $_SESSION['sv_guestperroom'];
 $this->setMyParamValue($this->guestsPerRoom, $bsiCore->ClearInput($tmpVar), 0, true);
 
 $tmpVar = isset($_POST['child_per_room'])? $_POST['child_per_room'] : $_SESSION['sv_childcount'] ;
 $this->setMyParamValue($this->childPerRoom, $bsiCore->ClearInput($tmpVar), 0, true);
 
 $tmpVar = isset($_REQUEST['currency'])? $_REQUEST['currency'] : $_SESSION['sv_currency'] ;
 $this->setMyParamValue($this->currency, $bsiCore->ClearInput($tmpVar), 0, true);
  
 $this->mysqlCheckInDate = $bsiCore->getMySqlDate($this->checkInDate); 
 $this->mysqlCheckOutDate = $bsiCore->getMySqlDate($this->checkOutDate); 
 }
 
 private function setMyParamValue(&$membervariable, $paramvalue, $defaultvalue, $required = false){
 if($required){if(!isset($paramvalue)){$this->invalidRequest();}}
 if(isset($paramvalue)){ $membervariable = $paramvalue;}else{$membervariable = $defaultvalue;}
 }
 private function setMySessionVars(){
 if(isset($_SESSION['sv_checkindate'])) unset($_SESSION['sv_checkindate']);
 if(isset($_SESSION['sv_checkoutdate'])) unset($_SESSION['sv_checkoutdate']);
 if(isset($_SESSION['sv_mcheckindate'])) unset($_SESSION['sv_mcheckindate']);
 if(isset($_SESSION['sv_mcheckoutdate'])) unset($_SESSION['sv_mcheckoutdate']);
 if(isset($_SESSION['sv_nightcount'])) unset($_SESSION['sv_nightcount']);
 if(isset($_SESSION['sv_guestperroom'])) unset($_SESSION['sv_guestperroom']);
 if(isset($_SESSION['sv_childcount'])) unset($_SESSION['sv_childcount']);
 if(isset($_SESSION['sv_currency'])) unset($_SESSION['sv_currency']);
 
 $_SESSION['sv_checkindate'] = $this->checkInDate;
 $_SESSION['sv_checkoutdate'] = $this->checkOutDate;
 $_SESSION['sv_mcheckindate'] = $this->mysqlCheckInDate;
 $_SESSION['sv_mcheckoutdate'] = $this->mysqlCheckOutDate;
 $_SESSION['sv_nightcount'] = $this->nightCount; 
 $_SESSION['sv_guestperroom'] = $this->guestsPerRoom; 
 $_SESSION['sv_childcount'] = $this->childPerRoom; 
 $_SESSION['sv_currency'] = $this->currency; 
 $_SESSION['svars_details'] = array();
 }
 
 private function invalidRequest(){
 header('Location: booking-failure.php?error_code=9');
 die;
 }
 private function getNightCount() { 
 $checkin_date = getdate(strtotime($this->mysqlCheckInDate));
 $checkout_date = getdate(strtotime($this->mysqlCheckOutDate));
 $checkin_date_new = mktime( 12, 0, 0, $checkin_date['mon'], $checkin_date['mday'], $checkin_date['year']);
 $checkout_date_new = mktime( 12, 0, 0, $checkout_date['mon'], $checkout_date['mday'], $checkout_date['year']);
 $this->nightCount = round(abs($checkin_date_new - $checkout_date_new) / 86400);
 }
 private function getDateRangeArray($startDate, $endDate, $nightAdjustment = true) { 
 $date_arr = array();
 $day_array=array();
 $total_array=array();
 $time_from = mktime(1,0,0,substr($startDate,5,2), substr($startDate,8,2),substr($startDate,0,4));
 $time_to = mktime(1,0,0,substr($endDate,5,2), substr($endDate,8,2),substr($endDate,0,4)); 
 if ($time_to >= $time_from) {
 if($nightAdjustment){
  while ($time_from < $time_to) { 
  array_push($date_arr, date('Y-m-d',$time_from));
  array_push($day_array, date('D',$time_from));
  $time_from+= 86400; // add 24 hours
  }
 }else{
  while($time_from <= $time_to) { 
  array_push($date_arr, date('Y-m-d',$time_from));
  array_push($day_array, $time_from);
  $time_from+= 86400; // add 24 hours
  }
 } 
 } 
 array_push($total_array, $date_arr);
 array_push($total_array, $day_array);
 return $total_array; 
 }
 private function checkSearchEngine(){
 global $bsiCore;
 if(intval($bsiCore->config['conf_booking_turn_off']) > 0){
 $this->searchCode = "SEARCH_ENGINE_TURN_OFF";
 return 0;
 }
 $diffrow = mysql_fetch_assoc(mysql_query("SELECT DATEDIFF('".$this->mysqlCheckOutDate."', '".$this->mysqlCheckInDate."') AS INOUTDIFF"));
 $dateDiff = intval($diffrow['INOUTDIFF']);
 if($dateDiff < 0){
 $this->searchCode = "OUT_BEFORE_IN";
 return 0;
 }else if($dateDiff < intval($bsiCore->config['conf_min_night_booking'])){
 $this->searchCode = "NOT_MINNIMUM_NIGHT";
 return 0;
 }
 $userInputDate = strtotime($this->mysqlCheckInDate);
 $hotelDateTime = strtotime(date("Y-m-d"));
 $timezonediff = ($userInputDate - $hotelDateTime);
 if($timezonediff < 0){
 $this->searchCode = "TIME_ZONE_MISMATCH";
 return 0;
 } 
 }
 private function loadRoomTypes() { 
 $sql = mysql_query("SELECT * FROM bsi_roomtype");
 while($currentrow = mysql_fetch_assoc($sql)){
 $rtimg = isset($_POST['rtimg']) ? $_POST['rtimg'] : '';
 array_push($this->roomType, array('rtid'=>$currentrow["roomtype_ID"], 'rtname'=>$currentrow["type_name"])); 
 }
 mysql_free_result($sql);
 } 
 private function loadMultiCapacity() { 
 $sql = mysql_query("SELECT * FROM bsi_capacity WHERE capacity >= ".$this->guestsPerRoom);
 while($currentrow = mysql_fetch_assoc($sql)){ 
 $this->multiCapacity[$currentrow["id"]] = array('capval'=>$currentrow["capacity"],'captitle'=>$currentrow["title"]);
 
 } 
 mysql_free_result($sql);
 }
 
 public function getAvailableRooms($roomTypeId, $roomTypeName, $capcityid){
 global $bsiCore;
 [b]$currency_symbol = $bsiCore->config['conf_currency_symbol']; //UNDEFINED INDEX: conf_currency_symbol Error// [/b] 
 $searchresult = array('roomtypeid'=>$roomTypeId, 'roomtypename'=>$roomTypeName, 'capacityid'=>$capcityid, 'capacitytitle'=>$this->multiCapacity[$capcityid]['captitle'], 'capacity'=>$this->multiCapacity[$capcityid]['capval'], 'maxchild'=>$this->childPerRoom);
 $room_count = 0;
 $dropdown_html = '<option value="0" selected="selected">0</option>';
 $price_details_html = '';
 $total_price_amount = 0;
 $calculated_extraprice = 0;
 $total_specail_price=0;
 $specail_price_flag=0;
 $extraSearchParam = "";
 $minimum_night_flg=1;
 $variable_concat=1;
 $searchsql = "SELECT rm.room_ID, rm.room_no
 FROM bsi_room rm
 WHERE rm.roomtype_id = ".$roomTypeId."
 AND rm.capacity_id = ".$capcityid."".$extraSearchParam."
 AND rm.room_id NOT IN
  (SELECT resv.room_id
  FROM bsi_reservation resv, bsi_bookings boks
  WHERE boks.is_deleted = FALSE
  AND resv.bookings_id = boks.booking_id
  AND resv.room_type_id = ".$roomTypeId."
  AND (('".$this->mysqlCheckInDate."' BETWEEN boks.start_date AND DATE_SUB(boks.end_date, INTERVAL 1 DAY))
  OR (DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY) BETWEEN boks.start_date AND DATE_SUB(boks.end_date, INTERVAL 1 DAY)) OR (boks.start_date BETWEEN '".$this->mysqlCheckInDate."' AND DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY))  OR (DATE_SUB(boks.end_date, INTERVAL 1 DAY) BETWEEN '".$this->mysqlCheckInDate."' AND DATE_SUB('".$this->mysqlCheckOutDate."', INTERVAL 1 DAY))))";
  
 $sql = mysql_query($searchsql);
 $tmpctr = 1;
 $searchresult['availablerooms'] = array();
 while($currentrow = mysql_fetch_assoc($sql)){ 
 $dropdown_html.= '<option value="'.$tmpctr.'">'.$tmpctr.'</option>';
 array_push($searchresult['availablerooms'], array('roomid'=>$currentrow["room_ID"], 'roomno'=>$currentrow["room_no"]));
 $tmpctr++;
 }
 
 mysql_free_result($sql);
 if($tmpctr >= 1){
 $totalDays = $this->getDateRangeArray($this->mysqlCheckInDate, $this->mysqlCheckOutDate); 
 $totalamt3=0;
 
 
 $dayName=array_count_values($totalDays[1]);
 $_month = date('M',strtotime($this->mysqlCheckInDate));
 $month_ = date('M',strtotime($this->mysqlCheckOutDate));
 $_color = '#f2f2f2';
 $color_ = '#f2f2f2';
 if($_month == $month_){
  $mon = $_month;
 }else{
  $mon = $_month.' - '.$month_;
 }
 $price_details_html='<tr><td bgcolor='.$_color.'><b>'.MONTH.'</b></td>';
 foreach($dayName as $days => $totalnum){
  
  $$days=0;
  $h1=$days.$variable_concat;
  $$h1=0;
 }
 $total_child_price=0;
 $total_child_price2=0;
 $price_details_html.='<td bgcolor='.$color_.' align="right"><b>'.$this->nightCount.' Night(s)</b></td></tr>';
 foreach($totalDays[0] as $date2 => $val){  
  $pricesql = mysql_query("SELECT * FROM bsi_priceplan WHERE roomtype_id = ".$roomTypeId." AND capacity_id = ".$capcityid." AND ('".$val."' BETWEEN start_date AND end_date)");
  if(mysql_num_rows($pricesql)){
  $row=mysql_fetch_assoc($pricesql);
  }else{
  $pricesql2 = mysql_query("SELECT * FROM bsi_priceplan WHERE roomtype_id = ".$roomTypeId." AND capacity_id = ".$capcityid." AND default_plan=1");
  $row=mysql_fetch_assoc($pricesql2);
  }
  
  
  
  $day=date('D',strtotime($val));
  $$day+=$row[strtolower($day)];
  //*************************** specail offer ******************
  $sql_sp=mysql_query("select * from bsi_special_offer where '".$val."' between `start_date` and `end_date` and (room_type=".$roomTypeId ." or room_type=0)");
  $row99=mysql_fetch_assoc($sql_sp);
  
  $h2=$day.$variable_concat;
  if(mysql_num_rows($sql_sp)){  
  $c999=round($row[strtolower($day)]- (($row[strtolower($day)]*$row99['price_deduc'])/100),1);
  $$h2+=$c999;
  if($row99['min_stay'] <= $minimum_night_flg){ $specail_price_flag=1; }  
  $minimum_night_flg++;  
  }else{
  $$h2+=$row[strtolower($day)];
  }
  
  //echo $$day.'/'.$$h2.' ';
  //*************************** specail offer ******************
  $chld_row2=mysql_fetch_assoc(mysql_query("SELECT distinct(`no_of_child`) FROM `bsi_room` WHERE `capacity_id`=".$capcityid." and `roomtype_id`=".$roomTypeId.""));
  if($chld_row2['no_of_child'] >= $this->childPerRoom && $this->childPerRoom != 0){
  $child_flag=true;
  $childpricesql = mysql_query("SELECT * FROM bsi_priceplan WHERE roomtype_id = ".$roomTypeId." AND capacity_id =1001 AND ('".$val."' BETWEEN start_date AND end_date)");
  if(mysql_num_rows($pricesql)){
  $chrow=mysql_fetch_assoc($childpricesql);
  }else{
  $childpricesql2 = mysql_query("SELECT * FROM bsi_priceplan WHERE roomtype_id = ".$roomTypeId." AND capacity_id =1001 AND default_plan=1");
  $chrow=mysql_fetch_assoc($childpricesql2);
  }
  
  $day=date('D',strtotime($val));  
  $$day+=($chrow[strtolower($day)]*$this->childPerRoom); 
  //*************************** specail offer ******************
  $sql_sp1=mysql_query("select * from bsi_special_offer where '".$val."' between `start_date` and `end_date` and (room_type=".$roomTypeId ." or room_type=0)");
  
  
  //$h22=$day.$variable_concat;
  if(mysql_num_rows($sql_sp1)){ 
  $row999=mysql_fetch_assoc($sql_sp1);  
   $c999=round(($chrow[strtolower($day)]*$this->childPerRoom)- ((($chrow[strtolower($day)]*$this->childPerRoom)*$row999['price_deduc'])/100),1);
   //echo $c999;
   $$h2+=$c999;
   $total_child_price2+=$c999;
   
  }else{
   
   $$h2+=($chrow[strtolower($day)]*$this->childPerRoom);
   $total_child_price2+=($chrow[strtolower($day)]*$this->childPerRoom);
  }
  
  //echo $$day.'/'.$$h2.' ';
  //*************************** specail offer ****************** 
  $total_child_price+=($chrow[strtolower($day)]*$this->childPerRoom);
  
  
  
  }
 }
 $night_count_at_customprice = 0; 
 $searchresult['prices'] = array(); 
 
  
  foreach($dayName as $days => $totalnum){  
  $totalamt3=$totalamt3+$$days; 
  $h3=$days.$variable_concat;
  $total_specail_price=$total_specail_price+$$h3;
  }
 
 $total_price_amount=$totalamt3;
 // echo $total_specail_price;
 if($bsiCore->config['conf_tax_amount'] > 0 && $bsiCore->config['conf_price_with_tax']==1){
 $total_price_amount=$total_price_amount+(($total_price_amount * $bsiCore->config['conf_tax_amount'])/100);
 $total_specail_price=$total_specail_price+(($total_specail_price * $bsiCore->config['conf_tax_amount'])/100);
 $total_child_price=$total_child_price+(($total_child_price * $bsiCore->config['conf_tax_amount'])/100);
 $total_child_price2=$total_child_price2+(($total_child_price2 * $bsiCore->config['conf_tax_amount'])/100);
 }
 
 }
 if($specail_price_flag){
 $searchresult['roomprice'] = $total_specail_price; 
 }else{
 $searchresult['roomprice'] = $total_price_amount; 
 }
 if($tmpctr > 1) array_push($_SESSION['svars_details'], $searchresult);
 unset($searchresult);
 
 return array(
 'roomcnt' => $tmpctr-1, 
 'roomdropdown' => $dropdown_html,
 'pricedetails' => $price_details_html, 
 [b]'child_flag'=>$child_flag, //UNDEFINED VARIABLE CHILD_FLAG//[/b]
 'specail_price_flag'=>$specail_price_flag,
 'total_specail_price'=>$total_specail_price,
 'total_child_price'=>$total_child_price,
 'total_child_price2'=>$total_child_price2,
 'totalprice' => $total_price_amount);
 }
 }
 ?>

And here is the code(or php file) I’m executing upon which I’m getting erros that I’ve mentioned above.

    <?php
    session_start();
    include("includes/db.conn.php");
    include("includes/conf.class.php");
    include("includes/search.class.php");
    include("language.php");
    $bsisearch = new bsiSearch();
    $bsiCore->clearExpiredBookings();
    $HTTP_REFERER = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
    $pos2 = strpos($_SERVER['HTTP_REFERER'],$_SERVER['SERVER_NAME']);
    if($bsisearch->nightCount==0 and !$pos2){
            header('Location: booking-failure.php?error_code=9');
    }
    ?>
    <!doctype html>
    <html>
        <head>
            <meta charset="utf-8">
            <title><?php echo $bsiCore->config['conf_hotel_name']; ?></title>
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <link rel="stylesheet" href="css/bootstrap.css" type="text/css" media="screen"/>
            <link rel="stylesheet" href="css/bootstrap-responsive.css" type="text/css" media="screen"/>
            <link rel="stylesheet" href="css/datepicker.css" type="text/css" media="screen"/>
     
            <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/>
     
            <link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" />
            <link rel="stylesheet" href="css/colorbox.css" />
            <link rel="stylesheet" href="css/flexslider.css" type="text/css" media="screen" />
     
            <script type="text/javascript" src="js/jquery.min.js"></script>
            <script type="text/javascript" src="js/bootstrap.min.js"></script>
            <script type="text/javascript" src="js/bootstrap-datepicker.js"></script>
            <script type="text/javascript" src="js/hotelvalidation.js"></script>
     
            <script type="text/javascript" src="js/jquery.lightbox-0.5.min.js"></script>
            <script src="js/jquery.colorbox.js"></script>
            <script defer src="js/jquery.flexslider.js"></script>
     
            <script type="text/javascript">
                $(window).load(function() {
                    $('.flexslider').flexslider({
                        animation: "fade",
                        controlNav: true,
                        directionNav: true
                    });
                });
            </script>
            <script>
                    function currency_change(ccode)
                    {
                            window.location.href = '<?php echo $_SERVER['PHP_SELF']; ?>?currency=' + ccode;
                    }      
           
    </script>
           
        </head>
        <body>
           
                <div class="container-fluid">
                    <div class="row-fluid">
                        <div class="span12">
                                            <div id="body-div">
                            <h1> <?php echo $bsiCore->config['conf_hotel_name']; ?></h1>
                               <div class="wizard">
                                <div class="step1 greenStep"><img src="images/wizard/1.png" alt="" /><p><?php echo SELECT_DATES_TEXT; ?></p></div>
                                <div class="step2 yellowStep"><img src="images/wizard/2.png" alt="" /><p><?php echo ROOMS_TEXT; ?> & <?php echo RATES_TEXT; ?></p></div>
                                <div class="step3 grayStep"><img src="images/wizard/3.png" alt="" /><p><?php echo YOUR_DETAILS_TEXT; ?></p></div>
                                <div class="step4 grayStep"><img src="images/wizard/4.png" alt="" /><p><?php echo PAYMENT_TEXT; ?></p></div>
                                <div class="step5 grayLastStep"><img src="images/wizard/5.png" alt="" /><p><?php echo CONFIRM_TEXT; ?></p></div>
                             </div>
                             <div class="progress">
                                    <div class="bar bar-success" style="width: 20%;">20% Complete</div>
                                                            <div class="bar bar-warning" style="width: 20%;"></div>
                            </div>
                         
                            <div class="wrapper">
                                <h2><?php echo SEARCH_INPUT_TEXT; ?> (<a href="index.php"><?php echo MODIFY_SEARCH_TEXT; ?></a>)</h2>
                                <table class="normal-table">
                                    <tbody>
                                        <tr>
                                          <td><strong>
                                            <?php echo CHECK_IN_D_TEXT; ?>
                                            :</strong></td>
                                          <td><?php echo $bsisearch->checkInDate; ?></td>
                                        </tr>
                                        <tr>
                                          <td><strong>
                                            <?php echo CHECK_OUT_D_TEXT; ?>
                                            :</strong></td>
                                          <td><?php echo $bsisearch->checkOutDate; ?></td>
                                        </tr>
                                        <tr>
                                          <td><strong>
                                            <?php echo TOTAL_NIGHTS_TEXT; ?>
                                            :</strong></td>
                                          <td><?php echo $bsisearch->nightCount; ?></td>
                                        </tr>
                                        <tr>
                                          <td><strong>
                                            <?php echo ADULT_ROOM_TEXT; ?>
                                            :</strong></td>
                                          <td><?php echo $bsisearch->guestsPerRoom?></td>
                                        </tr>
                                       
                                         <?php if($bsisearch->childPerRoom){ ?>
                                         <tr>
                                         <td><strong><?php echo CHILD_PER_ROOM_TEXT; ?>:</strong></td>
                                         <td><?php echo $bsisearch->childPerRoom; ?></td>
                                        </tr>
                                        <?php } ?>
                                    </tbody>
                                </table>
                               
                                 <form name="searchresult" id="searchresult" method="post" action="booking_details.php" onSubmit="return validateSearchResultForm('<?php echo SELECT_ONE_ROOM_ALERT; ?>');">
                            </div>
                            <div class="wrapper">
                                <div class="htitel">
                                    <h2 class="fl" style="border:0; margin:0;"><?php echo SEARCH_RESULT_TEXT; ?></h2>
                                    <div class="control-group fr">
                                        <div class="controls">
                                            <?php echo $bsiCore->get_currency_combo2($bsisearch->currency); ?>
                                        </div>
                                    </div>
                                </div>
                               
                                        <?php
                                                                                    $gotSearchResult = false;
                                                                                    $idgenrator = 0;
                                                                                    $ik=1;
                                                                                    foreach($bsisearch->roomType as $room_type){
                                                                                            foreach($bsisearch->multiCapacity as $capid => $capvalues){
                                                                                                    $room_result = $bsisearch->getAvailableRooms($room_type['rtid'], $room_type['rtname'], $capid);
                                                                                                           
                                                                                                            $sqlroomcheck=mysql_query("select * from bsi_room where roomtype_id=".$room_type['rtid']." and capacity_id=".$capid);
                                                                                                            if(mysql_num_rows($sqlroomcheck)){
                                                                                                            echo '<script> $(document).ready(function() { ';
                                                                                                            echo '
                                                                                                                    $("#iframe_'.str_replace(" ","",$room_type['rtid']).'_'.str_replace(" ","",$capid).$ik.'").colorbox({iframe:true, width: $(\\'#body-div\\').width() + \\'px\\', height: "90%"});
                                                                                                                    $("#iframe_details_'.str_replace(" ","",$room_type['rtid']).'_'.str_replace(" ","",$capid).$ik.'").colorbox({iframe:true,  width: $(\\'#body-div\\').width() + \\'px\\', height: "60%"});
                                                                                                                    $(".group_'.$room_type['rtid'].'_'.$capid.'").colorbox({rel:\\'group_'.$room_type['rtid'].'_'.$capid.'\\', maxWidth: $(\\'#body-div\\').width(), maxHeight:"80%", slideshow:true, slideshowSpeed:5000});
                                                                                                                   
                                                                                                                            ';
                                                                                                            echo '}); </script>';
                                                                                                            echo '<script type="text/javascript">
                                                                                                                            $(document).ready(function() {
                                                                                                                                    $("#mySlides_'.$capid.'_'.$room_type['rtid'].' a").lightBox();
                                                                                                                            });
                                                                                                              </script>';  
                                     
                                      ?>
                                <!-- start of search row -->
                                <div class="container-fluid" style="margin:0; padding:0;">
                                    <div class="row-fluid" style="background-color: #faac59; padding: 1% 0">
                                       
                                        <div class="span12">
                                            <div class="span5">
                                                <div class="search-gallery">
                                                    <div class="flexslider" style="cursor:pointer; cursor:hand;" >
                                                        <ul class="slides">
                                                            <?php echo $bsiCore->roomtype_photos($room_type['rtid'],$capid); ?>        
                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="span7">
                                                <div class="search-details">
                                                    <table cellpadding="5" cellspacing="0" border="0" width="100%"  bgcolor="#faac59" style="text-align:left; " >
                                                     <?php if($room_result['specail_price_flag']){ $offertag='style="background:url(images/offer.png) no-repeat left top; padding-left:23px; height:35px;"'; }else{ $offertag='';  }?>
                                                   
                                                        <tr>
                                                            <td width="100%" <?php echo $offertag; ?>> 
                                                                <span  style="font-size:18px;"><strong><?php echo $room_type['rtname']; ?></strong> (<?php echo $capvalues['captitle']; ?>) <?php if($room_result['child_flag']){ ?> <?php echo WITH_CHILD; ?> <?php } ?></strong> </span>  <span style="float:right;">
                                                                    <a href="roomtype-details.php?tid=<?php echo $room_type['rtid']; ?>" id='iframe_details_<?php echo str_replace(" ","",$room_type['rtid']).'_'.str_replace(" ","",$capid).$ik; ?>' style="font-weight:bold; color:#FFF;" ><?php echo VIEW_ROOM_FACILITIES_TEXT; ?></a></span>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td width="100%" valign="top" style="font-size:13px">
                                                                <table  width="100%" class="table table-bordered table2">
                                                                    <tr>
                                                                        <td colspan="2" bgcolor="#faa448" >
                                                                            <span style=" font-size:14px; font-weight:bold">
                                                                                <a style="color:#fff" id='iframe_<?php echo str_replace(" ","",$room_type['rtid']).'_'.str_replace(" ","",$capid).$ik; ?>' href="calendar.php?rtype=<?php echo $room_type['rtid']; ?>&cid=<?php echo $capid; ?>" title='<span  style="font-size:16px;"><strong><?php echo $room_type['rtname']; ?></strong> ( <?php echo $capvalues['captitle']; ?> ) </span>' ><?php echo VIEW_NIGHTLY_PRICE_TEXT; ?> & <?php echo CALENDAR_AVAILABILITY_TEXT; ?></a>
                                                                            </span>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td bgcolor="#faa448"><strong><?php echo MAX_OCCUPENCY_TEXT; ?></strong></td>
                                                                        <td bgcolor="#faa448"><?php echo $capvalues['capval']; ?>
                        <?php echo ADULT_TEXT; ?> <?php if($room_result['child_flag']){ ?> <?php echo AND_TEXT; ?> <?php echo $bsisearch->childPerRoom;?> <?php echo CHILD_TEXT; ?><?php } ?> <?php echo PER_ROOM_TEXT; ?></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td bgcolor="#faa448"><strong> <?php echo TOTAL_PRICE_OR_ROOM_TEXT; ?> </strong></td>
                                                                         <?php if($room_result['specail_price_flag']){ ?>
                                                                        <td bgcolor="#faa448"><span style="font-weight:bold; color:#cc0000;"> <del><?php echo $bsiCore->get_currency_symbol($bsisearch->currency).$bsiCore->getExchangemoney($room_result['totalprice'],$bsisearch->currency); ?></del> </span>  <strong><?php echo $bsiCore->get_currency_symbol($bsisearch->currency).$bsiCore->getExchangemoney($room_result['total_specail_price'],$bsisearch->currency); ?></strong> <?php if($room_result['child_flag']){ ?> (included <span style="color:#cc0000; text-decoration:line-through;"><?php echo $bsiCore->get_currency_symbol($bsisearch->currency).$bsiCore->getExchangemoney($room_result['total_child_price'],$bsisearch->currency); ?></span> <?php echo $bsiCore->get_currency_symbol($bsisearch->currency).$bsiCore->getExchangemoney($room_result['total_child_price2'],$bsisearch->currency); ?> <?php echo FOR_TEXT; ?> <?php echo $bsisearch->childPerRoom;?> <?php echo CHILD_TEXT; ?>) <?php }?></td>
                                                                       
                                                                        <?php }else{ ?>
                                                                        <td bgcolor="#faa448"><span style="font-weight:bold;"><strong><?php echo $bsiCore->get_currency_symbol($bsisearch->currency).$bsiCore->getExchangemoney($room_result['totalprice'],$bsisearch->currency); ?></strong> <?php if($room_result['child_flag']){ ?> (included <?php echo $bsiCore->get_currency_symbol($bsisearch->currency).$bsiCore->getExchangemoney($room_result['total_child_price'],$bsisearch->currency); ?> <?php echo FOR_TEXT; ?> <?php echo $bsisearch->childPerRoom;?> <?php echo CHILD_TEXT; ?>) <?php }?></td>
                                                                         <?php } ?>
                                                                    </tr>
                                                                    <tr>
                                                                                                                          <?php
                                                                        if(intval($room_result['roomcnt']) > 0){
                                                                        $gotSearchResult = true;
                                                                        ?>
                                                                   
                                                                        <td bgcolor="#faa448"><strong><?php echo SELECT_NUMBER_OF_ROOM_TEXT; ?></strong></td>
                                                                        <td bgcolor="#faa448">
                                                                            <select name="svars_selectedrooms[]" class="input-mini">
                                                                                <?php echo $room_result['roomdropdown']; ?>
                                                                            </select>
                                                                        </td>
                                                                        <?php }else{
                                                                                                                                            echo '<script> $(document).ready(function() { ';
                                                                                                                                                    echo '
                                                                                                                                                            $("#iframe2_'.str_replace(" ","",$room_type['rtid']).'_'.str_replace(" ","",$capid).$ik.'").colorbox({iframe:true, width: $(\\'.container-fluid\\').width() + \\'px\\', height: "80%"});
                                                                                                                                                           
                                                                                                                                                                    ';
                                                                                                                                                    echo '}); </script>';
                                                                                           ?>
                                                                       
                                                                        <td bgcolor="#faa448" colspan="2">
                                                                           <strong>Not Available</strong></span> ( <a style="color:#fff; font-size:13px" id='iframe2_<?php echo str_replace(" ","",$room_type['rtid']).'_'.str_replace(" ","",$capid).$ik; ?>' href="calendar.php?rtype=<?php echo $room_type['rtid']; ?>&cid=<?php echo $capid; ?>" title='<span  style="font-size:16px;"><strong><?php echo $room_type['rtname']; ?></strong> ( <?php echo $capvalues['captitle']; ?> ) </span>' ><strong><?php echo CHECK_AVILABILITY; ?> </strong></a> )
                                                                        </td>
                                                                       <?php } ?>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </div>
     
                                        </div>
                                    </div>
                                </div>  
                                <!-- end of search row -->
                                <?php } } }
                                                           
                                                            $flag88=0;
                                                                    if($gotSearchResult){
                                                                            echo '<div id="" style="width:600px !important;"><table cellpadding="5" cellspacing="0" border="0" width="100%" >';
                                                                            echo '<tr><td align="right" style="padding-right:30px;"></td></tr>';
                                                                            echo '</table></div>'; 
                                                                    $flag88=1;
                                                                    }else{
                                                                            echo '<table cellpadding="4" cellspacing="0" width="100%"><tbody><tr><td style="font-size:13px; color:#F00;" align="center"><br /><br />';
                                                                            if($bsisearch->searchCode == "SEARCH_ENGINE_TURN_OFF"){
                                                                                    echo SORRY_ONLINE_BOOKING_CURRENTLY_NOT_AVAILABLE_TEXT;                        
                                                                            }else if($bsisearch->searchCode == "OUT_BEFORE_IN"){
                                                                                    echo SORRY_YOU_HAVE_ENTERED_A_INVALID_SEARCHING_CRITERIA_TEXT;                         
                                                                            }else if($bsisearch->searchCode == "NOT_MINNIMUM_NIGHT"){
                                                                                    echo MINIMUM_NUMBER_OF_NIGHT_SHOULD_NOT_BE_LESS_THAN_TEXT.' '.$bsiCore->config['conf_min_night_booking'].' '. PLEASE_MODIFY_YOUR_SEARCHING_CRITERIA_TEXT;
                                                                            }else if($bsisearch->searchCode == "TIME_ZONE_MISMATCH"){
                                                                                    $tempdate = date("l F j, Y G:i:s T");
                                                                                    echo BOOKING_NOT_POSSIBLE_FOR_CHECK_IN_DATE_TEXT.' '.$bsisearch->checkInDate.' '. PLEASE_MODIFY_YOUR_SEARCHING_CRITERIA_TO_HOTELS_DATE_TIME_TEXT.'<br>'. HOTELS_CURRENT_DATE_TIME_TEXT.' '.$tempdate;
                                                                            }else{
                                                                                    echo SORRY_NO_ROOM_AVAILABLE_AS_YOUR_SEARCHING_CRITERIA_TRY_DIFFERENT_DATE_SLOT;
                                                                            }
                                                                            echo '<br /><br /><br /></td></tr></tbody></table>';
                                                                    }
                                                           
                                                             ?>
                               
                           
                            </div>
                            <div class="wrapper" style="margin-bottom: 20px">
                                <div class="container-fluid" style="margin:0; padding:0;">
                                    <div class="row-fluid" style="background-color: #faac59; padding: 1% 0">
                                    <?php if($flag88){  ?>
                                        <div class="span12">
                                            <div class="back1">
                                                <button id="registerButton" type="button" onClick="window.location.href='index.php'" ><?php echo BACK_TEXT; ?></button>
                                            </div>
                                            <div class="continue2">
                                                <button id="registerButton" type="submit" class="conti2" ><?php echo CONTINUE_TEXT; ?></button>
                                            </div>
                                        </div>
                                        <?php }else{ ?>
                                       
                                           <div class="span12">
                                            <div class="back1">
                                                <button id="registerButton" type="button" onClick="window.location.href='index.php'" ><?php echo BACK_TEXT; ?></button>
                                            </div>
                                           
                                        </div>
                                         <?php } ?>
                                    </div>
                                   </form>
                                </div>  
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </body>
    </html>

Hi st_7, welcome to the forums!

As I can see, there are two lines that are giving you errors.

The first one is this line:

$currency_symbol = $bsiCore->config['conf_currency_symbol']; //UNDEFINED INDEX: conf_currency_symbol

Should it be possible for $bsiCore->config[‘conf_currency_symbol’] to be undefined? If yes, then you’ll need to use an isset check on this, but if not then you probably have a bug somewhere else in your program.

The second one is this line here:

'child_flag' => $child_flag, //UNDEFINED VARIABLE CHILD_FLAG

Searching through your code, the only place I can see this variable being set is here:


if ($chld_row2['no_of_child'] >= $this->childPerRoom && $this->childPerRoom != 0) {
    $child_flag = true;

so it looks like your IF check is failing, and $child_flag is not being initialised. If this variable should be false by default, you’ll need to set it outside of (and before) the IF statement.

There are a couple of other issues with your code that aren’t related to your original question:

  • You’re using the mysql_* functions. The mysql extension is deprecated and will be removed from PHP at some point. You should consider switching to the mysqli or PDO extension (as a bonus, either of the two will allow you to use prepared statements, which will make your app more secure).
  • It’s a good idea to avoid using global variables. They make your code less reusable, and it’s easy for one part of your program to accidentely change a global, leading to difficult-to-trace bugs. If you need access to the $bsiCore object from the bsiSearch class, pass it via the constructor and store it in a class property.

Does the bsiCore config have a conf_currency_symbol key?
$bsiCore->config['conf_currency_symbol']

This is the only place where I see $child_flag being defined, and only if the code enters the if

  $chld_row2=mysql_fetch_assoc(mysql_query("SELECT distinct(`no_of_child`) FROM `bsi_room` WHERE `capacity_id`=".$capcityid." and `roomtype_id`=".$roomTypeId.""));
  if($chld_row2['no_of_child'] >= $this->childPerRoom && $this->childPerRoom != 0){
  $child_flag=true;
  $childpricesql = mysql_query("SELECT * FROM bsi_priceplan WHERE roomtype_id = ".$roomTypeId." AND capacity_id =1001 AND ('".$val."' BETWEEN start_date AND end_date)");
  if(mysql_num_rows($pricesql)){
  $chrow=mysql_fetch_assoc($childpricesql);
  }else{
  $childpricesql2 = mysql_query("SELECT * FROM bsi_priceplan WHERE roomtype_id = ".$roomTypeId." AND capacity_id =1001 AND default_plan=1");
  $chrow=mysql_fetch_assoc($childpricesql2);
  }

Maybe you could define it to some value outside of the if, and maybe also in the else.

Thanks to both of you for replying,

@fretburner, being an absolute noob, I don’t know whether $bsiCore->config[‘conf_currency_symbol’] is defined or not !!. But I did find a reference to it in the main class file called ‘admin.class.php’. The following is the particular section of that main class file which contains a reference to ‘conf_currency_symbol’.

public function global_setting_post(){
        global $bsiCore;
        if(isset($_POST['price_inclu_tax'])){
            $pincludetax=1;
        }else{
            $pincludetax=0;
        }
        //echo "htmlentities('".$_POST['currency_symbol']."','ENT_COMPAT','utf-8')";
        $this->configure_update('conf_notification_email',  mysql_real_escape_string($_POST['email_notification']));
        //$this->configure_update('conf_currency_code',  mysql_real_escape_string($_POST['currency_code']));
        //$this->configure_update('conf_currency_symbol',  htmlentities(mysql_real_escape_string($_POST['currency_symbol']),ENT_COMPAT,'utf-8'));
        $this->configure_update('conf_booking_turn_off',  mysql_real_escape_string($_POST['booking_turn']));  

As you can see the line which has a reference of ‘conf_currency_symbol’ is commented, thinking it may be related to the problem, I un-commented the line and in order to get that value to search.class page(on to which the errors are being pointed to), I’ve used

include("includes/admin.class.php");

in search.class page, but it did no good(meaning either it is not related to this issue or I couldn’t get that value to this page).

Secondly about child_flag, my observations are exactly as yours. I didn’t find it being defined or declared anywhere else either in this file or in other, except with that ‘IF’ statement in the same file. That’s why I’m quite confused and I don’t know whether child_flag can be set to false all the time or not. The problem with me(at present) is that I don’t understand the code(or the meaning of the code). Some one who understands the coding can easily tell what that particular code is meant to do & what it will do, unfortunately I’m not that some one.

But I did find fixes for these two issues by trial & error, in the line

$currency_symbol = $bsiCore->config['conf_currency_symbol'];

I’ve removed '$bsiCore->config & just left the remaining part. So, now that line looks like this.

$currency_symbol = ['conf_currency_symbol'];

and it gives no errors any more. But, whether it is the right solution? or why it doesn’t throw any error? or even what '$currency_symbol=[‘conf_currency_symbol’] means?, I simply don’t know. And as far as the child_flag error is concerned, if I set it to true($child_flag=true;) or false($child_flag=false;) just above ‘return array’ line towards the end of the file, I get no errors whatsoever. But again I’m not sure whether it is right solution or not. Hence I decided to post on fourms like these to get solution(as well as knowledge).

I’m learning the languages so that I can read & understand the code(it may take time, may be a very long one). In the mean time I want to get these two errors fixed. And by the way, I’ll definitely move to Mysqli or PDO, once I get a grip on coding(I’ve already read few articles explaining the benefits of them). You may wonder, why don’t I just hire a web developer to do these all things?, well I did hire a person to provide me a simple website with both backend booking management system & frontend booking process system. After paying about $250 or so(including his fee, domain & hosting charges), he is not at all reachable now(I paid in advance believing him, which resulted in the present situation of mine).

@Mittineague, can you please let me know how to define that child_flag in the else?.

Thanks to you both for replying.

I would do it something like this

$var = <{a default value}>;
.........
if (.......) {
$var = <{a value}>;
}else{
$var = <{a different value}>

Any experienced, legitimate developer wouldn’t pick up a bucket for that price so you get what you pay for. If it looks to good to be true it probably is. The person who supplied that probably doesn’t know the answer because it is likely just something ripped from the internet somewhere. The quality of the code is definitely subpar to say the least. I would be worried there are a bunch of other hidden bugs scattered across everything that developer supplied you. Hopefully you’re not processing payments or anything like that…

Lol, I’m thinking I paid a fair price, but my requirements are not too technical(except for this backend booking management), if for the site only there were people willing to do for as low as $30(because if you take out the booking management, my site requirements are so simple, even a person like me can do with some wysiwyg website builders). Yeah, I agree with you, the quality of the code is so low, there were references to the elements to the data base that doesn’t exist at all. I’ve done all the cleaning(in response to the errors I was getting), now only these two bothering me. And I don’t process payments, the user is simply directed to another secure payment server, which handles all the payment processing stuff.