Server IP : 68.65.122.142 / Your IP : 18.226.88.240 Web Server : LiteSpeed System : Linux server167.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64 User : glenirhm ( 1318) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/glenirhm/moodledata/../mygc.glenbowcollege.ca/admin/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php // We need to use sessions, so you should always start sessions using the below code. session_start(); // If the user is not logged in redirect to the login page... if (!isset($_SESSION['loggedin'])) { header('Location: index.html'); exit; } error_reporting(E_ALL); // speed things up with gzip plus ob_start() is required for csv export if(!ob_start('ob_gzhandler')) ob_start(); header('Content-Type: text/html; charset=utf-8'); include('lazy_mofo.php'); include('../common/header_admin.php'); include('../common/connectPDO.php'); // create LM object, pass in PDO connection, see i18n folder for country + language options $lm = new lazy_mofo($pdo, 'en-us'); // table name for updates, inserts and deletes $lm->table = 'student'; // identity / primary key for table $lm->identity_name = 'id'; // optional, define output control on the grid $lm->grid_output_control['email'] = array('type' => 'email'); // make email clickable $lm->form_input_control['confirmed'] = array('type' => 'radio', 'sql' => "select 0, 'No' union select 1, 'Conditionally' union select 2, 'Yes'"); // optional, define editable input controls on the grid //$lm->grid_input_control['confirmed'] = array('type' => 'checkbox'); // show search box, but _search parameter still needs to be passed to query below $lm->grid_show_search_box = true; // query to define grid view // IMPORTANT - last column must be the identity/key for [edit] and [delete] links to appear // include an 'order by' to prevent potential parsing issues $lm->grid_sql = " select id , fname , lname , id from student order by lname desc "; // bind parameter for grid query $lm->grid_sql_param[':_search'] = '%' . trim(@$_REQUEST['_search']) . '%'; // optional, define what is displayed on edit form. identity id must be passed in also. $lm->form_sql = " select id , confirmed , id from student where id = :id "; // bind parameter for form query $lm->form_sql_param[':id'] = @$_REQUEST['id']; // copy validation rules, same rules when updating $lm->on_update_validate = $lm->on_insert_validate; // Naci: Trying to get the form data $lm->on_update_user_function = 'send_email'; function send_email(){ $_SESSION["id"] = $_REQUEST['id']; $id = $_REQUEST['id']; // Do whatever you want except for a return statement here. That would interrupt the actual update process //$link = "<script>window.open('http://localhost/www/mojum/sis/admin/admin2student_email.php', 'width=710,height=555,left=160,top=170')</script>"; } // run the controller $lm->run(); echo "</body></html>";