Moved to PHP folder
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user