Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-21-2012, 08:45 AM   PM User | #1
monsterboy
New to the CF scene

 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
monsterboy is an unknown quantity at this point
Ignited Datatables Edit Column Help, Please

I have ignited datatables step up and I'm stuck on a new feature I would like to add. I have 2 cells, email and phone which I would like to be hidden the code looks like this.

Code:
->edit_column('leads.email', '<span style="font-style:italic;"> Accept to View Email </span>', 'leads.email')
->edit_column('leads.phone', '<span style="font-style:italic;"> Accept to View Phone </span>', 'leads.phone');
How can I detect whether the phone is null in the database as, I need to change the message to imply there is a phone number present. Any help would be great, thanks guys.

Code:
<?php
require_once('../../../datatables/Datatables.php');
require_once('../../../Connections/datatables-connect.php');

if (!isset($_SESSION)) {
  session_start();
}

$datatables = new Datatables();  // for mysqli  =>  $datatables = new     Datatables('mysqli'); 

$datatables->connect($config);

$datatables
->select('leads.lead_id, leads.date_time, CONCAT(leads.first_name," ",leads.surname), CONCAT(leads.country," / ",leads.area), courses.course_type, leads.email, leads.phone, leads.ip_address, leads.enquiry, leads.notes')

->from('courses')

->join('leads', 'leads.lead_get_course_id = courses.course_id', 'left')
->select('start_date, price')

->join('addresses', 'courses.course_get_address_id = addresses.address_id', 'left')
->select('addresses.location_name, addresses.address_name, address, postcode, addresses.date_added, price_option, duration, duration_option, awarding_body, results_turnaround')

->join('clients', 'clients.client_id = courses.course_get_client_id', 'left')
->select('clients.client_id')

->select('leads.town_city')
->select('leads.travel_distance')

->where('checked_by_admin = "Yes" AND status = "Pending" AND clients.client_id = "'.$_SESSION['ClientID'].'"')

->unset_column('clients.client_id')

->add_column('moreinfo', '<div align="center" style="cursor:pointer"><img src="../images/details_open.png" class="buttons" alt="More Info"/></div>', 'leads.lead_id')

->add_column('approve', '<div align="center" style="cursor:pointer"><img src="../images/approve.png" class="buttons" alt="Approve" onClick="javascript:approve_link($1);"/></div>', 'leads.lead_id')

->add_column('decline', '<div align="center" style="cursor:pointer"><img src="../images/unapprove.png" class="buttons" alt="Unapprove" onClick="javascript:decline_link($1);"/></div>', 'leads.lead_id')

->edit_column('leads.email', '<span style="font-style:italic;"> Accept to View </span>', 'leads.email')
->edit_column('leads.phone null', '<span style="font-style:italic;"> Accept to View </span>', 'leads.phone');

if(isset($_POST['from_date']) && $_POST['from_date'] != '')
 $datatables->where('date_time >=', preg_replace("/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/i", "$3-$2-$1", $_POST['from_date']));

if(isset($_POST['to_date']) && $_POST['to_date'] != '')
 $datatables->where('date_time <=', preg_replace("/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/i", "$3-$2-$1", $_POST['to_date']));

echo $datatables->generate();

?>
monsterboy is offline   Reply With Quote
Reply

Bookmarks

Tags
php mysql

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:53 AM.


Advertisement
Log in to turn off these ads.