public function create_gen_path($cms_id, $stepsArray, $steps_pages) { global $fpdo; if ($stepsArray != '') { $i = 0; $path = "<div class='row'>"; $path .= '<div class="row bs-wizard" style="border-bottom:0;">'; $count = count($stepsArray); if ($_REQUEST['gr_id_pg'] == "") { $group_id = $i; } else { $group_id = $_REQUEST['gr_id_pg']; } $CurrentOrder = $group_id; foreach ($stepsArray as $stepName) { if ($count < 8) { $width = 100 / $count; } else { $width = 100 / 8; } if ($i % 8 == 0) { $path .= '</div><div class="row bs-wizard" style="border-bottom:0;">'; } $style = 'style="width:' . $width . '%;float:left"'; $req_id = ""; $class2 = ""; if ($CurrentOrder >= $i) { $class = 'complete'; } else { if ($_REQUEST['id'] == "") { $class2 = 'disabled'; } $class = 'notcomplete'; } if ($_REQUEST['id'] != "") { $req_id = "id=" . $_REQUEST['id'] . "&table_id=" . $_REQUEST['id'] . "&gr_id_pg=" . $i; } $pageLink = $steps_pages[$i] . "?{$req_id}"; $path .= '<div class=" bs-wizard-step ' . $class . ' ' . $class2 . '" ' . $style . '> <div class="text-center bs-wizard-stepnum">' . $this->getConstant("Step") . ": " . $stepName . '</div> <div class="progress"><div class="progress-bar"></div></div> <a href="' . $pageLink . '" class="bs-wizard-dot" data-group="' . $i . '"></a> </div>'; $i++; } $path .= '</div></div>'; } else { $groups = $fpdo->from("cms_module_fields_groups")->where("module_id", $cms_id)->fetchAll(); if ($_REQUEST['gr_id_pg'] == "") { $_REQUEST['gr_id_pg'] = $first_group; } $AllGroupsArray = array(); $AllGroups = array(); $AllFieldsArray = array(); $NotSavedFields = array(); $NotSavedFieldsFullText = array(); foreach ($groups as $group_c) { $id = $group_c["id"]; array_push($AllGroupsArray, $id); $query_fields = $fpdo->from("cms_module_fields")->leftJoin("cms_module_fields_groups_fields on cms_module_fields.id=cms_module_fields_groups_fields.field_id")->where("grp_id = '{$id}' and table_id='" . $cms_id . "'")->fetchAll(); if (count($query_fields) > 0) { array_push($AllGroups, $id); } } $groups_ids = implode(',', $AllGroupsArray); $query_f = $fpdo->from("cms_module_fields")->leftJoin("cms_module_fields_groups_fields on cms_module_fields.id=cms_module_fields_groups_fields.field_id")->where("grp_id in ({$groups_ids}) and table_id='" . $cms_id . "'")->fetchAll(); if (count($query_f) > 0) { foreach ($query_f as $row) { array_push($AllFieldsArray, $row['id']); } } $AllSavedFields = implode(',', $AllFieldsArray); $getAllFields = $fpdo->from('cms_module_fields')->where("table_id='" . $cms_id . "' and id not in ({$AllSavedFields})")->fetchAll(); foreach ($getAllFields as $allFiels) { if ($allFiels['type'] == 'FullTextEditor') { array_push($NotSavedFieldsFullText, $allFiels['id']); } else { array_push($NotSavedFields, $allFiels['id']); } } $AllNotNullGroups = implode(',', $AllGroups); $groups_all = $fpdo->from("cms_module_fields_groups")->where("module_id='{$cms_id}' and id in ({$AllNotNullGroups})")->fetchAll(); $first_group = $groups_all[0]['id']; $path = "<div class='row'>"; $i = 0; $count = count($groups_all); $groupCounts = 1; $path .= '<div class="row bs-wizard" style="border-bottom:0;">'; $utils = new utils(); if ($_REQUEST['gr_id_pg'] == "") { $group_id = $groups_all[0]['id']; } else { $group_id = $_REQUEST['gr_id_pg']; } $CurrentOrder = $utils->lookupField("cms_module_fields_groups", "id", "ord", $group_id); foreach ($groups_all as $row) { if ($count < 8) { $width = 100 / $count; } else { $width = 100 / 8; } if ($i % 8 == 0) { $path .= '</div><div class="row bs-wizard" style="border-bottom:0;">'; } $style = 'style="width:' . $width . '%;float:left"'; $req_id = ""; $class2 = ""; if ($CurrentOrder >= $row['ord']) { $class = 'complete'; } else { if ($_REQUEST['id'] == "") { $class2 = 'disabled'; } $class = 'notcomplete'; } if ($_REQUEST['id'] != "") { $req_id = "id=" . $_REQUEST['id'] . "&"; } $pageLink = basename($_SERVER['PHP_SELF']) . "?" . $req_id . "cmsMID={$cms_id}&gr_id_pg=" . $row['id']; $path .= '<div class=" bs-wizard-step ' . $class . ' ' . $class2 . '" ' . $style . '> <div class="text-center bs-wizard-stepnum">' . $this->getConstant("Step") . ": " . $row['name'] . '</div> <div class="progress"><div class="progress-bar"></div></div> <a href="' . $pageLink . '" class="bs-wizard-dot" data-group="' . $row['id'] . '"></a> </div>'; $i++; $groupCounts++; } $path .= '</div></div>'; } return $path; }
public function create_gen_path($cms_id, $stepsArray, $steps_pages) { global $fpdo; if ($stepsArray != '') { $i = 0; $path = "<div class='row'>"; $path .= '<div class="col-sm-12 bs-wizard" style="border-bottom:0;">'; $count = count($stepsArray); if ($_REQUEST['gr_id_pg'] == "") { $group_id = $i; } else { $group_id = $_REQUEST['gr_id_pg']; } $CurrentOrder = $group_id; foreach ($stepsArray as $stepName) { if ($count < 8) { $width = 100 / $count; } else { $width = 100 / 8; } if ($i % 8 == 0) { $path .= '</div><div class="col-sm-12 bs-wizard" style="border-bottom:0;">'; } $style = 'style="width:' . $width . '%;float:left"'; $req_id = ""; $class2 = ""; if ($CurrentOrder >= $i) { $class = 'complete'; } else { if ($_REQUEST['id'] == "") { $class2 = 'disabled'; } $class = 'notcomplete'; } $url_id = ""; if ($_REQUEST['id'] != "" || $_REQUEST['table_id'] != "") { if ($_REQUEST['id'] != "") { $id_request = $_REQUEST['id']; $url_id = "cmsMID=" . $_SESSION['cmsMID'] . "&id=" . $_REQUEST['id'] . "&gr_id_pg=" . $i; } else { $id_request = $_REQUEST['table_id']; } if ($i == 2) { $req_id = "cmsMID=" . $_SESSION['cmsMID'] . "&id=" . $id_request . "&module_id=" . $id_request . "&gr_id_pg=" . $i; } else { $req_id = "cmsMID=" . $_SESSION['cmsMID'] . "&id=" . $id_request . "&table_id=" . $id_request . "&gr_id_pg=" . $i; } } if (count($steps_pages) > 0) { $pageLink = $steps_pages[$i] . "?{$req_id}"; } else { $pageLink = basename($_SERVER['PHP_SELF']) . "?" . $url_id; } $path .= '<div class=" bs-wizard-step ' . $class . ' ' . $class2 . '" ' . $style . '> <div class="text-center bs-wizard-stepnum">' . $this->getConstant("Step") . ": " . $this->getConstant($stepName) . '</div> <div class="progress"><div class="progress-bar"></div></div> <a href="' . $pageLink . '" class="bs-wizard-dot" data-group="' . $i . '"></a> </div>'; $i++; } $path .= '</div></div>'; } else { $utils = new utils(); $groups = $fpdo->from("cms_fields_groups_page_builder")->where("module_id", $cms_id)->fetchAll(); if ($_REQUEST['gr_id_pg'] == "") { $_REQUEST['gr_id_pg'] = $first_group; } $get_AllGroups = $utils->GetNotNullGroupsWithFields(); // $AllGroupsArray = $get_AllGroups[2]; $AllGroups = $get_AllGroups[0]; $AllNotNullGroups = implode(',', $AllGroups); $groups_all = $fpdo->from("cms_fields_groups_page_builder")->where("module_id='{$cms_id}' and id in ({$AllNotNullGroups})")->fetchAll(); $first_group = $groups_all[0]['id']; $count = count($groups_all); if ($count > 1) { $path = "<div class='row'>"; $i = 0; $groupCounts = 1; $path .= '<div class="col-sm-12 bs-wizard" style="border-bottom:0;">'; if ($_REQUEST['gr_id_pg'] == "") { $group_id = $groups_all[0]['id']; } else { $group_id = $_REQUEST['gr_id_pg']; } $CurrentOrder = $utils->lookupField("cms_fields_groups_page_builder", "id", "ord", $group_id); foreach ($groups_all as $row) { if ($count < 8) { $width = 100 / $count; } else { $width = 100 / 8; } if ($i % 8 == 0) { $path .= '</div><div class="col-sm-12 bs-wizard" style="border-bottom:0;">'; } $style = 'style="width:' . $width . '%;float:left"'; $req_id = ""; $class2 = ""; if ($CurrentOrder >= $row['ord']) { $class = 'complete'; } else { if ($_REQUEST['id'] == "") { $class2 = 'disabled'; } $class = 'notcomplete'; } if ($_REQUEST['id'] != "") { $req_id = "id=" . $_REQUEST['id'] . "&"; } $lang_word = ""; if ($row['lang'] != "") { $lang_word = " (" . $this->getConstant($row['lang']) . ")"; } $pageLink = basename($_SERVER['PHP_SELF']) . "?" . $req_id . "cmsMID={$cms_id}&gr_id_pg=" . $row['id']; $path .= '<div class=" bs-wizard-step ' . $class . ' ' . $class2 . '" ' . $style . '> <div class="text-center bs-wizard-stepnum">' . $this->getConstant("Step") . ": " . $row['name'] . $lang_word . '</div> <div class="progress"><div class="progress-bar"></div></div> <a href="' . $pageLink . '" class="bs-wizard-dot" data-group="' . $row['id'] . '"></a> </div>'; $i++; $groupCounts++; } $path .= '</div></div>'; } } return $path; }
session_start(); error_reporting(0); include_once "../config.php"; include_once 'controller/include.inc.php'; $voiControl = new VoilaController(); $utils = new utils(); $ob_roles = $voiControl->obRoles(); if ($_SESSION['go-cms'] == 'go') { $utils->redirect("views/home/home.php"); } $error_msg = ''; if ($_REQUEST['action'] == 'login') { $username_req = $_REQUEST['username']; $password_req = md5($_REQUEST['password']); $username = $utils->lookupField('cms_users', 'username', 'username', $username_req); $password = $utils->lookupField('cms_users', 'password', 'password', $password_req); $login_result = $ob_roles->login($username_req, $password_req); } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>VOILA CMS | Log in</title> <!-- Tell the browser to be responsive to screen width --> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <!-- Bootstrap 3.3.5 --> <link rel="stylesheet" href="includes/bootstrap/css/bootstrap.min.css"> <!-- Font Awesome -->