Example #1
0
 /**
  * Index Page for this controller.
  *
  * Maps to the following URL
  * 		http://example.com/index.php/welcome
  *	- or -
  * 		http://example.com/index.php/welcome/index
  *	- or -
  * Since this controller is set as the default controller in
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  * @see http://codeigniter.com/user_guide/general/urls.html
  */
 function __construct()
 {
     parent::__construct();
     $this->load->model('Mdl_Accounts', '', TRUE);
     $this->load->helper("utility");
     $this->load->helper("email");
 }
Example #2
0
 public function edit($arg = null)
 {
     $account = new stdClass();
     if ($arg != null) {
         $account = $this->Mdl_Accounts->get($arg);
         $account->isNew = false;
     } else {
         $account->isNew = true;
         $account->id = gen_uuid();
         $account->username = "";
         $account->firstname = "";
         $account->lastname = "";
         $account->status = 1;
         $account->role = "administrator";
     }
     $arrRoles = ["Free user", "Concreteprotector"];
     $account->rolesHTML = "<select name='role'>";
     foreach ($arrRoles as $role) {
         $selected = "";
         $selected = $role == $account->role ? " selected " : "";
         $Role = ucfirst($role);
         $account->rolesHTML .= "<option {$selected} value='{$role}'>{$Role}</option>";
     }
     $account->rolesHTML .= "</select>";
     parent::initView(get_class($this) . '/edit', 'Accounts', 'Edit account information.', $account);
     parent::loadView();
 }
Example #3
0
 /**
  * Index Page for this controller.
  *
  * Maps to the following URL
  * 		http://example.com/index.php/welcome
  *	- or -
  * 		http://example.com/index.php/welcome/index
  *	- or -
  * Since this controller is set as the default controller in
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  * @see http://codeigniter.com/user_guide/general/urls.html
  */
 function __construct()
 {
     parent::__construct();
     $this->load->model('Mdl_Dashboard', '', TRUE);
     $this->load->model('Mdl_Accounts');
     //$this->load->model('Mdl_Requests');
     //$this->load->model('Mdl_Prays');
 }
Example #4
0
 public function edit($id = null)
 {
     $record = new stdClass();
     $ings = $this->Mdl_Systems->getIngredients();
     if ($id != null) {
         $record = $this->Mdl_Systems->get($id);
         $record->isNew = false;
     } else {
         $record->isNew = true;
         $record->id = gen_uuid();
         $record->name = "";
         $record->saleprice = "";
         $record->share = "f";
         $record->status = true;
     }
     $share = "";
     $active = "";
     if ($record->share == "t") {
         $share = "checked";
     }
     if ($record->status) {
         $active = "checked";
     }
     $record->shareHTML = "<input {$share} id='share' type='checkbox' name='_share'><label for='share'>&nbsp;&nbsp;Share</label>";
     $record->activeHTML = "<input {$active} id='status' type='checkbox' name='_status'><label for='status'>&nbsp;&nbsp;Active</label>";
     /*
     	Colors....
     */
     $record->ingredientsHTML = "";
     foreach ($ings as $ing) {
         $checked = "";
         $extra = "";
         $factor = "";
         if (!$record->isNew) {
             foreach ($record->selIngs as $selIng) {
                 if ($selIng->ingredientid == $ing->id) {
                     $checked = "checked";
                     $extra = $selIng->extra;
                     $factor = $selIng->factor;
                 }
             }
         }
         $record->ingredientsHTML .= "<div class='row ing'>";
         $record->ingredientsHTML .= "<div class='col-md-8'>";
         $record->ingredientsHTML .= "<input {$checked} id='{$ing->id}' type='checkbox' name='{$ing->id}' value='1'><label for='{$ing->id}'>&nbsp;&nbsp;{$ing->name}</label><br>";
         $record->ingredientsHTML .= "</div>";
         $record->ingredientsHTML .= "<div class='col-md-2'>";
         $record->ingredientsHTML .= "<div class='row item'><div class='col-md-4'><label >{$ing->purchaseprice}</label></div><div class='col-md-8'><input class='_extra' name='{$ing->id}' value='{$extra}'/></div>";
         $record->ingredientsHTML .= "</div></div>";
         $record->ingredientsHTML .= "<div class='col-md-2'>";
         $record->ingredientsHTML .= "<div class='row item'><div class='col-md-4'><label >Units extra</label></div><div class='col-md-8'><input class='_factor' name='{$ing->id}' value='{$factor}'/></div>";
         $record->ingredientsHTML .= "</div></div>";
         $record->ingredientsHTML .= "</div>";
     }
     parent::initView("Systems/edit", "Systems", 'Edit Systems information.', $record);
     parent::loadView();
 }
Example #5
0
 public function edit($id = null)
 {
     $color = new stdClass();
     if ($id != null) {
         $color = $this->Mdl_Patterns->get($id);
         $color->isNew = false;
     } else {
         $color->isNew = true;
         $color->id = gen_uuid();
         $color->name = "";
     }
     parent::initView("Patterns/edit", "Patterns", 'Edit pattern information.', $color);
     parent::loadView();
 }
Example #6
0
 public function edit($id = null)
 {
     $color = new stdClass();
     if ($id != null) {
         $color = $this->Mdl_Colors->get($id);
         $color->isNew = false;
     } else {
         $color->isNew = true;
         $color->id = gen_uuid();
         $color->name = "";
     }
     parent::initView(get_class($this) . '/edit', 'Colors', 'Edit color information.', $color);
     parent::loadView();
 }
 public function edit($id = null)
 {
     $record = new stdClass();
     $colors = $this->Mdl_Ingredients->getColors();
     $patterns = $this->Mdl_Ingredients->getPatterns();
     if ($id != null) {
         $record = $this->Mdl_Ingredients->get($id);
         $record->isNew = false;
     } else {
         $record->isNew = true;
         $record->id = gen_uuid();
         $record->name = "";
         $record->coverage = "";
         $record->purchaseprice = "";
     }
     /*
     	Colors....
     */
     $record->colorsHTML = "";
     foreach ($colors as $col) {
         $checked = "";
         if (!$record->isNew) {
             foreach ($record->selectedColors as $selCol) {
                 if ($selCol->colorid == $col->id) {
                     $checked = "checked";
                 }
             }
         }
         $record->colorsHTML .= "<input {$checked} id='{$col->id}' type='checkbox' name='{$col->id}' value='1'><label for='{$col->id}'>&nbsp;&nbsp;{$col->name}</label><br>";
     }
     /*
     	Patterns....
     */
     $record->patternsHTML = "";
     foreach ($patterns as $pat) {
         $checked = "";
         if (!$record->isNew) {
             foreach ($record->selectedPatterns as $selPat) {
                 if ($selPat->patternid == $pat->id) {
                     $checked = "checked";
                 }
             }
         }
         $record->patternsHTML .= "<input {$checked} id='{$pat->id}' type='checkbox' name='{$pat->id}' value='1'><label for='{$pat->id}'>&nbsp;&nbsp;{$pat->name}</label><br>";
     }
     parent::initView("Ingredients/edit", "Ingredients", 'Edit ingredient information.', $record);
     parent::loadView();
 }
Example #8
0
 public function __construct()
 {
     parent::__construct();
 }