Server IP : 68.65.122.142  /  Your IP : 18.222.46.156
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/mygc.glenbowcollege.ca/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/glenirhm/mygc.glenbowcollege.ca/admin/records_documents.php
<?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'");
$lm->grid_output_control['picture_id_name'] = array('type' => 'image');         // make image clickable  
$lm->grid_output_control['test_result_upload'] = array('type' => 'image');  
$lm->grid_output_control['diploma_upload'] = array('type' => 'image');  
$lm->grid_output_control['amendment_student_contract_upload'] = array('type' => 'image');         // make image clickable  
$lm->grid_output_control['enrollment_contract_upload'] = array('type' => 'image');  
$lm->grid_output_control['signature_page_upload'] = array('type' => 'image');  
// 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
, picture_id_name
, diploma_upload
, test_result_upload
, amendment_student_contract_upload
, enrollment_contract_upload
, signature_page_upload
from student

order by lname desc
";

// bind parameter for grid query
$lm->grid_sql_param[':_search'] = '%' . trim(@$_REQUEST['_search']) . '%';

// copy validation rules, same rules when updating
$lm->on_update_validate = $lm->on_insert_validate;  

// run the controller
$lm->run();

echo "</body></html>";