Jump to content

Is Anyone familiar with OSTickets?


NotSureILikePHP

Recommended Posts

I NEVER get a good answer here so I stopped posting and just post on PHP Phreaks but this is way too confusing so I have to try here. I can NOT for the life of me figure out what is going on with this code. It's so horribly coded and I'm new to php so it's like trying to learn Mandarin from a special needs kid.

I created a class called Customers by mimicking the staff class. I can populate my grid with all the customers but when I try to search by a specific customer I have to know the full name WITH all the right capitalization. I'm trying to track down where the query is called but these coders don't use stored procedures they dynamically build them and it's one of the most complicated things I've ever seen. Here's the line of code I'm trying to trace, I think....


if ($filters) {
    $custs->filter($filters);
}
[/]

Now I can find this function and when I echo what it returns it returns the querystring WHERE A1.`cust_name` = 'test' which is exactly what I am looking for. However, I can't trace it any further than that. This is the code in that function

[code]
foreach (func_get_args() as $Q) {
            $this->constraints[] = $Q instanceof Q ? $Q : new Q($Q);
}
[/]

The Query looks like

SELECT A1.`cust_name` FROM `ost_customer` A1 WHERE A1.`cust_name` = 'test'

I have spent HOURS searching this code for A1 (returns thousands of rows), SELECT (which returns even more rows around 4 thousand), CUST_TABLE which is the variable my customer table name is stored and I have found NOTHING.


Can anyone help me find where this code is located so I can change it? I really wish they just used stored procedures. It would make this whole project so much more readable.

 

I would also like to know how to add % to a textbox. For example, I have a textbox so that the user can type "Test" and it should return 1 customer in the database named "Testy Corporate" but it doesn't unless you type the whole name. I would like to add % to the beginning and end like "%test%". However, when you hit submit it posts back and runs the query. Now, I'm assuming if I ever find the place where the sql statement is called I should be able to change that but is there a way that when you hit submit it automatically appends that to the text?

Link to comment
Share on other sites

I do have Eclipse installed but I can't figure out how to chase the rabbit. I can get it to debug on certain pages but I have spent 30 minutes hitting step into and not gotten to the spot that I want because the code is so convoluted. It starts debugging right away and I have told it not to in the settings and when I hit play the first time it never hits another breakpoint. Is there a better debugger than Eclipse and XDebug or am I just doing something wrong?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.