public function form($id = false)
 {
     $data['menu_id'] = $this->menu_id;
     $data['modules_name'] = $this->modules_name;
     $data['current_user'] = $this->current_user;
     $data['perm'] = $this->perm;
     $data["value"] = new Register_data($id);
     if ($id > 0) {
         if ($data['value']->checkin_date > 0) {
             $data['checkin_day'] = substr($data['value']->checkin_date, 8, 2);
             $data['checkin_month'] = substr($data['value']->checkin_date, 5, 2);
             $month_name = get_month_name(number_format($data['checkin_month'], 0), 'F');
             $data['checkin_month_name'] = $month_name;
             $data['checkin_year'] = substr($data['value']->checkin_date, 0, 4) + 543;
             $data['checkin_time'] = substr($data['value']->checkin_date, 11, 5);
             $data['checkin_hour'] = substr($data['value']->checkin_date, 11, 2);
             $data['checkin_minute'] = substr($data['value']->checkin_date, 14, 2);
         }
         if ($data['value']->checkout_date > 0) {
             $data['checkout_day'] = substr($data['value']->checkout_date, 8, 2);
             $data['checkout_month'] = substr($data['value']->checkout_date, 5, 2);
             $month_name = get_month_name(number_format($data['checkout_month'], 0), 'F');
             $data['checkout_month_name'] = $month_name;
             $data['checkout_year'] = substr($data['value']->checkout_date, 0, 4) + 543;
             $data['checkout_time'] = substr($data['value']->checkout_date, 11, 5);
             $data['checkout_hour'] = substr($data['value']->checkout_date, 11, 2);
             $data['checkout_minute'] = substr($data['value']->checkout_date, 14, 2);
         }
     }
     save_logs($this->menu_id, 'View', @$data['value']->id, 'View Register Data Detail');
     $this->template->build("register_publics/form", $data);
 }
Example #2
0
 public function split_date($year = null, $month = null, $day = null, $date_time = null, $date = null)
 {
     if (!empty($date_time)) {
         // echo $date_time;
         $year = substr($date_time, 0, 4);
         $month = substr($date_time, 5, 2);
         $day = substr($date_time, 8, 2);
         $hour = substr($date_time, 11, 2);
         $min = substr($date_time, 14, 2);
         $sec = substr($date_time, 17, 2);
         $date_format = array('year' => $year, 'month' => strtoupper(get_month_name($month)), 'day' => $day, 'hour' => $this->conver_time24_to12($hour), 'min' => $min, 'sec' => $sec, 'stat' => strtoupper(get_time_stat($hour)));
         return $date_format;
     }
 }
Example #3
0
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                        <?php 
    $open_date = explode(' ', $course->open_date);
    $open_date_exp = explode('-', $open_date[0]);
    $open_time_exp = explode(':', $open_date[1]);
    ?>
                                        <div class="col-md-6">
                                            <div class="well line-height text-medium" align="center">
                                                <span class="glyphicon glyphicon-calendar"></span> <b><?php 
    echo get_day_name($open_date_exp[2] . "-" . $open_date_exp[1] . "-" . $open_date_exp[0]);
    ?>
 - <?php 
    echo get_month_name($open_date_exp[1]);
    ?>
 <?php 
    echo $open_date_exp[2];
    ?>
/<?php 
    echo $open_date_exp[0];
    ?>
</b>
                                                <br>
                                                <span class="glyphicon glyphicon-time"></span> 5:30pm - 6:30pm COT
                                                <br><br>
                                                <b>USD $<?php 
    echo $course->price;
    ?>
</b>
Example #4
0
<?php

# List Loans of personal
require "accrp.php";
session_start();
require "security/secure.php";
beginDocument($lCustomerProfile, $sess_user);
$db = getDBConnection();
# the date, which is the reference for the calculation of due and balance
$ref_date = get_today_srd_string();
$personal_array = get_personal_array();
echo "<h2>Centre for the rehabilitation of the paralysed - CRP</h2>";
echo "<div align=center>" . ($type == "PF" ? "Provident " : "Credit Union ") . "Fund Statement for the month of ";
echo get_month_name($ref_date) . " " . get_year($ref_date) . "</div>";
if ($type == "PF") {
    $loan_table = "PF_LOAN";
} else {
    if ($type == "CUF") {
        $loan_table = "CUF_LOAN";
    } else {
        die("Loantype unspecified !");
    }
}
$result = mysql_query("select * from {$loan_table}", $db);
checkMySQLError();
beginPrettyTable("4", "{$loan_table}");
printRow(array("Emp_ID3", "Emp. Name", "LoanStart", "LoanEnd", "Loan-Amt", "Instalment", "Tot_Amt", "Due", "Balance"));
while ($row = mysql_fetch_array($result)) {
    $name = $personal_array[$row["EMP_ID3"]];
    $rest_inst_no = datediff("m", $ref_date, $row["LOAN_END"]);
    $rest_amount = $rest_inst_no * $row["INT_RATE"];
Example #5
0
/**
 * @Helper::getMonthLists()
 * @Author:Techno Services
 * @return
 */
function getMonthLists()
{
    $arr = array('01' => "01", '02' => "02", '03' => "03", '04' => "04", '05' => "05", '06' => "06", '07' => "07", '08' => "08", '09' => "09", '10' => "10", '11' => "11", '12' => "12");
    $monthlist = '';
    $n = 1;
    foreach ($arr as $key => $val) {
        $monthlist .= "<option value=\"{$key}\"";
        $monthlist .= $key == date('m') ? ' selected="selected"' : '';
        $monthlist .= ">" . get_month_name($n) . "</option>\n";
        $n++;
    }
    return $monthlist;
}
Example #6
0
 public function show_detail()
 {
     if ($_POST) {
         if (@$this->session->userdata("captcha") == $_POST['captcha']) {
             $sql = "select id from register_datas where firstname='" . trim(@$_POST['firstname']) . "' AND lastname='" . trim(@$_POST['lastname']) . "'";
             $register_id = $this->db->query($sql)->result();
             $register_id = @$register_id[0];
             $register_id = $register_id->id;
             if ($register_id > 0) {
                 $data['value'] = new Register_data($register_id);
                 if ($data['value']->rest_type == 'y') {
                     if ($data['value']->checkin_date > 0) {
                         $data['checkin_day'] = substr($data['value']->checkin_date, 8, 2);
                         $data['checkin_month'] = substr($data['value']->checkin_date, 5, 2);
                         $month_name = get_month_name(number_format($data['checkin_month'], 0), 'F');
                         $data['checkin_month_name'] = $month_name;
                         $data['checkin_year'] = substr($data['value']->checkin_date, 0, 4) + 543;
                         $data['checkin_time'] = substr($data['value']->checkin_date, 11, 5);
                     } else {
                         $data['checkin_day'] = '-';
                         $data['checkin_month'] = '-';
                         $data['checkin_month_name'] = '-';
                         $data['checkin_year'] = '-';
                         $data['checkin_time'] = '-';
                     }
                     if ($data['value']->checkout_date > 0) {
                         $data['checkout_day'] = substr($data['value']->checkout_date, 8, 2);
                         $data['checkout_month'] = substr($data['value']->checkout_date, 5, 2);
                         $month_name = get_month_name(number_format($data['checkout_month'], 0), 'F');
                         $data['checkout_month_name'] = $month_name;
                         $data['checkout_year'] = substr($data['value']->checkout_date, 0, 4) + 543;
                         $data['checkout_time'] = substr($data['value']->checkout_date, 11, 5);
                     } else {
                         $data['checkout_day'] = '-';
                         $data['checkout_month'] = '-';
                         $data['checkout_month_name'] = '-';
                         $data['checkout_year'] = '-';
                         $data['checkout_time'] = '-';
                     }
                 } else {
                     $data['checkin_day'] = '-';
                     $data['checkin_month'] = '-';
                     $data['checkin_month_name'] = '-';
                     $data['checkin_year'] = '-';
                     $data['checkout_day'] = '-';
                     $data['checkout_month'] = '-';
                     $data['checkout_month_name'] = '-';
                     $data['checkout_year'] = '-';
                 }
                 $this->load->view('show_detail', $data);
             } else {
                 set_notify('error', 'ไม่พบข้อมูลของคุณกรุณาลองใหม่อีกครั้ง');
                 redirect('register/search_detail');
             }
         } else {
             set_notify('error', 'รหัสรูปภาพไม่ถูกต้อง');
             redirect('register/search_detail');
         }
     } else {
         set_notify('error', 'ไม่พบข้อมูลของคุณกรุณาลองใหม่อีกครั้ง');
         redirect('register/search_detail');
     }
 }