sms_domain= "http://enterprise.smsgupshup.com/GatewayAPI/rest"; $this->method= "sendMessage"; $this->userid = "2000075484"; $this->password = "ClearCar123"; $this->v = "1.1"; $this->msg_type = "TEXT"; $this->auth_scheme = "PLAIN";*/ $this->secretkey="ytrewKJHGL"; /* Min/Max 10 Char Allowed */ $this->stringlimit=7; /* Limit for string */ $this->hotel_keystr='h'; $this->attraction_keystr='a'; $this->state_keystr='s'; $this->city_keystr='c'; $this->country_keystr='v'; $this->hotel_review_keystr='z'; $this->attraction_review_keystr='x'; $this->city_review_keystr='p'; $this->table_name; $this->emailid; $this->subject; $this->headers; /*$this->DB_HOST = 'localhost'; $this->DB_USER = 'root'; $this->DB_PASSWORD = ''; $this->DB_NAME = 'dhanashree'; */ $this->DB_HOST = 'cabsaasdbrdsmumbai.c7n25apkpmtf.ap-south-1.rds.amazonaws.com'; $this->DB_USER = 'dhanashr_new1' ; $this->DB_PASSWORD = '=TSO1WPgbllp' ; $this->DB_NAME = 'dhanashr_new' ; $this->userPostedData = array(); $hostName = $this->DB_HOST ; $userName = $this->DB_USER ; $password = $this->DB_PASSWORD ; $dbName = $this->DB_NAME ; $this->OpenConnection($hostName , $userName , $password , $dbName); return $this->table_name ; } // Function for commonclass End /* Function for Send SMS*/ function sendSms($mobileNo,$msg) { $mobileNo=urlencode($mobileNo); $msg=urlencode($msg); $smsString="$this->sms_domain?method=$this->method&send_to=$mobileNo&msg=$msg&userid=$this->userid&password=$this->password&v=$this->v&msg_type=$this->msg_type&auth_scheme=$this->auth_scheme"; return $smsString; } // Function for set table name Start function setTable($name) { $this->table_name = $name; } // Function for set table name End // Open Database Connection Function start function OpenConnection($hostName , $userName , $password , $dbName) { $link = mysql_connect($hostName, $userName, $password)or die("Connection Error"); mysql_select_db($dbName); return $link; } // Open Database Connection Function End // Generate Current URL function current_page_url() { $page_url = 'http'; if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { $page_url .= 's'; } return $page_url.'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; } // Generate Current URL End // Function for retrive Distinct Data from datatbae start function getDistinctData($colname='',$cond='',$orderBy='',$orderBy1='',$limit='') { if((trim($orderBy) && trim($cond)) && trim($colname) && trim($orderBy1) && trim($limit)) { $sql1 = " SELECT distinct ".$colname." FROM $this->table_name"." WHERE ".$cond." "."ORDER BY ".$orderBy1." ".$orderBy." Limit ".$limit; $result1 = mysql_query( $sql1 ) or die("Query Error :".mysql_error()) ; } else if((trim($orderBy) && trim($cond)) && trim($colname) ) { $sql1 = " SELECT distinct ".$colname." FROM $this->table_name"." WHERE ".$cond." "."ORDER BY ".$colname." ".$orderBy ; $result1 = mysql_query( $sql1 ) or die("Query Error :".mysql_error()) ; } else if(trim($cond) && trim($colname) ) { $sql1 = " SELECT distinct ".$colname." FROM $this->table_name"." WHERE ".$cond ; $result1 = mysql_query( $sql1 ) or die("Query Error :".mysql_error()) ; } else if( trim($orderBy) ) { $sql1 = " SELECT distinct ".$colname." FROM $this->table_name"." "."ORDER BY ".$colname." ".$orderBy ; $result1 = mysql_query( $sql1 ) or die("Query Error :".mysql_error()) ; } //echo $sql1; return $result1; } // Function for retrive Distinct Data from datatbae end // Function for retrive Data from table start function selectSql($condition='',$coloums='', $pageNum='', $pageRecord='', $orderBy='' , $sortOrder='', $groupBy='', $limit='' , $limit2='' ,$rand='') { $pos=substr($condition,0,6); if($pos=='select') { $sql=$condition; } else { if( trim($coloums) ) $sql = " SELECT ".$coloums." FROM `".$this->table_name."`"; else $sql = " SELECT * FROM `".$this->table_name."`" ; if( trim($condition) ) $sql .= " WHERE ".$condition ; if( trim($groupBy) ) $sql .= " GROUP BY ".$groupBy ; if( trim($orderBy) ) $sql .= " ORDER BY ".$orderBy." ".$sortOrder ; if(trim($rand)) $sql .= " ORDER BY RAND()"; if( trim($limit) && (trim($limit2)=="") ) $sql .= " LIMIT 0, ".$limit; if( trim($limit) && trim($limit2) ) $sql .= " LIMIT ".$limit2.", ".$limit; if( $pageNum ) $sql .= " LIMIT ".$this->queryLimit($pageNum,$pageRecord ) ; } $result = mysql_query( $sql ) or mysql_error() ; return $result ; } // Function for retrive Data from table end // function for Retrive data from database start function fetchData($resultset) { $data = array(); while($row = mysql_fetch_assoc($resultset)) { $data[] = $row; } return $data; } // function for Retrive data from database end // function for getting affected rows by last query start function getAffectedRows($resultSet) { $count = mysql_num_rows($resultSet); return $count; } // function for getting affected rows by last query end // function for Insert Data start function insertData() { $cols = "" ; $vals = "" ; foreach( $this->userPostedData as $key=>$value ) { if($key!="PHPSESSID") { $cols .= str_replace("txt" , "" , $key)."," ; $vals .= "'".$value ."'," ; } } $cols = substr($cols , 0 , strlen($cols)-1) ; $vals = substr($vals , 0 , strlen($vals)-1) ; $this->sql = "INSERT INTO ".$this->table_name. " ( ".$cols." ) VALUES "." ( ". $vals ." ) "; if(!mysql_query($this->sql)) { echo mysql_error() ; die() ; } else { $insert = "success" ; } return $insert ; } // function for Insert Data end // Function for Update Data start function updateData($condition) { $cols = ""; $vals = ""; foreach($this->userPostedData as $key=>$value) { $cols .= $key ."='".$value."',"; } $cols = substr($cols, 0 ,strlen($cols)-1); $this->sql = "update ".$this->table_name." set ".$cols."where ".$condition; $result = mysql_query($this->sql); if(mysql_error()) { echo mysql_error() ; die() ; } else { $insert = "success" ; } return $insert ; } // Function for Update Data end //get the minimum price of products function minSliderValue($condition='',$coloums='') { $query = "SELECT min(".$coloums.") as minvalue from `".$this->table_name."`"; if( trim($condition) ) $query .= " WHERE ".$condition ; $result = mysql_query($query) or die(mysql_error()); if(mysql_num_rows($result) > 0) { $row = mysql_fetch_assoc($result); return $row['minvalue']; } } //get the maximum price of products function maxSliderValue($condition='',$coloums='') { $query = "SELECT max(".$coloums.") as mvalue from `".$this->table_name."`"; if( trim($condition) ) $query .= " WHERE ".$condition ; $result = mysql_query($query) or die(mysql_error()); if(mysql_num_rows($result) > 0) { $row = mysql_fetch_assoc($result); return $row['mvalue']; } } // Function for geting all the variables which are post/get start /*function getRequestedData() { if($_GET && empty($_POST)) $GetVar = $_GET ; else $GetVar = $_POST ; $GetVar = $GetVar ; return $GetVar ; } */ function secureSuperGlobalGET(&$value, $key) { $_GET[$key] = htmlspecialchars(stripslashes($_GET[$key])); $_GET[$key] = str_ireplace("script", "blocked", $_GET[$key]); $_GET[$key] = mysql_escape_string($_GET[$key]); return $_GET[$key]; } function secureSuperGlobalPOST(&$value, $key) { $_POST[$key] = htmlspecialchars(stripslashes($_POST[$key])); $_POST[$key] = str_ireplace("script", "blocked", $_POST[$key]); $_POST[$key] = mysql_escape_string($_POST[$key]); return $_POST[$key]; } function getRequestedData() { array_walk($_GET, array($this, 'secureSuperGlobalGET')); array_walk($_POST, array($this, 'secureSuperGlobalPOST')); //return $_GET; if($_GET && empty($_POST)) $GetVar = $_GET ; else $GetVar = $_POST ; $GetVar = $GetVar ; return $GetVar ; } // Function for geting all the variables which are post/get end // Function fro Redirect to next page start function redirect($page) { echo ""; } // Function fro Redirect to next page end // Function for Logout Session start function logout($page) { session_destroy(); echo ""; } // Function for Logout Session end // Function for delete data start function deleteData($condition) { $this->sql = "delete from ".$this->table_name." where ".$condition; $result = mysql_query($this->sql); if(mysql_error()) { echo mysql_error(); die(); }else{ $insert = "success"; } return $insert; } // Function for delete data end // Function for get last insert id start function LastInsertedId() { $insert = mysql_insert_id(); return $insert; } // Function for get last insert id end /* Function for creating Alphabetic string Start Coded By : Vikrant S. Ghan */ function get_array($key) { $encode_arr[]=''; for ($i=0; $isecretkey; $stringlimit1=$this->stringlimit; $encode_arr=$this->get_array($secretkey1); if (strlen($id)<$stringlimit1) { $temp_count=$stringlimit1-strlen($id); $tempid=""; for ($i=0; $i<$temp_count; $i++) { $tempid.=0; } $id=$tempid.$id; } $temp_str=''; for ($i=0; $isecretkey; $encode_arr=$this->get_array($secretkey1); $temp_str=''; for ($i=0; $i=1) { if($encode_arr[$j]==$temp) { $temp_str.=$j;} } else { if(($encode_arr[$j]!=$encode_arr[0])) { if($encode_arr[$j]==$temp) { $temp_str.=$j;} } } } } return $temp_str; } /* Function for creating Alphabetic string End */ // Function For queryLimit for paging queryLimit start function queryLimit($pageNumber,$pageRecord) { if( trim($pageNumber) ) { $pgnumber = ($pageNumber - 1) * $pageRecord ; } else $pgnumber = 0 ; return $pgnumber." , ".$pageRecord ; } // Function For queryLimit for paging queryLimit end /* Paging start (vikrant) */ function paging($num , $currentPage , $currentNum,$rpp='',$callfunction='') { if(trim($rpp)) $rpp=$rpp; else $rpp=10; if(trim($callfunction)) $callfunction=$callfunction; else $callfunction='getpage'; if($num>$rpp) { $ct = $num / $rpp ; $ct = ceil($ct) ; if( $currentPage > 1 ) $pagingPrevious ='
  • « Previous
  • '; else $pagingPrevious = '' ; if($currentPage>5) { $currentPage1=$currentPage-1; $currentPage1=$currentPage1/2; if(is_float($currentPage1)) { $tempcurrentPage1=explode(".",$currentPage1); if($tempcurrentPage1[0]%2==0) $currentPage1=ceil($currentPage1); } } if($currentPage==5 && $ct!=5) { $start = $currentPage; if(($currentPage+4)>$ct) $cct=$ct; else $cct=$currentPage+4; } else if($currentPage>5 && ($currentPage1%2==0)) { $temp=$currentPage1%2; $start = $currentPage; if(($currentPage+4)>$ct) $cct=$ct; else $cct=$currentPage+4; } else if($currentPage <= 5 && $ct <= 5) { $cct = $ct ; $start = 1 ; } else if( $currentPage < 5 && $ct > 5) { $cct = 5 ; $start = 1 ; } else if($currentPage%2==1) { if(($currentPage+2)>$ct) $cct=$ct; else $cct = $currentPage+2 ; $start = $currentPage-2 ; } else { $currentPage1=$currentPage-2; $currentPage1=$currentPage1/2; if($currentPage1%2==0) { if(($currentPage+3)>$ct) $cct=$ct; else $cct = $currentPage+3 ; $start = $currentPage-1 ; } else { if(($currentPage+1)>$ct) $cct=$ct; else $cct = $currentPage+1 ; $start = $currentPage-3 ; } } for($i=$start;$i<=$cct;$i++) { if($currentPage == $i || !trim($currentPage) && $i == 1) $paging .= '
  • '.$i.'
  • '; else $paging .= '
  • '.$i.'
  • '; } if( trim($currentPage) == "" ) $currentPage++ ; if( $currentPage < $ct ) $pagingNext = '
  • '.'Next »
  • '; else // $pagingNext = '
  • Next »
  • '; $pagingNext = ''; $paging = $pagingPrevious.$pagingStart.$paging.$pagingEnd.$pagingNext ; } else { $paging = "" ; } $finalPagination .= $paging ; return $finalPagination ; } /* Paging end (vikrant) */ /* For Admin Section Start */ // Function for alternate css for row start function getClassName($count) { if( $count % 2 == 0 ) $class = "alternateList" ; else $class = "List" ; return $class ; } // Function for alternate css for row end // Function for vaidate admin session start function validsessionAdmin() { if(isset($_SESSION['admin_id'])) { $sessionset = true; }/*else{ echo ""; } return $sessionset;*/ } function removeDir($dirname) { if (is_dir($dirname)) $dir_handle = opendir($dirname); if (!$dir_handle) return false; while($file = readdir($dir_handle)) { if ($file != "." && $file != "..") { if (!is_dir($dirname."/".$file)) unlink($dirname."/".$file); else { $a=$dirname.'/'.$file; $this->removeDir($a); } } } closedir($dir_handle); rmdir($dirname); return true; } function getId($tblName,$col,$str) { $this->setTable($tblName); $cond = "name='".$str."'"; $result = $this->selectSql($cond); $row1 = $this->fetchData($result); foreach($row1 as $rows1) { $id=$rows1[$col]; } return $id; } function getColValue($tblName,$col,$cond1) { $this->setTable($tblName); $cond = $cond1; $result = $this->selectSql($cond); $row1 = $this->fetchData($result); foreach($row1 as $rows1) { $id=$rows1[$col]; } return $id; } function insertValues($tblName,$col1,$col2,$postData,$postData1) { $this->setTable($tblName); $add=''; $add[$col1] = $postData; $add[$col2] = $postData1; $this->userPostedData = $add; $insert_query = $this->insertData(); } function getValues($tblName1,$col1,$cond1,$col2,$tblName2,$div,$col3) { $this->setTable($tblName1); $cond = "$col1=".$cond1; $result = $this->selectSql($cond,'','','',$col3,'ASC'); $row1 = $this->fetchData($result); foreach($row1 as $rows1) { $tempId =$rows1[$col2]; $this->setTable($tblName2); $cond1 = "$col2=".$tempId; $result1 = $this->selectSql($cond1); $row = $this->fetchData($result1); foreach($row as $rows) { $name=$rows['name']; echo ""; } } } function deleteValues($tblName,$colId) { $this->setTable($tblName); $cond = "packageId='".$colId."'"; $result = $this->deleteData($cond); } function chkUrl($pageName,$tableTypeId,$cnt) { $this->setTable('pageurl'); $cond = "name='".$pageName."'"; $result = $this->selectSql($cond); $count = $this->getAffectedRows($result); if($count>=1) { if($tableTypeId==1 || $tableTypeId==2 || $tableTypeId==3) { $this->setTable('tabletype'); $cond = "tableTypeId='".$tableTypeId."'"; $result = $this->selectSql($cond); $row = $this->fetchData($result); foreach($row as $rows) { $name=$rows['name']; } $cnt++; if($cnt==1) $pageName.="-".$name."-".$cnt; else if($cnt<=50) { $tmppageName=explode("-",$pageName); $tmplen=strlen($tmppageName[count($tmppageName)-1]); $pageName=substr($pageName,0,strlen($pageName)-$tmplen); $pageName.=$cnt; } $this->setTable('pageurl'); $cond = "name='".$pageName."'"; $result = $this->selectSql($cond); $count = $this->getAffectedRows($result); if($count>=1) { if($cnt<=50) return $this->chkUrl($pageName,$tableTypeId,$cnt); else return "error"; } else return $pageName; } } else return $pageName; } function genrateUrl($name) { $name=str_replace("'","",$name); $name=str_replace("-","",$name); $name=str_replace("(","",$name); $name=str_replace(")","",$name); $name=str_replace(",","",$name); $name=str_replace("!","",$name); $name=str_replace("-","",$name); $name=str_replace(".","-",$name); $tempName=explode(" ",$name); $tempNameStr=''; for($i=0; $i
    Fatal error: Class 'commonclass' not found in /var/www/html/Dhanashree/index.php on line 6