我正在我的网站中集成payu money。成功传输后,页面出现以下错误
遇到PHP错误严重性:通知
消息:未定义变量:公司
文件名:controllers/Company_Controller.php
行号:1308
发生数据库错误错误编号:1064
您的SQL语法有错误;查看与MariaDB服务器版本对应的手册,了解在第1行接近"限制1"的地方使用的正确语法
从公司选择comp_name,comp_email,其中comp_id=限制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');