/** * Returns all the Accounts for logged in user. * * @return View */ public function getIndex() { // Get all the user's accounts //Auth::id() : gives the logged in userid $accounts = $this->accounts->where('user_id', Auth::id())->orderBy('created_at', 'DESC')->paginate(10); return View::make('site/account/index', array('accounts' => $accounts)); }
public function insert_product_warehouse($form) { $data = array(); $data['product_id'] = $form['product_id']; $data['warehouse_cost'] = $form['product_cost']; $data['warehouse_price'] = $form['product_price']; $data['warehouse_quantity'] = $form['product_quantity']; $data['warehouse_barcode'] = $form['product_barcode']; $data['warehouse_qtytype'] = $form['p_qtytype']; $data['warehouse_sp_bill'] = $form['sup_bill']; $this->insert($this->table_name, $data); $accounts = new accounts(); $products = new product(); // Create GL $amount = $form['product_cost'] * $products->generate_item_quantity($form['product_id'], $form['p_qtytype'], $form['product_quantity']); $type = 'debit'; $account = 'Purchase'; $account_type = 'Stock'; $date = $accounts->_date('Y-m-d H:i:s', date('d-m-Y')); $results = $accounts->create_general_ledger($amount, $type, $account, $account_type, $date); // Purchase $product = $form['product_id']; $cost = $form['product_cost']; $quantity = $products->generate_item_quantity($form['product_id'], $form['p_qtytype'], $form['product_quantity']); $date = $date; $account = 'purchase'; $account_type = 'stock'; $results = $accounts->create_purchase($product, $cost, $quantity, $date, $account, $account_type); return $this->row_count(); }
public function sale_insert($form) { $data = array(); $data['sale_bill_number'] = $form['bill_number']; $data['sale_shift_number'] = $form['user_shift_number']; $data['sale_terminal_number'] = $form['user_terminal_point_number']; $data['sale_payment'] = $form['payment_mode']; $data['sale_user_id'] = $form['user_id']; $data['sale_date'] = $this->_date('Y-m-d H:i:s', date('d-m-Y')); // Sales Insert in Sale Table $this->insert($this->table_name, $data); if ($this->row_count() > 0) { $sale_id = $this->last_id(); } else { return false; } // Sales Products Insert in Sale Products Table if ($sale_id) { foreach ($_SESSION['terminal_list'] as $key => $value) { $val_array = array(); foreach ($value[key($value)] as $key_array => $value_array) { $val_array[$key_array] = $value_array; } $product['salepro_product_id'] = $val_array['p_id']; $product['salepro_product_price'] = $val_array['p_price'] - $val_array['discount_amount']; $product['salepro_product_quantity'] = $val_array['quantity']; $product['salepro_date'] = $this->_date('Y-m-d H:i:s', date('d-m-Y')); $product['salepro_sale_id'] = $sale_id; $this->insert('sale_product', $product); // Account $accounts = new accounts(); // Sale and revenue $product_id = $val_array['p_id']; $cost = $val_array['p_cost']; $price = $val_array['p_price'] - $val_array['discount_amount']; $quantity = $val_array['quantity']; $total = $price * $quantity; $date = $accounts->_date('Y-m-d H:i:s', date('d-m-Y')); $accounts->create_sales($product_id, $cost, $price, $quantity, $total, $date); // Profit and loss $cost1 = $cost * $quantity; $price1 = $price * $quantity; $profit = $price1 - $cost1; $results = $accounts->create_profitloss($product_id, $cost, $price, $quantity, $profit, $date); } return true; } else { return false; } }
private function create_accounts_from_select($rows) { $accounts = new accounts(); foreach ($rows as $row) { if (isset($this->cache[$row['id']])) { $new = $this->cache[$row['id']]; } else { $new = account::create($row['name'], $row['email'], $row['created'], $row['modified']); $this->cache[$row['id']] = $new; } $accounts->push($new); } return $accounts; }
/** * Returns all the Accounts for logged in user. * * @return View */ public function getIndex() { // Get all the user's accounts //Auth::id() : gives the logged in userid $open_tickets = $this->ticket->where('user_id', Auth::id())->where('active', TRUE)->orderBy('created_at', 'DESC')->paginate(10); $closed_tickets = $this->ticket->where('user_id', Auth::id())->where('active', FALSE)->orderBy('created_at', 'DESC')->paginate(10); if (!Auth::check()) { Log::error("Not authorized access"); return Redirect::to('ticket')->with('error', Lang::get('ticket/ticket.ticket_auth_failed')); } // var_dump($accounts, $this->accounts, $this->accounts->owner); // Show the page return View::make('site/ticket/index', array('open_tickets' => $open_tickets, 'closed_tickets' => $closed_tickets)); }
function chg_settings($row) { if (isset($_GET, $_POST, $_GET['account_id']) && count($_POST) && ($ac_id = (int) $_GET['account_id'])) { $acc = new accounts(); $acc->account_id = $ac_id; $acc->read_repository(); if ($acc->data['account_id']) { $email = addslashes($this->__get_email($ac_id)); $name = addslashes(${$acc}->data['firstname'] . ' ' . $acc->data['lastname']); $login = addslashes($acc->data['account_lid']); $alias = addslashes(htmlspecialchars($acc->data['account_lid'])); $status = $acc->data['status'] != 'A' ? 'users_opt & ~ 2097152' : 'users_opt|2097152'; $GLOBALS['phpgw']->db->query("UPDATE phpgw_fud_users SET name='{$name}', email='{$email}', login='******', alias='{$alias}', users_opt={$status} WHERE egw_id=" . $ac_id); } } }
public function actionSignup() { $signup = new signupForm(); if ($signup->load(Yii::$app->request->post()) && $signup->validate()) { echo 'success!'; echo '<br>' . $signup->username . "<br>"; // выбираем шаблон БД $db = new \yii\db\Connection(['dsn' => 'mysql:host=localhost;dbname=it_service_template', 'username' => 'root', 'password' => '', 'charset' => 'utf8']); $have_db = $db->createCommand('SHOW DATABASES LIKE "my_new_db"')->queryOne(); // проверяем таблицу accounts базы данных it_service_system на наличие аккаунта $account = accounts::find()->where(['name' => $signup->username])->andWhere(['email' => $signup->email])->one(); if (!$have_db && !$account) { // добавляем запись в таблицу аккаунта $db->createCommand('CREATE DATABASE my_new_db CHARACTER SET utf8 COLLATE utf8_general_ci')->execute(); //TODO: копируем таблицы из it_service_template в it_service_account_{account_id} // Получаем список таблиц из шаблона $template_tables = $db->createCommand('SHOW TABLES')->query(); // echo 'список таблиц из шаблона: <br>'; // foreach ( $template_tables as $t_table ){ // foreach ( $t_table as $ta ) echo $ta . '<br>'; // } // подключаемся к БД аккаунта $db = new \yii\db\Connection(['dsn' => 'mysql:host=localhost;dbname=my_new_db', 'username' => 'root', 'password' => '', 'charset' => 'utf8']); // создаем таблицы в новой БД по шаблону foreach ($template_tables as $t_table) { foreach ($t_table as $ta) { $db->createCommand('CREATE TABLE ' . $ta . ' LIKE it_service_template.' . $ta)->execute(); } } //TODO: скопировать данные справочников из таблиц шаблонной базы //$template_db_cartridge_types = CartridgeType::findAll(); // заносим аккаунт в таблицу it_service_system.accounts //------------------------------------------------------------------------- } else { echo "БД уже есть! : "; $ttt = json_encode($have_db); print_r($ttt . '<br>'); } } else { return $this->render('signup', ['model' => $signup]); } }
</div><!-- Col-md-6 Close --> <div class="col-md-3"> <div class="form-group"> <label for="p_supplier" class="col-sm-12"> </label> <div class="col-sm-12"> <button type="submit" class="btn btn-success btn-perspective pull-right" name="show_report">Show Report</button> </div> </div> </div> </form> <div class="clearfix" style="margin-bottom:10px;"></div> </div><!-- Box Close --> <div class="clearfix" style="margin-bottom:10px;"></div> <?php $accounts = new accounts(); if (isset($_POST['show_report'])) { $to_date = $_POST['to_date']; $from_date = $_POST['from_date']; $assets_type = $_POST['assets_type']; if ($_POST['assets_type']) { $assets_type = $_POST['assets_type']; } else { $assets_type = NULL; } if ($_POST['to_date']) { $to_date = $_POST['to_date']; $to_date = $accounts->_date('Y-m-d H:i:s', $to_date); } else { $to_date = NULL; }
<!-- Developer : chintan khatri Date : 01-10-2016 --> <!DOCTYPE html> <?php include_once './class.php'; session_start(); if ($_SESSION['user'] === TRUE) { } else { header('location:login.php'); } $db = new accounts(); $insert_transection = new transection(); if ($_POST) { if ($_POST['tr_type'] === '0') { $db->credit_account($_POST['in_amount'], $_POST['in_ac_id']); $cat_id = $_POST['exp_cat_id']; } else { $db->debit_account($_POST['in_amount'], $_POST['in_ac_id']); $cat_id = 13; } $insert_transection->new_transection($_POST['in_date'], $_POST['tr_type'], $_POST['in_des'], $_POST['in_amount'], $cat_id, $_POST['in_ac_id']); } ?> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/> <title>Alpha</title>
<?php require_once 'header.php'; ?> <section> <hr/> <div class="container"> <div class="row"> <?php $accounts = new accounts(); // Get Sales if ($_GET['product_name']) { $product_id = $_GET['product_name']; } else { $product_id = NULL; } if ($_GET['to_date']) { $to_date = $_GET['to_date']; $to_date = $accounts->_date('Y-m-d H:i:s', $to_date); } else { $to_date = NULL; } if ($_GET['from_date']) { $from_date = $_GET['from_date']; $from_date = $accounts->_date('Y-m-d H:i:s', $from_date); } else { $from_date = NULL; } $results = $accounts->get_sales_report($product_id, $to_date, $from_date);
function __construct() { parent::__construct(); $this->load->model('creditors_model'); }
} // Check digit.. mswCheckDigit($_GET['disputeUsers'], true); // Load ticket data.. $SUPTICK = mswGetTableData('tickets', 'id', $_GET['disputeUsers']); // Checks.. if (!isset($SUPTICK->id)) { $HEADERS->err404(true); exit; } // Load mail params include REL_PATH . 'control/mail-data.php'; // Class.. include_once PATH . 'control/classes/class.accounts.php'; include_once REL_PATH . 'control/classes/class.accounts.php'; $MSACC = new accounts(); $MSPORTAL = new accountSystem(); $MSACC->settings = $SETTINGS; $MSPORTAL->settings = $SETTINGS; // Add users.. if (isset($_POST['add']) && isset($_GET['disputeUsers'])) { $count = 0; $tickID = (int) $_GET['disputeUsers']; $TICKET = mswGetTableData('tickets', 'id', $tickID); $USER = mswGetTableData('portal', 'id', $TICKET->visitorID); $new = array(); if (!empty($_POST['name']) && $tickID > 0 && isset($TICKET->id) && isset($USER->id)) { // Batch loop visitors to be added..nuke duplicate emails.. foreach (array_keys($_POST['email']) as $k) { $name = $_POST['name'][$k]; $email = $_POST['email'][$k];
<li><a href="dashboard.php"><i class="fa fa-home"></i></a></li> <li><a href="accounts.php">Accounts</a></li> <li class="active">Account Receviable</li> </ol> <!-- End breadcrumb --> <div class="panel panel-info"> <div class="panel-heading"> <h3>Account Receviable</h3> </div> <div class="panel-body"> <!-- BEGIN DATA TABLE --> <div class="the-box"> <div class="table-responsive"> <?php $accounts = new accounts(); $results = $accounts->get_payable_receviable_report($account = NULL, $account_type = NULL, $to_date = NULL, $from_date = NULL, $type = 'receviable', $status = 0); if ($results) { // print_f($results); ?> <table class="table table-striped table-hover" id="datatable-example"> <thead class="the-box dark full"> <tr> <th>Type</th> <th>Person Type</th> <th>Description</th> <th>Bank</th> <th>Amount</th> <th>Due Date</th> <th>Action</th> </tr>
</ol> <!-- End breadcrumb --> <div class="panel panel-info"> <div class="panel-heading"> <div class="right-content"> <a href="add_assets.php"><button class="btn btn-success btn-perspective btn-lg pull-right">ADD ASSETS</button></a> </div> <h3>Assets</h3> </div> <div class="panel-body"> <!-- BEGIN DATA TABLE --> <div class="the-box"> <div class="table-responsive"> <?php $accounts = new accounts(); $results = $accounts->get_assets(); if ($results) { ?> <table class="table table-striped table-hover" id="datatable-example"> <thead class="the-box dark full"> <tr> <th>Assets Type</th> <th>Assets Amount</th> <th>Assets Payment Mode</th> <th>Action</th> </tr> </thead> <tbody> <?php foreach ($results as $res) {
<section> <hr/> <div class="container"> <div class="row"> <div class="tableHeading"> <p class="nomargin alignCenter"><?php echo isset($_GET['id']) ? 'Update' : 'Add'; ?> Purchase</p> </div> <?php $suppliers = new supplier(); $all_suppliers = $suppliers->get_suppliers(); $accounts = new accounts(); $ID = isset($_GET['id']) ? $_GET['id'] : NULL; if (isset($_POST['add_purchase'])) { $supplier_id = $_POST['supplier_id']; $bill_number = $_POST['bill_number']; $due_date = $_POST['due_date']; $bill_amount = $_POST['bill_amount']; $payment_type = $_POST['payment_type']; if ($payment_type == 'cheque') { $type = 'credit'; } else { $type = 'debit'; } $bank_detail = $_POST['bank_detail']; if ($bank_detail) { $account = 'bank';
<!-- Developer : chintan khatri Date : 01-10-2016 --> <!DOCTYPE html> <?php include_once './class.php'; session_start(); if ($_SESSION['user'] === TRUE) { } else { header('location:login.php'); } $db = new accounts(); $insert_transection = new transection(); $transfer_records = new tranfer(); if ($_POST) { $transfer_records->new_transfer($_POST['tr_date'], $_POST['tr_amount'], $_POST['tr_des'], $_POST['tr_ac_id_from'], $_POST['tr_ac_id_to']); $insert_transection->new_transection($_POST['tr_date'], 1, $_POST['tr_des'], $_POST['tr_amount'], 15, $_POST['tr_ac_id_to']); $insert_transection->new_transection($_POST['tr_date'], 0, $_POST['tr_des'], $_POST['tr_amount'], 15, $_POST['tr_ac_id_from']); $db->credit_account($_POST['tr_amount'], $_POST['tr_ac_id_from']); $db->debit_account($_POST['tr_amount'], $_POST['tr_ac_id_to']); } ?> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/> <title>Alpha</title> <!-- CSS --> <?php
This File: ajax.php Description: System File Ajax Ops ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ if (!defined('PARENT') || !isset($_GET['ajax'])) { $HEADERS->err403(true); } // Load classes not loaded by main system.. include REL_PATH . 'control/classes/class.accounts.php'; include PATH . 'control/classes/class.accounts.php'; $MSACC = new accountSystem(); $MSACC->settings = $SETTINGS; $MSPTL = new accounts(); $MSPTL->settings = $SETTINGS; // Parse based on directive.. switch ($_GET['ajax']) { //========================= // Ticket delete ops.. //========================= case 'delete': if (USER_DEL_PRIV == 'yes') { switch ($_GET['type']) { // Ticket reply.. case 'reply': $ID = (int) $_GET['id']; $RP = mswGetTableData('replies', 'id', $ID); $TK = mswGetTableData('tickets', 'id', $RP->ticketID); switch ($RP->replyType) {
This File: accounts.php Description: System File ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ if (!defined('PARENT')) { $HEADERS->err403(true); } // Access.. if (!in_array($cmd, $userAccess) && $MSTEAM->id != '1') { $HEADERS->err403(true); } // Load mail params include REL_PATH . 'control/mail-data.php'; // Class.. include_once PATH . 'control/classes/class.accounts.php'; $MSACC = new accounts(); $MSACC->settings = $SETTINGS; // Check email.. if (isset($_POST['checkEntered'])) { $msg = ''; if (!mswIsValidEmail($_POST['checkEntered'])) { $ret = 'exists'; $msg = $msg_main13; } else { $ret = $MSACC->check(); if ($ret == 'exists') { $msg = $msg_portal32; } } echo $JSON->encode(array('response' => $ret, 'message' => $msg)); exit;
public function review($_projectID) { parent::view("shared/header"); parent::view("cie/menu"); parent::model("projects"); $model = new projects(); if ($_projectID != null || isset($_POST['project'])) { parent::model("docs"); $model1 = new docs(); parent::model("projects"); $model2 = new projects(); if (isset($_POST['project'])) { $project = $model2->ShowProjectByID($_POST['project']); } else { $project = $model2->ShowProjectByID($_projectID[0]); } if ($project != null) { parent::model("business"); $model4 = new business(); $cie = $model4->ShowCieByUserID($_SESSION['ID']); if ($project->status == 1 && $project->businessID == $cie->ID) { $data['title'] = $project->title; $data['projectID'] = $project->ID; $internId = $project->internID; if ($internId != null) { //Vérifier l'existence d'une évaluation de stage $data['readOnly'] = $model1->ReadOnlyAdvisor($internId, 'cieReview'); parent::model("accounts"); $model3 = new accounts(); $data['intern'] = $model3->ShowUserByID($internId); if ($data['readOnly']) { //si le formulaire existe $data['review'] = $model1->LoadAdvisor($internId, "cieReview"); $data['alert'] = "alert-warning"; $data['message'] = "L'évaluation pour ce stagiaire et pour ce projet existe déjà."; } else { //si le formulaire n'existe pas //Enregistrer le formulaire d'évaluation. if (isset($_POST['sendReview']) && isset($_POST['project']) && $_SESSION['form_timer'] + 1200 > time()) { try { $_POST['intern'] = $internId; $model1->SaveAdvisor($_SESSION['ID'], "cieReview", $_POST); $data['review'] = $model1->LoadAdvisor($internId, 'cieReview'); $data['alert'] = "alert-success"; $data['message'] = "L'évaluation a été enregistrée avec succès."; $data['readOnly'] = true; } catch (Exception $e) { $data['alert'] = "alert-warning"; $data['message'] = "L'évaluation n'a pas pu être enregistrée."; } } } parent::view("cie/review", $data); parent::view("shared/footer"); } else { $data['alert'] = "alert-warning"; $data['message'] = "Aucun stagiaire associé à ce projet."; $this->index($data); } } else { $data['alert'] = "alert-warning"; $data['message'] = "Il vous est interdit de visualiser ce formulaire."; $this->index($data); } } else { $data['alert'] = "alert-warning"; $data['message'] = "Ce projet n'existe pas."; $this->index($data); } } else { $this->index(null); } }
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This File: accountman.php Description: System File ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ if (!defined('PARENT')) { $HEADERS->err403(true); } // Access.. if (!in_array($cmd, $userAccess) && $MSTEAM->id != '1') { $HEADERS->err403(true); } // Classes.. include_once PATH . 'control/classes/class.accounts.php'; $MSACC = new accounts(); $MSACC->settings = $SETTINGS; // Enable/disable (Ajax).. if (isset($_GET['changeState'])) { $MSACC->enable(); echo $JSON->encode(array('ok')); exit; } // Delete levels.. if (isset($_POST['delete']) && USER_DEL_PRIV == 'yes') { @ini_set('memory_limit', '100M'); @set_time_limit(0); $count = $MSACC->delete($MSTICKET); $OK = true; } $title = $msg_adheader40;
if (!defined('PARENT')) { $HEADERS->err403(true); } // Access.. if (!in_array($cmd, $userAccess) && $MSTEAM->id != '1') { $HEADERS->err403(true); } // Batch enable/disable fields.. $batchEnDisFields = array('users' => $msg_tools30, 'portal' => $msg_tools31, 'fields' => $msg_tools32, 'responses' => $msg_tools33, 'imap' => $msg_tools34, 'faq-cat' => $msg_tools35, 'faq-que' => $msg_tools36); // Load mail params include REL_PATH . 'control/mail-data.php'; // Account classes.. include REL_PATH . 'control/classes/class.accounts.php'; include_once PATH . 'control/classes/class.accounts.php'; $MSACCNT = new accountSystem(); $MSACC = new accounts(); $MSACC->settings = $SETTINGS; $MSACCNT->settings = $SETTINGS; // Batch enable/disable.. if (isset($_POST['enable-disable'])) { if (!empty($_POST['tbls'])) { $MSSET->batchEnableDisable($batchEnDisFields); switch ($_POST['endis-option']) { case 'enable': $txt = $msg_tools37; break; case 'disable': $txt = $msg_tools38; break; } $OK5 = true;
<li class="active"><?php echo isset($_GET['id']) ? 'Update' : 'Add'; ?> Assets</li> </ol> <div class="panel panel-info"> <div class="panel-heading"> <h3><?php echo isset($_GET['id']) ? 'Update' : 'Add'; ?> Assets</h3> </div> <div class="panel-body"> <?php $accounts = new accounts(); $bank = new bank(); $bank_result = $bank->get_banks(); $ID = isset($_GET['id']) ? $_GET['id'] : NULL; if (isset($_POST['add_assets'])) { $type = $_POST['assets_type']; $amount = $_POST['assets_amount']; $payment_mode = $_POST['assets_payment_mode']; $bank = $_POST['bank_name']; $due_date = $_POST['due_date']; $detail = $_POST['assets_detail']; // Update old record if (isset($ID)) { $results = $accounts->update_assets($type, $amount, $payment_mode, $bank, $due_date, $detail, $ID); } else { // Insert new
public function import($lines, $del, $enc) { $count = 0; $data = array(); // Upload CSV file.. if (is_uploaded_file($_FILES['file']['tmp_name'])) { $handle = fopen($_FILES['file']['tmp_name'], 'r'); if ($handle) { while (($CSV = fgetcsv($handle, $lines, $del, $enc)) !== false) { // Clean array.. $CSV = array_map('trim', $CSV); // Add account.. $_POST['name'] = isset($CSV[0]) && $CSV[0] ? $CSV[0] : ''; $_POST['email'] = isset($CSV[1]) && mswIsValidEmail($CSV[1]) ? $CSV[1] : ''; $_POST['userPass'] = isset($CSV[2]) && $CSV[2] ? $CSV[2] : substr(md5(uniqid(rand(), 1)), 0, $this->settings->minPassValue); $_POST['enabled'] = 'yes'; $_POST['timezone'] = isset($CSV[3]) && in_array($CSV[3], array_keys($this->timezones)) ? $CSV[3] : $this->settings->timezone; $_POST['ip'] = ''; // If name and email are ok and email doesn`t exist, we can add user.. if ($_POST['name'] && $_POST['email'] && accounts::check($_POST['email']) == 'accept') { ++$count; // Add to db.. accounts::add(array('name' => $_POST['name'], 'email' => $_POST['email'], 'userPass' => $_POST['userPass'], 'enabled' => 'yes', 'timezone' => $_POST['timezone'], 'ip' => $_POST['ip'], 'notes' => '', 'language' => $this->settings->language, 'enableLog' => $this->settings->enableLog)); // Add to array.. $data[$count] = array($_POST['name'], $_POST['email'], $_POST['userPass']); } } fclose($handle); } // Clear temp file.. @unlink($_FILES['file']['tmp_name']); } return $data; }
</ol> <!-- End breadcrumb --> <div class="panel panel-info"> <div class="panel-heading"> <div class="right-content"> <a href="add_capitals.php"><button class="btn btn-success btn-perspective btn-lg pull-right">ADD CAPITAL</button></a> </div> <h3>Capital</h3> </div> <div class="panel-body"> <!-- BEGIN DATA TABLE --> <div class="the-box"> <div class="table-responsive"> <?php $accounts = new accounts(); $results = $accounts->get_capital(); if ($results) { ?> <table class="table table-striped table-hover" id="datatable-example"> <thead class="the-box dark full"> <tr> <th>Capital Name</th> <th>Assets Amount</th> <th>Assets Date</th> <th>Action</th> </tr> </thead> <tbody> <?php foreach ($results as $res) {
</p> </div> <!-- END EXAMPLE ALERT --> <!-- BEGIN SiTE INFORMATIONS --> <div class="row marginBottom"> <div class="col-sm-3"> <div class="the-box no-border bg-success tiles-information"> <i class="fa fa-users icon-bg"></i> <div class="tiles-inner text-center"> <?php $to_date = '2015-09-02 00:00:00'; $from_date = NULL; $product_id = NULL; $accounts = new accounts(); $results = $accounts->get_sales_report($product_id, $to_date, $from_date); // print_f($results); $total = 0; foreach ($results as $value) { $price = $value->sales_price; $qty = $value->sales_quantity; $subtotal = $price * $qty; $total += $subtotal; } ?> <p>TODAY SALES</p> <h1 class="bolded"><?php echo $currency . $total; ?> </h1>
public function review($_review) { parent::view("shared/header"); parent::view("intern/menu"); parent::model("accounts"); $intern = new accounts(); $data['intern'] = $intern->ShowUserByID($_SESSION['ID']); parent::model("docs"); $model = new docs(); $data['readOnly'] = true; //Tout dépendant du premier paramètre passer en paramètre, choisir la bonne page switch ($_review[0]) { case "evalAdvMid": $exist = $model->ReadOnlyAdvisor($_SESSION['ID'], "review1"); if (!$exist) { $data['alert'] = "alert-warning"; $data['message'] = "Aucune évaluation de mi-stage pour le moment."; $this->info($data); } else { $data["review"] = $model->LoadAdvisor($_SESSION['ID'], "review1"); $data['advisor'] = $intern->ShowUserByID($data["review"]->Coordonnateur); parent::view("intern/eval", $data); } break; case "evalAdvFinale": $exist = $model->ReadOnlyAdvisor($_SESSION['ID'], "review2"); if (!$exist) { $data['alert'] = "alert-warning"; $data['message'] = "Aucune évaluation de fin de stage pour le moment."; $this->info($data); } else { $data["review"] = $model->LoadAdvisor($_SESSION['ID'], "review2"); $data['advisor'] = $intern->ShowUserByID($data["review"]->Coordonnateur); parent::view("intern/eval", $data); } break; case "interview": $exist = $model->ReadOnlyCie($_SESSION['ID'], "interview"); if (!$exist) { $data['alert'] = "alert-warning"; $data['message'] = "Aucune entrevue évaluée pour le moment."; $this->info($data); } else { $data["interview"] = $model->LoadCie($_SESSION['ID'], "interview"); parent::view("intern/interview", $data); } break; case "evalSup": $exist = $model->ReadOnlyAdvisor($_SESSION['ID'], "cieReview"); if (!$exist) { $data['alert'] = "alert-warning"; $data['message'] = "Aucune évaluation du superviseur pour le moment."; $this->info($data); } else { $data["review"] = $model->LoadAdvisor($_SESSION['ID'], "cieReview"); parent::model("projects"); $model = new projects(); $data['project'] = $model->ShowProjectByID($data["review"]->project); parent::view("intern/evalSup", $data); } break; default: $this->index(); } parent::view("shared/footer"); }
function __construct() { parent::__construct(); }
public function submitCie() { parent::model("business"); parent::model("accounts"); $business = new business(); $user = new accounts(); if (!$business->EmailExist($_POST["email"])) { if ($user->UsernameExist($_POST["user"]) || $_POST["user"] == "") { $_POST["user"] = $user->PassGen(); } try { $user->CreateUser($_POST["name"], $_POST["user"], $user->PassGen(), 1); $business->CreateBusiness($_POST["address"], $_POST["city"], $_POST["tel"], $_POST["email"], $user->DBLastInsertedID('users')); $data['alert'] = "alert-success"; $data['message'] = "L'entreprise a été soumise aux coordonnateurs de stage. Merci de votre participation."; } catch (PDOException $e) { $data['alert'] = "alert-warning"; $data['message'] = "L'entreprise n'a pu être soumise aux coordonnateurs de stage. Veuillez réessayer."; } } else { $data['alert'] = "alert-warning"; $data['message'] = "Une entreprise avec ce même email existe déjà."; } parent::view('shared/header'); parent::view('home/menu'); parent::view('home/index', $data); parent::view('shared/footer'); }
This File: acc-import.php Description: System File ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ if (!defined('PARENT')) { $HEADERS->err403(true); } // Access.. if (!in_array($cmd, $userAccess) && $MSTEAM->id != '1') { $HEADERS->err403(true); } // Load mail params include REL_PATH . 'control/mail-data.php'; // Class.. include_once PATH . 'control/classes/class.accounts.php'; $MSACC = new accounts(); $MSACC->settings = $SETTINGS; $MSACC->timezones = $timezones; // Import.. if (isset($_POST['process'])) { $lines = $_POST['lines'] ? str_replace(array('.', ','), array(), $_POST['lines']) : '0'; $del = $_POST['delimiter'] ? $_POST['delimiter'] : ','; $enc = $_POST['enclosed'] ? $_POST['enclosed'] : '"'; $data = $MSACC->import($lines, $del, $enc); // Send emails.. if (count($data) > 0 && isset($_POST['welcome'])) { foreach ($data as $k => $v) { // Message tags.. $MSMAIL->addTag('{NAME}', $v[0]); $MSMAIL->addTag('{EMAIL}', $v[1]); $MSMAIL->addTag('{PASSWORD}', $v[2]);
This File: accountsearch.php Description: System File ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ if (!defined('PARENT')) { $HEADERS->err403(true); } // Access.. if (!in_array($cmd, $userAccess) && $MSTEAM->id != '1') { $HEADERS->err403(true); } // Class.. include_once PATH . 'control/classes/class.accounts.php'; include_once REL_PATH . 'control/classes/class.download.php'; $MSACC = new accounts(); $MSDL = new msDownload(); $MSACC->settings = $SETTINGS; // Export.. if (isset($_GET['export'])) { $MSACC->export($msg_accounts37, $MSDL); } // Enable/disable (Ajax).. if (isset($_GET['changeState'])) { $MSACC->enable(); echo $JSON->encode(array('ok')); exit; } // Delete levels.. if (isset($_POST['delete']) && USER_DEL_PRIV == 'yes') { @ini_set('memory_limit', '100M');