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
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
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
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
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
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()); }
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
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
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