Commit 9cf16604 by Jansa Jose

examm admin panel

parent 17852c54
......@@ -23,6 +23,7 @@ class Exam_model extends CI_Model {
//}
}
function get_all_exams(){
$this->db->select("CAST(AES_DECRYPT(`exam_procedure`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as exam_procedure,id,CAST(AES_DECRYPT(`observation`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as observation ");
$all_exams = $this->db->get('tbl_exams');
if($all_exams->num_rows() > 0){
$result = $all_exams->result_array();
......@@ -35,6 +36,7 @@ class Exam_model extends CI_Model {
}
}
function get_single_exam($id){
$this->db->select("CAST(AES_DECRYPT(`exam_procedure`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as exam_procedure,id,CAST(AES_DECRYPT(`observation`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as observation ");
$single_exams = $this->db->get_where('tbl_exams',array('id' => $id));
if($single_exams->num_rows() > 0){
return $single_exams->row_array();
......@@ -47,9 +49,12 @@ class Exam_model extends CI_Model {
if($res){
return false;
}else{*/
if($this->db->update('tbl_exams',array('exam_procedure'=>encrypt_data(ucfirst($data['exam_procedure'])),'observation'=>encrypt_data(ucfirst($data['observation']))),array('id'=>$id))){
if($this->db->query("update `tbl_exams set `exam_procedure` = AES_ENCRYPT('".$exam_procedure."','Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA'),`observation` = AES_ENCRYPT('".$observation."','Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') where id = $id ")) {
return true;
}
/*if($this->db->update('tbl_exams',array('exam_procedure'=>encrypt_data(ucfirst($data['exam_procedure'])),'observation'=>encrypt_data(ucfirst($data['observation']))),array('id'=>$id))){
return true;
}
}*/
//}
}
}
\ No newline at end of file
......@@ -92,8 +92,8 @@
?>
<tr>
<td class="hidden"><?php echo $exams['id'];?></td>
<td><?php echo decrypt_data($exams['exam_procedure']);?></td>
<td><i><?php echo decrypt_data($exams['observation']);?></i></td>
<td><?php echo $exams['exam_procedure'];?></td>
<td><i><?php echo $exams['observation'];?></i></td>
<td>
<a class='btn btn-sm btn-primary' href='<?php echo base_url(); ?>ManageExams/exams_edit/<?php echo $exams['id']; ?>'> <i class='fa fa-fw fa-edit'></i> Edit </a>
<a class='btn btn-sm btn-danger' href='<?php echo base_url(); ?>ManageExams/exams_delete/<?php echo $exams['id']; ?>'> <i class='fa fa-fw fa-trash'></i> Delete </a>
......
......@@ -44,11 +44,11 @@ if(isset($data)) {
<div class="form-group">
<label>Exam or Procedure</label>
<input type="text" name="exam_procedure" value="<?php echo decrypt_data($data['exam_procedure']);?>" class="form-control required" placeholder="Enter Exams or Procedure" data-parsely-minlength="10" data-parsley-required="true">
<input type="text" name="exam_procedure" value="<?php echo $data['exam_procedure'];?>" class="form-control required" placeholder="Enter Exams or Procedure" data-parsely-minlength="10" data-parsley-required="true">
</div>
<div class="form-group">
<label>Observation</label>
<input type="text" name="observation" value="<?php echo decrypt_data($data['observation']);?>" class="form-control required" placeholder="Enter Observation" data-parsley-required="true">
<input type="text" name="observation" value="<?php echo $data['observation'];?>" class="form-control required" placeholder="Enter Observation" data-parsley-required="true">
</div>
</div><!-- /.box-body -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment