public static function getInstance() { if (is_null(self::$instance)) { self::$instance = new administrator(); } return self::$instance; }
function adminLoginNow() { $username = $_REQUEST['login_user']; $password = $_REQUEST['login_password']; $admin = new administrator(); $admin->setUsername($username); $data = $admin->getAdminFromUsername(); if (count($data) > 0) { $admin->extractor($data); if ($admin->password() == md5($password)) { $session = new Sessions(); $session->setAdminLoginSessions($admin->id(), $admin->name(), $admin->email()); Common::jsonSuccess("Success"); } else { Common::jsonError("Login Error"); } } else { Common::jsonError("Login Error"); } }
public static function adminTokenField() { $core = core::getInstance(); eval($core->callHook('startShowAdminTokenField')); $output = '<input type="hidden" name="token" value="' . administrator::getToken() . '" />'; eval($core->callHook('endShowAdminTokenField')); echo $output; }
function fogetPassword($adminId, $adminPW) { $systemSetting = new systemSetting(); $common = new common(); $systemSetting->extractor($systemSetting->getSettings()); $Administrator = new administrator(); $Administrator->setAdminId($adminId); $Administrator->extractor($Administrator->getAdministratorByAdminId()); $subject = $systemSetting->sySettingCompanyName() . " Reset Your Password !"; $EmailMessage = '<table width="785" border="0" cellpadding="20" cellspacing="0"> <tr> <td width="-34" bgcolor="#333333" style="font-family:Arial, Helvetica, sans-serif; font-size:20px; color:#000; padding:4px 0 4px 5px;"> </td> <td width="699" align="left" bgcolor="#333333"><img src="' . DOC_ROOT . 'uplode-img/company-logo/' . $systemSetting->sySettingCompanyLogo() . '" /></td> </tr> <tr> <td colspan="2" bgcolor="#f0f0f0" style=" font-family:arial; font-size:13px;"> <br> Dear <strong> ' . $Administrator->getAdminName() . '</strong>, <br/><br/> Thank you for confirming, following is your username and temporary password. <br> <br> <p> <strong>Panel Username :</strong> ' . $Administrator->getAdminUsername() . '<br/> <strong>Panel Password :</strong> <span style="color:#F00"><strong> ' . $adminPW . '</strong> </span><br/> <br/><br/> <p> Thanking you for taking the time in shopping online with us. <br/> ' . $systemSetting->sySettingCompanyName() . '<br/><br/> Best Regards,<br/> Web Administrator<br/> <strong>' . $systemSetting->sySettingCompanyName() . ' - on ' . date('Y-m-d h:i a') . '</strong><br/> </p> <hr/> <span style="color:#666; font-size:11px; font-family:Arial, Helvetica, sans-serif;">You are receiving this email, because an account has been registered at the ' . $systemSetting->sySettingCompanyName() . ' Online Shoping cart portal. If you have not made any registration or unaware of the same, please email administrator at ' . $systemSetting->sySettingCompanyEmail() . ' to remove you from this panel.</span> </td> </tr> </table> '; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = $systemSetting->sySettingHost(); // sets GMAIL as the SMTP server $mail->Port = $systemSetting->sySettingPort(); // set the SMTP port $mail->Username = $systemSetting->sySettingSmtpUsername(); // GMAIL username $mail->Password = $systemSetting->sySettingSmtpPassword(); // GMAIL password $mail->From = $systemSetting->sySettingSmtpUsername(); $mail->FromName = $systemSetting->sySettingFromName(); $mail->Subject = $subject; $mail->WordWrap = 50; // set word wrap $mail->MsgHTML($EmailMessage); $mail->AddAddress($Administrator->getAdminEmail(), $systemSetting->sySettingCompanyName()); $mail->IsHTML(true); // send as HTML $mail->Send(); return true; }
echo $id; include_once 'nurses.php'; $user_nurse = new nurses(); $user_nurse->get_nurse($id); $user_row = $user_nurse->fetch(); $_SESSION['user'] = $user; $_SESSION['fname'] = $user_row['nurse_fname']; $_SESSION['sname'] = $user_row['nurse_sname']; $_SESSION['id'] = $id; $_SESSION['admin'] = false; header('Location: index.php'); } else { session_start(); $id = $row['id']; include_once 'administrator.php'; $user_admin = new administrator(); $user_admin->get_administrator($id); $user_row = $user_admin->fetch(); session_start(); $_SESSION['user'] = $user; $_SESSION['fname'] = $user_row['admin_fname']; $_SESSION['sname'] = $user_row['admin_sname']; $_SESSION['id'] = $id; $_SESSION['admin'] = true; header('Location: index.php'); } } } } } ?>
{ if ($where == NULL) { $where = " AND `lang`='{$lang}' "; } else { $where = " AND `lang`='{$lang}' AND ({$where})"; } $data = $this->_model->_webMenu(0, '', NULL, $where); return $data; } public function viewDatetime($time) { return date('Y-m-d H:i', $time); } } include_once 'error/admin.php'; $c = new administrator(); $lang = $c->language(); $error = ''; if (isset($_POST['btnLogin'])) { $cUser = new controlUsers(); $user = trim($_POST['username']); $pass = $_POST['password']; $group = 3; $ip = $_SERVER['REMOTE_ADDR']; $error = $cUser->login($user, $pass, $ip, $group); } //print_r($arrUrl); //session_destroy(); if (!isset($_SESSION['adminId'])) { include_once 'view/admin_login.php'; } else {
echo $core->lang($v->getInfoVal('name')); ?> </a></li> <?php } } ?> <!-- notifications mobile --> <li class="notifsNumber"> <a href="#" data-reveal-id="notifs"><?php echo $core->lang('Notifications'); ?> <span class="notif round label"></span></a> </li> <li><a href="index.php?action=logout&token=<?php echo administrator::getToken(); ?> " class="tiny button alert"><?php echo $core->lang('Logout'); ?> </a></li> <li><a href="../" class="tiny button" onclick="window.open(this.href);return false;"><?php echo $core->lang('Back to website'); ?> </a></li> </ul> </aside> <a class="exit-off-canvas"></a> <!-- CONTENU & SIDEBAR NAVIGATION PRINCIPALE -->
$nid = intval($_REQUEST['nid']); $obj = new administrator(); if (!$obj->edit_administrator($nid, $sname, $fname, $gender, $department)) { echo '<div id="divStatus" class="error"> Could Not Update Admin Information <span class="ti-face-sad" ></span> </div>'; } else { echo '<div id="divStatus" class="success"> Admin Information Updated <span class="ti-face-smile" ></span> </div> '; } } break; case 5: include_once 'administrator.php'; include_once 'users.php'; if (isset($_REQUEST["id"])) { $nid = intval($_REQUEST['id']); $user = new users(); $obj = new administrator(); if (!$obj->delete_admin($nid)) { echo '<div id="divStatus" class="error" onclick=hideStatus()> Could Not Delete <span class="ti-face-sad" ></span></div>'; } else { $user->delete_user($nid); echo '<div id="divStatus" class="success"> Delete Successful <span class="ti-face-smile" ></span></div> '; } } break; }
getAllAdmins(); } } xmlhttp.open("GET","adminFunctions.php?cmd=4&fn="+fn+"&sn="+sn +"&gender="+g+"&dpt="+d+"&nid="+nid,true); xmlhttp.send(); } </script> <?php $nid = intval($_REQUEST['id']); include_once "administrator.php"; include_once 'department.php'; $obj = new administrator(); if (!$obj->get_administrator($nid)) { echo 'could not find'; } $row = $obj->fetch(); $sname = $row['admin_sname']; $fname = $row['admin_fname']; $gender = $row['gender']; $department = intval($row['department']); $deptment = new departments(); ?> <form action="nursesupdate.php" method="post" id="add-form"> <legend> Update Nurse Information </legend> <table class="add">
class setup extends adb { function setup() { } function createTable($name, $query) { $str_query = "create table if not exists " . $name . "(" . $query . ")"; return $this->query($str_query); } } $obj = new setup(); $obj->createTable('webPro_department', 'department_id INT AUTO_INCREMENT PRIMARY KEY,' . 'department_name VARCHAR(30)'); $obj->createTable('webPro_nurses', 'nurse_id INT AUTO_INCREMENT PRIMARY KEY,' . 'nurse_fname VARCHAR(50),' . 'nurse_sname VARCHAR(50),' . 'gender CHAR,' . 'department INT,' . 'FOREIGN KEY (department) REFERENCES webPro_department(department_id)'); $obj->createTable('webPro_administrators', 'admin_id INT AUTO_INCREMENT PRIMARY KEY,' . 'admin_fname VARCHAR(50),' . 'admin_sname VARCHAR(50),' . 'gender CHAR,' . 'department INT,' . 'position VARCHAR(20),' . 'FOREIGN KEY (department) REFERENCES webPro_department(department_id)'); $obj->createTable('webPro_tasks', 'task_id INT AUTO_INCREMENT PRIMARY KEY,' . 'description VARCHAR(100),' . 'nurse INT,' . 'date DATE,' . 'due_date DATE,' . 'date_started DATE,' . 'date_finished DATE,' . 'assigned_by INT,' . 'task_status VARCHAR(15) DEFAULT "not started",' . 'isadmin TINYINT(1),' . 'time TIME,' . 'FOREIGN KEY (nurse) REFERENCES webPro_nurses(nurse_id)'); $obj->createTable('webPro_users', 'user VARCHAR(50),' . 'password VARCHAR(20),' . 'admin BOOLEAN,' . 'id INT'); include_once 'administrator.php'; include_once 'users.php'; $fname = 'admin'; $sname = ''; $gender = 'M'; $department = 1; $username = '******'; $password = '******'; $obj = new administrator(); $user = new users(); $admin = 1; $obj->add_admin($sname, $fname, $gender, $department); $id = $obj->get_insert_id(); $user->add_users($username, $password, $admin, $id);
*/ session_start(); define('ROOT', './'); include_once ROOT . 'common/config.php'; include_once COMMON . 'util.class.php'; include_once COMMON . 'core.class.php'; include_once COMMON . 'pluginsManager.class.php'; include_once COMMON . 'plugin.class.php'; include_once COMMON . 'show.class.php'; include_once COMMON . 'administrator.class.php'; $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); $core = new core($lang); if (file_exists(DATA . 'config.json')) { die($core->lang('Config file already exist !')); } $administrator = new administrator(); $pluginsManager = pluginsManager::getInstance(); $msg = ""; $msgType = ""; if ($core->install()) { $plugins = $pluginsManager->getPlugins(); if ($plugins != false) { foreach ($plugins as $plugin) { if ($plugin->getLibFile()) { include_once $plugin->getLibFile(); if (!$plugin->isInstalled()) { $pluginsManager->installPlugin($plugin->getName(), true); } $plugin->setConfigVal('activate', '1'); $pluginsManager->savePluginConfig($plugin); }
page/other/down.png" alt="icon" /></a></td> <td> <!-- Boutons d'actions --> <ul class="button-group radius"> <li><a class="tiny button success" href="index.php?p=page&action=edit&id=<?php echo $pageItem->getId(); ?> "><?php echo $core->lang("Edit"); ?> </a></li> <?php if (!$pageItem->getIsHomepage() && $pageItem->targetIs() != 'plugin') { ?> <li><a class="tiny button alert" href="index.php?p=page&action=del&id=<?php echo $pageItem->getId() . '&token=' . administrator::getToken(); ?> " onclick = "if(!confirm('<?php echo $core->lang("Delete this page ?"); ?> ')) return false;"><?php echo $core->lang("Delete"); ?> </a></li><?php } ?> </ul> </td> </tr> <?php }