payumoney 与 codeigniter 集成
payumoney integration with codeigniter
我在 website.After 成功转账中整合 payu money,页面出现以下错误
遇到了一个PHP错误
严重性:通知
消息:未定义的变量:公司
文件名:controllers/Company_Controller.php
行号:1308
发生数据库错误
错误编号:1064
您的 SQL 语法有误;查看与您的 MariaDB 服务器版本对应的手册,了解在第 1
行 'limit 1' 附近使用的正确语法
SELECT comp_name, comp_email FROM company where comp_id= limit 1
文件名:models/Common_model.php
行号:187
这是我的命令我的控制器
public function OrderSuccess()
{
if ($this->Common_model->Is_Company_Logged())
{
if(isset($_POST['status']) && $_POST['status']=='success' && $packid=$_POST['udf1']>0)
{
//---------------- Generate Order ----------------------//
$packid=$_POST['udf1'];
$sql_pack="SELECT package_title, package_price, package_month, package_jobs FROM package where package_id=".$packid." limit 1";
$pack=$this->Common_model->get_data_by_query($sql_pack);
$sql_comp="SELECT comp_name, comp_email FROM company where comp_id=".$company['id']." limit 1";
$comp=$this->Common_model->get_data_by_query($sql_comp);
print_r($pack); exit;
$data=array();
//------------------ Insert in Order Table -------------------//
$ordercode=$this->Common_model->Generate(8, 'both');
$tax=($pack[0]->package_price*18)/100;
$total=round($pack[0]->package_price+$tax);
$order['order_code']=$ordercode;
$order['order_package']=$packid;
$order['order_company']=$company['id'];
$order['order_cost']=$pack[0]->package_price;
$order['order_tax']=$tax;
$order['order_total']=$total;
$order['order_date']=date('Y-m-d H:i:s');
$order['order_note']='';
$order['order_paid']=1;
$order_insert=$this->Main_model->insertQuery('company_orders',$order);
if($order_insert)
{
$order_id=$this->db->insert_id();
}
//---------------- Insert In company pack table --------------//
$cpack['cpack_package']=$packid;
$cpack['cpack_orderid']=$order_id;
$cpack['cpack_company']=$company['id'];
$cpack['cpack_validfrom']=date('Y-m-d');
$cpack['cpack_validto']=date('Y-m-d', strtotime('+'.$pack[0]->package_month.' month'));
$cpack['cpack_months']=$pack[0]->package_month;
$cpack['cpack_jobs']=$pack[0]->package_jobs;
$cpack['cpack_date']=date('Y-m-d H:i:s');
$cpack_insert=$this->Main_model->insertQuery('company_pack',$cpack);
//-------------------------------------------------------------//
$maildata['package']=$pack[0]->package_title;
$maildata['comp_name']=$comp[0]->comp_name;
$maildata['comp_email']=$comp[0]->comp_email;
$this->EmailNotifications->SendEmail(3, $maildata);
$this->EmailNotifications->SendEmail(4, $maildata);
$this->session->unset_userdata('company_cart');
//------------------------------------------------------//
$this->load->view('company/header');
$this->load->view('company/success_order');
$this->load->view('company/footer');
}
else
redirect('company/');
}
else
{
redirect('company/');
}
}
感谢您的指导。
我忘了声明变量公司
$company=$this->session->userdata('company_logged_in');
我在 website.After 成功转账中整合 payu money,页面出现以下错误
遇到了一个PHP错误 严重性:通知
消息:未定义的变量:公司
文件名:controllers/Company_Controller.php
行号:1308
发生数据库错误 错误编号:1064
您的 SQL 语法有误;查看与您的 MariaDB 服务器版本对应的手册,了解在第 1
行 'limit 1' 附近使用的正确语法SELECT comp_name, comp_email FROM company where comp_id= limit 1
文件名:models/Common_model.php
行号:187
这是我的命令我的控制器
public function OrderSuccess()
{
if ($this->Common_model->Is_Company_Logged())
{
if(isset($_POST['status']) && $_POST['status']=='success' && $packid=$_POST['udf1']>0)
{
//---------------- Generate Order ----------------------//
$packid=$_POST['udf1'];
$sql_pack="SELECT package_title, package_price, package_month, package_jobs FROM package where package_id=".$packid." limit 1";
$pack=$this->Common_model->get_data_by_query($sql_pack);
$sql_comp="SELECT comp_name, comp_email FROM company where comp_id=".$company['id']." limit 1";
$comp=$this->Common_model->get_data_by_query($sql_comp);
print_r($pack); exit;
$data=array();
//------------------ Insert in Order Table -------------------//
$ordercode=$this->Common_model->Generate(8, 'both');
$tax=($pack[0]->package_price*18)/100;
$total=round($pack[0]->package_price+$tax);
$order['order_code']=$ordercode;
$order['order_package']=$packid;
$order['order_company']=$company['id'];
$order['order_cost']=$pack[0]->package_price;
$order['order_tax']=$tax;
$order['order_total']=$total;
$order['order_date']=date('Y-m-d H:i:s');
$order['order_note']='';
$order['order_paid']=1;
$order_insert=$this->Main_model->insertQuery('company_orders',$order);
if($order_insert)
{
$order_id=$this->db->insert_id();
}
//---------------- Insert In company pack table --------------//
$cpack['cpack_package']=$packid;
$cpack['cpack_orderid']=$order_id;
$cpack['cpack_company']=$company['id'];
$cpack['cpack_validfrom']=date('Y-m-d');
$cpack['cpack_validto']=date('Y-m-d', strtotime('+'.$pack[0]->package_month.' month'));
$cpack['cpack_months']=$pack[0]->package_month;
$cpack['cpack_jobs']=$pack[0]->package_jobs;
$cpack['cpack_date']=date('Y-m-d H:i:s');
$cpack_insert=$this->Main_model->insertQuery('company_pack',$cpack);
//-------------------------------------------------------------//
$maildata['package']=$pack[0]->package_title;
$maildata['comp_name']=$comp[0]->comp_name;
$maildata['comp_email']=$comp[0]->comp_email;
$this->EmailNotifications->SendEmail(3, $maildata);
$this->EmailNotifications->SendEmail(4, $maildata);
$this->session->unset_userdata('company_cart');
//------------------------------------------------------//
$this->load->view('company/header');
$this->load->view('company/success_order');
$this->load->view('company/footer');
}
else
redirect('company/');
}
else
{
redirect('company/');
}
}
感谢您的指导。
我忘了声明变量公司
$company=$this->session->userdata('company_logged_in');