sebsimappus Posted April 10, 2016 Share Posted April 10, 2016 Hello, I'd use the hook system to validate the opening of a ticket via javascript, but I think my hook file does not work because it not work. If someone can have an idea. <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); function openticket() { if($_POST['submitticket.php?step=2&deptid=']=='2' && !empty($_POST['name']) && !empty($_POST['email']) && !empty($_POST['token']) && !empty($_POST['subject']) && !empty($_POST['message'])) { $command = "openticket"; $adminuser = "admin"; $values["clientid"] = $_POST['clientid']; $values["deptid"] = $_POST['2']; $values["subject"] = $_POST['subject']; $values["message"] = $_POST['message']; $values["priority"] = $_POST['Medium']; if($results['result']=='success'){ $command = "openticket"; $values["responsetype"] = "json"; $results = localAPI($command,$values,$adminuser); //print_r($results); echo "TicketOpen"; }else{ echo "false"; } exit(); } } add_hook("ClientAreaPage",1,"openticket"); ?> thank you in advance 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.