favourite added
This commit is contained in:
parent
ac7950fe8b
commit
b0852aeaa1
50
application/controllers/user.php
Normal file → Executable file
50
application/controllers/user.php
Normal file → Executable file
@ -1519,15 +1519,51 @@ function deliver_perform()
|
|||||||
|
|
||||||
$this->loadviews("deliver_perform",$this->global,$data,NULL);
|
$this->loadviews("deliver_perform",$this->global,$data,NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
*favourite add function and load view
|
||||||
|
*/
|
||||||
|
|
||||||
|
function favourite()
|
||||||
|
{
|
||||||
|
$this->global['pageTitle'] = 'Siddharth :Favourite ';
|
||||||
|
|
||||||
|
|
||||||
|
// $data['ponoreset']=$this->purchaseorder_model->ponoresetfinyear();
|
||||||
|
|
||||||
|
|
||||||
|
$this->loadViews("Favourite", $this->global,Null);
|
||||||
|
|
||||||
|
}
|
||||||
|
function favouriteadd()
|
||||||
|
{
|
||||||
|
$name = $this->input->post('name');
|
||||||
|
$url = $this->input->post('url');
|
||||||
|
$status = $this->input->post('status');
|
||||||
|
$CreateBy = $this->session->userdata ( 'userId' );
|
||||||
|
|
||||||
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
|
$createddt = $dt->format('Y-m-d H:i:s');
|
||||||
|
$menu = $this->input->post('menu');
|
||||||
|
// $RowCount = $this->input->post('txtRowCount');
|
||||||
|
// $DeletedRow = $this->input->post('txtDeletedRow');
|
||||||
|
// $comma_separated = explode(':', $DeletedRow);
|
||||||
|
$favourite = array('Menu_Name'=>$name,'Menu_URL'=>$url,'Status'=>$status,'Created_BY'=>$CreateBy,'Created_ON'=>$createddt,'Menu_ID'=>$menu);
|
||||||
|
$getdata= $this->user_model->favouriteadd($favourite);
|
||||||
|
// print_r($favourite);
|
||||||
|
// die();
|
||||||
|
if($getdata==1)
|
||||||
|
|
||||||
|
{
|
||||||
|
echo"success";
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo"failed";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -47,4 +47,16 @@ if(!function_exists('verifyHashedPassword'))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_fav($user)
|
||||||
|
{
|
||||||
|
$CI = &get_instance();
|
||||||
|
$CI->load->database();
|
||||||
|
|
||||||
|
$CI->db->where('Created_BY',$user);
|
||||||
|
$CI->db->where('Status',1);
|
||||||
|
return $CI->db->get('T_fav_add')->result();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -286,6 +286,29 @@ GROUP BY financial_year ";
|
|||||||
return $query->result();
|
return $query->result();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*fav model
|
||||||
|
*/
|
||||||
|
function favouriteadd($favourite)
|
||||||
|
|
||||||
|
{ //echo $favourite['Menu_ID'];die;
|
||||||
|
if($favourite['Menu_ID'] !=''){
|
||||||
|
//echo "if";
|
||||||
|
|
||||||
|
// $this->db->where('id', $id);
|
||||||
|
// return $this->db->delete('employee');
|
||||||
|
$this->db->where('Menu_ID',$favourite['Menu_ID']);
|
||||||
|
$this->db->delete('T_fav_add');
|
||||||
|
|
||||||
|
}else{
|
||||||
|
//echo "else";
|
||||||
|
|
||||||
|
$this->db->insert('T_fav_add',$favourite);
|
||||||
|
$r = $this->db->affected_rows();
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1207
application/views/Favourite.php
Normal file
1207
application/views/Favourite.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -206,6 +206,50 @@ display: none;
|
|||||||
<section class="sidebar"><!-- sidebar menu: : style can be found in sidebar.less -->
|
<section class="sidebar"><!-- sidebar menu: : style can be found in sidebar.less -->
|
||||||
<ul class="sidebar-menu">
|
<ul class="sidebar-menu">
|
||||||
<!-- <li class="header">MAIN NAVIGATION</li> -->
|
<!-- <li class="header">MAIN NAVIGATION</li> -->
|
||||||
|
|
||||||
|
<li class="treeview">
|
||||||
|
<a href="">
|
||||||
|
<i class="fa fa-star-half-o"></i>
|
||||||
|
<span>Favourite Added</span>
|
||||||
|
<span class="pull-right-container">
|
||||||
|
<span class="fa fa-angle-down pull-right"></span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ul class="treeview-menu">
|
||||||
|
<?php
|
||||||
|
$fav = get_fav($this->session->userdata('userId'));
|
||||||
|
foreach($fav as $index=>$favget) {
|
||||||
|
if($index <=6){
|
||||||
|
$menu = $favget->Menu_URL;
|
||||||
|
//echo $menu?>
|
||||||
|
<li><a href='<?php echo base_url().$menu ?>'>
|
||||||
|
|
||||||
|
<!-- <i class="fa fa-arrow-circle-up"></i>
|
||||||
|
--> <span><?php echo $favget->Menu_Name ?></span>
|
||||||
|
</a>
|
||||||
|
<?php
|
||||||
|
}} ?>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</li><!--FavouriteAdded active treeview -->
|
||||||
|
<!-- FavouriteAdded Ends -->
|
||||||
|
|
||||||
|
<!-- Favourite Starts -->
|
||||||
|
|
||||||
|
<li class="treeview">
|
||||||
|
<a href="<?php echo base_url(); ?>user/Favourite">
|
||||||
|
<i class="fa fa-star"></i><span>Favourite</span>
|
||||||
|
<span class="pull-right-container">
|
||||||
|
|
||||||
|
<!-- <i class="fa fa-angle-right pull-right"></i> -->
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li><!--Favourite active treeview -->
|
||||||
|
<!-- Favourite Ends -->
|
||||||
|
|
||||||
|
|
||||||
<!-- Dashboard Starts -->
|
<!-- Dashboard Starts -->
|
||||||
|
|
||||||
<li class="active treeview">
|
<li class="active treeview">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user