Monthly Archives: December 2009

Insert accounts in Sugar CRM using Codeigniter

//load new database of Sugar CRM as defined in database.php $this->db2 = $this->ci->load->database(’db_crm’, TRUE);   //generate unique id for sugar crm . length:36 $accounts_id=$this->generateCrmID(’accounts’);   //insert account into CRM $account_data=array( ‘id’=> $accounts_id, ‘name’=> $user_details[’first_name’].’ ‘.$user_details[’last_name’], ‘date_entered’=> date(’Y-m-d h:i:s’), ‘date_modified’=> date(’Y-m-d … Continue reading

Posted in CodeIgniter, PHP Tagged , ,

Insert ticket in Support Suite using CodeIgniter

// Insert the Actual Record $ticket_data=array( ‘ticketid’=>”, ‘ticketmaskid’=>$ticketmaskid , ‘departmentid’=>1 , ‘ticketstatusid’=>1 , ‘priorityid’=> 1, ‘emailqueueid’=>0 , ‘userid’=>68 , ‘staffid’=>2, ‘ownerstaffid’=>2, ‘assignstatus’=>1, ‘fullname’=>’someva’ , ‘email’=>$user_details[’email’] , ‘lastreplier’=>’someva’ , ‘replyto’=>$user_details[’email’] , ‘subject’=>’New Account is registered’ , ‘dateline’=>now() , ‘lastactivity’=>now() , ‘laststaffreplytime’=>now() … Continue reading

Posted in CodeIgniter, PHP Tagged , ,

SEO based urls : CodeIgniter routes

You can use this code for SEO urls   //this section enables you to use some controllers $route[’admin/(:any)’] = "admin/$1"; $route[’contact/(:any)’] = "contact/$1"; $route[’auth/(:any)’] = "auth/$1"; $route[’testimonials/(:any)’] = "testimonials/$1";   //else everything in url will handle by this pro controller’s … Continue reading

Posted in CodeIgniter, Newbie, PHP Tagged ,

Automatic Config BASE URL in CodeIgniter

Change $config['base_url'] with this. This is one time set config system for all sites and urls. In application/config folder open config.php Find this $config[’base_url’]=’http://example.com’; and replace with this   $config[’base_url’] = ((isset($_SERVER[’HTTPS’]) && $_SERVER[’HTTPS’] == "on") ? "https" : "http"); … Continue reading

Posted in CodeIgniter, PHP Tagged , , ,

Insert user in Support suite using CodeIginiter

Paste following code in end of database.php located in config folder $db[’db_support’][’hostname’] = "localhost"; $db[’db_support’][’username’] = "dbname"; $db[’db_support’][’password’] = "password"; $db[’db_support’][’database’] = "supportsuite_databasename"; $db[’db_support’][’dbdriver’] = "mysql"; $db[’db_support’][’dbprefix’] = ""; $db[’db_support’][’pconnect’] = TRUE; $db[’db_support’][’db_debug’] = TRUE; $db[’db_support’][’cache_on’] = FALSE; $db[’db_support’][’cachedir’] = … Continue reading

Posted in CodeIgniter, PHP, PHP-Tips Tagged , ,

Use QColor from getColor on QLabel and QTextbox

//To use color on text and label //Simple sample :) QColor color = QColorDialog::getColor(QColor(ui->backgroundColorPickerText->text()), this); if(color.isValid()) {   QPixmap pix(21, 21); pix.fill(color);   ui->backgroundColorPickerLabel->setPixmap(pix); ui->backgroundColorPickerText->setText(color.name()); }

Posted in Qt, Qt-Tips Tagged , , ,

create a custom dialog box with multi line input in qt

//create a custom dialog box with multi line input void MainWindow::createMultilineInput() { //class variable dlgMultiLine = new QDialog(this);   //local variable QGridLayout *gridLayout = new QGridLayout(dlgMultiLine);   //class variable txtMultiline = new QPlainTextEdit();   txtMultiline->setObjectName(QString::fromUtf8("txtMultiline")); gridLayout->addWidget(txtMultiline, 0, 0, 1, 1); … Continue reading

Posted in Qt, Qt-Tips Tagged , ,

show data in external window with custom widget in qt

Sometime you need to show data in external window with custom widget(s). This little code will help you. function showCustomWidget() {   QDialog *dlgMultiLine = new QDialog(); QGridLayout *gridLayout = new QGridLayout(dlgMultiLine); QPlainTextEdit *txtMultiline = new QPlainTextEdit();   txtMultiline->setPlainText(this->toPlainText());   … Continue reading

Posted in Qt, Qt-Tips Tagged , , ,

getting all files from subdirectories recursively with c using qt framework/

// Display a dialog to the user to choose his music directory QString directory_path = QFileDialog::getExistingDirectory(this, tr("Select your music directory"), QDir::currentPath());   // Then create an instance of our QDirIterator, which takes as parameters // the directory, a QDir filter … Continue reading

Posted in Qt, Qt-Tips

A Tip in codeigniter to join two tables have same coloum name id

A Tip in codeigniter to join two tables have same coloum name id $this->ci->db->select("users.*", FALSE); $this->ci->db->select("user_profile.*", FALSE); $this->ci->db->from("users"); $this->ci->db->join("user_profile", "user_profile.user_id = users.id",’inner’); $this->ci->db->where(array(’users.id’=>$user_id), NULL, FALSE); Users table has id and other table User_profile have id and user_id now users’s id … Continue reading

Posted in Newbie, PHP, PHP-Tips