static function salvar() { return function ($req, $res, $svc, $app) { $newCliente = $req->paramsPost(); $isNew = empty($req->id); if ($isNew) { $cliente = $app->db->cadcliente->create(); $cliente->set_expr('data', 'now()'); } else { $cliente = $app->db->cadcliente->find_one($req->id); } $cliente->cidade = $newCliente->cidade; $cliente->status = $newCliente->status; $cliente->contrato = $newCliente->contrato; $cliente->designacao = $newCliente->designacao; $cliente->cliente = $newCliente->cliente; $cliente->velocidade = $newCliente->velocidade; $cliente->operadora = $newCliente->operadora; $cliente->endereco = $newCliente->endereco; $cliente->equipamento = $newCliente->equipamento; $cliente->save(); $id = $isNew ? $cliente->id() : $req->id; Flash::success('Salvo com sucesso'); $res->redirect("/cliente/{$id}"); }; }
static function salvar() { return function ($req, $res, $svc, $app) { $newVelocidade = $req->paramsPost(); $velocidade = $app->db->velocidade->create(); $velocidade->velocidade = $newVelocidade->velocidade; $velocidade->save(); Flash::success('Velocidade cadastrada com sucesso'); $res->redirect("/cadastro"); }; }
static function salvar() { return function ($req, $res, $svc, $app) { $newEquipamento = $req->paramsPost(); $equipamento = $app->db->equipamento->create(); $equipamento->cidade = $newEquipamento->cidade; $equipamento->fabricante = $newEquipamento->fabricante; $equipamento->ident = $newEquipamento->ident; $equipamento->equipamento = $newEquipamento->equipamento; $equipamento->localizacao = $newEquipamento->localizacao; $equipamento->tipo_acesso = $newEquipamento->tipo_acesso; $equipamento->ip = $newEquipamento->ip; $equipamento->ip_interno = $newEquipamento->ip_interno; $equipamento->login = $newEquipamento->login; $equipamento->senha = $newEquipamento->senha; $equipamento->save(); Flash::success('Equipamento cadastrado com sucesso'); $res->redirect("/equipamentos"); }; }
} } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if (isset($_POST["MM_insert"]) && $_POST["MM_insert"] == "form1") { $insertSQL = sprintf("INSERT INTO sys_users (user_name, user_pwd, user_role_ids, user_fullname, user_email, user_mobile, user_photo, user_state, user_sex, user_created_by) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['user_name'], "text"), GetSQLValueString($_POST['user_pwd'], "text"), GetSQLValueString($_POST['user_role_ids'], "text"), GetSQLValueString($_POST['user_fullname'], "text"), GetSQLValueString($_POST['user_email'], "text"), GetSQLValueString($_POST['user_mobile'], "text"), GetSQLValueString($_POST['user_photo'], "text"), GetSQLValueString(isset($_POST['user_state']) ? "true" : "", "defined", "1", "0"), GetSQLValueString($_POST['user_sex'], "text"), GetSQLValueString($_SESSION['User_id'], "int")); mysql_select_db($database_dares_conn, $dares_conn); $Result1 = mysql_query($insertSQL, $dares_conn) or die(mysql_error()); $insertGoTo = "index.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= strpos($insertGoTo, '?') ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } Flash::success($ecss_lang['sys']['User']['ADD_SUCCESS']); header(sprintf("Location: %s", $insertGoTo)); } mysql_select_db($database_dares_conn, $dares_conn); $query_get_role = "SELECT * FROM sys_role"; $get_role = mysql_query($query_get_role, $dares_conn) or die(mysql_error()); $row_get_role = mysql_fetch_assoc($get_role); $totalRows_get_role = mysql_num_rows($get_role); // html page title $pageTitle = $ecss_lang['sys']['User']['LIST_USER']; // require page header require_once $config['base_url'] . '/admin/template/includes/header.php'; ?> <!-- page content --> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="x_panel" style="min-height:600px;">
} } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if (isset($_POST["MM_update"]) && $_POST["MM_update"] == "form1") { $updateSQL = sprintf("UPDATE subject_lesson SET lesson_name=%s, lesson_order=%s, lesson_type=%s, lesson_state=%s WHERE lesson_id=%s", GetSQLValueString($_POST['lesson_name'], "text"), GetSQLValueString($_POST['lesson_order'], "int"), GetSQLValueString($_POST['lesson_type'], "int"), GetSQLValueString($_POST['lesson_state'], "int"), GetSQLValueString($_POST['lesson_id'], "int")); mysql_select_db($database_dares_conn, $dares_conn); $Result1 = mysql_query($updateSQL, $dares_conn) or die(mysql_error()); $updateGoTo = "index.php"; if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= strpos($updateGoTo, '?') ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING']; } Flash::success($ecss_lang['Subject']['Lesson']['EDIT_SUCCESS']); header(sprintf("Location: %s", $updateGoTo)); } $colname_get_lesson_by_lesid = "-1"; if (isset($_GET['lesid'])) { $colname_get_lesson_by_lesid = $_GET['lesid']; } mysql_select_db($database_dares_conn, $dares_conn); $query_get_lesson_by_lesid = sprintf("SELECT * FROM subject_lesson WHERE lesson_id = %s", GetSQLValueString($colname_get_lesson_by_lesid, "int")); $get_lesson_by_lesid = mysql_query($query_get_lesson_by_lesid, $dares_conn) or die(mysql_error()); $row_get_lesson_by_lesid = mysql_fetch_assoc($get_lesson_by_lesid); $totalRows_get_lesson_by_lesid = mysql_num_rows($get_lesson_by_lesid); ?> <?php // html page title
require_once dirname(__FILE__) . './vendor/autoload.php'; //autoload packages use McKay\Flash; chk_lgn(); $db = new Database(); $user = new User($db->conn); if ($_POST) { $user->first_name = $_POST['first_name']; $user->last_name = $_POST['last_name']; $user->email = $_POST['email']; $user->phone = $_POST['phone']; $user->status = 1; $user->role = 'doctor'; $user->password = '******'; if ($user->register()) { Flash::success('Doctor Successfully Added!!'); } else { Flash::error('Doctor Could Not Be Added!!'); } } include 'templates/header.php'; ?> <div id="page-wrapper"> <div class="container-fluid"> <!-- Page Heading --> <div class="row"> <div class="col-lg-12"> <h1 class="page-header"> Add doctor
require_once '../../../config/boot.php'; use McKay\Flash; $input = array_merge($_GET, $_POST); $action = $input['action']; if (empty($action)) { header('location:index.php'); } if ($action == 'delete') { $faculty_id = GetSQLValueString($input['faculty_id'], "int"); $delete = sprintf("DELETE FROM academy_structure_faculty WHERE faculty_id=%s", $faculty_id); mysql_select_db($database_dares_conn, $dares_conn); $result = mysql_query($delete, $dares_conn) or die(mysql_error()); if ($result) { Flash::success($ecss_lang['ACADEMY_STRUCTURE']['FACULTY']['DELETE_SUCCESS']); } else { Flash::success($ecss_lang['ACADEMY_STRUCTURE']['FACULTY']['DELETE_ERROR']); } } if ($action == 'mass-delete') { mysql_select_db($database_dares_conn, $dares_conn); $ids = implode(",", $input['table_records']); $delete = sprintf('DELETE FROM academy_structure_faculty WHERE faculty_id IN(%s)', $ids); $query = mysql_query($delete); if ($query) { Flash::success($ecss_lang['ACADEMY_STRUCTURE']['FACULTY']['MASS_DELETE_SUCCESS']); } else { Flash::error($ecss_lang['ACADEMY_STRUCTURE']['FACULTY']['MASS_DELETE_ERROR']); } } header('location:index.php'); exit;
exit; } $createFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $createFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if (isset($input["MM_insert"]) && $input["MM_insert"] == "form1") { $year_name = GetSQLValueString($input['year_name'], "text"); if (empty($year_name)) { header('location: edit.php?year_id=' . $yearRow['year_name']); exit; } $insert = sprintf("UPDATE academy_structure_year SET year_name=%s WHERE year_id=%s", $year_name, $yearRow['year_id']); $result = mysql_query($insert, $dares_conn) or die(mysql_error()); if ($result) { Flash::success($ecss_lang['ACADEMY_STRUCTURE']['YEAR']['UPDATE_SUCCESS']); header('location: index.php?faculty_id=' . $facultyRow['faculty_id']); exit; } } // html page title $pageTitle = 'تعديل سنة ' . $yearRow['year_name']; // require page header require_once $config['base_url'] . '/admin/template/includes/header.php'; ?> <!-- page content --> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="x_panel" style="min-height:600px;"> <div class="x_title"> <h2><?php
<?php require_once dirname(__FILE__) . './vendor/autoload.php'; //autoload packages use McKay\Flash; chk_lgn(); $db = new Database(); $user = new User($db->conn); $record = new Record($db->conn); if ($_POST) { $id = $_POST['id']; $update = $_POST['record']; if ($record->update($id, $update)) { Flash::success('Record Successfully Updated!!'); unset($_POST); } else { Flash::error('Record Could Not Be Updated!!'); } } if (isset($_GET['id'])) { $user_id = $_GET['id']; } else { $user_id = $_SESSION['user_id']; } $data = $record->read($user_id); require 'templates/header.php'; ?> <div id="page-wrapper"> <div class="container-fluid">
static function salvar() { return function ($req, $res, $svc, $app) { $newTicket = $req->paramsPost(); $isNew = empty($req->id); if ($isNew) { $ticket = $app->db->ticket->create(); $ticket->criado_em = date('Y-m-d H:i:s'); $ticket->protocolo = date('YmdHis'); $ticket->operadora = $newTicket->operadora; $ticket->cidade = $newTicket->cidade; $ticket->tipo_problema = $newTicket->tipo_problema; $ticket->cliente_final = $newTicket->cliente_final; $ticket->designacao = $newTicket->designacao; } else { $ticket = $app->db->ticket->find_one($req->id); } $ticket->previsao = $newTicket->previsao; $ticket->status = $newTicket->status; $ticket->telefone = $newTicket->telefone; $ticket->obs = $newTicket->obs; $ticket->save(); $id = $isNew ? $ticket->id() : $req->id; Flash::success('Salvo com sucesso'); $res->redirect("/ticket/{$id}"); }; }
static function removeEmail() { return function ($req, $res, $svc, $app) { $app->db->user_email->find_one($req->id)->delete(); Flash::success('Email removido com sucesso'); $res->code(204)->header('X-Location', $req->headers()->referer)->send(); }; }
require_once dirname(__FILE__) . './vendor/autoload.php'; //autoload packages use McKay\Flash; chk_lgn(); $db = new Database(); $user = new User($db->conn); if ($_POST) { $user->first_name = $_POST['first_name']; $user->last_name = $_POST['last_name']; $user->email = $_POST['email']; $user->phone = $_POST['phone']; $user->status = 1; $user->role = 'patient'; $user->password = '******'; if ($user->register()) { Flash::success('Patient Successfully Added!!'); } else { Flash::error('Patient Cound Not Be Added!!'); } } include 'templates/header.php'; ?> <div id="page-wrapper"> <div class="container-fluid"> <!-- Page Heading --> <div class="row"> <div class="col-lg-12"> <h1 class="page-header"> Add Patients
$theValue = $theValue != "" ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = $theValue != "" ? intval($theValue) : "NULL"; break; case "double": $theValue = $theValue != "" ? doubleval($theValue) : "NULL"; break; case "date": $theValue = $theValue != "" ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = $theValue != "" ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } if (isset($_GET['lesid']) && $_GET['lesid'] != "") { $deleteSQL = sprintf("DELETE FROM subject_lesson WHERE lesson_id=%s", GetSQLValueString($_GET['lesid'], "int")); mysql_select_db($database_dares_conn, $dares_conn); $Result1 = mysql_query($deleteSQL, $dares_conn) or die(mysql_error()); $deleteGoTo = "index.php"; if (isset($_SERVER['QUERY_STRING'])) { $deleteGoTo .= strpos($deleteGoTo, '?') ? "&" : "?"; $deleteGoTo .= $_SERVER['QUERY_STRING']; } Flash::success($ecss_lang['Subject']['Lesson']['DELETE_SUCCESS']); header(sprintf("Location: %s", $deleteGoTo)); }
$createFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $createFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if (isset($_POST["MM_insert"]) && $_POST["MM_insert"] == "form1") { $faculty_name = GetSQLValueString($_POST['faculty_name'], "text"); $user_id = GetSQLValueString($_SESSION['User_id'], "int"); if (empty($faculty_name)) { header('location: create.php'); exit; } $insert = sprintf("INSERT INTO academy_structure_faculty (faculty_name, faculty_created_by) VALUES (%s, %s)", $faculty_name, $user_id); mysql_select_db($database_dares_conn, $dares_conn); $result = mysql_query($insert, $dares_conn) or die(mysql_error()); if ($result) { Flash::success($ecss_lang['ACADEMY_STRUCTURE']['FACULTY']['ADD_SUCCESS']); header('location: index.php'); exit; } } // html page title $pageTitle = 'إضافة كلية'; // require page header require_once $config['base_url'] . '/admin/template/includes/header.php'; ?> <!-- page content --> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="x_panel" style="min-height:600px;"> <div class="x_title"> <h2>الكليات</h2>