示例#1
1
function getDatePath($dt)
{
    $year = get_year($dt);
    $month = substr($dt, 5, 2);
    $day = get_day($dt);
    return $year . "/" . $month . "/" . $day;
}
示例#2
0
/**
 * Display an event
 * [event title="Our event" text="A bit of information" date="YYYY-MM-DD" url="http://example.com/example"]
 */
function event_shortcode($atts)
{
    if (!isset($atts['title']) || !isset($atts['date'])) {
        return;
    }
    $event = array('day' => get_day($atts['date']), 'month' => get_month($atts['date']), 'year' => get_year($atts['date']), 'title' => isset($atts['title']) ? $atts['title'] : null, 'desc' => isset($atts['text']) ? $atts['text'] : null, 'url' => isset($atts['url']) ? $atts['url'] : null);
    $link = '<a class="Type-ignore Event Event--linked" href="' . $event['url'] . '">';
    $open = $event['url'] ? $link : '<div class="Event">';
    $close = $event['url'] ? '</a>' : '</div>';
    return '<div class="Type-event u-cf">' . $open . '<div class="Event-figure">
					<div class="Event-date">
						<span>' . $event['month'] . '</span>
						<span>' . $event['year'] . '</span>
					</div>
					<div class="Event-day">
						<span>' . $event['day'] . '</span>
					</div>
				</div>
				<div class="Event-body">
					<div class="Type Type--plain">
						<span class="Event-title">' . $event['title'] . '<br></span>
						<span class="u-colorGreen u-sm-show">' . $event['desc'] . '</span>
					</div>
				</div>' . $close . '</div>';
}
示例#3
0
function date_to_pdf($date)
{
    $day = get_day($date);
    $month = get_month($date);
    monthnum_to_thai($month);
    $year = get_year($date);
    $year = gen_year($year);
    $day = check_zero_num($day);
    $date = $day . " " . $month . " " . $year;
    return $date;
}
示例#4
0
function get_events()
{
    $num = 1;
    $events = array();
    while ($num <= 4) {
        $date = get_field('event_' . $num . '_date');
        $event = array('day' => get_day($date), 'month' => get_month($date), 'year' => get_year($date), 'title' => get_field('event_' . $num . '_title'), 'desc' => get_field('event_' . $num . '_desc'), 'url' => get_field('event_' . $num . '_url'));
        if ($event['day'] && $event['title']) {
            array_push($events, $event);
        }
        $num++;
    }
    return $events;
}
/**
 * Generate the json data to be plotted in the graph
 * TODO: Ugly code, need to revise  
 * 
 * The data is an array of graph coordinates, which in our case is in this form
 * ([time], [number of likes/comments])  
 * 
 * @param $period
 *   The period to calculate the most popular status (by month, e.g. 6 or 12 months)
 */
function generate_data($statuses, $period = null) {
  $oldest_status = get_oldest($statuses);  
  $oldest_year = get_year($oldest_status['updated_time']); // year of the oldest status    
  $newest_status = get_newest($statuses);  
  $newest_year = get_year($newest_status['updated_time']); // year of the most recent status     
      
  // Currently the graph can only plot time period of 2, 3, 4, 6
  // So make it 12 months if an invalid number is passed
  if (($period == null) || ($period > 12) || ((12 % $period) != 0)) {
  	$period = 12;
  }
  
  $from = "01-01-$oldest_year";
  
  $data = array();  
  for ($year = $oldest_year; $year <= $newest_year + 1; $year++) {  	
  	$to = "01-01-$year";  	
  	for ($month = 1 + $period; $month <= 12 + 1; $month += $period) {
      if ($to != $from) {  	      	    	    	    	  
  	    $most_popular = get_most_popular($statuses, '', $from, $to);
  	    if ($most_popular) {
  	      $popularity = $most_popular['like_count'] + $most_popular['comment_count']; 
   	    }
  	    else {
  	      $popularity = 0;
  	    }    	    	    	 
  	    // Notes: The Flot API can only accept time data as Javascript timestamp
  	    // We need to pass a valid date string and generate timestamp at front end  	      	  
  	    $data['plot_data'][] = array(date('M j, Y', strtotime("$to")), $popularity);
  	    $data['status_data'][] = array(
  	      'status' => status_format_js($most_popular),
  	      'from' => $from,
  	      'to' => $to,
  	    );  	    
  	    
  	    if ($year == $newest_year + 1) {  	      
  	      break;	
  	    }
  	  } 
  	  $next = $month + 1; 	    	    	 
  	  $from = $to;
  	  $to = "01-$month-$year";
  	}  	
  }	  
  return $data;
}
示例#6
0
function apprentice($id)
{
    $ci = get_model();
    $data['employee'] = $ci->db->where('id', $id)->get('employee')->result();
    $check = $data['employee'][0]->firstday;
    $day = strtotime("+3 month");
    $now = strtotime("now");
    $day = $day - $now;
    $check = strtotime($check);
    $get = $check + $day;
    $get = date(Y . "-" . m . "-" . d, $get);
    $day3 = get_day($get);
    $month = get_month($get);
    $year = get_year($get);
    $year = gen_year($year);
    $day3 = check_zero_num($day3);
    $end['end'] = $day3 . " " . $month . " " . $year;
    $end['end2'] = $month . " " . $year;
    return $end;
}
示例#7
0
 public function edit($id)
 {
     ini_set('memory_limit', '256M');
     $data['employee'] = $this->db->where('id', $id)->get('employee')->result();
     $data['province'] = get_province();
     $firstday = $data['employee'][0]->firstday;
     $lastday = $data['employee'][0]->lastday;
     $day = get_day($firstday);
     $month = get_month_num($firstday);
     $month = monthnum_to_eng($month);
     $year = get_year($firstday);
     $data['firstday'] = $day . "-" . $month . "-" . $year;
     $day1 = get_day($lastday);
     $month1 = get_month_num($lastday);
     $month1 = monthnum_to_eng($month1);
     $year1 = get_year($lastday);
     $data['lastday'] = $day1 . "-" . $month1 . "-" . $year1;
     $this->load->view('employee/header');
     $this->load->view('employee/edit', $data);
     $this->load->view('footer');
 }
 public function reports()
 {
     // Calculate the Holidays and update the database
     $clerks = $this->reports_model->get_clerks('clerk_id, start_date, end_date', 'clerk');
     // we calculate the tax - holiday years
     $this_year = get_year(1);
     $last_year = get_year(0);
     foreach ($clerks as $clerk => $value) {
         $clerk_status[$value['clerk_id']] = $this->reports_model->get_status('clerks_list_rota.date, clerk_status.status, clerks_list_rota.status_id, clerk.clerk_name, clerk.secret_no', $this_year['start'], $this_year['end'], $value['clerk_id']);
         $clerk_status_last[$value['clerk_id']] = $this->reports_model->get_status('clerks_list_rota.date, clerk_status.status, clerks_list_rota.status_id, clerk.clerk_name, clerk.secret_no', $last_year['start'], $last_year['end'], $value['clerk_id']);
     }
     // we create 2 variables with the holiday calculations
     $holidays = holiday($clerks, $clerk_status, $this_year);
     $holidays_last = holiday($clerks, $clerk_status_last, $last_year);
     // we calculate the sick days
     $sick_days = sick($clerk_status);
     // we calculate the dayly overtimes
     $dayly_overtime = overtime($clerk_status);
     // query the database to get the data for the form
     $clerk = $this->load_file->get_data_extend('clerk', 'clerk_id, clerk_name');
     $companies = $this->load_file->get_data_extend('companies', 'company');
     $clerk_list[0] = 'Select Clerk';
     // prepare the tables for the form
     foreach ($clerk as $row) {
         $clerk_list[$row['clerk_id']] = $row['clerk_name'];
     }
     foreach ($companies as $row) {
         $comp_list[] = $row['company'];
     }
     //check validation for user input in sign up form
     $this->form_validation->set_rules('rep_type', 'Report Type', 'required|xss_clean');
     $this->form_validation->set_rules('date_from', 'Date From', 'trim|required|xss_clean');
     $this->form_validation->set_rules('date_to', 'Date To', 'trim|xss_clean');
     $this->form_validation->set_rules('comp', 'Company', 'trim|xss_clean');
     $this->form_validation->set_rules('clerk', 'Clerk', 'trim|xss_clean');
     // We get the POST data
     $post_data = array('rep_type' => $this->input->post('rep_type'), 'date_from' => $this->input->post('date_from'), 'date_to' => $this->input->post('date_to'), 'comp' => $this->input->post('comp'), 'clerk' => $this->input->post('clerk'));
     // Do a check on the dates submited
     $date_from = date('z', strtotime($post_data['date_from']));
     $date_to = date('z', strtotime($post_data['date_to']));
     if ($date_to == 0 && $date_from <= date('z')) {
         $post_data['date_to'] = date('Y-m-d');
         $error = FALSE;
         $msg = '';
     } elseif ($date_to < $date_from) {
         $error = TRUE;
         $msg = '<h4 class="error_msg">You canot have earlier date than the starting date!</h4>';
     } else {
         $error = FALSE;
         $msg = '';
     }
     // prepere the data to sent to the reports page
     $data = array('name' => 'Admin', 'message_display' => $msg, 'clerk_list' => $clerk_list, 'comp_list' => $comp_list);
     if ($this->form_validation->run() == FALSE || $error == TRUE) {
         // Load the view as a result and check if the user is logged in for resubmission
         if ($this->login_database->is_logged()) {
             $this->load->view('reports_view', $data);
         } else {
             $this->load->view('login_form', $data);
         }
     } else {
         // Validation successful and prepare the data for the result
         unset($clerk_list);
         // clear out this var, we need it later
         unset($clerks);
         if ($post_data['comp'] != 0) {
             $company = $post_data['comp'];
         } else {
             $company = FALSE;
         }
         if ($post_data['clerk'] != 0) {
             $clerk = $post_data['clerk'];
         } else {
             $clerk = FALSE;
         }
         // We query the database
         $clerk_data = $this->reports_model->get_weekly('clerks_check.clerk_id', $post_data['date_from'], $post_data['date_to'], $clerk, $company);
         if ($clerk_data != NULL) {
             foreach ($clerk_data as $key => $value) {
                 $clerks[] = $clerk_data[$key]['clerk_id'];
             }
             $clerks = array_unique($clerks);
             foreach ($clerks as $clerk => $value) {
                 $clerk_details[$value] = $this->reports_model->get_weekly('clerks_check.clerk_id, clerk.clerk_name, clerk.secret_no, clerks_check.status, clerks_check.date, clerks_check.time, clerks_check.sign_time, clerks_check.id, clerks_check.approval', $post_data['date_from'], $post_data['date_to'], $clerks[$clerk]);
             }
             switch ($post_data['rep_type']) {
                 case 0:
                     // Weekly report page
                     $clerk_list = overtime_deductions($clerk_details, FALSE);
                     // prepere the data to sent to the reports page
                     $data = array('name' => 'Admin', 'message_display' => $msg, 'clerk_list' => $clerk_list, 'holidays' => $holidays, 'holidays_last' => $holidays_last, 'sick_days' => $sick_days, 'dayly_overtime' => $dayly_overtime);
                     // Load the view as a result and check if the user is logged in
                     if ($this->login_database->is_logged()) {
                         $this->load->view('weekly', $data);
                     } else {
                         $this->load->view('login_form', $data);
                     }
                     break;
                 case 1:
                     // Monthly Simple report page
                     $clerk_list = overtime_deductions($clerk_details, TRUE);
                     // prepere the data to sent to the reports page
                     $data = array('name' => 'Admin', 'message_display' => $msg, 'clerk_list' => $clerk_list, 'holidays' => $holidays, 'holidays_last' => $holidays_last, 'sick_days' => $sick_days, 'dayly_overtime' => $dayly_overtime);
                     // Load the view as a result and check if the user is logged in
                     if ($this->login_database->is_logged()) {
                         $this->load->view('monthly_simple', $data);
                     } else {
                         $this->load->view('login_form', $data);
                     }
                     break;
                 case 2:
                     // Monthly Analitic report page
                     $clerk_list = overtime_deductions($clerk_details, TRUE);
                     // prepere the data to sent to the reports page
                     $data = array('name' => 'Admin', 'message_display' => $msg, 'clerk_list' => $clerk_list, 'holidays' => $holidays, 'holidays_last' => $holidays_last, 'sick_days' => $sick_days, 'dayly_overtime' => $dayly_overtime);
                     // Load the view as a result and check if the user is logged in
                     if ($this->login_database->is_logged()) {
                         $this->load->view('monthly', $data);
                     } else {
                         $this->load->view('login_form', $data);
                     }
                     break;
                 default:
                     break;
             }
         } else {
             // prepere the data to sent to the reports page
             $data['message_display'] = '<h4 class="error_msg">No Data Available!</h4>';
             // Load the view as a result and check if the user is logged in
             if ($this->login_database->is_logged()) {
                 $this->load->view('reports_view', $data);
             } else {
                 $this->load->view('login_form', $data);
             }
         }
     }
 }
示例#9
0
文件: accrp.php 项目: k9ert/ac4ngos
function add_days($date, $adddays)
{
    $timestamp = mktime(0, 0, 0, get_month($date), get_day($date) + $adddays, get_year($date));
    return date("Y-m-d", $timestamp);
}
示例#10
0
function print_check_voucher()
{
    global $path_to_root, $systypes_array;
    $trans_no = $_POST['PARAM_0'];
    $trans_num = $_POST['PARAM_1'];
    $orientation = $_POST['PARAM_2'];
    $destination = $_POST['PARAM_3'];
    if ($destination) {
        include_once $path_to_root . "/reporting/includes/excel_report.inc";
    } else {
        include_once $path_to_root . "/reporting/includes/pdf_report2.inc";
    }
    $orientation = $orientation ? 'L' : 'P';
    $rep = new FrontReport(_('JOURNAL VOUCHER'), "JournalVoucher", user_pagesize(), 9, $orientation);
    $dec = user_price_dec();
    $cols = array(0, 65, 105, 125, 175, 210, 250, 300, 360, 370);
    $aligns = array('left', 'left', 'left', 'center', 'right', 'right', 'right', 'right', 'right');
    $rep->SetHeaderType(0);
    $rep->Font();
    $rep->Info(null, $cols, null, $aligns);
    $rep->NewPage();
    $res = get_transaction($trans_no);
    $myrow = db_fetch($res);
    $credit = $debit = 0;
    $res2 = get_gl_trans(0, $trans_num);
    $res3 = get_gl_trans(0, $trans_num);
    $fiscal = get_year();
    //to be use
    $year_no = substr(sql2date($fiscal['begin']), 8);
    //to be use
    $transtype = ST_JOURNAL;
    $ser = db_fetch(get_used_series($year_no, $transtype));
    $num = substr($ser['year'], 2);
    $rep->Font('bold');
    //$rep->TextCol(7,11, _("ST. MATTHEW'S PUBLISHING CORPORATION"));
    $rep->Font();
    $rep->NewLine();
    // $rep->TextCol(7,11, _("Tel. Nos. 426-5611 * 433-5385 Telefax: 426-1274"));
    $rep->NewLine(3);
    //$rep->Font('bold');
    //$rep->SetFontSize(14);
    //$rep->TextCol(3,8, _("JOURNAL VOUCHER"));
    $rep->NewLine(5);
    $rep->SetFontSize(10);
    $rep->TextCol(0, 2, $myrow['tranDate']);
    $rep->SetFontSize(12);
    $rep->TextCol(6, 8, $num . "-" . str_pad($myrow['customized_no'], 4, 0, STR_PAD_LEFT));
    $rep->NewLine(2);
    //$rep->Line($rep->row  - -10);
    // $rep->TextCol(7,8, _("DEBIT"));
    //$rep->TextCol(9,10, _("CREDIT"));
    //$rep->TextCol(5,7, _("ACCOUNT CODE"));
    $rep->SetFontSize(10);
    $rep->Font();
    //$rep->Line($rep->row  - 4);
    $rep->NewLine(2);
    while ($myrow3 = db_fetch($res3)) {
        $accounts = get_gl_accounts($myrow3['account']);
        $account = db_fetch($accounts);
        if ($myrow3['amount'] > 0) {
            $rep->TextCol(0, 3, $account['account_name']);
            $rep->TextCol(4, 5, $account['account_code']);
            $rep->AmountCol(5, 7, $myrow3['amount'], 2);
            $rep->NewLine();
            $debit += $myrow3['amount'];
        } else {
            $rep->TextCol(0, 3, $account['account_name']);
            $rep->TextCol(4, 5, $account['account_code']);
            $rep->AmountCol(7, 9, abs($myrow3['amount']), 2);
            $rep->NewLine();
            $credit += abs($myrow3['amount']);
        }
    }
    // $rep->Line($rep->row  - -4);
    $rep->NewLine(17);
    $rep->Font('bold');
    //$rep->TextCol(0,4, _("Total"));
    $rep->AmountCol(5, 7, $debit, 2);
    $rep->AmountCol(7, 9, $credit, 2);
    $rep->NewLine(2);
    $rep->Font();
    $comment = get_comments_string($transtype, $trans_num);
    $rep->TextCol(0, 9, $comment);
    // $rep->Line($rep->row  - 4);
    $rep->End();
}
示例#11
0
/**
 * Make a still image citation
 *
 * @param Item $item The item
 * @param boolean $html Use html formatting
 * @param boolean $full Full citation
 * @return string
 */
function make_still_image_citation($item, $html, $full)
{
    global $AUTHOR_ELEMENT, $DATE_ELEMENT, $TITLE_ELEMENT, $PUBLISHER_ELEMENT;
    $citation = add_element("", safe_metadata($item, $TITLE_ELEMENT));
    if ($full) {
        $citation = add_element($citation, safe_metadata($item, $AUTHOR_ELEMENT));
        $citation = add_element($citation, safe_metadata($item, $PUBLISHER_ELEMENT));
        $citation = add_element($citation, get_year(safe_metadata($item, $DATE_ELEMENT)));
    }
    return $citation;
}
示例#12
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"];
示例#13
0
<?php

$out = array();
require './header.php';
$addition = '';
if (isset($_GET['archive'])) {
    $year = get_year($_GET['archive']);
    $month = get_month($_GET['archive']);
    if (check_input('number', $year) && check_input('number', $month)) {
        $addition .= ' and year(post_time) = ' . $year . ' and month(post_time)
		= ' . $month . ' ';
    }
}
$sql0 = 'select count(*) from note, user where author_id = uid' . $addition;
$count = $mysql_obj->fetch_array($mysql_obj->query($sql0));
$note_count = $count['count(*)'];
$pager = new Paging($note_count, $config['articles_per_page']);
$sql1 = 'select post_id, title, post_time, user_name from user, note where 
	author_id = uid ' . $addition . 'order by `post_time` desc ' . 'limit ' . ($pager->mCurrentPage - 1) * $pager->mPageSize . ',' . $pager->mPageSize;
$articles = $mysql_obj->query($sql1);
$out['article_list'] = array();
$out['content'] = '';
if ($mysql_obj->get_rows_count()) {
    for (; $article = $mysql_obj->fetch_array($articles);) {
        $out['article_list'][] = $article;
    }
    foreach ($out['article_list'] as $article) {
        $out['content'] .= '<div class="blog-post">';
        $out['content'] .= '<a class="title" href="article.php?id=' . $article['post_id'] . '"><h3 class="blog-post-title">' . $article['title'] . '</h3></a>';
        $out['content'] .= '<p class="blog-post-meta article-info">' . $article['post_time'] . ' by ' . $article['user_name'] . '</p>';
        $out['content'] .= '</div><!-- /.blog-post --> <hr>';
示例#14
0
<?

require_once("business/rekap_umum.class.php");
require_once("function/format_tanggal.php");

$tmpl->setBasedir("module/rekap_umum/templates");
$tmpl->readTemplatesFromFile("main_view.html");

$urlProc=$crypt->paramEncrypt('module=rekap_umum&file=detil_view');

$tmpl->addVar("article", "HEADLINE", "Rekapitulasi Umum");
$tmpl->addVar("article", "URL_PROSES", "index.php?".$urlProc);

$thisyear = get_year();
$startyear = $thisyear - 10;

$row=0;
for($startyear; $startyear<=$thisyear; $startyear++){
   if ($startyear==$thisyear){
      $selected = 'SELECTED';
   }else{ 
      $selected = '';
   }
   $years[$row]=array('TAHUN'=>$startyear, 'SELECTED'=>$selected);
   $row++;
}

foreach($years as $tahun){
   $tmpl->addVars("tahun", $tahun);
	$tmpl->parseTemplate("tahun", "a");
}           
示例#15
0
function create_job($obj)
{
    global $data;
    $data = $obj;
    $job_name = $data->job_name;
    $frequency = $data->frequency;
    $message = $data->message;
    $recipients = $data->recipients;
    $params = json_decode("{}");
    $params->days = $data->param_days;
    $params->dates = $data->param_dates;
    $params->months = $data->param_months;
    //$params = $data->parameters;
    //die( json_encode($params) );
    if ($frequency != 'I') {
        $start = get_php_timestamp($data->start_date);
    }
    //$end = get_php_timestamp($data->end_date);
    $recur = $data->recur;
    $schedules = array();
    if ($frequency == 'I') {
        $start = strtotime("now");
        array_push($schedules, strtotime("now"));
    } elseif ($frequency == 'O') {
        array_push($schedules, $start);
    } elseif ($frequency == 'D') {
        //array_push($schedules,$start);
        //$date = $start;
        for ($i = 0; $i < $recur; $i++) {
            $date = add_js_timestamp($data->start_date, $frequency, $i);
            array_push($schedules, $date);
        }
    } elseif ($frequency == 'W') {
        for ($i = 0; $i < count($params->days); $i++) {
            $start_week_date = get_start_day($params->days[$i], $start);
            for ($j = 0; $j < $recur; $j++) {
                $date = add_js_timestamp(date_string($start_week_date), $frequency, $j);
                //Add weekly count
                array_push($schedules, $date);
            }
        }
    } elseif ($frequency == 'M') {
        for ($i = 0; $i < count($params->months); $i++) {
            for ($j = 0; $j < count($params->dates); $j++) {
                if ($params->dates[$j] > 31) {
                    $str = "";
                    //Its a special date, use it intelligently !!
                    //String format ==> 'Last Sunday of December 2015'
                    switch ($params->dates[$j]) {
                        case 41:
                            //First Day
                            $str = "First ";
                            break;
                        case 42:
                            //Second Day
                            $str = "Second ";
                            break;
                        case 43:
                            //Third Day
                            $str = "Third ";
                            break;
                        case 44:
                            //Fourth Day
                            $str = "Fourth ";
                            break;
                        case 45:
                            //Last Day
                            $str = "Last ";
                            break;
                    }
                    $day = $str;
                    for ($k = 0; $k < count($params->days); $k++) {
                        $str = "";
                        $str = $day . $days[$params->days[$k]];
                        $str = $str . " of ";
                        $str = $str . "" . $months[$params->months[$i]];
                        $str = $str . "" . get_year($data->start_date);
                        array_push($schedules, strtotime($str));
                    }
                } else {
                    $date = get_month_date($params->dates[$j], $params->months[$i]);
                    array_push($schedules, $date);
                }
            }
        }
    }
    //Save entries to the Database
    $db = pdoConnect();
    $query = "INSERT INTO jobs\n\t\t\t(`name`, `frequency`, `recur`, `message`, `recipients`, `start_date`, `parameters`, `user_id`) \n\t\t\tVALUES \n\t\t\t(:name, :frequency, :recur, :message, :recipients, :start_date, :parameters, :user_id );";
    $sqlVars = array();
    $obj_recipients = json_decode("{}");
    //Create Object
    $obj_recipients->values = $recipients;
    $sqlVars[':name'] = $job_name;
    $sqlVars[':frequency'] = $frequency;
    $sqlVars[':recur'] = $recur;
    $sqlVars[':message'] = $message;
    $sqlVars[':recipients'] = json_encode($obj_recipients);
    $sqlVars[':start_date'] = date_string($start);
    $sqlVars[':parameters'] = json_encode($params);
    $sqlVars[':user_id'] = "";
    //$this->userID;
    //die( json_encode($sqlVars) )  ;
    $stmt = $db->prepare($query);
    $stmt->execute($sqlVars);
    $job_id = $db->lastInsertId();
    $query = "INSERT INTO scheduler\n\t\t\t(`job_id`, `execution_date`) \n\t\t\tVALUES \n\t\t\t(:job_id, :execution_date);";
    $sqlVars = array();
    $sqlVars[':job_id'] = $job_id;
    $schedule_id = -1;
    $schedule_strings = array();
    foreach ($schedules as $schedule) {
        $sqlVars[':execution_date'] = date_string($schedule);
        $stmt = $db->prepare($query);
        $stmt->execute($sqlVars);
        $schedule_id = $db->lastInsertId();
        array_push($schedule_strings, array("id" => $schedule_id, "date" => date_string($schedule)));
        //echo date_string($schedule)."\n";
    }
    //***** Return output ******//
    $history = array();
    if ($frequency == 'I') {
        $history = send_to_recipients($obj_recipients, $message, $schedule_id);
    }
    return array("job_id" => $job_id, "schedules" => $schedule_strings, "history" => $history);
}
示例#16
0
DOB:
<select name="day" id="day">
<?php 
include 'date.php';
get_date();
?>
</select>

<select name="month" id="month">
<?php 
get_month();
?>
</select>
<select name="year" id="year">
<?php 
get_year();
?>
</select>
<br>
Gender:
<select name="gender" id="gender">
<option></option>
<option>Male</option>
<option>Female</option>
</select>
<br>
Username:<input type=text name="uname" id="uname">
<br>
Password:<input type=password name="pass" id="pass">
Confirm Password:<input type=password name="cpass" id="cpass">
<br>
示例#17
0
文件: error.php 项目: steem/qwp
</head>
<body>
<div class="container">
    <div class="page-header">
        <h1>Ops... </h1>
    </div>
    <p class="lead">Something goes wrong! Please follow the instructions below to fix the issue.</p>
    <p><?php 
echo $error_description;
?>
</p>
</div>
<footer class="footer">
    <div class="container">
        <p class="text-muted">&copy; <?php 
echo COMPANY_NAME . ' ' . get_year();
?>
</p>
    </div>
</footer>
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<?php 
qwp_render_js_lang();
?>
<script src="js/qwp.js"></script>
<?php 
qwp_render_js();
?>
</body>
</html>
示例#18
0
function get_post_viewed_coverage_trend($view_type, $time_span, $output_type, $year_id)
{
    global $wpdb;
    $time_span = "post_views_" . $time_span;
    if ($output_type == "excerpt") {
        $output_type = "previewed";
    } else {
        $output_type = "viewed";
    }
    if ($year_id == "") {
        $year_id = get_year();
    }
    $trend = $wpdb->get_var($wpdb->prepare("SELECT " . $time_span . " FROM " . WP_POST_VIEWS_SUMMARY_TABLE . " where summary_type='" . $view_type . "_" . $output_type . "_coverage' and year_id=" . $year_id, APP_POST_TYPE));
    return $trend;
}