Пример #1
0
    $note = $_POST['innernote'];
    if ($note != "") {
        $name = $_SESSION['FIRST_NAME'] . " " . $_SESSION['LAST_NAME'];
        $qry = "INSERT INTO ost_ticket_note(ticket_id,staff_id,source,title,note,created) VALUES('" . $ticket_id . "','" . $_SESSION['STAFF_ID'] . "','" . $name . "','Ticket Updated by " . $name . "','" . $note . "',NOW())";
        $res = mysql_query($qry) or die("Bingo...right?");
    }
    echo "Update Successful! Wow, you just totally changed that data like a pro.";
    mysql_close($link);
}
/* Create a new ticket */
if (isset($_GET['new'])) {
    $link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("pickle");
    mysql_select_db(DB_NAME) or die("Dig Doug");
    $data = superSanitize($_POST);
    require_once 'util.php';
    $ticketID = randNumber();
    $duedate = explode('/', $data['duedate']);
    $qry = "INSERT INTO \n\t\tost_ticket(`ticket_id`, `ticketID`, `dept_id`, `priority_id`, `topic_id`, `staff_id`, `email`, `name`, `subject`, `helptopic`, `phone`, `phone_ext`, `ip_address`, `status`, `source`, `isoverdue`, `isanswered` " . ($data['duedate'] == '' ? "" : ",`duedate`") . ",`created`) \n\t\t VALUES('" . $data['ticket_id'] . "', '" . $ticketID . "', '" . $data['dept_id'] . "', '" . $data['priority_id'] . "', '" . $data['helptopicID'] . "', '" . $data['assigned'] . "', '" . $data['email'] . "', '" . $data['name'] . "', '" . $data['subject'] . "', '" . $data['helptopic'] . "', '" . $data['phone'] . "', '" . $data['phone_ext'] . "', '" . getRealIpAddr() . "', '" . "open" . "', '" . $data['ticket_source'] . "', '" . "0" . "', '" . "0" . "'," . ($data['duedate'] == '' ? "" : " '" . gmdate('Y-m-d H:i:s', mktime(0, 0, 0, $duedate[0], $duedate[1], $duedate[2])) . "', ") . " NOW()) ";
    mysql_query($qry) or die("that is a funny joke there bob.");
    //update attachments
    /* send email here depending on whether alert user or staff is checked */
    echo "New Ticket Created Successfully! I just cannot believe you did it SO fast.";
    //echo sendMail("*****@*****.**","*****@*****.**","Test Message","<p>Are <b>you</b> actually named <em>Ross</em> too!</p>")?"Mail Sent":"Mail Fail";
    mysql_close($link);
}
/* Ticket - menu, Edit & New */
if (isset($_GET['menu'])) {
    if ($_GET['menu'] == 'new') {
        require_once 'auth.php';
        require_once 'config.php';
        require_once 'scripts.php';
Пример #2
0
 function forgot_password()
 {
     $email = $this->input->post("email");
     $user = $this->common_model->query("SELECT * FROM users WHERE users.email = '" . $email . "'");
     if ($user->num_rows() > 0) {
         $user = $user->row();
         $rand = randNumber(100);
         $this->common_model->query("UPDATE users SET users.random='" . $rand . "' WHERE  users.email='" . $email . "';");
         //Sending Email
         $email_setting = array('mailtype' => 'html');
         $this->email->initialize($email_setting);
         /*$user->companyName*/
         $this->email->from('*****@*****.**', 'ILM Data Drive');
         $this->email->reply_to('*****@*****.**', 'ILM Data Drive');
         $this->email->to($email);
         $this->email->subject('Please reset your password and login.');
         $message = "\n<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n<html xmlns='http://www.w3.org/1999/xhtml'>\n<head>\n<title>On Site Confirmation</title>\n<head>\n<style>\n* {\n\tmargin: 0;\n\tpadding: 0;\n}\nbody {\n\tfont-family:Verdana, Geneva, sans-serif;\n}\nh1 {\n\tfont-size: 32px;\n\tfont-weight: normal;\n}\nh1, h2, h3 {\n\tline-height: 40px;\n}\n.red {\n\tcolor: #DD5A43 !important;\n}\n.white {\n\tcolor: #0000 !important;\n}\n</style>\n</head>\n<body>\n<div class='center login-layout' style='width:600px; margin:auto;'>\n<div class='main-container container-fluid'>\n  <h1> <img style='width: 86px;' src='" . base_url() . "assets/images/logo.png'> <span class='red'>ILM Data Drive</span> </h1>\n  <h4 class='blue'>&copy; Data Drive</h4>\n  <br />\n<br />\n<br />\n<br />\n<h3 style='color:#000;'>Please reset your password. <a href='" . site_url("homepage/resetpassword/" . $rand) . "'>Click Here</a></h3>\n</div>\n</div>\n</body>\n</html>\n\t\t";
         $this->email->message($message);
         $this->email->send();
         echo 'The password reset process has now been started. Please check your email for instructions on what to do next. ';
     } else {
         echo 'No client account was found with the email address you entered';
     }
 }