Exemplo n.º 1
0
 function edit()
 {
     $idval = $this->input->get['id'];
     $data['pagename'] = '';
     $this->editproduct = new productModel();
     $res = $this->editproduct->retrieve($idval);
     $data['pro_row'] = $res;
     $this->maincategory = new maincategoryModel();
     $res1 = $this->maincategory->select();
     $data['maincat_row'] = $res1;
     $this->category = new categoryModel();
     $res2 = $this->category->select();
     $data['cat_row'] = $res2;
     $this->subcategory = new subcategoryModel();
     $res3 = $this->subcategory->select();
     $data['subcat_row'] = $res3;
     $this->producttypefound = new producttypeModel();
     $resproducttype = $this->producttypefound->select();
     $data['row_type'] = $resproducttype;
     $this->featurefound = new featureModel();
     $resfeaturefound = $this->featurefound->select();
     $data['row_feature'] = $resfeaturefound;
     $data['body'][] = View::do_fetch(VIEW_PATH . 'admin/product/editproduct.php', $data);
     $data['foot'][] = 'footer of  K-MVC';
     View::do_dump(VIEW_PATH . 'layouts/homelayout.php', $data);
 }
Exemplo n.º 2
0
function _edit_score($OID = 0, $CID = 0)
{
    loginRequireMgmt();
    if (!loginCheckPermission(USER::MGMT_TEAM)) {
        redirect("errors/401");
    }
    $item = "Team";
    $urlPrefix = "mgmt_team";
    $object = new Team();
    $object->retrieve($OID, $CID);
    if (!$object->exists()) {
        $data['body'][] = "<p>{$item} Not Found!</p>";
    } else {
        $fdata['form_heading'] = "Edit {$item} Score";
        $fdata['object'] = $object;
        $fdata['actionUrl'] = myUrl("{$urlPrefix}/ops_update_score");
        $fdata['actionLabel'] = "Submit";
        $fdata['cancelUrl'] = myUrl("{$urlPrefix}/manage");
        $fdata['cancelLabel'] = "Cancel";
        $form = View::do_fetch(VIEW_PATH . "{$urlPrefix}/score_form.php", $fdata);
        $data['head'][] = View::do_fetch(VIEW_PATH . "{$urlPrefix}/score_form_js.php");
        $data['body'][] = "<h2>Edit {$item} Score</h2>";
        $data['body'][] = $form;
    }
    View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
Exemplo n.º 3
0
function _showevents($n = 0)
{
    $n = (int) $n;
    $data['body'][] = '<h2>Show Events</h2><br />';
    _make_html_table($n, $data);
    View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
function _addGrupaMember()
{
    isUserLoggedIn();
    $grupa = new Grupa(getdbh());
    $checkGroup = $grupa->checkGroupRegistration($_POST['userID']);
    if ($checkGroup != false) {
        if ($checkGroup['ID_GRUPA'] != $_POST['grupaID']) {
            $delete = $grupa->deleteGrupaMember($checkGroup['ID']);
        }
    }
    $check = $grupa->checkRegister($_POST['grupaID'], $_POST['userID']);
    if ($check == false) {
        $addMember = $grupa->addGrupaMember($_POST['grupaID'], $_POST['userID']);
        if ($addMember) {
            $data['msg'][] = "Studentul a fost inscris in grupa";
            $data['redirect'][] = 'administrare/show_grup';
            View::do_dump(VIEW_PATH . 'layout.php', $data);
        } else {
            $data['msg'][] = "Eroare la inscriere";
            $data['redirect'][] = 'administrare/show_grup';
            View::do_dump(VIEW_PATH . 'layout.php', $data);
        }
    } else {
        $data['msg'][] = "Studentul este inscris la aceasta grupa";
        $data['redirect'][] = 'administrare/show_grup';
        View::do_dump(VIEW_PATH . 'layout.php', $data);
    }
}
Exemplo n.º 5
0
function _about($mode = "version")
{
    $form = View::do_fetch(VIEW_PATH . 'student/' . $mode . '.php');
    //$data['body'][]='<h2>Add New Topic</h2>';
    $data['body'][] = $form;
    View::do_dump(VIEW_PATH . 'layouts/student.php', $data);
}
function _showAllMat()
{
    $materie = new Materii(getdbh());
    $result['materii'] = $materie->fetchMaterii();
    $data['msg'][] = View::do_fetch(VIEW_PATH . 'showAllMat.tpl.php', $result);
    View::do_dump(VIEW_PATH . 'layout.php', $data);
}
Exemplo n.º 7
0
function _show($OID = 0, $CID = 0)
{
    loginRequireMgmt();
    if (!loginCheckPermission(USER::MGMT_HMB_DATA)) {
        redirect("errors/401");
    }
    $item = "HMB Data";
    $urlPrefix = "mgmt_hmb_data";
    $object = new HMBData();
    $object->retrieve($OID, $CID);
    if (!$object->exists()) {
        $data['body'][] = "<p>{$item} Not Found!</p>";
    } else {
        $fdata['form_heading'] = "Test {$item} -- Todo remove this";
        $fdata['object'] = $object;
        $fdata['actionUrl'] = myUrl("{$urlPrefix}/ops_update");
        $fdata['actionLabel'] = "Submit";
        $fdata['cancelUrl'] = myUrl("{$urlPrefix}/manage");
        $fdata['cancelLabel'] = "Back";
        $form = View::do_fetch(VIEW_PATH . "{$urlPrefix}/show.php", $fdata);
        //$data['head'][]=View::do_fetch(VIEW_PATH."$urlPrefix/form_js.php");
        $data['body'][] = "<h2>Show {$item}</h2>";
        $data['body'][] = $form;
    }
    View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
Exemplo n.º 8
0
function _index()
{
    loginRequireMgmt();
    $data['pagename'] = 'Welcome';
    $data['body'][] = View::do_fetch(VIEW_PATH . 'mgmt_main/index.php');
    View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
Exemplo n.º 9
0
 static function producto($producto)
 {
     if (!$producto->exists()) {
         View::do_dump(APP_PATH . 'views/productos/error.php', array('mensaje' => "El producto seleccionado no existe"));
         exit;
     }
 }
function _request_new_password()
{
    if (isset($_POST['email'])) {
        $user = new User(getdbh());
        $ID = $user->checkEmail($_POST['email']);
        if (isset($ID['ID'])) {
            $setToken = $user->setRecover($ID['ID'], $_POST['email']);
            if ($setToken != false) {
                $body = 'Pentru a schimba parola apasa   <a href="' . WEB_DOMAIN . WEB_FOLDER . 'ops/recover_password/' . $setToken . '"> AICI </a>';
                if (sendEmail('Schimbare parola', $body, '*****@*****.**', $_POST['email'])) {
                    $data['msg'][] = "Emailul cu linkul de resetare a parolei a fost trimis";
                    View::do_dump(VIEW_PATH . 'layout.php', $data);
                } else {
                    $data['msg'][] = "Emailul nu a fost trimis";
                    View::do_dump(VIEW_PATH . 'layout.php', $data);
                }
            } else {
                $data['msg'][] = "Tokenul este gresit sau au trecut mai mult de 2 zile de la cererea de recuperare parola";
                View::do_dump(VIEW_PATH . 'layout.php', $data);
            }
        } else {
            $data['msg'][] = "Acest user nu exista";
            View::do_dump(VIEW_PATH . 'layout.php', $data);
        }
    } else {
        redirect('main/index');
    }
}
Exemplo n.º 11
0
function _newUser()
{
    $user = new User(getdbh());
    $email = $user->checkEmail($_POST['email']);
    if (isset($email['ID'])) {
        $data['msg'][] = " Acest email nu este disponibil! Va rugam alegeti altul!";
        $data['redirect'][] = 'main/new';
        View::do_dump(VIEW_PATH . 'layout.php', $data);
    } else {
        $result = $user->addUser($_POST['email'], $_POST['password1'], $_POST['nume'], $_POST['prenume']);
        if ($result > 0) {
            $setToken = $user->newUserToken($result);
            if ($setToken != false) {
                $body = 'Pentru a activa contul apasa   <a href="' . WEB_DOMAIN . WEB_FOLDER . 'ops/newUserToken/' . $setToken . '"> AICI </a>';
                if (sendEmail('Email confirmare cont', $body, '*****@*****.**', $_POST['email'])) {
                    $data['msg'][] = "Emailul cu linkul de confirmare cont a fost trimis";
                    $data['redirect'][] = 'main/index';
                    View::do_dump(VIEW_PATH . 'layout.php', $data);
                } else {
                    $data['msg'][] = "Emailul cu linkul de confirmare nu a fost trimis";
                    $data['redirect'][] = 'main/index';
                    View::do_dump(VIEW_PATH . 'layout.php', $data);
                }
            } else {
                $data['msg'][] = "Eroare la generarea tokenului";
                $data['redirect'][] = 'main/index';
                View::do_dump(VIEW_PATH . 'layout.php', $data);
            }
        } else {
            $data['msg'][] = "Eroare la crearea contului!";
            $data['redirect'][] = 'main/index';
            View::do_dump(VIEW_PATH . 'layout.php', $data);
        }
    }
}
Exemplo n.º 12
0
function _ver($url = '')
{
    precondition::url($url);
    $producto = new Producto();
    $producto->retrieve_one("url=?", $url);
    precondition::producto($producto);
    View::do_dump(APP_PATH . 'views/productos/ver.php', array('producto' => $producto));
}
Exemplo n.º 13
0
 function paymentsuccess()
 {
     $this->bapuobj = new bapuappModel();
     $res = $this->bapuobj->paymentsuccess($this->input->request['orderid']);
     $data['row'] = $res;
     $data['jsonval'] = $_GET['jsoncallback'];
     View::do_dump(VIEW_PATH . 'bapuapp/guestdetail.php', $data);
 }
Exemplo n.º 14
0
function _addMaterii()
{
    isUserLoggedIn();
    $user = new User(getdbh());
    $result['profesori'] = $user->fetchByType('profesor');
    $data['msg'][] = View::do_fetch(VIEW_PATH . 'addMaterii.tpl.php', $result);
    View::do_dump(VIEW_PATH . 'layout.php', $data);
}
Exemplo n.º 15
0
 function checkout()
 {
     $this->bapuobj = new bapuappModel();
     $res = $this->bapuobj->checkout($this->input->request['name'], $this->input->request['email'], $this->input->request['address'], $this->input->request['country'], $this->input->request['city'], $this->input->request['phone'], $this->input->request['allitem'], $this->input->request['total']);
     $data['row'] = $res;
     $data['jsonval'] = $_GET['jsoncallback'];
     View::do_dump(VIEW_PATH . 'bapuapp/guestdetail.php', $data);
 }
Exemplo n.º 16
0
 function allorder()
 {
     $this->biggiesobj = new biggiesappModel();
     $res = $this->biggiesobj->allorder();
     $data['row'] = $res;
     $data['jsonval'] = $_GET['jsoncallback'];
     View::do_dump(VIEW_PATH . 'bapuapp/guestdetail.php', $data);
 }
Exemplo n.º 17
0
function _editar($url = '')
{
    precondition::url($url);
    $prod = new Producto();
    $prod->retrieve_one("url=?", $url);
    precondition::producto($prod);
    View::do_dump(APP_PATH . 'views/productos/editar.php', array('id' => $prod->id, 'nombre' => $prod->nombre, 'precio' => $prod->precio, 'stock' => $prod->stock, 'url' => $prod->url));
}
Exemplo n.º 18
0
function _login($username = '')
{
    $data['pagename'] = 'Please Login';
    $data['body'][] = '<h2>Please Login to Proceed</h2><br />';
    $data['body'][] = View::do_fetch(VIEW_PATH . 'mgmt_main/login_form.php', array('username' => $username));
    $data['body'][] = '<p>You can login with username="******" and password="******".<br />If that doesnt work try resetting the user database first.</p>';
    View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
function _show_materii()
{
    $materii = new Materii(getdbh());
    $allMaterii = $materii->fetchGroupaAndMateria();
    $result['materii'] = $allMaterii;
    $data['msg'][] = View::do_fetch(VIEW_PATH . 'afisare_materii.tpl.php', $result);
    View::do_dump(VIEW_PATH . 'layout.php', $data);
}
Exemplo n.º 20
0
function _show_grup()
{
    isUserLoggedIn();
    $grupa = new Grupa(getdbh());
    $allGroups = $grupa->fetchAll();
    $result['grupa'] = $allGroups;
    $data['msg'][] = View::do_fetch(VIEW_PATH . 'afisare_grupa.tpl.php', $result);
    View::do_dump(VIEW_PATH . 'layout.php', $data);
}
Exemplo n.º 21
0
function _clear_scores()
{
    $fdata['actionUrl'] = myUrl('ops/clear_scores');
    $fdata['cancelUrl'] = myUrl('mgmt_main/index');
    $data['pagename'] = 'Clear Scores';
    $data['body'][] = '<h2>Warning Submitting this form will clear all scoring data the Database</h2><br/>';
    $data['body'][] = View::do_fetch(VIEW_PATH . 'mgmt_main/clear_scores_form.php', $fdata);
    View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
Exemplo n.º 22
0
function _manage($n = 0)
{
    require_login();
    $n = (int) $n;
    $data['body'][] = '<h2>Manage Users</h2><br />';
    _make_user_table($n, $data);
    $data['body'][] = '<p><a href="' . myUrl('users/add') . '">Add New User</a></p>';
    View::do_dump(VIEW_PATH . 'layouts/mainlayout.php', $data);
}
Exemplo n.º 23
0
 function user()
 {
     $data['pagename'] = '';
     $this->studentlist = new adminloginModel();
     //$data['body'][]=View::do_fetch(VIEW_PATH.'admin/main/homeheader.php',$data);
     $data['body'][] = View::do_fetch(VIEW_PATH . 'users/brandz/index.php', $data);
     $data['foot'][] = 'footer of  K-MVC';
     View::do_dump(VIEW_PATH . 'layouts/layout.php', $data);
 }
Exemplo n.º 24
0
function _resetdb()
{
    $fdata['actionUrl'] = myUrl('ops/resetdb');
    $fdata['cancelUrl'] = myUrl('mgmt_main/index');
    $data['pagename'] = 'Reset Database';
    $data['body'][] = '<h2>Warning Submitting this form will reset the Database</h2><br/>';
    $data['body'][] = View::do_fetch(VIEW_PATH . 'mgmt_main/resetdb_form.php', $fdata);
    View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
Exemplo n.º 25
0
function _show_users()
{
    isUserLoggedIn();
    $user = new User(getdbh());
    $user_details = $user->fetchAll();
    $result['user'] = $user_details;
    $data['msg'][] = View::do_fetch(VIEW_PATH . 'afisare_user.tpl.php', $result);
    View::do_dump(VIEW_PATH . 'layout.php', $data);
}
Exemplo n.º 26
0
function _loaddb()
{
    $fdata['actionUrl'] = myUrl('mgmt_cpa_data/ops_loaddb');
    $fdata['cancelUrl'] = myUrl('mgmt_cpa_data/index');
    $data['pagename'] = 'Load Database';
    $data['body'][] = '<h2>Warning Submitting this form will replace all existing CPS data in the Database</h2><br/>';
    $data['body'][] = View::do_fetch(VIEW_PATH . 'mgmt_cpa_data/loaddb.php', $fdata);
    View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
Exemplo n.º 27
0
function _about($mode = "version")
{
    //loginRequireMgmt();
    //if (!loginCheckPermission(USER::MGMT_TOPIC)) redirect("errors/401");
    $form = View::do_fetch(VIEW_PATH . 'mgmt_main/' . $mode . '.php');
    //$data['body'][]='<h2>Add New Topic</h2>';
    $data['body'][] = $form;
    View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
function _addTemaView()
{
    isUserLoggedIn();
    if (getUserType() == 'profesor') {
        $grupa = new Grupa(getdbh());
        $result['grupa'] = $grupa->fetchAll();
        $data['msg'][] = View::do_fetch(VIEW_PATH . 'addTema.tpl.php', $result);
        View::do_dump(VIEW_PATH . 'layout.php', $data);
    }
}
function _showGrupaDetails($id = 0, $numeGrupa = '')
{
    isUserLoggedIn();
    $grupa = new Grupa(getdbh());
    $result['users'] = $grupa->fetchGrupaUsers($id);
    $result['nume'] = $numeGrupa;
    $result['id'] = $id;
    $data['msg'][] = View::do_fetch(VIEW_PATH . 'showGrupaDetails.tpl.php', $result);
    View::do_dump(VIEW_PATH . 'layout.php', $data);
}
Exemplo n.º 30
0
 function tinindex()
 {
     $data['pagename'] = '';
     $this->tin = new tinModel();
     $res = $this->tin->select();
     $data['tin'] = $res;
     $data['body'][] = View::do_fetch(VIEW_PATH . 'tax/tin.php', $data);
     $data['foot'][] = 'footer of  K-MVC';
     View::do_dump(VIEW_PATH . 'layouts/homelayout.php', $data);
 }