Ejemplo n.º 1
0
 /**
  * method to close a ticket
  * 
  */
 public function closeTicket()
 {
     if (isset($_REQUEST['id']) && !empty($_REQUEST["id"])) {
         $partTicket = Ticket::find_by_id($_REQUEST["id"]);
         $partTicket->status = "Closed";
         $theUser = Employee::find_by_id($_SESSION['emp_ident']);
         $cemail = !empty($_REQUEST['cemail']) ? explode(",", $_REQUEST['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()) {
             $schedule = Schedule::find_by_ticket_id($_REQUEST["id"]);
             if ($schedule) {
                 $schedule->status = "Closed";
                 $schedule->update();
             }
             $this->sendMail("Customer", $subject, $msg, $cemail);
             return true;
         } else {
             return false;
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * this the detail listing 
  * for support session between 
  * customer and administrator
  */
 public function detail($id = "")
 {
     @$this->loadModel("Support");
     $datum = $this->model->getData();
     $replyData = $this->model->getTicketData($id);
     //$this->view->state = $datum['state'];
     $uri = new Url("");
     $ticket = $replyData['ticket'];
     $replies = $replyData["replies"];
     //$this->view->employee =   Employee::find_by_sql("SELECT * FROM employee WHERE emp_dept='5'");
     $this->view->country = $datum['country'];
     $this->view->ticket = $replyData['ticket'];
     //$this->view->mymenu = $this->model->getById($id);
     $pgdetail = "";
     /**
      * hhhhhh
      */
     if ($ticket) {
         /**
          * Load ticket buttons
          */
         $pgdetail .= "<div class='row'><input type='hidden' name='cid' id='cid' value='{$ticket->prod_id}' />\n     \t<div class='large-12 columns'><div class='btn-group'><a href='" . $uri->link("support/ticketlist") . "'class='btn btn-info button'  >&laquo; Back</a>";
         if ($ticket->status != "Closed") {
             //if status is not closed
             /*Check if a technician has been assigned*/
             if (Schedule::find_by_ticket_id($ticket->id)) {
                 /*If exist do not display assign task button*/
                 $pgdetail .= "<a href='#' id='dh' class='btn btn-primary button'> Reply </a><a href='#' id='close' class='btn btn-danger button' >Close Ticket </a>";
             } else {
                 $pgdetail .= "<a href='#' id='dh' class='btn btn-primary button'> Reply </a><a href='#' id='close' class='btn btn-danger button' >Close Ticket </a><a href='#' data-reveal-id='myModal5' class='btn btn-info button'>Assign Task to Employee</a>";
             }
         }
         $pgdetail .= "</div>\n     </div></div>\n         </div> <!--closing to reload close -->\n         <div id='hideme'><form action='" . $uri->link("support/doCreateAdminReply/" . $ticket->id . "") . "' method='post' enctype='multipart/form-data' name='frmEmp5' id='frmEmp5'>\n\t     <fieldset><div id='transalert'></div>\n   \t       \n\t            <div class='row'>\n                    <div class='large-12 columns'>\n                    <input type='hidden'  name='cname' id='cname' value='Customer Support Robert Johnson Holdings'  />\n                            <input type='hidden' id='disid' name='disid' value='" . $ticket->id . "' />\n                            \n                            \n                            <div>Enter emails to copy here separate with commas</div>\n\t                      <input type='text' id='cemail' name='cemail' />\n\t\t                    <input type='hidden'   name='email' id='email'  />\n\t\t                    <div id='tm2'></div>\n                            <div>Response</div>\n\t                      <textarea  name='issue' id='issue' ></textarea></td>\n                  \n\t\t                <a class='btn btn-info' id='replysave' >Send Reply </a>\n                    </div>\n\t\t                    \n\t\t                  \n\t\t                    \n          </fieldset>\n           </form></div>";
         /**
          * form close
          */
         $pgdetail .= "<div id='granddiv'><div id='divclose'><div class='row'>\n     \t<div class='ticketdetailscontainer'>\n        <div class='large-3 columns'>\n            <div class='internalpadding'>\n                Submitted\n                <div class='detail'>" . $ticket->datecreated . "</div>\n            </div>\n        </div>\n        <div class='large-3 columns'>\n            <div class='internalpadding'>\n                Department\n                <div class='detail'>{$ticket->department}</div>\n            </div>\n        </div>\n        <div class='large-3 columns'>\n            <div class='internalpadding'>\n                Priority\n                <div class='detail'>{$ticket->priority}</div>\n            </div>\n        </div>\n        <div class='large-3 columns'>\n            <div class='internalpadding'>\n                Status\n                <div class='detail'>";
         $pgdetail .= $ticket->status == "Open" ? "<span style='color:#779500'>Open</span>" : "<span style='color:#f00'>{$ticket->status}</span>";
         $pgdetail .= "</div>\n            </div>\n        </div>\n        \n        <div class='clear'></div>\n    <br clear='all' />\n                </div>\n  \t </div><!-- Erred Close of grand div -->";
     }
     $pgdetail .= "\n           <div class='ticketmsgs'>\n           ";
     if ($replies) {
         foreach ($replies as $reply) {
             if ($reply->sender_type == "Client") {
                 $pgdetail .= "<div class='clientheader'>\n                    <div style='float:right;'>{$reply->datecreated}</div>\n                                {$reply->sender_name} || Client\n                    </div>\n                    <div class='clientmsg'>\n                                {$reply->message}\n                   </div>";
             } else {
                 $pgdetail .= "<div class='adminheader'>\n                    <div style='float:right;'>{$reply->datecreated}</div>\n                            {$reply->sender_name} || Staff\n                    </div>\n                    \n                    <div class='adminmsg'>\n\n                        {$reply->message}\n                                             \n                        <div class='clear'></div>\n                    </div>";
             }
         }
     }
     $pgdetail .= "</div></div>";
     $this->view->myReplyData = $pgdetail;
     $this->view->render("support/detail");
 }
Ejemplo n.º 3
0
        $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";
        }
        echo "</td><td>{$pending->datemodified} </td><td><a href='" . $uri->link("support/detail/" . $pending->id . "") . "'>View</a></td><td>\n                <select sid='{$pending->id}' class='cschedule2'><option values=''>--Select--</option><option values='0'>Open</option><option values='1'>Closed</option><option values='2'>In Progress</option></select></td></tr>";
    }
}
?>