Jump to content

garf3r

New Members
  • Posts

    4
  • Joined

  • Last visited

garf3r's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This is my array 'status' => array( 'title' => _l('Status (do not use)'), 'field' => array( 'type' => 'select', 'name' => 'search[status]', 'value' => isset($search['status'])?$search['status']:'', 'blank' => ' - Status - ', 'options' => array( _Quote => _l('Quote'), _Application => _l('Application'), 'On Risk' => _l('On Risk'), _Dead => _l('Dead'), _NTU => _l('NTU'), _Cancelled => _l('Cancelled'), _TestLead => _l('Test Lead'), ), ), ), And this is my search string (which comes up blank) if(isset($search['status']) && trim($search['status'])){ $str = (int)$search['status']; // search all the customer site addresses. $sql .= " LEFT JOIN `"._DB_PREFIX."customer` cur ON (c.customer_id = cur.status)"; $where .= " AND (cur.status = '$str')"; } Any ideas?
  2. I'm just guessing here, i found this in the user.php public static function get_users($search=array(),$mysql=false){ // limit based on customer id /*if(!isset($_REQUEST['customer_id']) || !(int)$_REQUEST['customer_id']){ return array(); }*/ // build up a custom search sql query based on the provided search fields $sql = "SELECT *,u.user_id AS id "; $sql .= ", u.name AS name "; $from = " FROM `"._DB_PREFIX."user` u "; $where = " WHERE 1 "; $where .= " AND u.customer_id = 0 "; if(isset($search['generic']) && $search['generic']){ $str = mysql_real_escape_string($search['generic']); $where .= " AND ( "; $where .= " u.name LIKE '%$str%' OR "; $where .= " u.email LIKE '%$str%' OR "; $where .= " u.phone LIKE '%$str%' OR "; $where .= " u.mobile LIKE '%$str%' "; $where .= ' ) '; } if(isset($search['customer_id']) && $search['customer_id']){ /*$str = mysql_real_escape_string($search['customer_id']); $where .= " AND u.customer_id = '$str'"; $sql .= " , c.primary_user_id AS is_primary "; $from .= " LEFT JOIN `"._DB_PREFIX."customer` c ON u.customer_id = c.customer_id ";*/ set_error('Bad usage of get_user() - please report this error.'); return array(); } if(isset($search['security_role_id']) && (int)$search['security_role_id']>0){ $str = (int)$search['security_role_id']; $from .= " LEFT JOIN `"._DB_PREFIX."user_role` ur ON u.user_id = ur.user_id"; $where .= " AND ur.security_role_id = $str"; } foreach(array('email') as $key){ if(isset($search[$key]) && $search[$key] !== ''&& $search[$key] !== false){ $str = mysql_real_escape_string($search[$key]); $where .= " AND u.`$key` LIKE '$str'"; } } I'm guessing it may be something to do with that?
  3. It's the Ultimate Client Manager from code canyon? I could supply the files if needed, most of it has just been a case of changing fields etc, but the search for this doesn't seem to hook it
  4. Hi there, new to the forum Ok so i have a crm and i'm trying to add bits, been pretty succesful at most of it, however i've added a new field "status" and i want to be able to search this field, i've tried copying and changing the existing code, but it doesn't seem to be grabbing it. So here's some exisiting code (that works and searches the field marked "Address" 'address' => array( 'title' => _l('Address:'), 'field' => array( 'type' => 'text', 'name' => 'search[address]', 'value' => isset($search['address'])?$search['address']:'', 'size' => 15, ) ), 'status' => array( 'title' => _l('Status:'), 'field' => array( 'type' => 'text', 'name' => 'search[status]', 'value' => isset($search['status'])?$search['status']:'', 'size' => 15, ) ), I thought a simple name change like above would work, but it doesn't pull anything through, anyone got any ideas?
×
×
  • 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.