/** * Get settings data from DB. * * @access private * @return array */ private function getDataFromDB() { $data = array(); $query = $this->db->query("\n\t\t\tSELECT setting_name, setting_value\n\t\t\tFROM ts_system_settings\n\t\t\tORDER BY id\n\t\t"); while (($row = $this->db->fetchAssoc($query)) != NULL) { $data[$row['setting_name']] = $row['setting_value']; } return $data; }
/** * Add new user to database. Check if all fields were correctly filled in * and were they filled at all. Also check is there already user with such * user name and email. * * @access public * @param string User name. * @param string User password. * @param string Re-typed user password. * @param string User email. */ public function signUp($username = "", $userpass = "", $reuserpass = "", $email = "") { # Check for emptyness if ($this->validator->required($username, $userpass, $reuserpass, $email)) { # Compare passwords if ($this->validator->compareVals($userpass, $reuserpass)) { $userData = array('username' => $username, 'email' => $email); # Before adding, check does such user already exist if (!$this->chkUserExistance($userData)) { # Let us control is it first user or no # If he/she is first user, then it is probably admin $userCount = $this->db->fetchAssoc("SELECT COUNT(1) AS total FROM ts_users"); if ($userCount['total'] == 0) { $userGroup = 1; } else { $userGroup = 2; } # Add new user to database $this->db->query("\n\t\t\t\t\t\tINSERT INTO ts_users(\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tusername,\n\t\t\t\t\t\t\tuserpass,\n\t\t\t\t\t\t\temail,\n\t\t\t\t\t\t\tugroup\n\t\t\t\t\t\t) VALUES(\n\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t'" . $this->db->escapeVal($username) . "',\n\t\t\t\t\t\t\t'" . $this->db->escapeVal($this->hashPassword($username, $userpass)) . "',\n\t\t\t\t\t\t\t'" . $this->db->escapeVal($email) . "',\n\t\t\t\t\t\t\t" . $this->db->escapeVal($userGroup) . "\n\t\t\t\t\t\t)\n\t\t\t\t\t"); } } } # Redirect to main page header("Location: / "); }
public function query($sql, $errorLevel = E_USER_ERROR) { if (in_array(strtolower(substr($sql, 0, strpos($sql, ' '))), $this->writeQueries)) { throw new Exception("Attempted to write to readonly database"); } return parent::query($sql, $errorLevel); }
public function query($sql, $errorLevel = E_USER_ERROR) { $query = new stdClass(); $query->query = $sql; $query->source = ''; $query->count = 0; $trace = $this->userCaller(); if ($trace) { $query->source = 'Line ' . $trace['line'] . ' in ' . $trace['file']; } $this->queryRecord[] = $query; if (isset($this->allQueries[$sql])) { $cur = isset($this->duplicateQueries[$sql]) ? $this->duplicateQueries[$sql] : $query; if (!isset($cur->count)) { $cur->query = $sql; $cur->count = 0; } $cur->count = $cur->count + 1; if ($cur->count > 2 && !isset($cur->source)) { // lets see where it's coming from $trace = $this->userCaller(); if ($trace) { $cur->source = 'Line ' . $trace['line'] . ' in ' . $trace['file']; } } $this->duplicateQueries[$sql] = $cur; } // mark as having executed this query $this->allQueries[$sql] = true; return parent::query($sql, $errorLevel); }
/** * If a write query is detected, hand it off to the configured write database * * @param string $sql * @param int $errorLevel * @return \MySQLQuery */ public function query($sql, $errorLevel = E_USER_ERROR) { if (in_array(strtolower(substr($sql, 0, strpos($sql, ' '))), $this->writeQueries) || $this->writePerformed) { $alternateReturn = $this->writeDb()->query($sql, $errorLevel); $this->writePerformed = true; return $alternateReturn; } return parent::query($sql, $errorLevel); }
/** * * @param string $sql * @param integer $errorLevel * @return SS_Query */ public function query($sql, $errorLevel = E_USER_ERROR) { $query = parent::query($sql, $errorLevel); if (isset($_REQUEST['showqueries']) && Director::isDev()) { $count = 1 + (int) Config::inst()->get('MySQLDebuggableDatabase', 'queries_count'); Config::inst()->update('MySQLDebuggableDatabase', 'queries_count', $count); Debug::message(PHP_EOL . 'Query Counts: ' . $count . PHP_EOL, false); } return $query; }
/** * Add new ticket into database. * * @access public * @param int Selected urgency. * @param int Selected category. * @param string Subject of the ticket. * @param string Content of the ticket. */ public function addTicket($urgency, $services, $subject = "", $content = "") { if ($this->validator->required($urgency, $services, $subject, $content)) { $query1 = $this->chkTicketExistance("table", "ts_ticket_topic", "subject", $subject); $query2 = $this->chkTicketExistance("table", "ts_ticket_topic", "content", $content); if (!$query1 && !$query2) { // Later user method whoIsFromStaff $this->db->query("\n\t\t\t\t\tINSERT INTO ts_ticket_topic(\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tauthor_id,\n\t\t\t\t\t\trecepient_id,\n\t\t\t\t\t\tsubject,\n\t\t\t\t\t\tdate_time,\n\t\t\t\t\t\tcategory_id,\n\t\t\t\t\t\tpriority_id,\n\t\t\t\t\t\tstatus_id,\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t\tuser_ip\n\t\t\t\t\t) VALUES(\n\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t" . $this->db->escapeVal($_SESSION['id']) . ",\n\t\t\t\t\t\t1,\n\t\t\t\t\t\t'" . $this->db->escapeVal($subject) . "',\n\t\t\t\t\t\tNOW(),\n\t\t\t\t\t\t" . $this->db->escapeVal($services) . ",\n\t\t\t\t\t\t" . $this->db->escapeVal($urgency) . ",\n\t\t\t\t\t\t1,\n\t\t\t\t\t\t'" . $this->db->escapeVal($this->validator->eliminateTags($content)) . "',\n\t\t\t\t\t\t'" . $this->db->escapeVal($_SERVER['REMOTE_ADDR']) . "'\n\t\t\t\t\t)\n\t\t\t\t"); } } header("Location: / "); }
/** * Main method. * Returns resource with selected entries. * * @access public * @param int Select on what page user is currebtly. * @return resource */ public function paginate($page_num = '') { if ($page_num == '' || $page_num == 1) { $this->curPage = 1; } else { $this->curPage = $page_num; } $this->pageCheck = $this->chkPageNr($this->curPage); $this->startFrom = ($this->curPage - 1) * $this->entryPerPage; if ($this->user->isAdmin()) { $this->entriesToDisplay = $this->db->query("\n\t\t\t\tSELECT id, date_time, category_name, subject, status_name, priority_name\n\t\t\t\tFROM ts_tickets_view\n\t\t\t\tWHERE status_name = 'Opened'\n\t\t\t\tLIMIT " . $this->db->escapeVal($this->startFrom) . ", " . $this->db->escapeVal($this->entryPerPage)); } else { $this->entriesToDisplay = $this->db->query("\n\t\t\t\tSELECT id, date_time, category_name, subject, status_name, priority_name\n\t\t\t\tFROM ts_tickets_view\n\t\t\t\tWHERE author_id = " . $this->db->escapeVal($this->user->id) . "\n\t\t\t\tLIMIT " . $this->db->escapeVal($this->startFrom) . ", " . $this->db->escapeVal($this->entryPerPage)); } return $this->entriesToDisplay; }
$database = new MySQLDatabase(); $faculty = htmlspecialchars($_POST['faculty_id'], ENT_QUOTES); $department = htmlspecialchars($_POST['department_id'], ENT_QUOTES); $state = htmlspecialchars($_POST['state'], ENT_QUOTES); $gender = htmlspecialchars($_POST['gender'], ENT_QUOTES); $admission_status = htmlspecialchars($_POST['admission_status'], ENT_QUOTES); $form_id = htmlspecialchars($_POST['form_id'], ENT_QUOTES); $applicant_name = htmlspecialchars($_POST['applicant_name'], ENT_QUOTES); $date_from = htmlspecialchars($_POST['date_from'], ENT_QUOTES); $date_to = htmlspecialchars($_POST['date_to'], ENT_QUOTES); $arrayDateSpec = array(); if ($date_from != NULL && $date_to != NULL) { $arrayDateSpec = array($date_from, $date_to); } if ($faculty != 'all') { $faculty_details_result = $database->query("SELECT * FROM faculty WHERE faculty_id='" . $faculty . "'"); $faculty_details = $database->fetch_array($faculty_details_result); $faculty_code = $faculty_details['faculty_code']; } else { $faculty_code = 'all'; } if ($state != 'all') { $lga_result = $database->query("SELECT lga_id FROM lga WHERE state_id = '" . $state . "'"); $lga = array(); while ($row = $database->fetch_array($lga_result)) { array_push($lga, $row); } } $array_values = array('p.student_status' => $faculty_code, 'p.programme_applied_id' => $department, 'state_id' => $state, 'p.gender' => $gender, 'ads.status' => $admission_status, 'p.form_id' => $form_id, 'applicant_name' => $applicant_name, 'date' => $arrayDateSpec); function admission_status($status) {
function form_id_generator($applicant_id, $programme) { //get the length of random number to generate $random_number_length = 6 - strlen($applicant_id); //get d last two digits of the session $database = new MySQLDatabase(); $selectsessionsql = $database->query("SELECT session FROM application_status WHERE id=1"); $result = $database->fetch_array($selectsessionsql); $year = explode('/', $result['session']); $year = substr($year[0], 2, 2); $random_number = rand(pow(10, $random_number_length - 1), pow(10, $random_number_length) - 1); // The function returns year, programme return $year . $programme . $random_number . $applicant_id; }
<?php include_layout_template('admin_menu.php'); ?> <div class="span9"> <h2>Send Mail To Admin</h2> <hr> <h3>Note:</h3> <ul> <li>This function is used for sending of mails to other admins</li> <li>You will be required to enter your unijos mail password before you can send the mail</li> </ul> <?php $database = new MySQLDatabase(); $sql_all_users = $database->query("SELECT * FROM admin_users"); $admin_details = AdminLog::find_by_sql("SELECT * FROM admin_users WHERE user_id='" . $session->applicant_id . "'"); $admin_details = array_shift($admin_details); ?> <form action="" method="POST" class="form-horizontal sendmail" id="sendmail" > <div class="control-group"> <label class="control-label" for="inputEmail">Email: </label> <div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-envelope"></i></span> <input type="text" class="input-large" value="<?php echo $admin_details->email; ?> " id="email" name="email" readonly /> </div>
$lname = $db->sanitizeInput($_POST['lastname']); $email = $db->sanitizeInput($_POST['email']); $phonenum = $db->sanitizeInput($_POST['phonenumber']); $username = $_SESSION['valid_user']; //$teams_checked = sanitize_input_for_db($_POST['team']); $password = sha1($_POST['password']); $address = $db->sanitizeInput($_POST['address']); $city = $db->sanitizeInput($_POST['city']); $state = $db->sanitizeInput($_POST['state']); $zip = $db->sanitizeInput($_POST['zip']); $table = 'member'; //check to see if password is entered echo "confirmed passwd: " . $_POST['confirm_password'] . "\n"; echo "passwd: " . $_POST['password']; if ($_POST['password'] == $_POST['confirm_password']) { $query = "UPDATE {$table} SET fname = '{$fname}', lname='{$lname}', password='******', phone_number='{$phonenum}', street='{$address}', city='{$city}', state='{$state}', zip='{$zip}' \r\n\t\tWHERE username='******'"; $result = $db->query($query); $message = "Your account had been updated successfully."; } else { $message = "Both password must be the same, Please try again"; } $db->closeConnection(); //diplay message $wp = new WebPages("NVC Account Update"); echo $wp->content_area_tag; $wp->displayLeftMenus(); $wp->displayContentFullWidthWithLeftMenu($message); $wp->displayFooter(); echo $wp->content_area_tag_end; echo $wp->wrapper_tag_end; echo $wp->body_tag_end;
<input type="text" readonly name="applicant_number" placeholder="Applicant Number" class="input-xlarge" value="<?php echo $result->student_id; ?> " /> </div> </div> </div> <div class="control-group"> <label class="control-label">Response Description</label> <div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-chevron-down"></i></span> <select class="input-xlarge" name="approval_status" id="approval_status" > <?php $arrayDescription = $database->query("SELECT * FROM interswitch_error_code WHERE status=1"); while ($rowDesc = $database->fetch_array($arrayDescription)) { if ($rowDesc['response_code'] == $result->ResponseCode) { echo '<option selected="selected" value="' . $rowDesc['response_code'] . '">' . $rowDesc['response_description'] . '</option>'; } else { echo '<option value="' . $rowDesc['response_code'] . '">' . $rowDesc['response_description'] . '</option>'; } } ?> </select> </div> </div> </div> <div class="control-group"> <label class="control-label">Amount</label>
<div class="input-prepend"> <span class="add-on"><i class="iconic-hash"></i></span> <input type="text" class="input-xlarge" required id="app_no" name="app_no" value="<?php if (isset($application_no)) { echo $application_no; } ?> " readonly="readonly" /> </div> </div> </div> <!-- Title --> <?php $sql_title = "SELECT * FROM titles WHERE title_visible = 1"; $result = $database->query($sql_title); ?> <div class="control-group"> <label class="control-label" for="inputTitle">Title</label> <div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-chevron-down"></i></span> <select class="input-xlarge" name="title_id" id="title_id" > <option value="">--Title--</option> <?php while ($row = $database->fetch_array($result)) { if ($row['id'] == $user->title_id) { echo '<option selected="selected" value="' . $row['id'] . '">' . $row['title_name'] . '</option>'; } else { echo '<option value="' . $row['id'] . '">' . $row['title_name'] . '</option>'; }
if (!$session->is_logged_in()) { redirect_to('index.php'); } $user = new User(); $user->applicant_id = $session->applicant_id; $progress = $user->find_by_sql("SELECT progress FROM personal_details WHERE applicant_id='" . $user->applicant_id . "'"); $progress = array_shift($progress); if ($progress->progress != 'Completed') { redirect_to('application_form.php'); } $student_status = $user->get_student_status(); $database = new MySQLDatabase(); ?> <?php $personal_details = $database->query("SELECT * FROM personal_details p, title t, lga l, state s, religion r, nationality n, department d, faculty f, next_of_kin next, marital mar, photographs photo WHERE p.applicant_id='" . $session->applicant_id . "' AND p.title_id=t.title_id AND p.lga_id=l.lga_id AND l.state_id=s.state_id AND p.religion_id=r.religion_id AND p.country_id=n.country_id AND p.programme_applied_id=d.department_id AND d.faculty_id=f.faculty_id AND p.applicant_id=next.applicant_id AND p.applicant_id=photo.applicant_id AND p.marital_status=mar.marital_status_id"); $personal_details = $database->fetch_array($personal_details); ?> <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>University of Jos, Nigeria - <?php echo $personal_details['faculty_name']; ?> Complete Application Form</title> <?php require_once LIB_PATH . DS . 'javascript.php'; require_once LIB_PATH . DS . 'css.php'; ?> <style type="text/css">
echo $result->pin; ?> " /> </div> </div> </div> <div class="control-group"> <label class="control-label">Amount</label> <div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-chevron-down"></i></span> <select class="input-xlarge" name="amount" id="amount" > <?php $naira = '₦'; $arrayAmount = $database->query("SELECT * FROM form_amount WHERE status=1"); while ($row = $database->fetch_array($arrayAmount)) { $amountformat = $row['amount'] * 100 . '.00'; if ($amountformat == $result->amount) { echo '<option selected="selected" value="' . $row['amount'] . '">' . $naira . $row['amount'] . '</option>'; } else { echo '<option value="' . $row['amount'] . '">' . $naira . $row['amount'] . '</option>'; } } ?> </select> </div> </div> </div> <div class="control-group">
<?php $db = new MySQLDatabase(); $session = new Session(); $applicant_fullname = User::applicant_fullname($session->applicant_id); $result_details = User::find_by_id($session->applicant_id); $display_greeting = greeting(); /**/ $active_sql = "SELECT COUNT(*) FROM `applicant_notifications` WHERE status = 1 AND recipient_id = " . $session->applicant_id; $total_active = $db->query($active_sql); $total_active = $db->fetch_array($total_active); $total_active = array_shift($total_active); $inactive_sql = "SELECT COUNT(*) FROM `applicant_notifications` WHERE status = 2 AND recipient_id = " . $session->applicant_id; $total_inactive = $db->query($inactive_sql); $total_inactive = $db->fetch_array($total_inactive); $total_inactive = array_shift($total_inactive); $admissions = new Admission(); $sql = "select * from admission_status where applicant_id='" . $session->applicant_id . "'"; $admissions = Admission::find_by_sql($sql); foreach ($admissions as $admission) { $time = $admission->time_completed_application; $academic_session = $admission->academic_session; $status = $admission->status; $reason_ = $admission->reason; } ?> <div class="navbar"> <div class="navbar-inner"> <a class="brand" href="#"></a> <ul class="nav nav-tabs"> <li class="active"><a href="home.php"><span><i class="icon-home"></i> </span> Home</a></li>
</div> <table class="table table-hover table-stripped"> <thead> <tr> <th>S/N</th> <th>Passport</th> <th>Full Name</th> <th>Email</th> <th>Details</th> </tr> </thead> <tbody> <?php $db = new MySQLDatabase(); $credits = $db->query("SELECT * FROM credits WHERE status='active' ORDER BY credit_id ASC"); $numrows = $db->num_rows($credits); $passport_path = "documents" . DS . "credit_passports" . DS; $serial_no = 1; $numrows; while ($row = $db->fetch_array($credits)) { $mail = str_replace("@", "[at]", $row["email"]); if (empty($numrows)) { echo '<tr><td colspan="5" align="center">No Information Uploaded for the developer\'s Team</td></tr>'; } else { echo '<tr> <td>' . $serial_no . '</td> <td><div class="thumbnail" style="width: 100px; height: 133px;"><img src="' . $passport_path . $row["passport"] . '" width="100px" height="90px"></div></td> <td>' . $row["fullname"] . '</td> <td>' . $mail . '</td> <td><a href="developer_details.php?id=' . customEncrypt($row["credit_id"]) . '" class="btn">More...</a></td>
<?php require_once '../inc/initialize.php'; $db_academic = new MySQLDatabase(); $sql_grade = "SELECT * FROM exam_grade"; $result_grade = $db_academic->query($sql_grade); while ($record = $db_academic->fetch_array($result_grade)) { echo '<option value="' . $record['grade_id'] . '">' . $record['grade'] . '</option>'; }
<?php # Instance of Session $session = new Session(); # Get applicant's record from personal_details table using the session->id $user = User::find_by_id($session->id); if (isset($user->fullname) && !empty($user->fullname)) { $label = ucfirst($user->fullname); } else { $label = $user->email; } $db = new MySQLDatabase(); // get all total notifications for the aplicant $notifications_sql = "SELECT count(*) FROM `notifications` WHERE applicant_id ='" . $session->id . "'"; $total_notifications = $db->query($notifications_sql); $total_notifications = $db->fetch_array($total_notifications); $total_notifications = array_shift($total_notifications); // get total Read And Unread notifications for the aplicant //function pd_get_total_int($column, $int_value, $applicant_id) function pd_get_total_int($column, $int_value) { global $db; $query = "SELECT count(*) FROM `notifications` WHERE `" . $column . "` = " . $int_value; // $query = "SELECT count(*) FROM `notifications` WHERE `".$column."` = ".$int_value AND $applicant_id ='".$session->id."'; $total = $db->query($query); $total = $db->fetch_array($total); $total = array_shift($total); return $total; } $Unread = pd_get_total_int('status', 1); $Read = pd_get_total_int('status', 2); // get all total notifications for the aplicant
<div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-user"></i></span> <input type="text" class="input-xlarge" required id="full_name" name="full_name" value="<?php if (isset($user->full_name)) { echo $user->full_name; } ?> " placeholder="Surname, Firstname, middlename" readonly="" /> </div> </div> </div> <!-- Delivery type --> <?php $sql_type = "SELECT * FROM delivery_type WHERE dt_visible = 1"; $result = $database->query($sql_type); ?> <div class="control-group"> <label class="control-label" for="inputDeliveryType">Delivery Type</label> <div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-chevron-down"></i></span> <select class="input-xlarge" name="dt_id" id="dt_id" onChange="get_dm_options(this.value);"> <option value="">--Select--</option> <?php while ($row = $database->fetch_array($result)) { echo '<option value="' . $row['id'] . '">' . $row['dt_name'] . '</option>'; } ?> </select> </div>
if (!empty($result_olevel)) { $o = 1; foreach ($result_olevel as $row) { $no_arr[$o] = 'exam_no_' . $o; $year_arr[$o] = 'exam_year_' . $o; $type_arr[$o] = 'exam_type_' . $o; $centre_arr[$o] = 'exam_centre_' . $o; $olevel_detail[$o] = $row; $olevels[$o] = unserialize($row->subject_grade); //print_r($olevel_detail[$o]->o_level_id); //echo "<br>"; $o++; } } $sql_exam = "SELECT * FROM exam_id"; $result_exam = $db_academic->query($sql_exam); //print_r($olevel_detail[1]->exam_type_id); /*First row from database*/ if (!empty($olevel_detail[1])) { ?> <div class="span6"> <!-- Examination Number --> <div class="control-group"> <label for="inputFormId"><b>Examination Number</b></label> <div class="controls"> <input type="text" class="input-xlarge" value="<?php echo $olevel_detail[1]->exam_number; ?> " name="<?php echo $no_arr[1]; ?>
$reference_title_id = "reference_title_id_{$x}"; $referees_name = "referees_name_{$x}"; $referees_email = "referees_email_{$x}"; $referees_phone_number = "referees_phone_number_{$x}"; $referee_id_field = 'referees_id_' . $x; ?> <tr> <td><?php echo $x; ?> </td> <td> <!-- title for 1st refree --> <?php $sql_title = "SELECT * FROM title"; $result = $database->query($sql_title); ?> <?php if (isset($referee_id[$x])) { echo '<input type="hidden" name="' . $referee_id_field . '" value="' . $referee_id[$x] . '"/>'; } ?> <div class="control-group"> <div class="controls"> <div class="input-prepend"> <span class="add-on"><i class="icon-chevron-down"></i></span> <select class="input-small" name="<?php echo $reference_title_id; ?> " id="<?php
function app_id_generator($dt_id, $applicant_id) { # Get the length of random number to generate $random_number_length = 6 - strlen($applicant_id); # Get the last delivery type code $database = new MySQLDatabase(); $dtsql = $database->query("SELECT dt_code FROM delivery_type WHERE id='" . $dt_id . "'"); $result = $database->fetch_array($dtsql); $dt_code = $result['dt_code']; $random_number = rand(pow(10, $random_number_length - 1), pow(10, $random_number_length) - 1); $dt = Carbon::now(); $carbon_year = $dt->format('Y'); $year = substr($carbon_year, 2, 2); # Returns Delivery Type Code.Random Number.Year.Applicant Id return $dt_code . $random_number . $year . $applicant_id; }
<?php require_once '../inc/initialize.php'; $db_academic = new MySQLDatabase(); $sql_exam = "SELECT * FROM exam_id"; $result_exam = $db_academic->query($sql_exam); while ($record = $db_academic->fetch_array($result_exam)) { echo '<option value="' . $record['exam_type_id'] . '">' . $record['exam_name'] . '</option>'; }
if (ord(substr($string, $i, 1)) > 129) { $i++; } } if (strlen($tmpstr) < $strlen) { $tmpstr .= "..."; } return $tmpstr; } } $dbhost = '119.254.229.23'; $dbuser = '******'; $dbpass = '******'; $dbname = 'osscms'; $dbport = 3306; $dbinst = new MySQLDatabase(); $dbinst->dbconnect($dbhost, $dbuser, $dbpass, $dbname); $dbinst->query("SET NAMES utf8"); $divstr = "<html><html xmlns=\"http://www.w3.org/1999/xhtml\"><head> \n<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n<title></title>\n<link href=\"http://soft.csip.org.cn/css/style.css\" rel=\"stylesheet\" type=\"text/css\" >\n<link href=\"http://soft.csip.org.cn/css/layout.css\" rel=\"stylesheet\" type=\"text/css\" >\n<style type=\"text/css\" >\nbody {\n\tcolor:#333333;\n\tfont-family:\"宋体\" arial;\n\tfont-size:12px;\n\tfont-size-adjust:none;\n\tfont-style:normal;\n\tfont-variant:normal;\n\tfont-weight:normal;\n}\n\n.m03_a_bt a {\n\twidth:280px;\n\tline-height:24px;\n\tfont-size: 12px;\n}\n.nd {font-size:12px;}\n.m03_a_bt a:link, .m03_a_bt a:visited { font-size:12px; color: #333333; text-decoration: none;}\n.m03_a_bt a:hover { font-size:12px; color:#f00;\t}\n\n</style>\n</head>\n<body>"; $divstr .= "<div> <table class=\"m03_a_bt\" width=\"290\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"; $strSQL = sprintf("SELECT itemid, subject FROM oss_spaceitems WHERE folder=1 ORDER BY lastpost DESC limit 0, 7"); $result = $dbinst->query($strSQL); while ($myrow = $dbinst->fetchArray($result)) { $news_url = "http://oss.org.cn/?action-viewnews-itemid-" . $myrow['itemid']; $news_subject = cutText($myrow['subject'], 0, 30, 'UTF-8') . "..."; $divstr .= "<tr><td width=\"290\" ><a href=\"{$news_url}\" target=\"_blank\" >{$news_subject}</a></td></tr>"; } $dbinst->freeRecordSet($result); $divstr .= "</table></div></body></html>"; echo $divstr; exit;
<br> <!-- Content --> <div class="row-fluid"> <?php include_layout_template('admin_menu.php'); ?> <div class="span9"> <h2>Active Notifications</h2> <hr> <?php $database = new MySQLDatabase(); $active_notifications = "SELECT * FROM `applicant_notifications` as app_not JOIN `personal_details` as per WHERE status = 1 AND recipient_id = " . $session->applicant_id . " AND app_not.sender_id=per.applicant_id"; $result = $database->query($active_notifications); $pagecounter = 1; $serialno = 1; $max = 10; $number_of_notifications = $database->num_rows($result); echo '<div class="tabbable"> <div class="tab-content">'; while ($row = $database->fetch_array($result)) { if ($serialno % $max == 1) { if ($pagecounter == 1) { echo '<div class="tab-pane active" id="' . $pagecounter . '">'; } else { echo '<div class="tab-pane" id="' . $pagecounter . '">'; } echo '<table class="table table-hover"> <thead>
<?php require_once "../../inc/initialize.php"; $database = new MySQLDatabase(); $id = $_POST['acceptance_id']; $application_number = $_POST['applicant_number']; $responsecode = $_POST['approval_status']; $amount = $_POST['amount']; $returned_amount = $amount * 100 . '.00'; $payment_reference = $_POST['payment_ref']; $responseDescription = $database->fetch_array($database->query("SELECT * FROM interswitch_error_code WHERE response_code = '" . $responsecode . "'")); $responseDescription = $responseDescription['response_description']; $status = $_POST['student_status']; $updatesql = "UPDATE acceptance_acceptance_log SET PaymentReference='{$payment_reference}', Amount='{$amount}', returned_amount='{$returned_amount}', ResponseCode='{$responsecode}', ResponseDescription='{$responseDescription}', status='{$status}' WHERE id='{$id}'"; $result = $database->query($updatesql); if ($result) { echo '<h4 class="alert alert-success">Success</h4>'; echo '<hr>'; echo "You have successfully edited the acceptance fee payment record for applicant with application number: " . $application_number; echo '<hr>'; } else { echo '<h4 class="alert alert-error">Error</h4>'; echo '<hr>'; echo "Your updates were not saved"; }
<?php # Instance of Session $session = new Session(); # Instance of MySQLDatabase $db = new MySQLDatabase(); // print_r( $type); // die(); # Count the number of submitted transcript applications for an applicant $query_count = "SELECT count(*) FROM feedbacks WHERE applicant_id ='" . $session->id . "' "; $result_count = $db->query($query_count); $feedbacks_count = $db->fetch_array($result_count); $count = array_shift($feedbacks_count); // 1. the current page number ($current_page) $page = !empty($_GET['page']) ? (int) $_GET['page'] : 1; // 2. records per page ($per_page) $per_page = 3; // 3. total record count ($total_count) $total_count = $count; // use pagination instead $pagination = new Pagination($page, $per_page, $total_count); // Instead of finding all records, just find the records // for this page $sql = "SELECT * FROM feedbacks WHERE applicant_id ='" . $session->id . "' ORDER BY `id` DESC "; $sql .= "LIMIT {$per_page} "; $sql .= "OFFSET {$pagination->offset()}"; $active_feedbacks = Feedback::find_by_sql($sql); // Need to add ?page=$page to all links we want to // maintain the current page (or store $page in $session) $counter = 1; ?>
<div class="span9"> <h2>Search Form Log Transactions</h2> <hr> <h3>Note:</h3> <ul> <li>This is to search payment records in the form log transactions</li> </ul> <form action="" method="POST" class="form-horizontal search_acceptance" id="search_acceptance" > <div class="input-prepend"> <span class="add-on"><i class="icon-chevron-down"></i></span> <select class="input-large" name="approval_status" id="approval_status" > <option selected="selected" value="">--Select Code--</option> <?php $arrayDescription = $database->query("SELECT * FROM interswitch_error_code WHERE status=1 ORDER BY `interswitch_error_code`.`response_description` ASC"); while ($rowDesc = $database->fetch_array($arrayDescription)) { echo '<option value="' . $rowDesc['response_code'] . '">' . $rowDesc['response_description'] . '</option>'; } ?> </select> </div> <?php $sql_faculty = "SELECT * FROM faculty ORDER BY faculty_name ASC"; $result_set = $database->query($sql_faculty); ?> <div class="input-prepend"> <span class="add-on"><i class="icon-chevron-down"></i></span> <select class="input-large" name="faculty_id" id="faculty_id" onChange="get_options(this.value);" >