<?php session_start(); if (Login::isLogged(Login::$_login_front)) { Helper::redirect(Login::$_dashboard_front); } $objForm = new Form(); $objValid = new Validation($objForm); $objUser = new User(); // login form if ($objForm->isPost('login_email')) { if ($objUser->isUser($objForm->getPost('login_email'), $objForm->getPost('login_password'))) { Login::loginFront($objUser->_id, Url::getReferrerUrl()); } else { $objValid->add2Errors('login'); } } // registration form if ($objForm->isPost('first_name')) { $objValid->_expected = array('first_name', 'last_name', 'address_1', 'address_2', 'town', 'county', 'post_code', 'country', 'email', 'password', 'confirm_password'); $objValid->_required = array('first_name', 'last_name', 'address_1', 'town', 'county', 'post_code', 'country', 'email', 'password', 'confirm_password'); $objValid->_special = array('email' => 'email'); $objValid->_post_remove = array('confirm_password'); $objValid->_post_format = array('password' => 'password'); // validate password $pass_1 = $objForm->getPost('password'); $pass_2 = $objForm->getPost('confirm_password'); if (!empty($pass_1) && !empty($pass_2) && $pass_1 != $pass_2) { $objValid->add2Errors('password_mismatch'); } $email = $objForm->getPost('email');
<?php Login::restrictFront(); $objUser = new User(); $user = $objUser->getUser(Session::getSession(Login::$_login_front)); if (!empty($user)) { $objForm = new Form(); $objValid = new Validation($objForm); if ($objForm->isPost('first_name')) { $objValid->_expected = array('first_name', 'last_name', 'address_1', 'address_2', 'town', 'county', 'post_code', 'country', 'email'); $objValid->_required = array('first_name', 'last_name', 'address_1', 'town', 'county', 'post_code', 'country', 'email'); $objValid->_special = array('email' => 'email'); if ($objValid->isValid()) { if ($objUser->updateUser($objValid->_post, $user['id'])) { Helper::redirect('/?page=summary'); } else { $mess = "<p class=\"red\">There was a problem updating your details.<br />"; $mess .= "Please contact administrator.</p>"; } } } require_once '_header.php'; ?> <h1>Checkout</h1> <p>Please check your details and click <strong>Next</strong>.</p> <?php echo !empty($mess) ? $mess : null; ?>
<?php $objBusiness = new Business(); $business = $objBusiness->getBusiness(); if (!empty($business)) { $objForm = new Form(); $objValid = new Validation($objForm); if ($objForm->isPost('name')) { $objValid->_expected = array('name', 'address', 'telephone', 'email', 'website', 'vat_rate'); $objValid->_required = array('name', 'address', 'telephone', 'email', 'vat_rate'); $objValid->_special = array('email' => 'email'); $vars = $objForm->getPostArray($objValid->_expected); if ($objValid->isValid()) { if ($objBusiness->updateBusiness($vars)) { Helper::redirect('/admin' . Url::getCurrentUrl(array('action', 'id')) . '&action=edited'); } else { Helper::redirect('/admin' . Url::getCurrentUrl(array('action', 'id')) . '&action=edited-failed'); } } } require_once 'template/_header.php'; ?> <h1>Business</h1> <form action="" method="post"> <table cellpadding="0" cellspacing="0" border="0" class="tbl_insert"> <tr> <th><label for="name">Name: *</label></th> <td>
//Pembelian $objPembelian = new Pembelian(); $tglPembelian = $objPembelian->getTanggalPembelian(); //Laba Rugi $labarugi = new LabaRugi(); //Cash Flow $objCashFlow = new CashFlow(); $objCashFlow->getTanggal(); //Biaya Operasional $objBiayaOperasional = new BiayaOperasional(); $objBiayaOperasional->getTanggal(); if (isset($_GET['detailinvoice'])) { $noinvoice = $_GET['detailinvoice']; $invoice = $objPenjualan->getPenjualanInvoice($noinvoice); } if ($objForm->isPost('dafcabang')) { $admin = new Admin(); //if($objForm->getPost("dafcabang")!='cashflow'){ // $nmcabang = $objCabang->getNama($objForm->getPost("dafcabang"))?$objCabang->getNama($objForm->getPost("dafcabang")):"Semua Cabang"; //} switch ($objForm->getPost('form')) { case 'penjualan': //Penjualan //$tglAwal = Helper::dateToMySqlSystem($objForm->getPost('tglawaljual')); //$tglAkhir = Helper::dateToMySqlSystem($objForm->getPost('tglakhirjual')); $group = $objForm->getPost("group_by"); //$dir=$objForm->getPost("direction"); $direction = $objForm->getPost("direction") ?: "DESC"; $objPenjualan->_cabang = $objForm->getPost('dafcabang'); $objPenjualan->_startDate = Helper::dateToMySqlSystem($objForm->getPost("tglawaljual")); $objPenjualan->_endDate = Helper::dateToMySqlSystem($objForm->getPost("tglakhirjual"));
<?php $rows = array(); $objRecruitment = new Recruitment(); $objProject = new Project(); $projects = $objProject->getAllProjectTypes(); $waves = $objProject->getWaves(); $objTeam = new Team(); $teams = $objTeam->getTeamsForSearch(); $objPosition = new Position(); $positions = $objPosition->getAllPositions(true); $objForm = new Form(); $criteria = array(); if ($objForm->isPost('position')) { $project = $objForm->getPost('project'); if (!empty($project)) { $criteria['project_type_id'] = $project; } $project_year = $objForm->getPost('project_year'); if (!empty($project_year)) { $criteria['project_year'] = $project_year; } $project_wave = $objForm->getPost('project_wave'); if (!empty($project_wave)) { $criteria['project_wave'] = $project_wave; } $team = $objForm->getPost('team'); if (!empty($team)) { $criteria['team_id'] = $team; } $position = $objForm->getPost('position');
<?php if (Login::isLogged(Login::$_login_admin)) { Helper::redirect(Login::$_dashboard_admin); } $objForm = new Form(); $objValid = new Validation($objForm); if ($objForm->isPost('login_email')) { $objAdmin = new Admin(); if ($objAdmin->isUser($objForm->getPost('login_email'), $objForm->getPost('login_password'))) { Login::loginAdmin($objAdmin->_id, Url::getReferrerUrl()); } else { $objValid->add2Errors('login'); } } require_once 'template/_header.php'; ?> <h1>Login</h1> <form action="" method="post"> <table cellpadding="0" cellspacing="0" border="0" class="tbl_insert"> <tr> <th><label for="login_email">Login:</label></th> <td> <?php echo $objValid->validate('login'); ?> <input type="text" name="login_email" id="login_email"
<?php $id = Url::getParam('id'); if (!empty($id)) { $objOrder = new Order(); $order = $objOrder->getOrder($id); if (!empty($order)) { $objForm = new Form(); $objValid = new Validation($objForm); $objUser = new User(); $user = $objUser->getUser($order['client']); $objCountry = new Country(); $objCatalogue = new Catalogue(); $items = $objOrder->getOrderItems($id); $status = $objOrder->getStatuses(); if ($objForm->isPost('status')) { $objValid->_expected = array('status', 'notes'); $objValid->_required = array('status'); $vars = $objForm->getPostArray($objValid->_expected); if ($objValid->isValid()) { if ($objOrder->updateOrder($id, $vars)) { Helper::redirect('/admin' . Url::getCurrentUrl(array('action', 'id')) . '&action=edited'); } else { Helper::redirect('/admin' . Url::getCurrentUrl(array('action', 'id')) . '&action=edited-failed'); } } } require_once 'template/_header.php'; ?> <h1>Orders :: View</h1>
<?php if (Login::isLogged(Login::$_login_admin_id)) { Helper::redirect(SITE_URL . Login::$_dashboard_admin); } $objForm = new Form(); $objValidation = new Validation($objForm); if ($objForm->isPost('login_user')) { $objAdmin = new Admin(); $objValidation->_required = array('login_user', 'login_password'); if ($objAdmin->isUser($objForm->getPost('login_user'), $objForm->getPost('login_password'))) { $result = Login::loginAdmin($objAdmin->_user, Url::getReferrerUrl()); } else { $objValidation->add2Errors('login'); } if ($objValidation->isValid()) { } } ?> <html> <head> <title>XBook Management System</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="css/Core.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="../css/bootstrap.min.css"> <link rel="stylesheet" href="../css/bootstrap-theme.min.css"> <link rel="stylesheet" href="../css/bootstrap-select.min.css">
<?php $exco = $this->cPage == 'exco' ? 1 : 0; $project_type = $this->cPage == 'exco' ? 'exco' : 'project'; $objMember = new Member(); $objProject = new Project(); $projects = $objProject->getAllProjectsForList(); $objForm = new Form(); $objValid = new Validation($objForm); $params = array(); if ($objForm->isPost('project_type_id')) { $objValid->_expected = array('project_type_id', 'project_year'); $objValid->_required = array('project_type_id', 'project_year'); if ($objValid->isValid()) { $valid = 'yes'; $project_year = $objForm->getPost('project_year'); $project_type_id = $objForm->getPost('project_type_id'); $project_type = $objProject->getProjectTypeById($project_type_id); //var_dump($project_year); if (!empty($project_type)) { $split = explode('_', $project_year); $year_start = $split[0]; if (count($split) == 2) { $wave_id = $split[1]; $wave_info = $objProject->getWaves(array('id' => 3))[0]; $month_start = $wave_info['month_start']; $month_end = $wave_info['month_end']; $year_end = $wave_info['same_start_end'] == '1' ? $year_start : $year_start + 1; } else { $wave_id = 0; $month_start = $project_type['month_start'];
<?php $districts = $objMember->getAllDistricts(); $objForm = new Form(); $objValid = new Validation($objForm); $objSchool = new School(); $objValid->_expected = array('name', 'gender', 'day', 'month', 'year', 'personal_email', 'phone', 'district', 'skype', 'facebook', 'high_school', 'grad_year_h', 'uni', 'grad_year_u'); $objValid->_required = array('name', 'gender'); $objValid->_prefilled_fields = $member; //PERSONAL INFORMATION HANDLING if ($objForm->isPost('name')) { $email = $objForm->getPost('personal_email'); $phone = $objForm->getPost('phone'); $facebook = $objForm->getPost('facebook'); $high_school = $objForm->getPost('high_school'); $grad_year_h = $objForm->getPost('grad_year_h'); $uni = $objForm->getPost('uni'); $grad_year_u = $objForm->getPost('grad_year_u'); if (!empty($member['personal_email']) && empty($email)) { $objValid->_special = array('personal_email' => 'email'); $objValid->_special = array(array('field' => 'personal_email', 'case_type' => 'check_is_email')); } if (!empty($member['phone']) && empty($phone)) { $objValid->_required[] = 'phone'; } if (!empty($member['facebook']) && empty($facebook)) { $objValid->_required[] = 'facebook'; } if (!empty($member['high_school']) && empty($high_school)) { $objValid->_required[] = 'high_school'; }