public function delete($id) { $article = Client::find_by_id($id); if ($article->delete()) { return true; } }
function create() { if ($_POST) { $config['upload_path'] = './files/media/'; $config['encrypt_name'] = TRUE; $config['allowed_types'] = '*'; $this->load->library('upload', $config); $this->load->helper('notification'); unset($_POST['userfile']); unset($_POST['file-name']); unset($_POST['send']); unset($_POST['_wysihtml5_mode']); unset($_POST['files']); $settings = Setting::first(); $client = Client::find_by_id($this->client->id); $user = User::find_by_id($settings->ticket_default_owner); $_POST['from'] = $client->firstname . ' ' . $client->lastname . ' - ' . $client->email; $_POST['company_id'] = $client->company->id; $_POST['client_id'] = $client->id; $_POST['user_id'] = $settings->ticket_default_owner; $_POST['queue_id'] = $settings->ticket_default_queue; $_POST['type_id'] = $settings->ticket_default_type; $_POST['status'] = $settings->ticket_default_status; $_POST['created'] = time(); $_POST['subject'] = htmlspecialchars($_POST['subject']); $ticket_reference = Setting::first(); $_POST['reference'] = $ticket_reference->ticket_reference; $ticket = Ticket::create($_POST); $new_ticket_reference = $_POST['reference'] + 1; $ticket_reference->update_attributes(array('ticket_reference' => $new_ticket_reference)); if (!$this->upload->do_upload()) { $error = $this->upload->display_errors('', ' '); $this->session->set_flashdata('message', 'error:' . $error); } else { $data = array('upload_data' => $this->upload->data()); $attributes = array('ticket_id' => $ticket->id, 'filename' => $data['upload_data']['orig_name'], 'savename' => $data['upload_data']['file_name']); $attachment = TicketHasAttachment::create($attributes); } if (!$ticket) { $this->session->set_flashdata('message', 'error:' . $this->lang->line('messages_create_ticket_error')); redirect('ctickets'); } else { $this->session->set_flashdata('message', 'success:' . $this->lang->line('messages_create_ticket_success')); if (isset($user->email) && isset($ticket->reference)) { send_ticket_notification($user->email, '[Ticket#' . $ticket->reference . '] - ' . $_POST['subject'], $_POST['text'], $ticket->id); } if (isset($client->email) && isset($ticket->reference)) { send_ticket_notification($client->email, '[Ticket#' . $ticket->reference . '] - ' . $_POST['subject'], $_POST['text'], $ticket->id); } redirect('ctickets/view/' . $ticket->id); } } else { $this->theme_view = 'modal'; $this->view_data['title'] = $this->lang->line('application_create_ticket'); $this->view_data['form_action'] = 'ctickets/create'; $this->content_view = 'tickets/client_views/_ticket'; } }
function __construct() { parent::__construct(); $this->view_data['core_settings'] = Setting::first(); if ($this->input->cookie('language') != "") { $language = $this->input->cookie('language'); } else { if (isset($this->view_data['language'])) { $language = $this->view_data['language']; } else { if (!empty($this->view_data['core_settings']->language)) { $language = $this->view_data['core_settings']->language; } else { $language = "english"; } } } $this->lang->load('application', $language); $this->lang->load('messages', $language); $this->lang->load('event', $language); $this->user = $this->session->userdata('user_id') ? User::find_by_id($this->session->userdata('user_id')) : FALSE; $this->client = $this->session->userdata('client_id') ? Client::find_by_id($this->session->userdata('client_id')) : FALSE; if ($this->client) { $this->theme_view = 'application_client'; } $this->view_data['datetime'] = date('Y-m-d H:i', time()); $this->view_data['sticky'] = Project::all(array('conditions' => 'sticky = 1')); $this->view_data['quotations_new'] = Quote::find_by_sql("select count(id) as amount from quotations where status='New'"); if ($this->user || $this->client) { $access = $this->user ? $this->user->access : $this->client->access; $access = explode(",", $access); if ($this->user) { $this->view_data['menu'] = Module::find('all', array('order' => 'sort asc', 'conditions' => array('id in (?) AND type = ?', $access, 'main'))); $this->view_data['widgets'] = Module::find('all', array('conditions' => array('id in (?) AND type = ?', $access, 'widget'))); } else { $this->view_data['menu'] = Module::find('all', array('order' => 'sort asc', 'conditions' => array('id in (?) AND type = ?', $access, 'client'))); } if ($this->user) { $update = User::find($this->user->id); } else { $update = Client::find($this->client->id); } $update->last_active = time(); $update->save(); if ($this->user) { $this->view_data['user_online'] = User::all(array('conditions' => array('last_active+(30 * 60) > ? AND status = ?', time(), "active"))); $this->view_data['client_online'] = Client::all(array('conditions' => array('last_active+(30 * 60) > ? AND inactive = ?', time(), "0"))); } $email = $this->user ? 'u' . $this->user->id : 'c' . $this->client->id; $this->view_data['messages_new'] = Privatemessage::find_by_sql("select count(id) as amount from privatemessages where `status`='New' AND recipient = '" . $email . "'"); $this->view_data['tickets_new'] = Ticket::find_by_sql("select count(id) as amount from tickets where `status`='New'"); } /*$this->load->database(); $sql = "select * FROM templates WHERE type='notes'"; $query = $this->db->query($sql); */ $this->view_data["note_templates"] = ""; //$query->result(); }
protected function set_pseudo() { if (isset($this->client_id)) { $client = Client::find_by_id((int) $this->client_id); if ($client) { $this->pseudo = $client->pseudo; } } }
/** * method to close a ticket * */ public function closeTicket() { if (isset($_POST['id']) && !empty($_POST["id"])) { $partTicket = Ticket::find_by_id($_POST["id"]); $partTicket->status = "Closed"; $theUser = Employee::find_by_id($_SESSION['emp_ident']); $cemail = !empty($_POST['cemail']) ? explode(",", $_POST['cemail']) : ""; // print_r($partTicket); array_push($cemail, $partTicket->contact_email, $theUser->emp_email); $client = Client::find_by_id($partTicket->client_id); array_push($cemail, $client->email); $partTicket->datemodified = date("Y-m-d H:i:s"); $msg = "Your Complaint ticket status has been closed<br />"; $subject = "Robert Johnson Holdings(Technical Support) Ticket #'" . $partTicket->id . "' Close"; //print_r($cemail); //mail("*****@*****.**","Robert Johnson Holdings, Technical Support" , "all good"); if ($partTicket->update()) { // $this->sendMail("Customer",$subject ,$msg,$cemail); return true; } else { return false; } } }
<p>Total Tickets</p> </div> <div class="icon"> <i class="ion ion-pie-graph"></i> </div> <a href="<?php echo $uri->link("supportticket/index"); ?> " class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a> </div> </div><!-- ./col --> <?php global $session; $user = Client::find_by_id($_SESSION['client_ident']); if ($_SESSION['user_role'] == "admin") { echo "<div class='col-lg-2 col-xs-6'>\n <!-- small box -->\n <div class='small-box bg-teal'>\n <div class='inner'>\n <h3>{$this->usercount} </h3>\n <p>Users</p>\n </div>\n <div class='icon'>\n <i class='ion ion-person-add'></i>\n </div>\n <a href='"; echo $_SESSION['user_role'] === 'admin' ? $uri->link("users/index") : "javascript:void(0)"; echo "' class='small-box-footer'>More info <i class='fa fa-arrow-circle-right'></i></a>\n\n </div>\n </div>"; } elseif (strtolower($_SESSION['user_role']) == "standard user" || strtolower($_SESSION['user_role']) == "standard") { $me = Clientuser::find_by_id($_SESSION['user_ident']); } ?> </div><!-- /.row --> <div class="row"> <div class="col-lg-6"> <div class="box box-info">
function client($id = FALSE) { $this->load->helper('notification'); if ($_POST) { unset($_POST['send']); unset($_POST['_wysihtml5_mode']); $id = $_POST['id']; unset($_POST['id']); $client = Client::find_by_id($_POST['client_id']); $assign = Ticket::find_by_id($id); $attr = array('client_id' => $client->id, 'company_id' => $client->company->id); $assign->update_attributes($attr); if (isset($_POST['notify'])) { send_ticket_notification($client->email, '[Ticket#' . $assign->reference . '] - ' . $_POST['subject'], $_POST['message'], $assign->id); $_POST['internal'] = "0"; } unset($_POST['notify']); $_POST['subject'] = htmlspecialchars($_POST['subject']); $_POST['datetime'] = time(); $_POST['from'] = $this->user->firstname . " " . $this->user->lastname . ' - ' . $this->user->email; $_POST['reply_to'] = $this->user->email; $_POST['ticket_id'] = $id; $_POST['to'] = $_POST['client_id']; unset($_POST['client_id']); $article = TicketHasArticle::create($_POST); if (!$assign) { $this->session->set_flashdata('message', 'error:' . $this->lang->line('messages_save_ticket_error')); } else { $this->session->set_flashdata('message', 'success:' . $this->lang->line('messages_assign_ticket_success')); } redirect('tickets/view/' . $id); } else { $this->view_data['clients'] = Client::find('all', array('conditions' => array('inactive=?', '0'))); $this->view_data['ticket'] = Ticket::find($id); $this->theme_view = 'modal'; $this->view_data['title'] = $this->lang->line('application_client'); $this->view_data['form_action'] = 'tickets/client'; $this->content_view = 'tickets/_client'; } }
head('Welcome to Urban Illustration'); topbar(); ?> <div id="content"> <div id="maincontent"> <div class="textcontentalone"> <?php $tmpclt = Client::find_by_id($_GET['tclt']); if ($tmpclt->coupon == 'family') { $price = '$150'; } else { $price = '$190'; } ?> <h2>Thank you for Joining: The <?php echo DateManager::frontdisplaytimefromtmstp($classtojoin->c_date); ?> Class part of the <?php echo $sessiontojoin->name; ?>
public function getById($id) { return Client::find_by_id($id); // $myaccount = Accounts::find_by_phone($phone); }
$client->{$variable} = trim(${$variable}); break; } } $sql = "SELECT * FROM Strada WHERE Denumire='" . str_replace("%20", " ", $client->idStrada) . "'"; $stradaList = Strada::find_by_sql($sql); $strada = array_shift($stradaList); $client->idStrada = $strada->id; $client->TelefonMobil = preg_replace("/[^0-9]/", "", $client->TelefonMobil); $client->TelefonFix = preg_replace("/[^0-9]/", "", $client->TelefonFix); $client->TelefonFax = preg_replace("/[^0-9]/", "", $client->TelefonFax); $client->TelefonServici = preg_replace("/[^0-9]/", "", $client->TelefonServici); $client->save(); redirect_to("client_view.php?id=" . $client->id); } else { $client = Client::find_by_id($_GET['id']); $flow = $_GET['flow']; $strada = Strada::find_by_id($client->idStrada); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ro" lang="ro"> <head> <title>Imobiliare - Modificare client</title> <link rel="stylesheet" type="text/css" href=".././styles/main.css" /> <link rel="stylesheet" type="text/css" href=".././javascripts/jscal/css/jscal2.css" /> <link rel="stylesheet" type="text/css" href=".././javascripts/jscal/css/gold/gold.css" /> <script type="text/javascript" src=".././javascripts/jscal/js/jscal2.js"></script> <script type="text/javascript" src=".././javascripts/jscal/js/lang/en.js"></script>
function sendestimate($id = FALSE) { $this->load->helper(array('dompdf', 'file')); $this->load->library('parser'); $data["estimate"] = Invoice::find($id); //check if client contact has permissions for estimates and grant if not if (isset($data["estimate"]->company->client->id)) { $access = explode(",", $data["estimate"]->company->client->access); if (!in_array("107", $access)) { $client_estimate_permission = Client::find_by_id($data["estimate"]->company->client->id); $client_estimate_permission->access = $client_estimate_permission->access . ",107"; $client_estimate_permission->save(); } } $data["estimate"]->estimate_sent = date("Y-m-d"); $data["estimate"]->estimate_status = "Sent"; $data['items'] = InvoiceHasItem::find('all', array('conditions' => array('invoice_id=?', $id))); $data["core_settings"] = Setting::first(); $due_date = date($data["core_settings"]->date_format, human_to_unix($data["estimate"]->due_date . ' 00:00:00')); //Set parse values $parse_data = array('client_contact' => $data["estimate"]->company->client->firstname . ' ' . $data["estimate"]->company->client->lastname, 'client_company' => $data["estimate"]->company->name, 'due_date' => $due_date, 'estimate_id' => $data["core_settings"]->estimate_prefix . $data["estimate"]->reference, 'client_link' => $data["core_settings"]->domain, 'company' => $data["core_settings"]->company, 'logo' => '<img src="' . base_url() . '' . $data["core_settings"]->logo . '" alt="' . $data["core_settings"]->company . '"/>', 'invoice_logo' => '<img src="' . base_url() . '' . $data["core_settings"]->invoice_logo . '" alt="' . $data["core_settings"]->company . '"/>'); // Generate PDF $html = $this->load->view($data["core_settings"]->template . '/' . $data["core_settings"]->estimate_pdf_template, $data, true); $html = $this->parser->parse_string($html, $parse_data); $filename = $this->lang->line('application_estimate') . '_' . $data["estimate"]->reference; pdf_create($html, $filename, FALSE); //email $subject = $this->parser->parse_string($data["core_settings"]->estimate_mail_subject, $parse_data); $this->email->from($data["core_settings"]->email, $data["core_settings"]->company); if (!isset($data["estimate"]->company->client->email)) { $this->session->set_flashdata('message', 'error:This client company has no primary contact! Just add a primary contact.'); redirect('estimates/view/' . $id); } $this->email->to($data["estimate"]->company->client->email); $this->email->subject($subject); $this->email->attach("files/temp/" . $filename . ".pdf"); $email_estimate = read_file('./application/views/' . $data["core_settings"]->template . '/templates/email_estimate.html'); $message = $this->parser->parse_string($email_estimate, $parse_data); $this->email->message($message); if ($this->email->send()) { $this->session->set_flashdata('message', 'success:' . $this->lang->line('messages_send_estimate_success')); $data["estimate"]->update_attributes(array('status' => 'Sent', 'sent_date' => date("Y-m-d"))); log_message('error', 'Estimate #' . $data["core_settings"]->estimate_prefix . $data["estimate"]->reference . ' has been send to ' . $data["estimate"]->company->client->email); } else { $this->session->set_flashdata('message', 'error:' . $this->lang->line('messages_send_estimate_error')); log_message('error', 'ERROR: Estimate #' . $data["core_settings"]->estimate_prefix . $data["estimate"]->reference . ' has not been send to ' . $data["estimate"]->company->client->email . '. Please check your servers email settings.'); } unlink("files/temp/" . $filename . ".pdf"); redirect('estimates/view/' . $id); }
public function update() { if (!empty($_POST['cname']) && !empty($_POST['cphone']) && !empty($_POST['cemail'])) { $thisClient = Client::find_by_id((int) preg_replace('#[^0-9]#i', '', $_SESSION['client_ident'])); $error = array(); if (ctype_digit($_POST["cphone"]) == false) { array_push($error, "Phone Number entered is incorrect"); } else { $thisClient->contact_phone = $_POST["cphone"]; } if (!preg_match("/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})\$/i", $_POST["cemail"])) { array_push($error, "Email entered is incorrect"); } else { $thisClient->contact_email = $_POST["cemail"]; } if (strlen($_POST["cname"]) < 3) { array_push($error, "Name entered is incorrect"); } else { $thisClient->contact_name = strip_tags($_POST["cname"]); } if (!empty($error)) { $message = "Please check the following errors:<br /> "; $lenght = count($error); for ($i = 0; $i < $lenght; $i++) { $message = $message . $error[$i] . "<br />"; } echo "<div data-alert class='alert-box error'><a href='#' class='close'>×</a>{$message}</div>"; exit; } if ($thisClient->update()) { return 1; } else { return 2; } } /** * Section to update password * for client */ if (!empty($_POST['opword']) && !empty($_POST['pword'])) { $thisClient = Client::find_by_id((int) preg_replace('#[^0-9]#i', '', $_SESSION['client_ident'])); $error = array(); if ($thisClient->password != $_POST["opword"]) { array_push($error, "Old Password is Incorrect"); } if ($_POST["pword2"] != $_POST["pword"]) { array_push($error, "The new Password and Re-typed Password entered do not match."); } elseif (strlen($_POST['pword']) < 6) { array_push($error, "Password entered is too short. Minimum of Six(6) characters required."); } if (!empty($error)) { $message = "Please check the following errors:<br /> "; $lenght = count($error); for ($i = 0; $i < $lenght; $i++) { $message = $message . $error[$i] . "<br />"; } echo "<div data-alert class='alert-box error'><a href='#' class='close'>×</a>{$message}</div>"; exit; } $thisClient->password = $_POST["pword"]; if ($thisClient->update()) { return 1; } else { return 2; } } }
<tr > <td class="header" width="5%">Cod</td> <td class="header" width="15%">Client</td> <td class="header" width="10%">Telefon</td> <td class="header" width="5%">Tip proprietate</td> <td class="header" width="5%">Camere</td> <td class="header" width="10%">Tip ap.</td> <td class="header" width="5%">Etaje</td> <td class="header" width="30%">Zone</td> <td class="header" width="10%">Buget</td> <td class="header" width="5%">Plata</td> </tr> <?php $i = 0; foreach ($cerereList as $cerere) { $client = Client::find_by_id($cerere->idClient); $zoneIdList = explode(",", $cerere->Zona); $TipProprietateList = ""; if (strlen($cerere->TipProprietate) > 0) { $tmplist = explode(",", substr($cerere->TipProprietate, 1, -1)); foreach ($tmplist as $tmpx) { if ($tmpx == 1) { $tmpx = "apartament"; } if ($tmpx == 2) { $tmpx = "ap. in vila"; } if ($tmpx == 3) { $tmpx = "casa"; } if ($tmpx == 4) {
public function sendMailCloseTicket($id) { $ticket = Ticket::find_by_id($id); $ccemails = Ccemail::find_by_ticket($id); $client = Client::find_by_id($_SESSION['client_ident']); $to = '*****@*****.**'; $subject = 'RE: Ticket Number: #' . str_pad($ticket->id, 8, "0", STR_PAD_LEFT) . " " . $ticket->subject; $headers = "From: " . $client->name . "<" . $client->email . ">\r\n"; $headers .= "Reply-To: " . $ticket->contact_email . "\r\n"; if ($ccemails) { $copyaddy = array(); $cc = ""; foreach ($ccemails as $ccemail) { array_push($copyaddy, $ccemail->email); } for ($i = 0; $i < count($copyaddy); $i++) { if ($i == count($copyaddy) - 1) { $cc .= $copyaddy[$i]; } else { $cc .= $copyaddy[$i] . ", "; } } $to .= ", " . $cc; } $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message = ' <html><body> <h1>Robert Johnson Holdings Limited</h1> <h2>Ticket Number #' . str_pad($ticket->id, 8, "0", STR_PAD_LEFT) . '</h2> <table width="100%" border="0"> <tr> <th scope="row" width="30%">Client</th> <td width="70%">' . $client->name . '</td> </tr> <tr> <th scope="row">Contact Person</th> <td>' . $ticket->contact_name . '</td> </tr> <tr> <th scope="row">Contact Phone Number</th> <td>' . $ticket->contact_phone . '</td> </tr> <tr> <th scope="row">Contact Email</th> <td>' . $ticket->contact_email . '</td> </tr>'; if ($ccemails) { $message .= '<tr> <th scope="row">Copied Emails</th> <td>' . $cc . '</td> </tr> <tr>'; } $message .= '<th scope="row">Department</th> <td>' . $ticket->department . '</td> </tr> <tr> <th scope="row">Ticket Status</th> <td>' . $ticket->status . '</td> </tr> <tr> <th scope="row">Priority Level</th> <td>' . $ticket->priority . '</td> </tr> <tr> <th scope="row">Related Product/Service</th> <td>' . $ticket->prod_name . ' at ' . $ticket->location . '</td> </tr> <tr> <th scope="row">Subject</th> <td>' . $ticket->subject . '</td> </tr> <tr> <th scope="row">Issue/Complaint/Suggestion</th> <td>Ticket has been closed.</td> </tr> </table> </body></html>'; if (mail($to, $subject, $message, $headers)) { return true; } else { return false; } }
?> ">back to classes</a> <table id="tbschedualdisplay"> <tr class="tabletitle"><td>Client Name</td><td>Child Name</td><td>Email</td><td>Phone</td><td>Coupon</td><td>Update</td><td>Remove</td></tr> <?php Client::displayclients($_GET['clsid']); ?> </table> <?php if (isset($_GET['updclt'])) { $updateclient = Client::find_by_id($_GET['updclt']); ?> <div class="box"> <h2>Update Client : <?php echo $updateclient->p_lastname; ?> </h2> <form action="clients-view.php?clsid=<?php echo $_GET['clsid']; ?> " method="post"> <input type="hidden" value="<?php echo $updateclient->id; ?>
<?php $cat = Prod_Cat::find_by_id($this->product->prod_cat_id); $prod_name = $cat->prod_cat_name; $client = Client::find_by_id($this->product->client_id); $client_name = $client->name; $employee = Employee::find_by_staff_id($this->product->incare_employee_id); $emp = $employee->emp_id . " " . $employee->emp_fname . " " . $employee->emp_lname; ?> <div id='transalert'></div> <div class="large-9 columns centre" role="content"> <!-- Table goes in the document BODY --> <div class="panel callout"> <h4 style="display:inline"><?php echo $prod_name . " " . $this->product->model; ?> </h4> <span class="button secondary right" style="display:inline"><a href="<?php echo $uri->link("products/index"); ?> ">Go Back</a></span> </div> <div class="row"> <div class="large-3 columns"> <a href="<?php echo $uri->link("products/signoff"); ?> "><div class="panel"><img src="public/icons/clock.png" />View Sign-Off Form</div></a> </div>
<body> <?php require_once ".././include/meniu.php"; ?> <form action="cerere_new.php" method="post" id="searchForm"> <div id="DetaliiClient" class="view"> <h3 onclick="showHide1('extraClient')" onmouseover="this.style.cursor='pointer'">Detalii client - extinde ...</h3> <?php if (isset($_GET['id'])) { $client = Client::find_by_id($_GET['id']); $ClientId = $client->id; } else { $client = Client::find_by_id($_POST['ClientId']); } $ClientNume = $client->full_name(); ?> <input type="hidden" name="ClientId" value="<?php echo htmlentities($ClientId); ?> " /> <table> <tr> <td class="label">Nume client:</td> <td><?php echo $ClientNume; ?> </td> </tr>
$sql_proprietate .= "TipConstructie,NrGrupuriSanitare,NumarBalcoane,SuprafataTerasa,CodBazaDate,AnConstructie,"; $sql_proprietate .= "DataActualizare,SuprafataUtila,SuprafataConstruita,OfertaSpeciala) VALUES "; $sql_dotare = "INSERT INTO DotareApartament (idApartament,idDotare) VALUES "; $sql_foto = "INSERT INTO Foto (idProprietate, NumeFisier, Tip, Marime, Detalii, Ordin, Schita) VALUES "; $sql = "SELECT * FROM Oferta WHERE (Exportat<>1 OR Exportat=NULL)"; $oferte = Oferta::find_by_sql($sql); //$oferta=array_shift($oferte); $td = 0; $ti = 0; $tu = 0; $sync = 0; $insert = 0; foreach ($oferte as $oferta) { $sync++; $apartament = Apartament::find_by_id($oferta->id); $client = Client::find_by_id($apartament->idClient); $agent = User::find_by_id($client->idUtilizator); $sql = "SELECT * FROM Proprietate WHERE CodBazaDate={$oferta->id}"; $update = 0; $result = mysql_query($sql, $conexiune2); if ($row = mysql_fetch_array($result)) { $update = 1; $idProprietate = $row["id"]; } if ($update) { $td1 = time(); $sql = "DELETE FROM DotareApartament WHERE idApartament={$idProprietate}"; $result = execute_querry($sql, $conexiune2); //$sql="ALTER TABLE DotareApartament AUTO_INCREMENT = 1"; //$result=execute_querry($sql, $conexiune2); $sql = "DELETE FROM Foto WHERE idProprietate={$idProprietate}";
$Inchiriere = $cerere->Inchiriere; $Buget = $cerere->Buget; $Moneda = $cerere->Moneda; $Credit = $cerere->Credit; $Detalii = $cerere->Detalii; $Stare = $cerere->Stare; } if (isset($_POST['submit'])) { $postlist = array_keys($_POST); foreach ($postlist as $variable) { if ($variable != "submit") { ${$variable} = $_POST[$variable]; } } $cerere = new Cerere(); $client = Client::find_by_id($ClientId); $cerere->id = $idCerere; $cerereStatic = Cerere::find_by_id($idCerere); $cerere->idClient = $ClientId; if (isset($subZonaChecked)) { $cerere->Zona = build_list($subZonaChecked); } if (isset($TipProprietate)) { $cerere->TipProprietate = build_list($TipProprietate); } if (isset($NumarCamere)) { $cerere->NumarCamere = build_list($NumarCamere); } if (isset($Confort)) { $cerere->Confort = build_list($Confort); }
public function getClientByID($id) { return Client::find_by_id($id); }
public function create() { global $database; if (isset($_POST['Submit']) && !empty($_POST['password']) && !empty($_POST['email'])) { $newuser = new Clientuser(); $company = Client::find_by_id($_SESSION['client_ident']); $newuser->fname = $_POST['fname']; $newuser->username = $_POST['email']; $newuser->lname = $_POST['sname']; $newuser->password = $_POST['password']; $newuser->phone = $_POST['phone']; $newuser->email = $_POST['email']; $newuser->company_id = $company->id; $newuser->company = $company->name; $newuser->client_id = $company->id; $newuser->user_role = "standard"; $newuser->date_added = date("Y-m-d H:i:s"); if (isset($_FILES['fupload']) && $_FILES['fupload']['error'] == 0) { move_uploaded_file($_FILES['fupload']['tmp_name'], "public/uploads/" . basename($_FILES['fupload']['name'])); $image = new Imageresize(); // an instance of image resize object $image->load("public/uploads/" . basename($_FILES['fupload']['name'])); //$image->image =; $image->resize(280, 280); $image->save("public/uploads/" . basename($_FILES['fupload']['name'])); //this section is needed to get the extension for image type in renaming the image if ($_FILES['fupload']['type'] == "image/gif") { $ext = ".gif"; } if ($_FILES['fupload']['type'] == "image/png") { $ext = ".png"; } if ($_FILES['fupload']['type'] == "image/jpeg") { $ext = ".jpeg"; } if ($_FILES['fupload']['type'] == "image/pjpeg") { $ext = ".jpeg"; } if ($_FILES['fupload']['type'] == "image/gif") { $ext = ".gif"; } if ($_FILES['fupload']['type'] == "image/jpg") { $ext = ".jpg"; } $new_name = uniqid() . "_" . time() . $ext; //new name for the image rename("public/uploads/" . basename($_FILES['fupload']['name']), "public/uploads/" . $new_name); $photo = $new_name; $newuser->img_url = $photo; } if ($database->db_query("SELECT * FROM users_client WHERE username='******' OR phone='" . $newuser->phone . "' OR email='" . $newuser->email . "'")) { if ($newuser->create()) { $to = $newuser->email; $subject = 'RJ Support ATM Services Portal '; $headers = "From: " . $company->name . "<" . $company->email . ">\r\n"; $headers .= "Reply-To: " . $company->contact_email . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message = "<p>Your username and password on the Robert Johnson ATM Support Portal is as below </p> "; $message .= "<p><b>Username: </b>" . $newuser->email . "<br>"; $message .= "<b>Password: </b>" . $_POST['password'] . "<br></p>"; $message .= "<br><br> Thank You"; mail($to, $subject, $message, $headers); return 1; } else { return 2; } } else { return 5; } } else { return 4; } }
public function activationlist() { $this->loadModel("Support"); $datum = $this->model->ActivationList("", "support"); $this->view->mytickets = $datum['activations']; $ticketlist = ""; $uri = new Url(""); $ticketlist .= "<div class='row'><div class='large-12 columns'>"; $ticketlist .= "</div></div><div class='row'><div class='large-12 columns'><table id='dt_basic' class='pure-table' width='100%'>\n\t\t\t<thead><tr>\n\t\t\t\t<th >Date</th><th>Terminal ID</th><th >Product</th><th>Client </th><th >Location</th><th>Status </th><th></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>"; if ($this->view->mytickets) { $x = 1; foreach ($this->view->mytickets as $ticket) { $ticketlist .= "<tr>\n\t\t\t\t\t<td>" . date_format(date_create($ticket->datecreated), "M d Y") . "</td><td>{$ticket->terminal_id}</td><td>{$ticket->product_name}</td><td>"; if ($ticket->client_id != "") { $client = Client::find_by_id($ticket->client_id); $ticketlist .= $client->name; } $ticketlist .= "</td><td>{$ticket->location} </td><td>{$ticket->status}</td><td><a href='" . $uri->link("support/activationdetails/" . $ticket->id . "") . "'>View</a></td>\n\t\t\t\t</tr>"; $x++; } } else { $ticketlist .= "<tr><td colspan='7'>No record to display</td></tr>"; } $ticketlist .= "</tbody>\n\t\t\t</table></div></div><div class='row'><div class='large-12 columns'>"; $ticketlist .= "</div><p> </p></div>"; $this->view->schedules = $ticketlist; $this->view->render("support/activationlist"); }
<tbody> <?php if ($this->pendings) { foreach ($this->pendings as $pending) { echo "<tr>\n <td>" . date_format(date_create($pending->datecreated), "M d Y") . "</td><td>{$pending->id}</td><td>{$pending->terminal_id}</td>"; $prod = Cproduct::find_by_terminal_id($pending->terminal_id); echo "<td>"; if (empty($pending->location)) { echo $prod->install_address . ", " . $prod->install_city; } else { echo $pending->location; } echo " </td>"; echo "<td>"; //$pending->client_name $myclient = Client::find_by_id($pending->client_id); if ($myclient) { echo $myclient->name; } echo "</td><td>"; $schedule = Schedule::find_by_ticket_id($pending->id); //print_r($schedule); if ($schedule) { $myengineer = Employee::find_by_id($schedule->emp_id); echo $myengineer ? $myengineer->emp_lname . " " . $myengineer->emp_fname : ""; } echo " </td><td>{$pending->issue}</td><td>"; if ($pending->status == 'Open') { echo "<span class='label bg-red' style='padding:5px'>{$pending->status}"; } else { echo "<span class='label bg-blue' style='padding:5px'>Pending";