added files
This commit is contained in:
282
application/controllers/Payment.php
Normal file
282
application/controllers/Payment.php
Normal file
@ -0,0 +1,282 @@
|
||||
<?php defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Payment extends CI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('form');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->model('Index_model');
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
if(empty($this->session->userdata('cart')))
|
||||
{
|
||||
redirect(base_url());
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->view("front/payment");
|
||||
}
|
||||
}
|
||||
|
||||
public function confirm()
|
||||
{
|
||||
$this->session->sess_destroy();
|
||||
$this->load->view("front/confirm");
|
||||
}
|
||||
|
||||
public function payment_order()
|
||||
{
|
||||
$cardsplit = str_split($this->input->post('card_number'));
|
||||
$ssl_customer_code = $cardsplit[12].$cardsplit[13].$cardsplit[14].$cardsplit[15];
|
||||
|
||||
$ssl_invoice_number = $this->input->post('billing_contact').time();
|
||||
$ssl_transaction_type = "ccsale";
|
||||
$ssl_cvv2cvc2_indicator = 1;
|
||||
$country = "USA";
|
||||
|
||||
$fields = array(
|
||||
"ssl_merchant_id" => "500693",
|
||||
"ssl_user_id" => "webpage",
|
||||
"ssl_pin" => "MX0MD3",
|
||||
"ssl_transaction_type" => urlencode($ssl_transaction_type),
|
||||
"ssl_show_form" => "false",
|
||||
"ssl_cvv2cvc2_indicator" => urlencode($ssl_cvv2cvc2_indicator), //0=Bypassed; 1=present; 2=Illegible; 9=Not Present.
|
||||
"ssl_salestax" => "0",
|
||||
|
||||
"ssl_result_format" => "html",
|
||||
"ssl_test_mode" => "false",
|
||||
"ssl_receipt_apprvl_method" => "redg", // sends to page with long data string url
|
||||
//"ssl_receipt_apprvl_method" => "link", // just posts receipt with link at bottom
|
||||
"ssl_receipt_link_url" => "http://abc.mydataboxx.com/order-confirm",
|
||||
"ssl_error_url" => "http://abc.mydataboxx.com/order-confirm",
|
||||
|
||||
//submitted details
|
||||
"ssl_invoice_number" => urlencode($ssl_invoice_number),
|
||||
"ssl_customer_code" => urlencode($ssl_customer_code),
|
||||
"ssl_first_name" => urlencode($this->input->post('company_name')),
|
||||
"ssl_last_name" => urlencode($this->input->post('billing_contact')),
|
||||
"ssl_avs_address" => urlencode($this->input->post('street_adrs')),
|
||||
"ssl_address2" => urlencode($this->input->post('customer_id')),
|
||||
"ssl_avs_zip" => urlencode($this->input->post('post_code')),
|
||||
"ssl_state" => urlencode($this->input->post('state')),
|
||||
"ssl_city" => urlencode($this->input->post('city_name')),
|
||||
"ssl_country" => urlencode($country),
|
||||
"ssl_phone" => urlencode($this->input->post('phone_no')),
|
||||
"ssl_email" => urlencode($this->input->post('emai_id')),
|
||||
"ssl_card_number" => urlencode($this->input->post('card_number')),
|
||||
"ssl_exp_date" => urlencode($this->input->post('exp_month').$this->input->post('exp_year')),
|
||||
"ssl_cvv2cvc2" => urlencode($this->input->post('cvv_code')),
|
||||
"ssl_amount" => urlencode($this->session->userdata('granttotal'))
|
||||
|
||||
);
|
||||
|
||||
$url = "https://api.demo.convergepay.com/VirtualMerchantDemo/process.do";
|
||||
|
||||
//initialize the post string variable
|
||||
$fields_string = '';
|
||||
//build the post string
|
||||
foreach($fields as $key=>$value) { $fields_string .=$key.'='.$value.'&'; }
|
||||
rtrim($fields_string, "&");
|
||||
|
||||
//open curl session
|
||||
$ch = curl_init();
|
||||
//begin seting curl options
|
||||
//set URL
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set method
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
//set post data string
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
|
||||
//these two options are frequently necessary to avoid SSL errors with PHP
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
//perform the curl post and store the result
|
||||
$result = curl_exec($ch);
|
||||
//close the curl session
|
||||
curl_close($ch);
|
||||
//a nice message to prevent people from seeing a blank screen
|
||||
echo "Processing, please wait...";
|
||||
|
||||
//print_r($result);
|
||||
|
||||
$masterdata = array('reg_date'=>date("Y-m-d"),
|
||||
'reg_total'=>$this->session->userdata('granttotal'),
|
||||
'reg_class_count'=>count($this->session->userdata('cart')),
|
||||
'payment_type'=>$this->input->post('payment_type'),
|
||||
'card_holder_name'=>$this->input->post('card_holder_name'),
|
||||
'card_number'=>$this->input->post('card_number'),
|
||||
'card_type'=>$this->input->post('card_type'),
|
||||
'exp_month'=>$this->input->post('exp_month'),
|
||||
'exp_year'=>$this->input->post('exp_year'),
|
||||
'cvv_code'=>$this->input->post('cvv_code'),
|
||||
'company_name'=>$this->input->post('company_name'),
|
||||
'billing_contact'=>$this->input->post('billing_contact'),
|
||||
'customer_id'=>$this->input->post('customer_id'),
|
||||
'street_adrs'=>$this->input->post('street_adrs'),
|
||||
'city_name'=>$this->input->post('city_name'),
|
||||
'state'=>$this->input->post('state'),
|
||||
'post_code'=>$this->input->post('post_code'),
|
||||
'phone_no'=>$this->input->post('phone_no'),
|
||||
'fax_no'=>$this->input->post('fax_no'),
|
||||
'adtnal_instrction'=>$this->input->post('adtnal_instrction'),
|
||||
'details'=>$this->input->post('details'),
|
||||
'email_id'=>$this->input->post('emai_id'),
|
||||
'status'=>'unpaid');
|
||||
|
||||
$regid = $this->Index_model->regmaster($masterdata);
|
||||
if($regid)
|
||||
{
|
||||
$attotal = 0;
|
||||
$cart = $this->session->userdata('cart');/*Cart Session*/
|
||||
foreach ($cart as $cartcount => $form)
|
||||
{
|
||||
$mcount = $this->session->userdata('mcount'.$form);
|
||||
$mpluscount = $this->session->userdata('mpluscount'.$form);
|
||||
$ncount = $this->session->userdata('ncount'.$form);
|
||||
$npluscount = $this->session->userdata('npluscount'.$form);
|
||||
$scount = $this->session->userdata('scount'.$form);
|
||||
$attcount = ($mcount + $mpluscount + $ncount + $npluscount + $scount); /*Attendee Count*/
|
||||
$classdata = array('reg_id'=>$regid,'form_id'=>$form,
|
||||
'att_count'=>$attcount,
|
||||
'regclass_total_price'=>$this->session->userdata('classtotal'.$form));
|
||||
$classform = $this->Index_model->returnclass($form);
|
||||
$remainseats = $classform->remain_seats-$attcount;
|
||||
$this->Index_model->remainclass($remainseats,$form);
|
||||
$regclassid = $this->Index_model->classdata($classdata);
|
||||
$classform = $this->session->userdata('classform'.$form);
|
||||
foreach ($classform as $formcount => $data)
|
||||
{
|
||||
$mprice = $data['class_price_m'];
|
||||
$mplusprice = $data['class_price_m2'];
|
||||
$nprice = $data['class_price_n'];
|
||||
$nplusprice = $data['class_price_n2'];
|
||||
$sprice = $data['class_price_s'];
|
||||
}
|
||||
|
||||
if($regclassid)
|
||||
{
|
||||
$attmcount = 0;
|
||||
$attmpcount = 0;
|
||||
$attncount = 0;
|
||||
$attnpcount = 0;
|
||||
$attscount = 0;
|
||||
|
||||
$member = $this->session->userdata('member'.$form);
|
||||
if (!empty($member) || isset($member['M']))
|
||||
{
|
||||
foreach ($member['M'] as $key => $val)
|
||||
{
|
||||
$attendedata = array(
|
||||
'reg_id'=>$regid,
|
||||
'regclass_id'=>$regclassid,
|
||||
'reg_m_type'=>'M',
|
||||
'att_f_name'=>isset($val['first_name'])? $val['first_name'] : '',
|
||||
'att_l_name'=>isset($val['last_name'])? $val['last_name'] : '',
|
||||
'att_email'=>isset($val['email_id'])? $val['email_id'] : '',
|
||||
'att_number'=>isset($val['phone_no'])? $val['phone_no'] : '',
|
||||
'att_ssn'=>isset($val['ssn'])? $val['ssn'] : '',
|
||||
'att_price'=>$mprice );
|
||||
$data = $this->Index_model->attendedata($attendedata);
|
||||
$attmcount+=1;
|
||||
}
|
||||
}
|
||||
|
||||
$memplus = $this->session->userdata('memplus'.$form);
|
||||
if (!empty($memplus) || isset($memplus['M2']))
|
||||
{
|
||||
foreach ($memplus['M2'] as $key => $val)
|
||||
{
|
||||
$attendedata = array(
|
||||
'reg_id'=>$regid,
|
||||
'regclass_id'=>$regclassid,
|
||||
'reg_m_type'=>'M2',
|
||||
'att_f_name'=>isset($val['first_name'])? $val['first_name'] : '',
|
||||
'att_l_name'=>isset($val['last_name'])? $val['last_name'] : '',
|
||||
'att_email'=>isset($val['email_id'])? $val['email_id'] : '',
|
||||
'att_number'=>isset($val['phone_no'])? $val['phone_no'] : '',
|
||||
'att_ssn'=>isset($val['ssn'])? $val['ssn'] : '',
|
||||
'att_price'=>$mplusprice );
|
||||
$data = $this->Index_model->attendedata($attendedata);
|
||||
$attmpcount+=1;
|
||||
}
|
||||
}
|
||||
|
||||
$nonmember = $this->session->userdata('nonmember'.$form);
|
||||
if (!empty($nonmember) || isset($nonmember['N']))
|
||||
{
|
||||
foreach ($nonmember['N'] as $key => $val)
|
||||
{
|
||||
$attendedata = array(
|
||||
'reg_id'=>$regid,
|
||||
'regclass_id'=>$regclassid,
|
||||
'reg_m_type'=>'N',
|
||||
'att_f_name'=>isset($val['first_name'])? $val['first_name'] : '',
|
||||
'att_l_name'=>isset($val['last_name'])? $val['last_name'] : '',
|
||||
'att_email'=>isset($val['email_id'])? $val['email_id'] : '',
|
||||
'att_number'=>isset($val['phone_no'])? $val['phone_no'] : '',
|
||||
'att_ssn'=>isset($val['ssn'])? $val['ssn'] : '',
|
||||
'att_price'=>$nprice );
|
||||
$data = $this->Index_model->attendedata($attendedata);
|
||||
$attncount+=1;
|
||||
}
|
||||
}
|
||||
|
||||
$nonplus = $this->session->userdata('nonplus'.$form);
|
||||
if (!empty($nonplus) || isset($nonplus['N2']))
|
||||
{
|
||||
foreach ($nonplus['N2'] as $key => $val)
|
||||
{
|
||||
$attendedata = array(
|
||||
'reg_id'=>$regid,
|
||||
'regclass_id'=>$regclassid,
|
||||
'reg_m_type'=>'N2',
|
||||
'att_f_name'=>isset($val['first_name'])? $val['first_name'] : '',
|
||||
'att_l_name'=>isset($val['last_name'])? $val['last_name'] : '',
|
||||
'att_email'=>isset($val['email_id'])? $val['email_id'] : '',
|
||||
'att_number'=>isset($val['phone_no'])? $val['phone_no'] : '',
|
||||
'att_ssn'=>isset($val['ssn'])? $val['ssn'] : '',
|
||||
'att_price'=>$nplusprice );
|
||||
$data = $this->Index_model->attendedata($attendedata);
|
||||
$attnpcount+=1;
|
||||
}
|
||||
}
|
||||
|
||||
$semember = $this->session->userdata('semember'.$form);
|
||||
if (!empty($semember) || isset($semember['S']))
|
||||
{
|
||||
foreach ($semember['S'] as $key => $val)
|
||||
{
|
||||
$attendedata = array(
|
||||
'reg_id'=>$regid,
|
||||
'regclass_id'=>$regclassid,
|
||||
'reg_m_type'=>'S',
|
||||
'att_f_name'=>isset($val['first_name'])? $val['first_name'] : '',
|
||||
'att_l_name'=>isset($val['last_name'])? $val['last_name'] : '',
|
||||
'att_email'=>isset($val['email_id'])? $val['email_id'] : '',
|
||||
'att_number'=>isset($val['phone_no'])? $val['phone_no'] : '',
|
||||
'att_ssn'=>isset($val['ssn'])? $val['ssn'] : '',
|
||||
'att_price'=>$sprice );
|
||||
$data = $this->Index_model->attendedata($attendedata);
|
||||
$attscount+=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$attotal+= $attmcount + $attmpcount + $attncount + $attnpcount + $attscount; /*Attendee Total Count*/
|
||||
}
|
||||
$this->Index_model->attotal($attotal,$regid);
|
||||
$this->session->set_flashdata('success_msg','Your Order Has Been Completed Successfully.');
|
||||
redirect('order-confirm');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Something Wrong Happen..! Register Again.');
|
||||
redirect('order-confirm');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
361
application/controllers/Registration.php
Normal file
361
application/controllers/Registration.php
Normal file
@ -0,0 +1,361 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Registration extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('form');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('session');
|
||||
$this->load->model('Index_model');
|
||||
}
|
||||
|
||||
public function index($locat_id=NULL)
|
||||
{
|
||||
$data['reg_location']=$this->Index_model->reg_location();
|
||||
$first_locat=$this->Index_model->first_location();
|
||||
$data['first_loc']=$first_locat->locat_id;
|
||||
if($locat_id)
|
||||
{
|
||||
$loc = $locat_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$loc = $first_locat->locat_id;
|
||||
}
|
||||
$data['reg_class']=$this->Index_model->reg_class($loc);
|
||||
$this->load->view('front/index',$data);
|
||||
}
|
||||
|
||||
public function reset_fn()
|
||||
{
|
||||
$this->session->sess_destroy();
|
||||
redirect(base_url());
|
||||
}
|
||||
|
||||
public function unset_fn($form,$key,$price,$type)
|
||||
{
|
||||
if($type=='M')
|
||||
{
|
||||
$member = $this->session->userdata('member'.$form);
|
||||
foreach ($member as $count => $subArr) {
|
||||
unset($member[$count][$key]);
|
||||
}
|
||||
$this->session->set_userdata('member'.$form,$member);
|
||||
$classtotal = $this->session->userdata('classtotal'.$form);
|
||||
$currentp = $classtotal - $price;
|
||||
$this->session->set_userdata('classtotal'.$form,$currentp);
|
||||
}
|
||||
elseif($type=='M2')
|
||||
{
|
||||
$memplus = $this->session->userdata('memplus'.$form);
|
||||
foreach ($memplus as $count => $subArr) {
|
||||
unset($memplus[$count][$key]);
|
||||
}
|
||||
$this->session->set_userdata('memplus'.$form,$memplus);
|
||||
$classtotal = $this->session->userdata('classtotal'.$form);
|
||||
$currentp = $classtotal - $price;
|
||||
$this->session->set_userdata('classtotal'.$form,$currentp);
|
||||
}
|
||||
elseif ($type=='N')
|
||||
{
|
||||
$nonmember = $this->session->userdata('nonmember'.$form);
|
||||
foreach ($nonmember as $count => $subArr) {
|
||||
unset($nonmember[$count][$key]);
|
||||
}
|
||||
$this->session->set_userdata('nonmember'.$form,$nonmember);
|
||||
$classtotal = $this->session->userdata('classtotal'.$form);
|
||||
$currentp = $classtotal - $price;
|
||||
$this->session->set_userdata('classtotal'.$form,$currentp);
|
||||
}
|
||||
elseif ($type=='N2')
|
||||
{
|
||||
$nonplus = $this->session->userdata('nonplus'.$form);
|
||||
foreach ($nonplus as $count => $subArr) {
|
||||
unset($nonplus[$count][$key]);
|
||||
}
|
||||
$this->session->set_userdata('nonplus'.$form,$nonplus);
|
||||
$classtotal = $this->session->userdata('classtotal'.$form);
|
||||
$currentp = $classtotal - $price;
|
||||
$this->session->set_userdata('classtotal'.$form,$currentp);
|
||||
}
|
||||
elseif ($type=='S')
|
||||
{
|
||||
$semember = $this->session->userdata('semember'.$form);
|
||||
foreach ($semember as $count => $subArr) {
|
||||
unset($semember[$count][$key]);
|
||||
}
|
||||
$this->session->set_userdata('semember'.$form,$semember);
|
||||
$classtotal = $this->session->userdata('classtotal'.$form);
|
||||
$currentp = $classtotal - $price;
|
||||
$this->session->set_userdata('classtotal'.$form,$currentp);
|
||||
}
|
||||
$urlcheck = $this->session->userdata('urlcheck');
|
||||
if($urlcheck)
|
||||
{
|
||||
redirect('loc-class/'.$urlcheck);
|
||||
}else{
|
||||
redirect(base_url());
|
||||
}
|
||||
}
|
||||
|
||||
public function manage_reg()
|
||||
{
|
||||
$form_class = $this->input->post('form_class');
|
||||
if(!empty($form_class))
|
||||
{
|
||||
foreach ($form_class as $form)
|
||||
{
|
||||
if (!empty($this->input->post('m_first_name_'.$form)) || isset($this->input->post('m_first_name_'.$form)['m_first_name_'.$form]))
|
||||
{
|
||||
foreach ($this->input->post('m_first_name_'.$form) as $mnamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$member[$form]['M'][$mnamecount]['first_name'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('m_last_name_'.$form) as $mnamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$member[$form]['M'][$mnamecount]['last_name'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('m_email_id_'.$form) as $mnamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$member[$form]['M'][$mnamecount]['email_id'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('m_phone_no_'.$form) as $mnamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$member[$form]['M'][$mnamecount]['phone_no'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('m_ssn_'.$form) as $mnamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$member[$form]['M'][$mnamecount]['ssn'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($member))
|
||||
{
|
||||
$this->session->set_userdata('member'.$form,$member[$form]); /* Session Of Member */
|
||||
}
|
||||
else { $m = 0; }
|
||||
}
|
||||
|
||||
|
||||
if (!empty($this->input->post('mp_first_name_'.$form)) || isset($this->input->post('mp_first_name_'.$form)['mp_first_name_'.$form]))
|
||||
{
|
||||
foreach ($this->input->post('mp_first_name_'.$form) as $mplusnmeount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$memplus[$form]['M2'][$mplusnmeount]['first_name'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('mp_last_name_'.$form) as $mplusnmeount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$memplus[$form]['M2'][$mplusnmeount]['last_name'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('mp_email_id_'.$form) as $mplusnmeount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$memplus[$form]['M2'][$mplusnmeount]['email_id'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('mp_phone_no_'.$form) as $mplusnmeount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$memplus[$form]['M2'][$mplusnmeount]['phone_no'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('mp_ssn_'.$form) as $mplusnmeount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$memplus[$form]['M2'][$mplusnmeount]['ssn'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($memplus))
|
||||
{
|
||||
$this->session->set_userdata('memplus'.$form,$memplus[$form]); /* Session Of Member 2+ */
|
||||
}
|
||||
else { $mp = 0; }
|
||||
}
|
||||
|
||||
|
||||
if (!empty($this->input->post('n_first_name_'.$form)) || isset($this->input->post('n_first_name_'.$form)['n_first_name_'.$form]))
|
||||
{
|
||||
foreach ($this->input->post('n_first_name_'.$form) as $nnamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$nonmember[$form]['N'][$nnamecount]['first_name'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('n_last_name_'.$form) as $nnamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$nonmember[$form]['N'][$nnamecount]['last_name'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('n_email_id_'.$form) as $nnamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$nonmember[$form]['N'][$nnamecount]['email_id'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('n_phone_no_'.$form) as $nnamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$nonmember[$form]['N'][$nnamecount]['phone_no'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('n_ssn_'.$form) as $nnamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$nonmember[$form]['N'][$nnamecount]['ssn'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($nonmember))
|
||||
{
|
||||
$this->session->set_userdata('nonmember'.$form,$nonmember[$form]); /* Session Of Non Member */
|
||||
}
|
||||
else { $n = 0; }
|
||||
}
|
||||
|
||||
|
||||
if (!empty($this->input->post('np_first_name_'.$form)) || isset($this->input->post('np_first_name_'.$form)['np_first_name_'.$form]))
|
||||
{
|
||||
foreach ($this->input->post('np_first_name_'.$form) as $nplusnmeount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$nonplus[$form]['N2'][$nplusnmeount]['first_name'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('np_last_name_'.$form) as $nplusnmeount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$nonplus[$form]['N2'][$nplusnmeount]['last_name'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('np_email_id_'.$form) as $nplusnmeount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$nonplus[$form]['N2'][$nplusnmeount]['email_id'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('np_phone_no_'.$form) as $nplusnmeount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$nonplus[$form]['N2'][$nplusnmeount]['phone_no'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('np_ssn_'.$form) as $nplusnmeount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$nonplus[$form]['N2'][$nplusnmeount]['ssn'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($nonplus))
|
||||
{
|
||||
$this->session->set_userdata('nonplus'.$form,$nonplus[$form]); /* Session Of Non Member 2+*/
|
||||
}
|
||||
else { $np = 0; }
|
||||
}
|
||||
|
||||
|
||||
if (!empty($this->input->post('s_first_name_'.$form)) || isset($this->input->post('s_first_name_'.$form)['s_first_name_'.$form]))
|
||||
{
|
||||
foreach ($this->input->post('s_first_name_'.$form) as $snamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$semember[$form]['S'][$snamecount]['first_name'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('s_last_name_'.$form) as $snamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$semember[$form]['S'][$snamecount]['last_name'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('s_email_id_'.$form) as $snamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$semember[$form]['S'][$snamecount]['email_id'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('s_phone_no_'.$form) as $snamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$semember[$form]['S'][$snamecount]['phone_no'] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($this->input->post('s_ssn_'.$form) as $snamecount => $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$semember[$form]['S'][$snamecount]['ssn'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($semember))
|
||||
{
|
||||
$this->session->set_userdata('semember'.$form,$semember[$form]); /* Session Of Subscribing Employer */
|
||||
}
|
||||
else { $s = 0; }
|
||||
}
|
||||
// if($m==0 && $mp==0 && $n==0 && $np==0 && $s==0)
|
||||
// {
|
||||
// $currenturl = $this->session->userdata('urlcheck');
|
||||
// $this->session->sess_destroy();
|
||||
// if($currenturl)
|
||||
// {
|
||||
// redirect('loc-class/'.$currenturl);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// redirect(base_url());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
$this->session->set_userdata('cart',$form_class);
|
||||
redirect('review-order');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
137
application/controllers/Review.php
Normal file
137
application/controllers/Review.php
Normal file
@ -0,0 +1,137 @@
|
||||
<?php defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Review extends CI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('form');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->model('Index_model');
|
||||
}
|
||||
public function review_order()
|
||||
{
|
||||
$cart = $this->session->userdata('cart');
|
||||
if(empty($cart))
|
||||
{
|
||||
redirect(base_url());
|
||||
}
|
||||
else
|
||||
{
|
||||
$granttotal = 0;
|
||||
foreach ($cart as $cartcount => $form) {
|
||||
$mtotal = 0;
|
||||
$mptotal = 0;
|
||||
$ntotal = 0;
|
||||
$nptotal = 0;
|
||||
$stotal = 0;
|
||||
$data['classform'.$form]=$this->Index_model->returnform($form);
|
||||
|
||||
$classform = $this->Index_model->returnclass($form);
|
||||
|
||||
$this->session->set_userdata('classform'.$form,$data['classform'.$form]);
|
||||
|
||||
/*Member*/
|
||||
|
||||
$member = ($this->session->userdata('member'.$form));
|
||||
|
||||
if (!empty($member) || isset($member['M'])) {
|
||||
$i = 1;
|
||||
foreach ($member['M'] as $key => $value) {
|
||||
$i++;
|
||||
}
|
||||
$this->session->set_userdata('mcount'.$form,$i-1);
|
||||
$mtotal = $classform->class_price_m * ($i-1);
|
||||
}
|
||||
|
||||
/*Member End*/
|
||||
|
||||
/*Member 2+*/
|
||||
|
||||
$memplus = ($this->session->userdata('memplus'.$form));
|
||||
|
||||
if (!empty($memplus) || isset($memplus['M2'])) {
|
||||
$i = 1;
|
||||
foreach ($memplus['M2'] as $key => $value) {
|
||||
$i++;
|
||||
}
|
||||
$this->session->set_userdata('mpluscount'.$form,$i-1);
|
||||
$mptotal = $classform->class_price_m2 * ($i-1);
|
||||
}
|
||||
|
||||
/*Member 2+ End*/
|
||||
|
||||
/*Non Member*/
|
||||
|
||||
$nonmember = $this->session->userdata('nonmember'.$form);
|
||||
|
||||
if (!empty($nonmember) || isset($nonmember['N'])) {
|
||||
$i = 1;
|
||||
foreach ($nonmember['N'] as $key => $value) {
|
||||
$i++;
|
||||
}
|
||||
$this->session->set_userdata('ncount'.$form,$i-1);
|
||||
$ntotal = $classform->class_price_n * ($i-1);
|
||||
}
|
||||
|
||||
/*Non Member End*/
|
||||
|
||||
/*Non Member 2+*/
|
||||
|
||||
$nonplus = $this->session->userdata('nonplus'.$form);
|
||||
|
||||
if (!empty($nonplus) || isset($nonplus['N2'])) {
|
||||
$i = 1;
|
||||
foreach ($nonplus['N2'] as $key => $value) {
|
||||
$i++;
|
||||
}
|
||||
$this->session->set_userdata('npluscount'.$form,$i-1);
|
||||
$nptotal = $classform->class_price_n2 * ($i-1);
|
||||
}
|
||||
|
||||
/*Non Member 2+ End*/
|
||||
|
||||
/*Employee*/
|
||||
|
||||
$semember = $this->session->userdata('semember'.$form);
|
||||
|
||||
if (!empty($semember) || isset($semember['S'])) {
|
||||
$i = 1;
|
||||
foreach ($semember['S'] as $key => $value) {
|
||||
$i++;
|
||||
}
|
||||
$this->session->set_userdata('scount'.$form,$i-1);
|
||||
$stotal = $classform->class_price_s * ($i-1);
|
||||
}
|
||||
|
||||
/*Employee End*/
|
||||
|
||||
if(isset($mtotal)) { $mtot = $mtotal; } else { $mtot = 0; }
|
||||
if(isset($mptotal)) { $mptot = $mptotal; } else { $mptot = 0; }
|
||||
if(isset($ntotal)) { $ntot = $ntotal; } else { $ntot = 0; }
|
||||
if(isset($nptotal)) { $nptot = $nptotal; } else { $nptot = 0; }
|
||||
if(isset($stotal)) { $stot = $stotal; } else { $stot = 0; }
|
||||
$classtotal = $mtot + $mptot + $ntot + $nptot + $stot; /*Class Total*/
|
||||
$this->session->set_userdata('classtotal'.$form,$classtotal);
|
||||
$granttotal+=$classtotal;
|
||||
}
|
||||
$this->session->set_userdata('granttotal',$granttotal);
|
||||
$this->load->view('front/review');
|
||||
}
|
||||
}
|
||||
|
||||
public function back()
|
||||
{
|
||||
$urlcheck = $this->session->userdata('urlcheck');
|
||||
if($urlcheck)
|
||||
{
|
||||
redirect('loc-class/'.$urlcheck);
|
||||
}else{
|
||||
redirect(base_url());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
25
application/controllers/Welcome.php
Normal file
25
application/controllers/Welcome.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Welcome extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('welcome_message');
|
||||
}
|
||||
}
|
96
application/controllers/admin/Admin.php
Normal file
96
application/controllers/admin/Admin.php
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Admin extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->library('session');
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('form');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('userauth');
|
||||
$this->load->library('password');
|
||||
$this->load->model('Admin_model');
|
||||
$this->load->helper('cookie');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('admin/login');
|
||||
}
|
||||
|
||||
public function dashboard()
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$data['class'] = $this->Admin_model->totalrows('tbl_classname','*');
|
||||
$data['creates'] = $this->Admin_model->totalrows('tbl_classform','*');
|
||||
$data['users'] = $this->Admin_model->totalrows('tbl_usermaster','*');
|
||||
$data['list'] = $this->Admin_model->totalrows('tbl_regmaster','*');
|
||||
$this->load->view('admin/dashboard',$data);
|
||||
}
|
||||
|
||||
public function login()
|
||||
{
|
||||
|
||||
$data['username'] = get_cookie('swebin_user_ad');
|
||||
$data['password'] = $this->password->decrypt_password(get_cookie('swebin_sec'));
|
||||
|
||||
$this->form_validation->set_rules('username', 'username', 'trim|required');
|
||||
$this->form_validation->set_rules('password', 'password', 'trim|required');
|
||||
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
{
|
||||
$this->load->view('admin/login',$data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$username = $this->input->post('username');
|
||||
$password_input = $this->input->post('password');
|
||||
$remember_me = $this->input->post('remember_me');
|
||||
$password = $this->password->encrypt_password($password_input);
|
||||
|
||||
if($remember_me)
|
||||
{
|
||||
$expire = time()+365*60*60*24;
|
||||
|
||||
set_cookie('abc_user',$username, $expire);
|
||||
set_cookie('abc_password',$password, $expire);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete_cookie('abc_user');
|
||||
delete_cookie('abc_password');
|
||||
}
|
||||
|
||||
|
||||
$data = $this->Admin_model->login_valid($username,$password);
|
||||
|
||||
if($data)
|
||||
{
|
||||
$this->session->set_userdata('user_id',$data['user_id']);
|
||||
$this->session->set_userdata('user_name',$data['user_name']);
|
||||
$this->session->set_userdata('user_type',$data['user_type']);
|
||||
|
||||
redirect('admin/dashboard');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('login_failed', 'Error Occur. Login Failed..!');
|
||||
$this->load->view('admin/login',$data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function logout()
|
||||
{
|
||||
$this->session->sess_destroy();
|
||||
redirect('admin', 'refresh');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
258
application/controllers/admin/Classsetting.php
Normal file
258
application/controllers/admin/Classsetting.php
Normal file
@ -0,0 +1,258 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Classsetting extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('form');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('userauth');
|
||||
$this->load->library('password');
|
||||
$this->load->model('Class_model');
|
||||
}
|
||||
|
||||
public function cl_name()
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$data['all_class']=$this->Class_model->all_class();
|
||||
$this->load->view('admin/classsetting-names',$data);
|
||||
}
|
||||
|
||||
public function cl_locations()
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$data['all_locations']=$this->Class_model->all_locations();
|
||||
$this->load->view('admin/classsetting-location',$data);
|
||||
}
|
||||
|
||||
public function cl_instructors()
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$data['all_instructors']=$this->Class_model->all_instructors();
|
||||
$this->load->view('admin/classsetting-instructor',$data);
|
||||
}
|
||||
|
||||
//CLASS
|
||||
|
||||
//manage class
|
||||
|
||||
public function manage_class()
|
||||
{
|
||||
$class_name = array('class_name'=>$this->input->post('class_name'));
|
||||
$action = $this->input->post('submit');
|
||||
if($action == "Add")
|
||||
{
|
||||
$data = $this->Class_model->create_class($class_name);
|
||||
if($data)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Class Created Successfully');
|
||||
redirect('admin/class-name');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/class-name');
|
||||
}
|
||||
}
|
||||
elseif($action == "Update")
|
||||
{
|
||||
$class_id = $this->input->post('class_id');
|
||||
$data = $this->Class_model->update_class($class_name,$class_id);
|
||||
if($data)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Class Updated Successfully');
|
||||
redirect('admin/class-name');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/class-name');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//end manage class
|
||||
|
||||
//return class
|
||||
|
||||
public function return_class($class_id)
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$return_class = $this->Class_model->return_class($class_id);
|
||||
$data['class_id']=$return_class->class_id;
|
||||
$data['class_name']=$return_class->class_name;
|
||||
$data['all_class']=$this->Class_model->all_class();
|
||||
$this->load->view('admin/classsetting-names',$data);
|
||||
}
|
||||
|
||||
//end return class
|
||||
|
||||
//delete class
|
||||
|
||||
function delete_class($class_id)
|
||||
{
|
||||
$delete_class = $this->Class_model->delete_class($class_id);
|
||||
if($delete_class)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Class Deleted Successfully');
|
||||
redirect('admin/class-name');
|
||||
} else {
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/class-name');
|
||||
}
|
||||
}
|
||||
|
||||
//end delete class
|
||||
|
||||
|
||||
//LOCATION
|
||||
|
||||
//manage location
|
||||
|
||||
public function manage_location()
|
||||
{
|
||||
$location_name = array('locat_name'=>$this->input->post('locat_name'));
|
||||
$action = $this->input->post('submit');
|
||||
if($action == "Add")
|
||||
{
|
||||
$data = $this->Class_model->create_location($location_name);
|
||||
if($data)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Location Created Successfully');
|
||||
redirect('admin/class-locations');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/class-locations');
|
||||
}
|
||||
}
|
||||
elseif($action == "Update")
|
||||
{
|
||||
$locat_id = $this->input->post('locat_id');
|
||||
$data = $this->Class_model->update_location($location_name,$locat_id);
|
||||
if($data)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Location Updated Successfully');
|
||||
redirect('admin/class-locations');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/class-locations');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//end location class
|
||||
|
||||
//return location
|
||||
|
||||
public function return_location($locat_id)
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$return_location = $this->Class_model->return_location($locat_id);
|
||||
$data['locat_id']=$return_location->locat_id;
|
||||
$data['locat_name']=$return_location->locat_name;
|
||||
$data['all_locations']=$this->Class_model->all_locations();
|
||||
$this->load->view('admin/classsetting-location',$data);
|
||||
}
|
||||
|
||||
//end return location
|
||||
|
||||
//delete location
|
||||
|
||||
function delete_location($locat_id)
|
||||
{
|
||||
$delete_location = $this->Class_model->delete_location($locat_id);
|
||||
if($delete_location)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Location Deleted Successfully');
|
||||
redirect('admin/class-locations');
|
||||
} else {
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/class-locations');
|
||||
}
|
||||
}
|
||||
|
||||
//end delete location
|
||||
|
||||
//INSTRUCTORS
|
||||
|
||||
//manage Instructors
|
||||
|
||||
public function manage_instructor()
|
||||
{
|
||||
$instructor_name = array('instr_name'=>$this->input->post('instr_name'));
|
||||
$action = $this->input->post('submit');
|
||||
if($action == "Add")
|
||||
{
|
||||
$data = $this->Class_model->create_instructors($instructor_name);
|
||||
if($data)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Instructor Added Successfully');
|
||||
redirect('admin/class-instructors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/class-instructors');
|
||||
}
|
||||
}
|
||||
elseif($action == "Update")
|
||||
{
|
||||
$instr_id = $this->input->post('instr_id');
|
||||
$data = $this->Class_model->update_instructors($instructor_name,$instr_id);
|
||||
if($data)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Instructors Updated Successfully');
|
||||
redirect('admin/class-instructors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/class-instructors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//end manage instructors
|
||||
|
||||
//return instructors
|
||||
|
||||
public function return_instructors($instr_id)
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$return_instructors = $this->Class_model->return_instructors($instr_id);
|
||||
$data['instr_id']=$return_instructors->instr_id;
|
||||
$data['instr_name']=$return_instructors->instr_name;
|
||||
$data['all_instructors']=$this->Class_model->all_instructors();
|
||||
$this->load->view('admin/classsetting-instructor',$data);
|
||||
}
|
||||
|
||||
//end return instructors
|
||||
|
||||
//delete instructors
|
||||
|
||||
function delete_instructors($instr_id)
|
||||
{
|
||||
$delete_instructors = $this->Class_model->delete_instructors($instr_id);
|
||||
if($delete_instructors)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Instructor Deleted Successfully');
|
||||
redirect('admin/class-instructors');
|
||||
} else {
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/class-instructors');
|
||||
}
|
||||
}
|
||||
|
||||
//end delete instructors
|
||||
|
||||
}
|
||||
|
||||
?>
|
222
application/controllers/admin/Createclass.php
Normal file
222
application/controllers/admin/Createclass.php
Normal file
@ -0,0 +1,222 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Createclass extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('form');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->model('Create_model');
|
||||
$this->load->library('userauth');
|
||||
}
|
||||
|
||||
public function cl_create()
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$data['class_name']=$this->Create_model->getData('tbl_classname');
|
||||
$data['class_instructor']=$this->Create_model->getData('tbl_instructors');
|
||||
$data['class_location']=$this->Create_model->getData('tbl_classlocations');
|
||||
$data['all_class']=$this->Create_model->getAll();
|
||||
$this->load->view('admin/class-create',$data);
|
||||
}
|
||||
|
||||
public function manage_create()
|
||||
{
|
||||
$action = $this->input->post('submit');
|
||||
|
||||
$form_data = array('class_id'=>$this->input->post('class_id'),
|
||||
'class_seats'=>$this->input->post('class_seats'),
|
||||
'remain_seats'=>$this->input->post('class_seats'),
|
||||
'instr_id'=>$this->input->post('instr_id'),
|
||||
'class_hours'=>$this->input->post('class_hours'),
|
||||
'class_registrants'=>implode(",",$this->input->post('class_registrants')),
|
||||
'class_price_m'=>$this->input->post('class_price_m'),
|
||||
'class_price_m2'=>$this->input->post('class_price_m2'),
|
||||
'class_price_n'=>$this->input->post('class_price_n'),
|
||||
'class_price_n2'=>$this->input->post('class_price_n2'),
|
||||
'class_price_s'=>$this->input->post('class_price_s'),
|
||||
'class_day'=>implode(',', (array) $this->input->post('class_day')),
|
||||
'calss_start_date'=>date("y-m-d",strtotime($this->input->post('calss_start_date'))),
|
||||
'calss_end_date'=>date("y-m-d",strtotime($this->input->post('calss_end_date'))),
|
||||
'calss_start_time'=>date('H:i:s',strtotime($this->input->post('calss_start_time'))),
|
||||
'calss_end_time'=>date('H:i:s',strtotime($this->input->post('calss_end_time'))),
|
||||
'locat_id'=>$this->input->post('locat_id'),
|
||||
'class_room'=>$this->input->post('class_room'),
|
||||
'class_address'=>$this->input->post('class_address'),
|
||||
'class_city'=>$this->input->post('class_city'),
|
||||
'class_state'=>$this->input->post('class_state'),
|
||||
'class_code'=>$this->input->post('class_code'),
|
||||
'class_phone'=>$this->input->post('class_phone'),
|
||||
'class_description'=>$this->input->post('class_description'));
|
||||
|
||||
if($action == "Add")
|
||||
{
|
||||
$data = $this->Create_model->insertRow('tbl_classform',$form_data);
|
||||
if($data)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Class Added Successfully');
|
||||
redirect('admin/create-class');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/create-class');
|
||||
}
|
||||
}
|
||||
elseif($action == "Update")
|
||||
{
|
||||
$form_id = $this->input->post('form_id');
|
||||
$data = $this->Create_model->updateRow('tbl_classform','form_id',$form_id,$form_data);
|
||||
if($data)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Class Updated Successfully');
|
||||
redirect('admin/create-class');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/create-class');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*Return form*/
|
||||
|
||||
public function return_form($form_id)
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$return_form = $this->Create_model->returnForm($form_id);
|
||||
$data['form_id']=$return_form->form_id;
|
||||
$data['class_name']=$return_form->class_name;
|
||||
$data['class_id']=$return_form->class_id;
|
||||
|
||||
$data['class_seats']=$return_form->class_seats;
|
||||
$data['instr_name']=$return_form->instr_name;
|
||||
$data['instr_id']=$return_form->instr_id;
|
||||
|
||||
$data['class_hours']=$return_form->class_hours;
|
||||
$data['class_registrants']=explode(",",$return_form->class_registrants);
|
||||
$data['class_price_m']=$return_form->class_price_m;
|
||||
$data['class_price_m2']=$return_form->class_price_m2;
|
||||
$data['class_price_n']=$return_form->class_price_n;
|
||||
$data['class_price_n2']=$return_form->class_price_n2;
|
||||
$data['class_price_s']=$return_form->class_price_s;
|
||||
$data['class_day']=explode(",",$return_form->class_day);
|
||||
|
||||
$data['calss_start_date']=date("d-m-Y",strtotime($return_form->calss_start_date));
|
||||
$data['calss_end_date']=date("d-m-Y",strtotime($return_form->calss_end_date));
|
||||
|
||||
$data['calss_start_time'] = date('h:i A',strtotime($return_form->calss_start_time));
|
||||
$data['calss_end_time'] = date('h:i A',strtotime($return_form->calss_end_time));
|
||||
|
||||
$data['locat_id']=$return_form->locat_id;
|
||||
$data['locat_name']=$return_form->locat_name;
|
||||
|
||||
$data['class_room']=$return_form->class_room;
|
||||
$data['class_address']=$return_form->class_address;
|
||||
$data['class_city']=$return_form->class_city;
|
||||
$data['class_state']=$return_form->class_state;
|
||||
$data['class_code']=$return_form->class_code;
|
||||
$data['class_phone']=$return_form->class_phone;
|
||||
$data['class_description']=$return_form->class_description;
|
||||
|
||||
$data['class_name']=$this->Create_model->getData('tbl_classname');
|
||||
$data['class_instructor']=$this->Create_model->getData('tbl_instructors');
|
||||
$data['class_location']=$this->Create_model->getData('tbl_classlocations');
|
||||
$data['all_class']=$this->Create_model->getAll();
|
||||
$this->load->view('admin/class-create',$data);
|
||||
}
|
||||
|
||||
/*Delete Form*/
|
||||
|
||||
function delete_form($form_id="")
|
||||
{
|
||||
if($form_id!="")
|
||||
{
|
||||
$delete_class = $this->Create_model->deleteForm('tbl_classform','form_id',$form_id); /*Delete Class By ID*/
|
||||
if($delete_class)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Class Deleted Successfully');
|
||||
redirect('admin/create-class');
|
||||
} else {
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/create-class');
|
||||
}
|
||||
}
|
||||
elseif(!empty($this->input->post('check_id')))
|
||||
{
|
||||
$action = $this->input->post('action');
|
||||
$check_id = array();
|
||||
$check_id = $this->input->post('check_id');
|
||||
|
||||
if($action=='delete') /*Delete Multiple Classes*/
|
||||
{
|
||||
foreach ($check_id as $key => $value)
|
||||
{
|
||||
$delete_class = $this->Create_model->deleteForm('tbl_classform','form_id',$value);
|
||||
}
|
||||
if($delete_class)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Records Deleted Successfully');
|
||||
redirect('admin/create-class');
|
||||
} else {
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/create-class');
|
||||
}
|
||||
}
|
||||
elseif ($action=='duplicate') /*Duplicate Class*/
|
||||
{
|
||||
foreach ($check_id as $key => $value)
|
||||
{
|
||||
$duplicate_class = $this->Create_model->returnForm($value);
|
||||
$form_data = array('class_id'=>$duplicate_class->class_id,
|
||||
'class_seats'=>$duplicate_class->class_seats,
|
||||
'remain_seats'=>$duplicate_class->class_seats,
|
||||
'instr_id'=>$duplicate_class->instr_id,
|
||||
'class_hours'=>$duplicate_class->class_hours,
|
||||
'class_registrants'=>$duplicate_class->class_registrants,
|
||||
'class_price_m'=>$duplicate_class->class_price_m,
|
||||
'class_price_m2'=>$duplicate_class->class_price_m2,
|
||||
'class_price_n'=>$duplicate_class->class_price_n,
|
||||
'class_price_n2'=>$duplicate_class->class_price_n2,
|
||||
'class_price_s'=>$duplicate_class->class_price_s,
|
||||
'class_day'=>$duplicate_class->class_day,
|
||||
'calss_start_date'=>$duplicate_class->calss_start_date,
|
||||
'calss_end_date'=>$duplicate_class->calss_end_date,
|
||||
'calss_start_time'=>$duplicate_class->calss_start_time,
|
||||
'calss_end_time'=>$duplicate_class->calss_end_time,
|
||||
'locat_id'=>$duplicate_class->locat_id,
|
||||
'class_room'=>$duplicate_class->class_room,
|
||||
'class_address'=>$duplicate_class->class_address,
|
||||
'class_city'=>$duplicate_class->class_city,
|
||||
'class_state'=>$duplicate_class->class_state,
|
||||
'class_code'=>$duplicate_class->class_code,
|
||||
'class_phone'=>$duplicate_class->class_phone,
|
||||
'class_description'=>$duplicate_class->class_description);
|
||||
$data = $this->Create_model->insertRow('tbl_classform',$form_data);
|
||||
}
|
||||
if ($data)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Duplicated Successfully');
|
||||
redirect('admin/create-class');
|
||||
} else {
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/create-class');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Select Records First.');
|
||||
redirect('admin/create-class');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
59
application/controllers/admin/Order_list.php
Normal file
59
application/controllers/admin/Order_list.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Order_list extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('form');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('password');
|
||||
$this->load->model('Orderlist_model');
|
||||
// $this->load->view('review-order');
|
||||
}
|
||||
|
||||
public function list_order()
|
||||
{
|
||||
|
||||
|
||||
$data['all_order']=$this->Orderlist_model->get_order();
|
||||
$this->load->view('admin/order-list',$data);
|
||||
}
|
||||
|
||||
|
||||
public function review_orderList($reg_id)
|
||||
{
|
||||
|
||||
|
||||
$data['order']=$this->Orderlist_model->review_order($reg_id);
|
||||
$data['return_class']=$this->Orderlist_model->return_class($reg_id);
|
||||
$data['registrants']=$this->Orderlist_model->return_attendee($reg_id);
|
||||
$this->load->view('front/review',$data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function delet_list($reg_name)
|
||||
{
|
||||
|
||||
$delete_list = $this->Orderlist_model->delet_list($reg_name);
|
||||
if($delete_list)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','User Deleted Successfully');
|
||||
$data['all_order']=$this->Orderlist_model->get_order();
|
||||
$this->load->view('admin/order-list',$data);
|
||||
} else {
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
$data['all_order']=$this->Orderlist_model->get_order();
|
||||
$this->load->view('admin/order-list',$data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
140
application/controllers/admin/Orderlist.php
Normal file
140
application/controllers/admin/Orderlist.php
Normal file
@ -0,0 +1,140 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Orderlist extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('form');
|
||||
$this->load->library("pagination");
|
||||
$this->load->model('Orderlist_model');
|
||||
$this->load->library('userauth');
|
||||
}
|
||||
|
||||
public function list_order()
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$config = array();
|
||||
$config["base_url"] = base_url() . "admin/order-list";
|
||||
$total_row = $this->Orderlist_model->record_count();
|
||||
$config["total_rows"] = $total_row;
|
||||
$config["per_page"] = 20;
|
||||
$config['use_page_numbers'] = TRUE;
|
||||
$config['num_links'] = $total_row;
|
||||
$config['cur_tag_open'] = '<a class="current">';
|
||||
$config['cur_tag_close'] = '</a>';
|
||||
$config['next_link'] = '»';
|
||||
$config['prev_link'] = '«';
|
||||
|
||||
$this->pagination->initialize($config);
|
||||
if($this->uri->segment(3)){
|
||||
$page = ($this->uri->segment(3)) ;
|
||||
}
|
||||
else{
|
||||
$page = 0;
|
||||
}
|
||||
$data["all_order"] = $this->Orderlist_model->get_order($config["per_page"], $page);
|
||||
|
||||
$str_links = $this->pagination->create_links();
|
||||
$data["links"] = explode(' ',$str_links );
|
||||
$this->load->view('admin/order-list',$data);
|
||||
}
|
||||
|
||||
public function order_search()
|
||||
{
|
||||
$orderno = $this->input->post('orderno');
|
||||
$fromedate = date("Y-m-d",strtotime($this->input->post('fromedate')));
|
||||
$todate = date("Y-m-d",strtotime($this->input->post('todate')));
|
||||
$data['all_order'] = $this->Orderlist_model->ordersearch($orderno,$fromedate,$todate);
|
||||
if($data['all_order']==array())
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','No Order For The Given Data.');
|
||||
redirect('admin/order-list');
|
||||
}
|
||||
$str_links = $this->pagination->create_links();
|
||||
$data["links"] = explode(' ',$str_links );
|
||||
$this->load->view('admin/order-list',$data);
|
||||
}
|
||||
|
||||
public function review_orderList($reg_id,$type)
|
||||
{
|
||||
$this->userauth->logged_in();
|
||||
$master = $this->Orderlist_model->review_order($reg_id);
|
||||
$data['return_class']=$this->Orderlist_model->return_class($reg_id);
|
||||
$data['member']=$this->Orderlist_model->returnAttende('tbl_attendee','reg_id','reg_m_type',$reg_id,'M');
|
||||
$data['member2']=$this->Orderlist_model->returnAttende('tbl_attendee','reg_id','reg_m_type',$reg_id,'M2');
|
||||
$data['nonmember']=$this->Orderlist_model->returnAttende('tbl_attendee','reg_id','reg_m_type',$reg_id,'N');
|
||||
$data['nonmember2']=$this->Orderlist_model->returnAttende('tbl_attendee','reg_id','reg_m_type',$reg_id,'N2');
|
||||
$data['semember']=$this->Orderlist_model->returnAttende('tbl_attendee','reg_id','reg_m_type',$reg_id,'S');
|
||||
$data['mcount'] = count($data['member']);
|
||||
$data['mcount2'] = count($data['member2']);
|
||||
$data['ncount'] = count($data['nonmember']);
|
||||
$data['ncount2'] = count($data['nonmember2']);
|
||||
$data['scount'] = count($data['semember']);
|
||||
|
||||
$data['reg_date'] = date("d-m-Y",strtotime($master->reg_date));
|
||||
$data['card_holder_name'] = $master->card_holder_name;
|
||||
$data['payment_type'] = $master->payment_type;
|
||||
$data['address'] = $master->street_adrs;
|
||||
$data['phone_no'] = $master->phone_no;
|
||||
$data['email_id'] = $master->email_id;
|
||||
$data['class_count'] = $master->reg_class_count;
|
||||
$data['att_count'] = $master->att_total_count;
|
||||
$data['card_number'] = $master->card_number;
|
||||
$data['card_type'] = $master->card_type;
|
||||
$data['status'] = $master->status;
|
||||
|
||||
|
||||
|
||||
$data['reg_total'] = $master->reg_total;
|
||||
$data['orderno'] = $master->reg_id;
|
||||
|
||||
|
||||
$data['type'] = $type;
|
||||
$this->load->view('admin/view-order',$data);
|
||||
}
|
||||
|
||||
public function delete_list($reg_id)
|
||||
{
|
||||
$delete_list = $this->Orderlist_model->delete_list($reg_id);
|
||||
if($delete_list)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Order Deleted Successfully');
|
||||
redirect('admin/order-list');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/order-list');
|
||||
}
|
||||
}
|
||||
|
||||
function update_status($reg_id)
|
||||
{
|
||||
$return_reg = $this->Orderlist_model->return_reg($reg_id);
|
||||
if($return_reg->status == "unpaid")
|
||||
{
|
||||
$update = $this->Orderlist_model->update_status("paid",$reg_id);
|
||||
if($update)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','Updated Successfully');
|
||||
redirect('admin/order-list');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/order-list');
|
||||
}
|
||||
}else
|
||||
{
|
||||
$this->session->set_flashdata('error_msg','Already Paid');
|
||||
redirect('admin/order-list');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
154
application/controllers/admin/User.php
Normal file
154
application/controllers/admin/User.php
Normal file
@ -0,0 +1,154 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class User extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('form');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('password');
|
||||
$this->load->model('User_model');
|
||||
$this->load->library('userauth');
|
||||
}
|
||||
|
||||
public function admin_user()
|
||||
{
|
||||
$this->userauth->logged_admin();
|
||||
$data['all_users']=$this->User_model->get_user();
|
||||
$this->load->view('admin/admin-users',$data);
|
||||
}
|
||||
|
||||
//add user
|
||||
public function add_user()
|
||||
{
|
||||
$password = $this->password->encrypt_password($this->input->post('user_password'));
|
||||
$user_id = $this->input->post('user_id');
|
||||
$user= array('user_name'=>$this->input->post('user_name'),
|
||||
'user_password'=>$password);
|
||||
$action = $this->input->post('submit');
|
||||
$check_user=$this->User_model->check_user($user['user_name']);
|
||||
|
||||
if($action == "Add")
|
||||
{
|
||||
if($check_user)
|
||||
{
|
||||
$user_data =$this->User_model->add_user($user);
|
||||
if($user_data)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','User Added Successfully');
|
||||
redirect('admin/admin-user');
|
||||
} else {
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/admin-user');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->session->set_flashdata('error_msg', 'User Already Exists.');
|
||||
redirect('admin/admin-user');
|
||||
}
|
||||
}
|
||||
if($action == "Update")
|
||||
{
|
||||
$return_user = $this->User_model->return_user($user_id);
|
||||
if($check_user)
|
||||
{
|
||||
$name = $this->input->post('user_name');
|
||||
$msg_type = "success_msg";
|
||||
$msg = "User Updated Successfully.";
|
||||
}
|
||||
else
|
||||
{
|
||||
$name = $return_user->user_name;
|
||||
if($this->input->post('user_name') == $return_user->user_name)
|
||||
{
|
||||
$msg_type = "success_msg";
|
||||
$msg = "User Updated Successfully.";
|
||||
}
|
||||
else
|
||||
{
|
||||
$msg_type = "error_msg";
|
||||
$msg = "User Already Exists.";
|
||||
}
|
||||
|
||||
}
|
||||
$update_data= array('user_name'=>$name,
|
||||
'user_password'=>$password);
|
||||
$user_update = $this->User_model->update_user($update_data,$user_id);
|
||||
if($user_update)
|
||||
{
|
||||
$this->session->set_flashdata($msg_type,$msg);
|
||||
redirect('admin/admin-user');
|
||||
} else {
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/admin-user');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//end add user
|
||||
|
||||
//return user
|
||||
|
||||
public function return_user($user_id)
|
||||
{
|
||||
$this->userauth->logged_admin();
|
||||
$return_user = $this->User_model->return_user($user_id);
|
||||
$data['user_id']=$return_user->user_id;
|
||||
$data['user_name']=$return_user->user_name;
|
||||
$data['user_password'] = $this->password->decrypt_password($return_user->user_password);
|
||||
$data['all_users']=$this->User_model->get_user();
|
||||
$this->load->view('admin/admin-users',$data);
|
||||
}
|
||||
|
||||
//end return user
|
||||
|
||||
//delete user
|
||||
|
||||
function delete_user($user_id)
|
||||
{
|
||||
$delete_user = $this->User_model->delete_user($user_id);
|
||||
if($delete_user)
|
||||
{
|
||||
$this->session->set_flashdata('success_msg','User Deleted Successfully');
|
||||
redirect('admin/admin-user');
|
||||
} else {
|
||||
$this->session->set_flashdata('error_msg','Error Occur');
|
||||
redirect('admin/admin-user');
|
||||
}
|
||||
}
|
||||
|
||||
//end delete user
|
||||
|
||||
//update status
|
||||
|
||||
function update_status($user_id)
|
||||
{
|
||||
$return_user = $this->User_model->return_user($user_id);
|
||||
$data['user_id']=$return_user->user_id;
|
||||
$data['user_status']=$return_user->user_status;
|
||||
if($return_user->user_type !="admin")
|
||||
{
|
||||
if($data['user_status']=="active")
|
||||
{
|
||||
$status ="inactive";
|
||||
}
|
||||
elseif($data['user_status']=="inactive")
|
||||
{
|
||||
$status ="active";
|
||||
}
|
||||
$data['user_id']=$user_id;
|
||||
$this->User_model->update_status($status,$user_id);
|
||||
}
|
||||
else { $this->session->set_flashdata('error_msg',"Admin Can't Be Inactive."); }
|
||||
redirect('admin/admin-user');
|
||||
}
|
||||
|
||||
//end update status
|
||||
|
||||
}
|
||||
|
||||
?>
|
11
application/controllers/index.html
Normal file
11
application/controllers/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user