zishan0215 / attendance

Attendance Management System for Computer Departement, JMI
Other
42 stars 130 forks source link

Admin->Teachers: Remove subject #27

Closed zishan0215 closed 9 years ago

zishan0215 commented 10 years ago

So lets discuss this here

wadhwasahil commented 10 years ago

public function view_teacher() { $this->data['page'] = 1; $this->data['name'] = $this->session->userdata('name'); $this->data['teacher_id'] = $this->input->post('teacher_id'); $array = array('teacher_id' => $this->data['teacher_id']); $this->data['teacher1']=$this->teacher_m->get_by($array,TRUE); $this->data['teacher2']=$this->subject_m->get_by($array); $this->data['subject_code'] = $this->input->post('subject_code'); $array=array("subject_code"=>$this->data['subject_code'],"teacher_id"=>0); $this->teacher_m->save($array); $this->load->view('admin/components/admin_header', $this->data); $this->load->view('admin/view_teacher_layout'); }

zishan0215 commented 10 years ago

$array=array("subject_code"=>$this->data['subject_code'],"teacher_id"=>0); $this->teacher_m->save($array); // To insert new data OR $this->teacher_m->save($array, $id); //To update existing data with given id

wadhwasahil commented 10 years ago

yahi to kiya hai maine

wadhwasahil commented 10 years ago

public function view_teacher() { $this->data['page'] = 1; $this->data['name'] = $this->session->userdata('name'); $this->data['teacher_id'] = $this->input->post('teacher_id'); $array = array('teacher_id' => $this->data['teacher_id']); $this->data['teacher1']=$this->teacher_m->get_by($array,TRUE); $this->data['teacher2']=$this->subject_m->get_by($array); $this->data['subject_code'] = $this->input->post('subject_code'); $array=array("subject_code"=>$this->data['subject_code'],"teacher_id"=>0); $this->teacher_m->save($array); $this->load->view('admin/components/admin_header', $this->data); $this->load->view('admin/view_teacher_layout'); }

zishan0215 commented 10 years ago

kya kar rahe ho ?

zishan0215 commented 10 years ago

This is not the way to do it..

wadhwasahil commented 10 years ago

tumne bhi to same cheez likhi hai upar

wadhwasahil commented 10 years ago

$array=array("subject_code"=>$this->data['subject_code'],"teacher_id"=>0); $this->teacher_m->save($array);

zishan0215 commented 10 years ago

firstly.. this query should only run when the admin clicks on the remove button.. secondly, what you are doing is insertion and not updation

wadhwasahil commented 10 years ago

so how to check if remove is clicked or not?

zishan0215 commented 10 years ago

refer increment semester

wadhwasahil commented 10 years ago

ok

wadhwasahil commented 10 years ago

using &nbsp??

zishan0215 commented 10 years ago

its just for space

wadhwasahil commented 10 years ago

$this->data['subject_code'] = $this->input->post('subject_code'); if($this->data['subject_code']){ $array=array('subject_code'=>$this->data['subject_code'],'teacher_id'=>0); $this->subject_m->save($array,$this->data['teacher_id']); }

wadhwasahil commented 10 years ago

ab theek hai??

zishan0215 commented 10 years ago

nope...if condition is wrong

wadhwasahil commented 10 years ago

kya galat hai isme?

zishan0215 commented 10 years ago

$array=array('teacher_id' => 0);

zishan0215 commented 10 years ago

just use this

wadhwasahil commented 10 years ago

foreign key constraint hai

zishan0215 commented 10 years ago

if condition galat hai tumhari.. pehle usko theek karo

wadhwasahil commented 10 years ago

pehle yeh batao ki subject table mein hum teacher_id=0 kaise kr sakte hain jab ki koi teacher ki teacher_id 0 nhi hai

wadhwasahil commented 10 years ago

delete hi krna padega

zishan0215 commented 10 years ago

hai teacher id 0.. check the database

wadhwasahil commented 10 years ago

mere mein nhi hai

wadhwasahil commented 10 years ago

lol

wadhwasahil commented 10 years ago

aagaye??

zishan0215 commented 10 years ago

haan

wadhwasahil commented 10 years ago

kaam ho gya

wadhwasahil commented 10 years ago

but ek error hai

zishan0215 commented 10 years ago

kya

wadhwasahil commented 10 years ago

delete ho ja rhi hain

zishan0215 commented 10 years ago

kya

wadhwasahil commented 10 years ago

wait main screen shot bhejta hoon

wadhwasahil commented 10 years ago

public function view_teacher() { $this->data['page'] = 1; $this->data['name'] = $this->session->userdata('name'); $this->data['teacher_id'] = $this->input->post('teacher_id'); $array = array('teacher_id' => $this->data['teacher_id']); $this->data['teacher1']=$this->teacher_m->get_by($array,TRUE); $this->data['teacher2']=$this->subject_m->get_by($array); $this->data['subject_code'] = $this->input->post('subject_code'); if(isset($_POST['subject_code'])){ $array=array('teacher_id'=>0); $this->subject_m->save($array,$this->data['subject_code']); } $this->load->view('admin/components/admin_header', $this->data); $this->load->view('admin/view_teacher_layout'); }

wadhwasahil commented 10 years ago

nowcheck

zishan0215 commented 10 years ago

abhi bhi galat hai if condition

wadhwasahil commented 10 years ago

kya galata hai

wadhwasahil commented 10 years ago

maine net se dekhi hai

zishan0215 commented 10 years ago

net se kyun dekh rahe ho.. code nahi dekh sakte ? keh raha hun increment waale main dekho kaise pata chal raha hai kab click kiya button ko

wadhwasahil commented 10 years ago

vo samajh nhi aaraha

zishan0215 commented 10 years ago

if($this->input->post('submit')) { //code here }

wadhwasahil commented 10 years ago

bhai tum ajeeb ho

wadhwasahil commented 10 years ago

upar wala bhi same chhez krta hai

zishan0215 commented 10 years ago

no

wadhwasahil commented 10 years ago

uss button ka naam remove hai

wadhwasahil commented 10 years ago

not submit

wadhwasahil commented 10 years ago

and uska name hai subject_code

zishan0215 commented 10 years ago

karlo changes.. idea de raha hun tumhe