Moved to PHP folder
This commit is contained in:
30
php/application/models/Admin_model.php
Normal file
30
php/application/models/Admin_model.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
class Admin_model extends CI_model
|
||||
{
|
||||
|
||||
function login_valid($username,$password)
|
||||
{
|
||||
$this->db->from('tbl_usermaster');
|
||||
$this->db->where('user_name',$username);
|
||||
$this->db->where('user_password',$password);
|
||||
$this->db->where('user_status','active');
|
||||
if($query=$this->db->get())
|
||||
{
|
||||
return $query->row_array();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function totalrows($tablename='',$fields='')
|
||||
{
|
||||
$this->db->select($fields);
|
||||
$this->db->from($tablename);
|
||||
$query = $this->db->get();
|
||||
$responce = $query->num_rows();
|
||||
return $responce;
|
||||
}
|
||||
}
|
||||
?>
|
176
php/application/models/Class_model.php
Normal file
176
php/application/models/Class_model.php
Normal file
@ -0,0 +1,176 @@
|
||||
<?php
|
||||
class Class_model extends CI_model
|
||||
|
||||
{
|
||||
|
||||
//CLASS
|
||||
|
||||
//get all classes
|
||||
|
||||
function all_class()
|
||||
{
|
||||
$this->db->from('tbl_classname');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//end get all classes
|
||||
|
||||
//create classes
|
||||
|
||||
function create_class($class_name)
|
||||
{
|
||||
$this->db->insert('tbl_classname',$class_name);
|
||||
return true;
|
||||
}
|
||||
|
||||
//end create classes
|
||||
|
||||
//update classes
|
||||
|
||||
function update_class($class_name,$class_id)
|
||||
{
|
||||
$this->db->where('class_id',$class_id);
|
||||
$this->db->update('tbl_classname',$class_name);
|
||||
return true;
|
||||
}
|
||||
|
||||
//end update classes
|
||||
|
||||
//return classes
|
||||
|
||||
function return_class($class_id)
|
||||
{
|
||||
$this->db->from('tbl_classname');
|
||||
$this->db->where('class_id',$class_id);
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
|
||||
//end return classes
|
||||
|
||||
//delete classes
|
||||
|
||||
function delete_class($class_id)
|
||||
{
|
||||
$this->db->where('class_id',$class_id);
|
||||
$this->db->delete('tbl_classname');
|
||||
return true;
|
||||
}
|
||||
|
||||
//end delete classes
|
||||
|
||||
|
||||
|
||||
//LOCATIONS
|
||||
|
||||
//get all locations
|
||||
|
||||
function all_locations()
|
||||
{
|
||||
$this->db->from('tbl_classlocations');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//end get all locations
|
||||
|
||||
//create location
|
||||
|
||||
function create_location($location_name)
|
||||
{
|
||||
$this->db->insert('tbl_classlocations',$location_name);
|
||||
return true;
|
||||
}
|
||||
|
||||
//end create location
|
||||
|
||||
//update location
|
||||
|
||||
function update_location($location_name,$locat_id)
|
||||
{
|
||||
$this->db->where('locat_id',$locat_id);
|
||||
$this->db->update('tbl_classlocations',$location_name);
|
||||
return true;
|
||||
}
|
||||
|
||||
//end update location
|
||||
|
||||
//return location
|
||||
|
||||
function return_location($locat_id)
|
||||
{
|
||||
$this->db->from('tbl_classlocations');
|
||||
$this->db->where('locat_id',$locat_id);
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
|
||||
//end return location
|
||||
|
||||
//delete location
|
||||
|
||||
function delete_location($locat_id)
|
||||
{
|
||||
$this->db->where('locat_id',$locat_id);
|
||||
$this->db->delete('tbl_classlocations');
|
||||
return true;
|
||||
}
|
||||
|
||||
//end delete location
|
||||
|
||||
//INSTRUCTORS
|
||||
|
||||
//get all Instructors
|
||||
|
||||
function all_instructors()
|
||||
{
|
||||
$this->db->from('tbl_instructors');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//end get all Instructors
|
||||
|
||||
//create Instructors
|
||||
|
||||
function create_instructors($instructor_name)
|
||||
{
|
||||
$this->db->insert('tbl_instructors',$instructor_name);
|
||||
return true;
|
||||
}
|
||||
|
||||
//end create Instructors
|
||||
|
||||
//update Instructors
|
||||
|
||||
function update_instructors($instructor_name,$instr_id)
|
||||
{
|
||||
$this->db->where('instr_id',$instr_id);
|
||||
$this->db->update('tbl_instructors',$instructor_name);
|
||||
return true;
|
||||
}
|
||||
|
||||
//end update Instructors
|
||||
|
||||
//return instructors
|
||||
|
||||
function return_instructors($instr_id)
|
||||
{
|
||||
$this->db->from('tbl_instructors');
|
||||
$this->db->where('instr_id',$instr_id);
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
|
||||
//end return instructors
|
||||
|
||||
//delete instructors
|
||||
|
||||
function delete_instructors($instr_id)
|
||||
{
|
||||
$this->db->where('instr_id',$instr_id);
|
||||
$this->db->delete('tbl_instructors');
|
||||
return true;
|
||||
}
|
||||
|
||||
//end delete instructors
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
50
php/application/models/Create_model.php
Normal file
50
php/application/models/Create_model.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
class Create_model extends CI_model
|
||||
{
|
||||
|
||||
function getData($table='') /*Get Data*/
|
||||
{
|
||||
$this->db->from($table);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
function getAll() /*Get All data*/
|
||||
{
|
||||
$this->db->from('tbl_classform');
|
||||
$this->db->join('tbl_classname', 'tbl_classform.class_id = tbl_classname.class_id');
|
||||
$this->db->order_by('tbl_classform.form_id','desc');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function insertRow($table, $data) /*Insert Data*/
|
||||
{
|
||||
$this->db->insert($table, $data);
|
||||
return true;
|
||||
}
|
||||
|
||||
function updateRow($table, $col, $colVal, $data) /*Update Data*/
|
||||
{
|
||||
$this->db->where($col,$colVal);
|
||||
$this->db->update($table,$data);
|
||||
return true;
|
||||
}
|
||||
|
||||
function returnForm($form_id) /*Return Data*/
|
||||
{
|
||||
$this->db->from('tbl_classform AS A');
|
||||
$this->db->join('tbl_classname AS B', 'A.class_id = B.class_id', 'INNER');
|
||||
$this->db->join('tbl_instructors AS C', 'A.instr_id = C.instr_id', 'INNER');
|
||||
$this->db->join('tbl_classlocations AS D', 'A.locat_id = D.locat_id', 'INNER');
|
||||
$this->db->where('form_id',$form_id);
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
|
||||
function deleteForm($table='',$field='',$form_id='') /*Delete Form*/
|
||||
{
|
||||
$this->db->where($field,$form_id);
|
||||
$this->db->delete($table);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
118
php/application/models/Index_model.php
Normal file
118
php/application/models/Index_model.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
class Index_model extends CI_model
|
||||
{
|
||||
|
||||
function reg_location() /*Select Class Of Default Location*/
|
||||
{
|
||||
$this->db->from('tbl_classform AS A');
|
||||
$this->db->join('tbl_classlocations AS B', 'A.locat_id = B.locat_id', 'INNER');
|
||||
$this->db->group_by('locat_name');
|
||||
$this->db->order_by("B.locat_name", "asc");
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
function reg_class($locat_id="") /*Select Class Of Location*/
|
||||
{
|
||||
$this->db->from('tbl_classform AS A');
|
||||
$this->db->join('tbl_classlocations AS B', 'A.locat_id = B.locat_id', 'INNER');
|
||||
$this->db->join('tbl_classname AS C', 'A.class_id = C.class_id', 'INNER');
|
||||
$this->db->join('tbl_instructors AS D', 'A.instr_id = D.instr_id', 'INNER');
|
||||
$this->db->order_by("A.form_id", "asc");
|
||||
if($locat_id!="")
|
||||
{
|
||||
$this->db->where('A.locat_id',$locat_id);
|
||||
}
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
function first_location() /*Select First Location*/
|
||||
{
|
||||
$this->db->from('tbl_classform AS A');
|
||||
$this->db->join('tbl_classlocations AS B', 'A.locat_id = B.locat_id', 'INNER');
|
||||
$this->db->order_by("A.form_id", "asc");
|
||||
return $this->db->get()->first_row();
|
||||
}
|
||||
|
||||
function regmaster($masterdata)
|
||||
{
|
||||
$this->db->insert('tbl_regmaster',$masterdata); /*Insert Reg Class Data*/
|
||||
$reg_id = $this->db->insert_id();
|
||||
return $reg_id;
|
||||
}
|
||||
|
||||
function classdata($classdata)
|
||||
{
|
||||
$this->db->insert('tbl_regclass',$classdata); /*Insert Class Data*/
|
||||
$regclass_id = $this->db->insert_id();
|
||||
return $regclass_id;
|
||||
}
|
||||
|
||||
function attendedata($attendedata) /*Insert Attendee Data*/
|
||||
{
|
||||
$this->db->insert('tbl_attendee',$attendedata);
|
||||
return true;
|
||||
}
|
||||
|
||||
function attotal($att_counts,$regid) /*Update Attendee Total Count*/
|
||||
{
|
||||
$this->db->set('att_total_count', $att_counts);
|
||||
$this->db->where('reg_id', $regid);
|
||||
$this->db->update('tbl_regmaster');
|
||||
return true;
|
||||
}
|
||||
|
||||
function remainclass($remainseats,$form_id) /*Update Remain Seats*/
|
||||
{
|
||||
$this->db->set('remain_seats', $remainseats);
|
||||
$this->db->where('form_id', $form_id);
|
||||
$this->db->update('tbl_classform');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function update_rclass($regclass_total,$value)
|
||||
{
|
||||
$this->db->set('regclass_total_price', $regclass_total);
|
||||
$this->db->where('regclass_id', $value);
|
||||
$this->db->update('tbl_regclass');
|
||||
return true;
|
||||
}
|
||||
|
||||
//Return Class
|
||||
function returnclass($form)
|
||||
{
|
||||
$this->db->from('tbl_classform');
|
||||
$this->db->where('form_id',$form);
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
//Return form
|
||||
function returnform($form)
|
||||
{
|
||||
$this->db->from('tbl_classform AS A');
|
||||
$this->db->join('tbl_classname AS B', 'A.class_id = B.class_id', 'INNER');
|
||||
$this->db->where('A.form_id',$form);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
//End Registration
|
||||
|
||||
function insert_payment($payment_data,$reg_id)
|
||||
{
|
||||
$this->db->where('reg_id',$reg_id);
|
||||
$this->db->update('tbl_regmaster',$payment_data);
|
||||
return true;
|
||||
}
|
||||
|
||||
function delete_order($id)
|
||||
{
|
||||
// $this->db->where('reg_id',$reg_id);
|
||||
// $this->db->delete('tbl_regmaster');
|
||||
$this->db->where('att_id',$id);
|
||||
$this->db->delete('tbl_attendee');
|
||||
// $this->db->where('reg_id',$reg_id);
|
||||
// $this->db->delete('tbl_regclass');
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
108
php/application/models/Orderlist_model.php
Normal file
108
php/application/models/Orderlist_model.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Orderlist_model extends CI_model{
|
||||
|
||||
public function record_count()
|
||||
{
|
||||
return $this->db->count_all("tbl_regmaster");
|
||||
}
|
||||
|
||||
public function get_order($limit,$start)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('tbl_regmaster');
|
||||
$this->db->join('tbl_regclass', 'tbl_regclass.reg_id = tbl_regmaster.reg_id');
|
||||
$this->db->join('tbl_classform', 'tbl_classform.form_id = tbl_regclass.form_id');
|
||||
$this->db->join('tbl_classlocations', 'tbl_classlocations.locat_id = tbl_classform.locat_id');
|
||||
$this->db->group_by('tbl_regmaster.reg_id');
|
||||
$this->db->order_by('tbl_regmaster.reg_id','desc');
|
||||
$this->db->limit($limit, $start);
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
//search
|
||||
public function ordersearch($orderno,$fromedate,$todate)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('tbl_regmaster');
|
||||
$this->db->join('tbl_regclass', 'tbl_regclass.reg_id = tbl_regmaster.reg_id');
|
||||
$this->db->join('tbl_classform', 'tbl_classform.form_id = tbl_regclass.form_id');
|
||||
$this->db->join('tbl_classlocations', 'tbl_classlocations.locat_id = tbl_classform.locat_id');
|
||||
$this->db->group_by('tbl_regmaster.reg_id');
|
||||
$this->db->order_by('tbl_regmaster.reg_id','desc');
|
||||
if($orderno)
|
||||
{
|
||||
$this->db->where('tbl_regmaster.reg_id',$orderno);
|
||||
}
|
||||
elseif($fromedate !="1970-01-01" && $todate !="1970-01-01")
|
||||
{
|
||||
$this->db->where('tbl_regmaster.reg_date >=', $fromedate);
|
||||
$this->db->where('tbl_regmaster.reg_date <=', $todate);
|
||||
}
|
||||
elseif($fromedate && $todate =="1970-01-01")
|
||||
{
|
||||
$this->db->where('tbl_regmaster.reg_date >=', $fromedate);
|
||||
}
|
||||
elseif($fromedate =="1970-01-01" && $todate)
|
||||
{
|
||||
$this->db->where('tbl_regmaster.reg_date <=', $todate);
|
||||
}
|
||||
$result=$this->db->get();
|
||||
return $result->result();
|
||||
|
||||
}
|
||||
|
||||
//review_order
|
||||
function review_order($reg_id)
|
||||
{
|
||||
$this->db->from('tbl_regmaster');
|
||||
$this->db->where('reg_id',$reg_id);
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
|
||||
function return_class($reg_id)
|
||||
{
|
||||
$this->db->from('tbl_regclass AS A');
|
||||
$this->db->join('tbl_classform AS B', 'A.form_id = B.form_id', 'INNER');
|
||||
$this->db->join('tbl_classname AS C', 'B.class_id = C.class_id', 'INNER');
|
||||
$this->db->join('tbl_classlocations AS D', 'B.locat_id = D.locat_id', 'INNER');
|
||||
$this->db->join('tbl_instructors AS E', 'B.instr_id = E.instr_id', 'INNER');
|
||||
$this->db->where('reg_id',$reg_id);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
function returnAttende($table='',$field1='',$field2='',$reg_id='',$type='')
|
||||
{
|
||||
$this->db->from($table);
|
||||
$this->db->where($field1,$reg_id);
|
||||
$this->db->where($field2,$type);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
function delete_list($reg_id)
|
||||
{
|
||||
$tables = array('tbl_regmaster', 'tbl_regclass', 'tbl_attendee');
|
||||
$this->db->where('reg_id',$reg_id);
|
||||
$this->db->delete($tables);
|
||||
return true;
|
||||
}
|
||||
|
||||
function return_reg($reg_id)
|
||||
{
|
||||
$this->db->from('tbl_regmaster');
|
||||
$this->db->where('reg_id',$reg_id);
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
|
||||
function update_status($status,$reg_id)
|
||||
{
|
||||
$this->db->where('reg_id',$reg_id );
|
||||
$this->db->set('status',$status);
|
||||
$this->db->update('tbl_regmaster');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
87
php/application/models/User_model.php
Normal file
87
php/application/models/User_model.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
class User_model extends CI_model
|
||||
{
|
||||
|
||||
function get_user()
|
||||
{
|
||||
$this->db->from('tbl_usermaster');
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
public function check_user($user_name)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('tbl_usermaster');
|
||||
$this->db->where('user_name',$user_name);
|
||||
$query=$this->db->get();
|
||||
|
||||
if($query->num_rows()>0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//create user
|
||||
|
||||
function add_user($user)
|
||||
{
|
||||
$this->db->insert('tbl_usermaster',$user);
|
||||
return true;
|
||||
}
|
||||
|
||||
//end create user
|
||||
|
||||
//update user
|
||||
|
||||
function update_user($user,$user_id)
|
||||
{
|
||||
$this->db->where('user_id',$user_id);
|
||||
$this->db->update('tbl_usermaster',$user);
|
||||
return true;
|
||||
}
|
||||
|
||||
//end update user
|
||||
|
||||
//return users
|
||||
|
||||
function return_user($user_id)
|
||||
{
|
||||
$this->db->from('tbl_usermaster');
|
||||
$this->db->where('user_id',$user_id);
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
|
||||
//end users classes
|
||||
|
||||
//update Status
|
||||
|
||||
function update_status($status,$user_id)
|
||||
{
|
||||
$this->db->where('user_id',$user_id );
|
||||
$this->db->set('user_status',$status);
|
||||
$this->db->update('tbl_usermaster');
|
||||
}
|
||||
|
||||
//end update Status
|
||||
|
||||
//delete user
|
||||
|
||||
function delete_user($user_id)
|
||||
{
|
||||
$this->db->where('user_id',$user_id);
|
||||
$this->db->delete('tbl_usermaster');
|
||||
return true;
|
||||
}
|
||||
|
||||
//end delete classes
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
11
php/application/models/index.html
Normal file
11
php/application/models/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