D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
alumni
/
application
/
controllers
/
admin
/
Filename :
Gallary.php
back
Copy
<?php /** * Description of User * * @author Softpro India Pvt. Ltd. */ class Gallary extends CI_Controller { //put your code here public function __construct() { parent::__construct(); $this->load->model("admin/GallaryManagement"); } public function setGallaryLimit() { if ($this->sessionvalidator->validateSession() && $this->sessionvalidator->getRole() == "Master Admin") { $viewData["limitData"] = $this->GallaryManagement->getGallaeryLimits()->result(); $this->load->view("admin/setGallaryLimit",$viewData); } else { redirect("admin/"); } } public function saveGallaryLimits() { if ($this->sessionvalidator->validateSession() && $this->sessionvalidator->getRole() == "Master Admin") { $this->form_validation->set_rules("lim_for", "limit for", "required", array("required" => "Select Limit For.")); $this->form_validation->set_rules("lim_pics", "pic count", "required|numeric", array("required" => "Enter Pic Count.", "numeric" => "Pic Count Must Be Numeric.")); if ($this->form_validation->run() == false) { $this->setGallaryLimit(); } else { $lim_for = $this->input->post("lim_for"); $lim_pics = $this->input->post("lim_pics"); if ($lim_pics > 0) { $gallaryLimitDetails = array( "lim_for" => $lim_for, "lim_pics" => $lim_pics); if ($this->GallaryManagement->saveGallaryLimits($gallaryLimitDetails)) { $this->session->set_flashdata("successMessage", "Gallary Limit Set Succesfully."); redirect(current_url()); } else { $this->session->set_flashdata("errorMessage", "Failed To Set Gallary Limit."); $this->setGallaryLimit(); } } else { $this->session->set_flashdata("errorMessage", "Pic Count Cannot be zero(0)."); $this->setGallaryLimit(); } } } else { redirect("admin/"); } } }