" - paging - " ,"item" => " - pages - " ,"page_id" => " - pages - " ,"page" => " - pages - " ,"c" => " - news categories, gallery categories, product categories - " ,"id" => " - news detail, products detail - " ,"man" => " - product manufacturer - " ,"sp" => " - product specials - " ,"adr" => " - eco address - " ,"pr_add" => " - eco add product - " ,"qnt" => " - eco add product quantity - " ,"spec" => " - eco prod spec - " ,"pr_del" => " - prod del favorite - " ,"pr_add" => " - prod add favorite - " ,"show_poll" => " - polls detail - " ,"pr" => " - suggestions detail - " ,"linkRedir" => " - banners - " ); $POST_ARRAY = array( "__poll_" => " - polls vote - " ); $injvars = ""; foreach ($_GET as $key => $value) { if(isset($GET_ARRAY[$key]) && $value != "") { if($value != strval(intval($value))) { $injvars .= $key . "=>" . str_replace("\\\\","\\",$value); unset($_GET[$key]); $_GET[$key] = intval($value); } } } if($injvars != "") { $HTTP_HOST = $_SERVER['HTTP_HOST']; $PHP_SELF = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : " ??? "; $IP = (getenv("HTTP_X_FORWARDED_FOR")) ? getenv("HTTP_X_FORWARDED_FOR") : getenv("REMOTE_ADDR"); $PHP_SELF_IP = $HTTP_HOST . " (" . $PHP_SELF . (isset($_SERVER['QUERY_STRING']) ? "?" . str_replace("\\\\","\\",urldecode($_SERVER['QUERY_STRING'])) : "") . ")"; $DateTime=date("Y-m-d H:i:s", time()); $LogMsg = "DateTime: " . $DateTime . "
"; $LogMsg .= "Host: " . $PHP_SELF_IP . "
"; $LogMsg .= "Ip: " . $IP . "
"; $LogMsg .= "Var: " . $injvars . "
"; //echo $LogMsg; $Headers = "MIME-Version: 1.0\r\nContent-type: text/html; charset=iso-8859-1\r\nFrom: Inj - " . $HTTP_HOST . " \r\n"; @mail("g.koskinopoulos@gmail.com","Injection: " . $HTTP_HOST, $LogMsg, $Headers); } if (!get_magic_quotes_gpc()) { foreach ($_GET as $key => $value){ $_GET[$key] = addslashes_array($_GET[$key]); } foreach ($_POST as $key => $value) { $_POST[$key] = addslashes_array($_POST[$key]); } } function addslashes_array($a) { if(is_array($a)) { foreach($a as $n=>$v) { $b[$n]=addslashes_array($v); } return $b; } else { return addslashes($a); } } ?>LoadLanguage($db,$tempLanguageCode); if($this->LanguageID == '') { $this->LoadLanguage($db,"gr"); } if($this->LanguageID == '') { $this->LoadLanguage($db,"en"); } } function LoadLanguage(&$db,$LanguageCode) { $result = $db->sql_query("SELECT * FROM languages WHERE is_active = 'True' AND language_code = '" . $LanguageCode . "'"); if($dr = $db->sql_fetchrow($result)){ $this->LanguageID = $dr["language_id"]; $this->LanguageCode = $dr["language_code"]; $this->LanguageCharset = $dr["charset"]; $this->DateFormat = $dr["dateFormat"]; $this->DecimalFormat = $dr["decimalFormat"]; } $db->sql_freeresult($result); } } ?>commands = array(); $this->images = array(); $this->texts = array(); $this->confirmMsg = array(); $this->jsCommand = array(); } function AddCommand($command,$image,$text,$validatePage = 0,$selectRowCheck = 0,$confirmMsg = "") { $this->commands[$command] = $command; $this->images[$command] = $image; $this->texts[$command] = $text; $this->validatePage[$command] = $validatePage; $this->selectRowCheck[$command] = $selectRowCheck; $this->confirmMsg[$command] = $confirmMsg; } function AddSimpleCommand($command,$image,$text,$validatePage = 0,$confirmMsg = "") { $this->commands[$command] = $command; $this->images[$command] = $image; $this->texts[$command] = $text; $this->validatePage[$command] = $validatePage; $this->selectRowCheck[$command] = "0"; $this->confirmMsg[$command] = $confirmMsg; } function AddJsCommand($command, $image,$text, $js = "") { $this->jsCommand[$command] = $js; $this->images[$command] = $image; $this->texts[$command] = $text; } function GetToolBar() { $ret = ""; foreach($this->commands as $key => $val){ $ret .= "  validatePage[$key] ? "1" : "0") . "," . ($this->selectRowCheck[$key] ? "1" : "0") . ",'" . (isset($this->confirmMsg[$key]) ? $this->confirmMsg[$key] : "") . "')\"> " . $this->texts[$key] . ""; } foreach($this->jsCommand as $key => $val){ $ret .= "   " . $this->texts[$key] . ""; } return $ret . "  " ; } function RenderToolBar() { echo $this->GetToolBar() . "  " ; } function CurrentCommand() { if(isset($_POST["Command"]) && !empty($_POST["Command"]) && $_POST["Command"] != "-1") { return $_POST["Command"]; } return ""; } function CurrentRecord() { if(isset($_POST["__Record"]) && !empty($_POST["__Record"]) && $_POST["__Record"] != "-1") { return $_POST["__Record"]; } return ""; } function GetSelector($value) { return ""; } } $toolBar = new ToolBar(); ?>MultiligualValidators[$instance] = $instance; } function AddTagValidator($TagID,$IsRequire,$DataType,$Message = "") { $this->TagValidatorsID[$TagID] = $TagID; $this->TagValidatorsIsRequire[$TagID] = $IsRequire; $this->ValidatorsDataType[$TagID] = $DataType; $this->ValidatorsMessages[$TagID] = $Message; } function AddFunctionValidator($functionName) { } function AddScriptValidator($functionName) { } function GetValidators() { $returnStr = ""; $multiVar = ""; foreach($this->MultiligualValidators as $key => $val){ $multiVar .= ",'" . $val . "'"; } if($multiVar != "") $multiVar = "\n var MultilinqualValidation = [" . substr($multiVar,1) . "];"; $TagVar = ""; foreach($this->TagValidatorsID as $key => $val){ $TagVar .= ",['" . $val . "'," . ($this->TagValidatorsIsRequire[$key] ? "1" : "0") . ",'" . $this->ValidatorsDataType[$key] . "','" . $this->ValidatorsMessages[$key] . "']"; } if($TagVar != "") $TagVar = "\n var CustomValidation = [" . substr($TagVar,1) . "];"; $returnStr .= $multiVar . $TagVar; return $returnStr; } function RenderValidators() { echo "\n\t\t\n"; } } $validator = new Validator();LanguageID . " AND pages.page_id =" . $__ID . " AND is_valid=1"; if($result = $db->sql_query($query)) { if($this->dr = $db->sql_fetchrow($result)) { $this->title = $this->dr["page_title"]; $this->content = $this->dr["content"]; $this->meta_keys = $this->dr["meta_keys"]; $this->meta_desc = $this->dr["meta_desc"]; } } $db->sql_freeresult($result); } } function ParseContent($content) { } function LoadRequestPage() { $this->title = ""; $this->content = ""; $this->meta_keys = ""; $this->meta_desc = ""; global $config; if(isset($_GET["page"]) && $_GET["page"] != "") { $this->LoadPage($_GET["page"]); } if($this->content == "" && isset($config["startPageID"])) { $this->LoadPage($config["startPageID"]); } } function LoadPage($pageID) { $this->GetPage($pageID); if($this->content != "") { global $components; // Find the tags preg_match_all('/\(.*?)\<\/component\>/is', $this->content, $matches); // Loop through each tag for ($i=0; $i < count($matches['0']); $i++) { $tag = $matches['0'][$i]; $text = $matches['1'][$i]; $new = ""; if(isset($components->Component[$text])) { $components->ComponentLoad($components->Component[$text],true); $new = $components->Content; $components->Content = ""; } // Replace with actual HTML $this->content = str_replace($tag, $new, $this->content ); } $auth->CurrentPage = $pageID; } } function RenderRequestPage() { echo $this->content; } } $pages = new GetPage(); class Components { var $Content = ''; var $Component = array(); function AddComponent($UrlParam, $Comp, $Option, $Path, $ShowOnlyComponentContent = false) { if($Path == "") $Path = 'gms/components/'; $this->Component[$UrlParam] = array ($UrlParam,$Comp,$Path,$Option,$ShowOnlyComponentContent); } function ComponentLoad($Component, $PushInContent = false) { global $config, $auth, $db, $toolBar, $validator, $messages, $events; $adminPrefix = defined('_ADMIN_PROCCESS') ? "admin." : ""; $file_include = $config["physicalPath"] . $Component[2] . $Component[1] . '/' . $adminPrefix . ($Component[3] != '' ? $Component[3] : $Component[1]) . ".php"; if(file_exists($file_include)) { $file_include_lang = $config["physicalPath"] . $Component[2] . $Component[1] . '/languages/' . $auth->LanguageCode . ".php"; //echo $file_include_lang; if(file_exists($file_include_lang)) require_once($file_include_lang); $file_include_gmsBase = $config["physicalPath"] . $Component[2] . $Component[1] . '/gmsCM.' . ($Component[3] != '' ? $Component[3] : $Component[1]) . ".php"; if(file_exists($file_include_gmsBase)) require_once($file_include_gmsBase); $file_include_gmsExtend = $config["physicalPath"] . 'sites/' . $config["site"] . '/gmsCMExtend/' . '/gmsCM.' . ($Component[3] != '' ? $Component[3] : $Component[1]) . ".php"; if(file_exists($file_include_gmsExtend)) require_once($file_include_gmsExtend); if($PushInContent) ob_start(); include($file_include); if($PushInContent) { $this->Content = ob_get_contents(); ob_end_clean(); } } } function LoadRequestComponent() { $this->Content = ''; if(isset($_GET["com"]) && $_GET["com"] && isset($this->Component[$_GET["com"]])) { $temp_comp = $this->Component[$_GET["com"]]; $this->ComponentLoad($temp_comp,true); } if($this->Content == '') { global $config; $adminPrefix = defined('_ADMIN_PROCCESS') ? "admin." : ""; $file_include = $config["physicalPath"] . 'sites/' . $config["site"] . '/components/' . $adminPrefix . "index.php"; if(file_exists($file_include)) { ob_start(); include($file_include); $this->Content = ob_get_contents(); ob_end_clean(); } } if(isset($temp_comp) && $temp_comp[4] === true) { global $htmlheader,$toolBar,$validator,$messages; LoadNoCacheHeader(); LoadCharSetHeader(); ?> RenderAdminHeader() : $htmlheader->RenderPublicHeader(); ?>
RenderToolBar(); ?>
RenderRequestComponent(); ?>
RenderValidators();?> RenderMessages();?> Content; } function LoadComponents($array_of_comp) { if(count($array_of_comp) > 0 ) { for($i =0 ; $i < count($array_of_comp) ; $i++) { if( isset($this->Component[$array_of_comp[$i]])) { $temp_comp = $this->Component[$array_of_comp[$i]]; $this->ComponentLoad($temp_comp); } } } } } $components = new Components();_events[$event][] = $function; } function trigger( $event, $args=null) { $result = array(); if ($args === null) { $args = array(); } if (isset( $this->_events[$event] )) { foreach ($this->_events[$event] as $func) { if (function_exists( $func )) { $result[] = call_user_func_array( $func, $args ); } } } return $result; } function call( $event ) { $args =& func_get_args(); array_shift( $args ); if (isset( $this->_events[$event] )) { foreach ($this->_events[$event] as $func) { if (function_exists( $func )) { return call_user_func_array( $func, $args ); } } } return null; } } $events = new Events();Reset(); } function Reset() { $this->RenderTable = ""; $this->LanguagesTable = array(); $this->ColumnsName = array(); $this->ColumnsType = array(); $this->ColumnsDataType = array(); $this->ColumnsHtmlRender = array(); $this->ColumnsRequire = array(); $this->ColumnsMaxLength = array(); $this->ColumnsPrimaryKeyValues = array(); $this->ColumnsAliasRender = array(); $this->ColumnsHtmlEditor = array(); $this->ColumnsPriorities = array(); $this->ColumnsMessages = array(); $this->JavascriptRender = ""; } function Init($langTableName,$_mode,&$_conn) { $this->Reset(); $this->LangTableName = $langTableName; $this->RenderMode = strtoupper($_mode); $this->db = &$_conn; $query = "SELECT * FROM languages"; $this->LanguagesTable = $this->db->sql_query($query); if($this->db->sql_numrows($this->LanguagesTable) <= 0){ $this->StopRender = true; } } function ReloadLanguages() { $query = "SELECT * FROM languages"; $this->LanguagesTable = $this->db->sql_query($query); if($this->db->sql_numrows($this->LanguagesTable) <= 0){ $this->StopRender = true; } } function AddColumn() { $args = func_get_args(); if(count($args) > 2) { $_columnName = $args[0]; $_dataType = strtoupper($args[1]); $_columnType = strtoupper($args[2]); $_htmlRender = count($args) > 3 ? $args[3] : ""; $_columnTitle = count($args) > 4 ? $args[4] : ""; $_aliasRender = count($args) > 5 ? $args[5] : ""; $_require = count($args) > 6 ? $args[6] : ""; $_maxLength = count($args) > 7 ? $args[7] : ""; $_message = count($args) > 8 ? $args[8] : ""; $_htmlEditorMode = count($args) > 9 ? $args[9] : ""; array_push($this->ColumnsPriorities,$_columnName); $this->ColumnsDataType[$_columnName] = $_dataType; $this->ColumnsType[$_columnName] = $_columnType; $this->ColumnsName[$_columnName] = $_columnTitle; if($_aliasRender != '') $this->ColumnsAliasRender[$_columnName] = $_aliasRender; else $this->ColumnsAliasRender[$_columnName] = $_columnName; $this->ColumnsRequire[$_columnName] = $_require; $this->ColumnsHtmlRender[$_columnName] = strtoupper($_htmlRender); $this->ColumnsMaxLength[$_columnName] = $_maxLength; $this->ColumnsHtmlEditor[$_columnName] = $_htmlEditorMode; $this->ColumnsMessages[$_columnName] = $_message; } } function AddPrimaryKeyValue($_columnName,$_Value) { $this->ColumnsPrimaryKeyValues[$_columnName] = $_Value; } function RenderInsert() { $cell=""; if(!$this->StopRender) { if($this->RenderMode == "TAB") { $Tab_Array = ""; $cell = $this->GetTabStart(); while ($dr = $this->db->sql_fetchrow($this->LanguagesTable)) { $Tab_ID = $this->TabInstanceName . $dr["language_code"]; $cell .= "
"; $Tab_Array .= ",['" . $Tab_ID . "','" . str_replace("'","",$dr["language_name"]) . "']"; $IsDefault = $dr["is_default"] == 'True'; $cell .= ""; $cell .= ""; $cell .= ""; $cell .= ""; for($x=0 ; $x < count($this->ColumnsPriorities) ; $x++) { $key = $this->ColumnsPriorities[$x]; $val = ""; if($this->ErrorFoundInUpdate != "") { $Idref = $this->TabInstanceName . $dr["language_code"] . $this->ColumnsAliasRender[$key]; if(isset($_POST[$Idref]) && !empty($_POST[$Idref])) { $val = $_POST[$Idref]; } } if($this->ColumnsType[$key] != "PRIMARYKEY") $cell .= $this->RenderControl($key,$dr["language_code"],$val); } $cell .= "
"; $cell .= "
"; } $cell .= $this->GetTabEnd(); $this->RenderTable = $cell; $this->JavascriptRender = ""; } } } function RenderUpdate() { $cell = ""; if(!$this->StopRender) { if($this->RenderMode == "TAB") { $Tab_Array = ""; $cell .= $this->GetTabStart(); $statement = "SELECT * from languages inner join " . $this->LangTableName . " on languages.language_id = " . $this->LangTableName . ".language_id"; $WhereSt = ""; foreach($this->ColumnsPrimaryKeyValues as $key=>$val) { $WhereSt .= " AND " . $key . " = " . $this->GetQuot($key) . $this->ColumnsPrimaryKeyValues[$key] . $this->GetQuot($key); } while ($dr = $this->db->sql_fetchrow($this->LanguagesTable)) { $drVals = ""; $query = $statement . " WHERE " . $this->LangTableName . ".language_id=" . $dr["language_id"] . $WhereSt; $CurrentTable = $this->db->sql_query($query); if($this->db->sql_numrows($CurrentTable) > 0){ $drVals = $this->db->sql_fetchrow($CurrentTable); } $Tab_ID = $this->TabInstanceName . $dr["language_code"]; $Tab_Array .= ",['" . $Tab_ID . "','" . str_replace("'","",$dr["language_name"]) . "']"; $cell .= "
"; $IsDefault = false;//$dr["is_default"] == 'True'; $cell .= ""; $cell .= ""; $cell .= ""; $cell .= ""; for($x=0 ; $x < count($this->ColumnsPriorities) ; $x++) { $key = $this->ColumnsPriorities[$x]; $val = ""; if($this->ErrorFoundInUpdate != "") { //if error found keep the values user insert $Idref = $this->TabInstanceName . $dr["LanguageCode"] . $this->ColumnsAliasRender[$key]; if(isset($_POST[$Idref]) && !empty($_POST[Idref])) { $val = $_POST[$Idref]; } } else { $val = (isset($drVals) && !empty($drVals) ? $drVals[$key] : ""); } if($this->ColumnsType[$key] != "PRIMARYKEY") $cell .= $this->RenderControl($key,$dr["language_code"],$val); } $cell .= "
"; $cell .= "
"; } $cell .= $this->GetTabEnd(); $this->RenderTable = $cell; $this->JavascriptRender = ""; } } } function GetRender() { global $validator; $validator->AddMultiligualValidate($this->TabInstanceName); return $this->RenderTable . "
" . $this->JavascriptRender . "
"; } function GetValidation($prefix) { $Validation_Array = ""; foreach($this->ColumnsName as $key=>$val) { if($this->ColumnsType[$key] != "PRIMARYKEY") { $requir = $this->ColumnsRequire[$key] ? "1" : "0"; $_type = $this->ColumnsDataType[$key]; $Validation_Array .= ",['" . $this->ColumnsAliasRender[$key] . "','" . $requir . "','" . $_type . "','" . $this->ColumnsMessages[$key] . "']"; } } if($Validation_Array != "") { return "\n var validation" . $prefix . " = [" . substr($Validation_Array,1) . "];"; } return ""; } function RenderControl($key,$subId,$val) { global $config; $ret = ""; $ret .= "" . $this->ColumnsName[$key] . " " . ""; $maxLength = ""; if ($this->ColumnsMaxLength[$key] != "-1") { $maxLength = "maxlength='" . $this->ColumnsMaxLength[$key] . "'"; } $Idref = $this->TabInstanceName . $subId . $this->ColumnsAliasRender[$key]; $ret .= ""; if(strtoupper($this->ColumnsHtmlRender[$key]) == "HTMLEDITOR") { $ret .= HtmlEditor::GetRender($Idref,$val,($this->ColumnsHtmlEditor[$key] != "" ? $this->ColumnsHtmlEditor[$key] : "")); } else if(strtoupper($this->ColumnsHtmlRender[$key]) == "MULTILINE") { $ret .= TextBox::GetRender($Idref,$val,$maxLength,"70%","TextArea","5"); } else if(strtoupper($this->ColumnsHtmlRender[$key]) == "UPLOAD") { $ret .= Upload::GetRender($Idref,$val); } else if(strtoupper($this->ColumnsHtmlRender[$key]) == "SINGLELINE") { $ret .= TextBox::GetRender($Idref,$val,$maxLength); } $ret .= ""; $ret .= ""; return $ret; } function GetTabStart() { return "
"; } function GetTabEnd() { return "
"; } function GetQuot($key) { return $this->ColumnsDataType[$key] == "STRING" || $this->ColumnsDataType[$key] == "DATE" || $this->ColumnsDataType[$key] == "DATETIME" ? "'" : ""; } function Update() { $replace_quot = false; if(!$this->StopRender) { if(count($this->ColumnsPrimaryKeyValues) > 0) { $statement = ""; while ($dr = $this->db->sql_fetchrow($this->LanguagesTable)) { $IsInsertMode = true; $statement = "SELECT count(*) from " . $this->LangTableName; $WhereSt = " WHERE language_id=" . $dr["language_id"] . " "; foreach($this->ColumnsPrimaryKeyValues as $key=>$val) { $WhereSt .= " AND " . $key . " = " . $this->GetQuot($key) . $this->ColumnsPrimaryKeyValues[$key] . $this->GetQuot($key); } $query = $statement . $WhereSt; $r = $this->db->sql_query($query); $oneLang = count($this->LanguagesTable) == 1; $IsInsertMode = (int)($this->db->sql_fetchfield(0,0,$r)) > 0 ? 1 : 0; $this->db->sql_freeresult($r); $Check_ID = $this->TabInstanceName . $dr["language_code"] . "_ck"; if( (isset($_POST[$Check_ID]) && !empty($_POST[$Check_ID]) && $_POST[$Check_ID] == "1") || $oneLang ) { $statement = ""; $ExecuteStatement = true; if($IsInsertMode == 0) { $statement = "INSERT INTO " . $this->LangTableName; $Columns = ""; $ColumnsValues = ""; foreach($this->ColumnsName as $key=>$val) { if($this->ColumnsType[$key] != "PRIMARYKEY") { $Idref = $this->TabInstanceName . $dr["language_code"] . $this->ColumnsAliasRender[$key]; if(isset($_POST[$Idref]) && !empty($_POST[$Idref])) { $Columns .= "," . $key; $ColumnsValues .= "," . $this->GetQuot($key) . ($replace_quot ? str_replace("'","''",$_POST[$Idref]) : $_POST[$Idref] ) . $this->GetQuot($key); } else { if((bool)$this->ColumnsRequire[$key]) { $ExecuteStatement = false; break; } else { $Columns .= "," . $key; $ColumnsValues .= ",NULL"; } } } } $Columns .= ",language_id"; $ColumnsValues .= ",'" . $dr["language_id"] . "'"; foreach($this->ColumnsPrimaryKeyValues as $key=>$val) { $Columns .= "," . $key; $ColumnsValues .= "," . $this->GetQuot($key) . $this->ColumnsPrimaryKeyValues[$key] . $this->GetQuot($key); } $statement .= "(" . substr($Columns,1) . ") VALUES (" . substr($ColumnsValues,1) . ")"; } else { $statement = "UPDATE " . $this->LangTableName . " SET "; $ColumnsAndValues = ""; foreach($this->ColumnsName as $key=>$val) { if($this->ColumnsType[$key] != "PRIMARYKEY") { $Idref = $this->TabInstanceName . $dr["language_code"] . $this->ColumnsAliasRender[$key]; if(isset($_POST[$Idref]) && !empty($_POST[$Idref])) { $ColumnsAndValues .= "," . $key . "=" . $this->GetQuot($key) . ($replace_quot ? str_replace("'","''",$_POST[$Idref]) : $_POST[$Idref] ) . $this->GetQuot($key); } else { if((bool)$this->ColumnsRequire[$key]) { $ExecuteStatement = false; break; } else { $ColumnsAndValues .= "," . $key . "=NULL"; } } } } $statement .= substr($ColumnsAndValues,1) . " " . $WhereSt; } if($ExecuteStatement) { //echo "$statement"; $this->db->sql_query($statement); } } else { $this->db->sql_query(" DELETE FROM " . $this->LangTableName . $WhereSt); } } return true; } else { echo ""; } } return false; } } ?> site_adminTitle */ } function RenderPublicHeader() { global $config,$auth; ?> site_title MultiligualRender != "" && $this->ModeDisplay != "UP_DOWN" ? true : false; if(count($this->ColumnsAlias) <= 0 && !$MultiSet) return ""; $res = ""; $res .= ""; if($MultiSet) $res .= ""; $res .= ""; $res .= "
". $this->MultiligualRender . ""; $res .= "
"; $res .= ""; $res .= ""; $res .= $MultiSet != "" ? ""; $WidthHasInited = true; } //parse meta fields if(!empty($this->MetaEngineFields)) { foreach($this->MetaEngineFields as $key=>$val) { if(!empty($this->MetaEngineDataRow)) { $res .= ""; } $tb = new TextBox("meta_" . $key,( isset($this->MetaEngineDataRow) && isset($this->MetaEngineDataRow[$key]) ? $this->MetaEngineDataRow[$key] : "")); $RenderTxt = $tb->GetRender(); if($Seperator != "") $res .= $val . $Seperator . $RenderTxt . "
" ; else $res .= ""; } } $res .= $MultiSet != "" ? "" : ""; if($this->ModeDisplay == "UP_DOWN") { $res .= ""; } $res .= $MultiSet != "" ? "" : ""; $res .= "
" . _CONTENT_PROPERTIES . "
" : ""; $Seperator = $MultiSet != "" ? ":
" : ""; $WidthHasInited = false; foreach($this->ColumnsAlias as $key=>$val) { $Id_Name = isset($this->ColumnsFormRenderName[$key]) ? $this->ColumnsFormRenderName[$key] : $key; $RenderTxt = ""; if(isset($this->ColumnsRenderType[$key])) { if($this->ColumnsRenderType[$key] == "DatePicker") { $newdp = new DatePicker($Id_Name,( isset($this->dr) && isset($this->dr[$key]) ? $this->dr[$key] : "")); $RenderTxt = $newdp->GetRender(); } else if($this->ColumnsRenderType[$key] == "TextBox") { $tb = new TextBox($Id_Name, ( isset($this->dr) && isset($this->dr[$key]) ? $this->dr[$key] : "")); $RenderTxt = $tb->GetRender(); } else if($this->ColumnsRenderType[$key] == "Label") { $lb = new Label(isset($this->dr) && isset($this->dr[$key]) ? $this->dr[$key] : "","m_nb"); $RenderTxt = $lb->GetRender(); } else if($this->ColumnsRenderType[$key] == "Upload") { $Up = new Upload($Id_Name,isset($this->dr) && isset($this->dr[$key]) ? $this->dr[$key] : ""); $RenderTxt = $Up->GetRender(); } else { $RenderTxt = $this->ColumnsRenderType[$key]; } } else { $lb = new Label(isset($this->dr) && isset($this->dr[$key]) ? $this->dr[$key] : ""); $RenderTxt = $lb->GetRender(); } if($Seperator != "") $res .= $val . $Seperator . $RenderTxt . "
" ; else $res .= "
" . $val . ":" . $RenderTxt . "
" . $val . ":" . $RenderTxt . "
" . $this->MultiligualRender . "
 
"; $res .= "
"; $res .= $this->HiddenArea; global $validator; foreach($this->ColumnsValidator as $key=>$val) { $Id_Name = isset($this->ColumnsFormRenderName[$key]) ? $this->ColumnsFormRenderName[$key] : $key; $validator->AddTagValidator($Id_Name,1,$val); } return $res; } } ?>MsgCollector,$msg); } function GetValidators() { $ret = ""; for($i = 0 ; $i < count($this->MsgCollector) ; $i++){ $ret .= "- " . str_replace("'","",$this->MsgCollector[$i]) . "\\n"; } return $ret; } function RenderMessages() { if(count($this->MsgCollector) > 0) { echo "\n\t\t\n"; } $this->MsgCollector = array(); } } ?>sql_query($sql); $physical_folder = ( $row = $db->sql_fetchrow($result) ) ? ((isset($row) && $row["physical_folder"] != "") ? $row["physical_folder"] : "-1") : "-1"; $db->sql_freeresult($result); $UserDirectory = $attachmentUploadDir . $physical_folder . "/"; if(is_dir($UserDirectory)) { return $UserDirectory; } else if(isset($row)) { // To create the folder with 0777 permissions, we need to set umask to zero. $UserDirectory = $attachmentUploadDir . $row["user_name"] . "/"; $oldumask = umask(0) ; mkdir( $UserDirectory, 0777 ) ; umask( $oldumask ) ; if(is_dir($UserDirectory)) { $sql = "UPDATE users SET physical_folder = '" . $row["user_name"] . "' WHERE user_id=" . $userID; $db->sql_query($sql); return $UserDirectory; } else { $salt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $len = strlen($salt); $pf = ''; mt_srand(10000000*(double)microtime()); for ($i = 0; $i < 10; $i++) $pf .= $salt[mt_rand(0,$len - 1)]; $UserDirectory = $attachmentUploadDir . $pf . "/"; $oldumask = umask(0) ; mkdir( $UserDirectory, 0777 ) ; umask( $oldumask ) ; if(is_dir($UserDirectory)) { $sql = "UPDATE users SET physical_folder = '" . $pf . "' WHERE user_id=" . $userID; $db->sql_query($sql); return $UserDirectory; } } } } function DeleteAttachment($ID) { global $db, $auth, $config; $request = $db->sql_query("SELECT filename, attach_id, type, user_id FROM users_attachments WHERE attach_id = $ID LIMIT 1"); if (mysql_num_rows($request) != 0) { list ($real_filename, $attach_id, $type, $user_id) = mysql_fetch_row($request); $attachmentUploadDir = AttachmentUploadDir($user_id); $file = getAttachmentFilename($real_filename,$attach_id,$attachmentUploadDir,false); $sql = "DELETE FROM users_attachments WHERE attach_id=$ID LIMIT 1"; $db->sql_query($sql); unlink($file) ; } } function CopyAttachment($ID,$NewName) { global $arImages, $db, $auth, $config; $request = $db->sql_query("SELECT filename, attach_id, type, user_id FROM users_attachments WHERE attach_id = $ID LIMIT 1"); if (mysql_num_rows($request) != 0) { list ($real_filename, $attach_id, $type, $user_id) = mysql_fetch_row($request); $attachmentUploadDir = AttachmentUploadDir($user_id); $file = getAttachmentFilename($real_filename,$attach_id,$attachmentUploadDir,false); $size = filesize($file); $sExtension = substr( $NewName, ( strrpos($NewName, '.') + 1 ) ) ; $filetype = in_array( strtolower($sExtension), $arImages ) ? "image" : "file"; $sql = "INSERT INTO users_attachments (type, user_id, filename, size) VALUES ('" . $filetype . "','" . $auth->UserId . "','" . str_replace("'","",$NewName) . "','" . $size . "')"; $db->sql_query($sql); $AttachID = $db->sql_nextid(); $sFilePath = $attachmentUploadDir . getAttachmentFilename($NewName,$AttachID,$attachmentUploadDir,true); copy($file,$sFilePath); return array($AttachID,$sFilePath,$NewName); } mysql_free_result($request); } function AttachmentVirtual($ID) { $ret = ""; global $arImages, $db, $auth, $config; $request = $db->sql_query("SELECT filename, attach_id, type, user_id FROM users_attachments WHERE attach_id = $ID LIMIT 1"); if (mysql_num_rows($request) != 0) { list ($real_filename, $attach_id, $type, $user_id) = mysql_fetch_row($request); $attachmentUploadDir = "/gallery/users/"; $sql = "SELECT * FROM users WHERE user_id=" . $user_id; $result = $db->sql_query($sql); $attachmentUploadDir .= ( $row = $db->sql_fetchrow($result) ) ? ((isset($row) && $row["physical_folder"] != "") ? $row["physical_folder"] : "-1") : "-1"; $db->sql_freeresult($result); $ret = $attachmentUploadDir . "/" . getAttachmentFilename($real_filename, $ID,""); } mysql_free_result($request); return $ret; } function UploadAttachment($ID, $user_id = -1) { global $config, $arAllowed, $arDenied, $arImages, $db, $auth; $oFile = $_FILES[$ID] ; if($oFile['name'] == "") return ""; $attachmentUploadDir = AttachmentUploadDir(($user_id == -1 ? $auth->UserId : $user_id)); //echo $attachmentUploadDir; //Get the uploaded file name. $sFileName = $oFile['name'] ; $sOriginalFileName = $sFileName ; $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; if ( ( count($arAllowed) == 0 || in_array( strtolower($sExtension), $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( strtolower($sExtension), $arDenied ) ) ) { $size = filesize($oFile['tmp_name']); $filetype = in_array( strtolower($sExtension), $arImages ) ? "image" : "file"; $sql = "INSERT INTO users_attachments (type, user_id, filename, size) VALUES ('" . $filetype . "','" . ($user_id == -1 ? $auth->UserId : $user_id) . "','" . str_replace("'","",$sFileName) . "','" . $size . "')"; $db->sql_query($sql); $AttachID = $db->sql_nextid(); $sFilePath = $attachmentUploadDir . getAttachmentFilename($sFileName,$AttachID,$attachmentUploadDir,true) ; move_uploaded_file($oFile['tmp_name'], $sFilePath ) ; if ( is_file( $sFilePath ) ) { $oldumask = umask(0) ; chmod( $sFilePath, 0777 ) ; umask( $oldumask ) ; } return array($AttachID,$sFilePath,$sFileName); } else { return ""; } return ""; } // Get an attachment's encrypted filename. If $new is true, won't check for file existence. function getAttachmentFilename($filename, $attachment_id, $attachmentUploadDir, $new = false ) { global $config, $useSimpleFileNames; // Remove special accented characters - ie. s. $clean_name = $filename; // Sorry, no spaces, dots, or anything else but letters allowed. $clean_name = preg_replace(array('/\s/', '/[^\w_\.\-]/'), array('_', ''), $clean_name); $enc_name = $attachment_id . '_' . str_replace('.', '_', $clean_name) . md5($clean_name); $clean_name = preg_replace('~\.[\.]+~', '.', $clean_name); if ($new && $useSimpleFileNames) return "(" . $attachment_id . ")" . $clean_name; else if ($new) return $enc_name; if (file_exists($attachmentUploadDir . $enc_name)) $filename = $attachmentUploadDir . $enc_name; else $filename = $attachmentUploadDir . "(" . $attachment_id . ")" . $clean_name; return $filename; } // Download an attachment. function Download() { global $config,$db; // Make sure some attachment was requested! if (!isset($_REQUEST['id'])) { header('HTTP/1.0 404 '); header('Content-Type: text/plain'); die('404 - '); } $_REQUEST['id'] = (int) $_REQUEST['id']; $request = $db->sql_query("SELECT filename, attach_id, type, user_id FROM users_attachments WHERE attach_id = $_REQUEST[id] LIMIT 1"); if (mysql_num_rows($request) == 0) { header('Content-Disposition: attachment; filename="File not found"'); header('Content-Type: application/octet-stream'); if (readfile($config["physicalPath"] . "/gms/images/none.gif") === null) echo implode('', file($config["physicalPath"] . "/gms/images/none.gif")); header('HTTP/1.0 404 '); header('Content-Type: text/plain'); die('File not found '); } list ($real_filename, $attach_id, $type, $user_id) = mysql_fetch_row($request); mysql_free_result($request); // Update the download counter. UpdateHit("users_attachments", "attach_id", $attach_id, "downloads"); // This is done to clear any output that was made before now. (would use ob_clean(), but that's PHP 4.2.0+...) @ob_end_clean(); if (!empty($config["gzip_enabled"]) && $config["gzip_enabled"] && @version_compare(PHP_VERSION, '4.2.0') >= 0) @ob_start('ob_gzhandler'); else @ob_start(); $attachmentUploadDir = AttachmentUploadDir($user_id); $filename = getAttachmentFilename($real_filename, $_REQUEST['id'], $attachmentUploadDir); // No point in a nicer message, because this is supposed to be an attachment anyway... if (!file_exists($filename)) { header('Content-Disposition: attachment; filename="File not found"'); header('Content-Type: application/octet-stream'); if (readfile($config["physicalPath"] . "/gms/images/none.gif") === null) echo implode('', file($config["physicalPath"] . "/gms/images/none.gif")); header('HTTP/1.0 404 '); header('Content-Type: text/plain'); die('File not found '); } // Send the attachment headers. header('Pragma: '); header('Cache-Control: max-age=' . (525600 * 60) . ', private'); $browser = array( 'is_opera' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false, 'is_opera6' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 6') !== false, 'is_ie4' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 4') !== false, 'is_safari' => strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== false, 'is_mac_ie' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false ); $is_gecko = strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false && !$browser; if (!$is_gecko) header('Content-Transfer-Encoding: binary'); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($filename)) . ' GMT'); header('Accept-Ranges: bytes'); header('Set-Cookie:'); header('Connection: close'); if ($type != "image") { header('Content-Disposition: attachment; filename="' . $real_filename . '"'); header('Content-Type: application/octet-stream'); //header('Content-Disposition: inline; filename="' . $real_filename . '"'); //header('Content-Type: Image/pjpeg'); } if (filesize($filename) != 0) { $size = @getimagesize($filename); if (!empty($size) && $size[2] > 0 && $size[2] < 4) header('Content-Type: image/' . ($size[2] != 1 ? ($size[2] != 2 ? 'png' : 'jpeg') : 'gif')); } if (empty( $config["gzip_enabled"]) && ! $config["gzip_enabled"]) header('Content-Length: ' . filesize($filename)); // Try to buy some time... @set_time_limit(0); @ini_set('memory_limit', '128M'); // On some of the less-bright hosts, readfile() is disabled. It's just a faster, more byte safe, version of what's in the if. if (@readfile($filename) === null) echo implode('', file($filename)); exit; } ?>filename = $xml_file; $this->xml = xml_parser_create(); xml_set_object($this->xml, $this); xml_set_element_handler($this->xml, 'startHandler', 'endHandler'); xml_set_character_data_handler($this->xml, 'dataHandler'); $this->parse($xml_file); } function parse($xml_file) { set_time_limit(0); $bytes_to_parse = 4096; if(function_exists("curl_init")) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $xml_file); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); $txt = curl_exec($ch); curl_close($ch); if($txt=='') { die('Cannot open XML data file: '.$xml_file); return false; } $parse = xml_parse($this->xml, $txt); } else { if (($fp = fopen($xml_file, 'r'))) { while ($data = fread($fp, $bytes_to_parse)) { $parse = xml_parse($this->xml, $data, feof($fp)); if (!$parse) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($this->xml)), xml_get_current_line_number($this->xml))); xml_parser_free($this->xml); } } } } return true; } function startHandler($parser, $name, $attributes) { $data['name'] = $name; if ($attributes) { $data['attributes'] = $attributes; } $this->data[] = $data; } function dataHandler($parser, $data) { if ($data = trim($data)) { $index = count($this->data) - 1; $this->data[$index]['content'] = $data; } } function endHandler($parser, $name) { if (count($this->data) > 1) { $data = array_pop($this->data); $index = count($this->data) - 1; $this->data[$index]['child'][] = $data; } } } ?>cc_number = ereg_replace('[^0-9]', '', $number); if (isset($type) && $type != "") { $this->cc_type = $type; } else { if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) $this->cc_type = 'Visa'; elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) $this->cc_type = 'Master Card'; elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) $this->cc_type = 'American Express'; elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) $this->cc_type = 'Diners Club'; elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) $this->cc_type = 'Discover'; elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) $this->cc_type = 'JCB'; elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) $this->cc_type = 'Australian BankCard'; else return -1; } if (is_numeric($expiry_m) && ($expiry_m > 0) && ($expiry_m < 13)) $this->cc_expiry_month = $expiry_m; else return -2; $current_year = date('Y'); $expiry_y = substr($current_year, 0, 2) . $expiry_y; if (is_numeric($expiry_y) && ($expiry_y >= $current_year) && ($expiry_y <= ($current_year + 10))) $this->cc_expiry_year = $expiry_y; else return -3; if ($expiry_y == $current_year) if ($expiry_m < date('n')) return -4; if($cvc != "") { if (is_numeric($cvc) && strlen($cvc) > 2 && strlen($cvc) < 5) $this->cc_number = trim(ereg_replace('[^0-9]', '', $number)); else return -5; } return ($this->is_valid() ? 0 : -6); } function is_valid() { $cardNumber = strrev($this->cc_number); $numSum = 0; for ($i=0; $i 9) { $firstNum = $currentNum % 10; $secondNum = ($currentNum - $firstNum) / 10; $currentNum = $firstNum + $secondNum; } $numSum += $currentNum; } // If the total has no remainder it's OK return ($numSum % 10 == 0); } } ?>$val) { if(!is_integer($key)) $data .= "$key=".urlencode($val)."&"; } } else { $data = $postdata; } $fp = pfsockopen("ssl://".$host, 443, $errno, $errstr, 120); if( !$fp ) { //print "$errstr ($errno)
\n"; LogError("Error during payment",$errno,str_replace("\n","",$errstr),"PHP"); return false; } else { fputs( $fp, "POST $usepath HTTP/1.0\r\n"); fputs( $fp, "Accept: */*\r\n"); fputs( $fp, "Accept: image/gif\r\n"); fputs( $fp, "Accept: image/x-xbitmap\r\n"); fputs( $fp, "Accept: image/jpeg\r\n"); if( strtoupper($method) == "POST" ) { $strlength = strlen( $postdata); fputs( $fp, "Content-type: application/x-www-form-urlencoded\r\n"); fputs( $fp, "Content-length: ".$strlength."\r\n\r\n"); fputs( $fp, $postdata."\r\n"); } fputs( $fp, "\r\n" , 1); $output = ""; while( !feof( $fp ) ) { $output .= fgets( $fp, 1024); } fclose( $fp); } $outputXML = explode("\r\n", $output); return $outputXML[7]; } } ?> Error Page

 

Please try again later.