Пример #1
0
 /**
  * log a subscription request to the database
  * @param  string $recipientEmail the email address of the recipient
  * @param  string $recipientName  the name of the recipient
  * @param  array $fields set of fields (answers) to assign to the user record
  * @param  string $listId unique identifier for the list
  * @param string $clientId unique identifier for the client making the request
  * @return null
  */
 public function log($recipientEmail, $recipientName, $fields, $listId, $clientId)
 {
     $logged = $this->repo->store(["list_id" => $listId, "client_id" => $clientId, "recipient_email" => $recipientEmail, "recipient_name" => $recipientName, "fields" => json_encode($fields), "requested" => getDateTime()]);
     if (!$logged) {
         return apiErrorResponse('badRequest', ['errors' => "There was a problem with the request."]);
     }
     Event::fire('RequestWasLogged');
     return apiSuccessResponse('ok');
 }
Пример #2
0
 public function match($data1, $data2)
 {
     $Kundali = new Library_Kundali();
     $fromDate = getDateTime($data1['dob']);
     $toDate = getDateTime($data2['dob']);
     $returnArrFrom = $Kundali->precalculate($fromDate['month'], $fromDate['day'], $fromDate['year'], $fromDate['hour'], $fromDate['minute'], $data1['zone_h'], $data1['zone_m'], $data1['lon_h'], $data1['lon_m'], $data1['lat_h'], $data1['lat_m'], $data1['dst'], $data1['lon_e'], $data1['lat_s']);
     $returnArrTo = $Kundali->precalculate($toDate['month'], $toDate['day'], $toDate['year'], $toDate['hour'], $toDate['minute'], $data2['zone_h'], $data2['zone_m'], $data2['lon_h'], $data2['lon_m'], $data2['lat_h'], $data2['lat_m'], $data2['dst'], $data2['lon_e'], $data2['lat_s']);
     $pts = $Kundali->getpoints($returnArrFrom[9], $returnArrTo[9]);
     $finalPoints = array('points' => $pts, 'result' => $Kundali->interpret($pts));
     return array($returnArrFrom, $returnArrTo, $finalPoints);
 }
Пример #3
0
function expense_voucher_detail($voucher_id, $voucher_paid_from_account, $expense_type, $expense_detail, $expense_ammount, $expense_attachment)
{
    $now = getDateTime(0, 'mySQL');
    $insert = DB::Insert(DB_PREFIX . $_SESSION['co_prefix'] . 'voucher_expense_detail', array('voucher_id' => $voucher_id, 'expense_account_id' => $voucher_paid_from_account, 'expense_type' => $expense_type, 'expense_description' => $expense_detail, 'expense_amount' => $expense_ammount, 'has_attachment' => $expense_attachment, 'created_by' => $_SESSION['user_name'], 'created_on' => $now, 'voucher_detail_status' => 'Draft'));
    $voucher_detail_id = DB::insertId();
    if ($voucher_detail_id) {
        return $voucher_detail_id;
        return $voucher_id;
    } else {
        return 0;
    }
}
 /**
  * set the appropriate attempt count for the row
  * @param  array $queueItem the database record for the queued item
  * @return null
  */
 protected function setAttempt($queueItem, $attempt)
 {
     $data = ["attempt_{$attempt}" => getDateTime()];
     # if this was the final attempt
     if ($attempt == 3) {
         $data['failed_all_attempts'] = true;
         $this->notifyAllFailed();
     }
     # update the database to reflect the attempt
     DB::table($this->table)->where('id', $queueItem->id)->update($data);
     # and request we re-queue the items
     $this->requeue();
 }
Пример #5
0
function add_coa($account_code, $account_group, $account_desc_short, $account_desc_long, $parent_account_id, $account_type)
{
    $consolidate_only = 0;
    $activity_account = 0;
    $has_parent = 0;
    $has_children = 0;
    $coa_level = 1;
    $code_exists = 0;
    $desc_exists = 0;
    if ($parent_account_id != 0) {
        $has_parent = 1;
    }
    if ($has_parent == 1) {
        $coa_level = get_account_level($parent_account_id) + 1;
    }
    if ($account_type == "consolidate_only") {
        $consolidate_only = 1;
    }
    if ($account_type == "activity_account") {
        $activity_account = 1;
    }
    if (account_code_exists($account_code)) {
        $code_exists = 1;
    }
    //check if account desc already exists
    if (account_desc_exists($account_desc_short)) {
        $desc_exists = 1;
    }
    if ($code_exists != 1 and $desc_exists != 1) {
        $insert = DB::Insert(DB_PREFIX . $_SESSION['co_prefix'] . 'coa', array('account_code' => $account_code, 'account_group' => $account_group, 'account_desc_short' => $account_desc_short, 'account_desc_long' => $account_desc_long, 'activity_account' => $activity_account, 'consolidate_only' => $consolidate_only, 'has_parent' => $has_parent, 'coa_level' => $coa_level, 'has_children' => $has_children, 'parent_account_id' => $parent_account_id, 'last_modified_by' => $_SESSION['user_name'], 'last_modified_on' => getDateTime(date('now'), "mySQL"), 'created_by' => $_SESSION['user_name'], 'created_on' => getDateTime(date('now'), "mySQL"), 'account_status' => 'Active'));
        $new_coa_id = DB::insertId();
        if ($new_coa_id > 0 and $has_parent == 1) {
            DB::update(DB_PREFIX . $_SESSION['co_prefix'] . 'coa', array('has_children' => 1), "account_id=%s", $parent_account_id);
        }
        return $new_coa_id;
    } else {
        return "0";
    }
}
Пример #6
0
 //$horo = new Models_Horo();
 $city = findCity($_GET['city_id']);
 //clearing user sql
 $modelGeneral->clearCache($userSql);
 //updating the city
 if ($uid == $_SESSION['user']['id']) {
     $data = array();
     $md5Check = md5($userDetails['horo_cities']);
     $horo_cities[$city['id']] = $city['name'];
     $data['horo_cities'] = json_encode($horo_cities);
     $md5Check2 = md5($data['horo_cities']);
     if ($md5Check != $md5Check2) {
         updateSettings($_SESSION['user']['id'], $data);
     }
 }
 $fromDate = getDateTime($_GET['from_date']);
 $date = $fromDate['year'] . '-' . $fromDate['month'] . '-' . $fromDate['day'];
 $past = '';
 $returnResult = array();
 for ($counter = 0; $counter < $_GET['no_days']; $counter++) {
     $day = date('d', strtotime("{$date} +{$counter} day"));
     $month = date('m', strtotime("{$date} +{$counter} day"));
     $year = date('Y', strtotime("{$date} +{$counter} day"));
     for ($j = 0; $j < 24; $j = $j + 1) {
         $hour = $j;
         $dob = $year . '-' . $month . '-' . $day . ' ' . $hour . ':00:00';
         $data2 = array_merge($city, array('dob' => $dob));
         $result = $horo->match($userDetails, $data2);
         if ($past == $result[1][9]) {
             continue;
         } else {
Пример #7
0
$js_global = '';
$js_global .= '<script type="text/javascript" src="' . DOMAIN_STATIC . '/themes' . $_version . '/pc/js/jquery.min.js?v=' . $cache_version . '"></script>';
$js_global .= '<script type="text/javascript" src="' . DOMAIN_STATIC . '/themes' . $_version . '/pc/js/bootstrap.min.js?v=' . $cache_version . '"></script>';
$js_global .= '<script type="text/javascript" src="' . DOMAIN_STATIC . '/themes' . $_version . '/tuthuoc/js/tuthuoc.js?v=' . $cache_version . '"></script>';
//google analytics
if (!DEBUG_LOCAL) {
    $js_global .= '<script>
                (function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
                    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                })(window,document,"script","//www.google-analytics.com/analytics.js","ga");
                ga("require","displayfeatures");
                ga("create", "UA-55614065-1", "auto");
                ga("send", "pageview");
            </script>';
    $js_global .= '<script>(function(d, s, id) {
                  var js, fjs = d.getElementsByTagName(s)[0];
                  if (d.getElementById(id)) return;
                  js = d.createElement(s); js.id = id;
                  js.src = "//connect.facebook.net/vi_VN/sdk.js#xfbml=1&appId=1561038610796934&version=v2.0";
                  fjs.parentNode.insertBefore(js, fjs);
                }(document, "script", "facebook-jssdk"));</script>';
    $js_global .= '<script lang="javascript">
    (function() {var _h1= document.getElementsByTagName("title")[0] || false;
        var product_name = ""; if(_h1){product_name= _h1.textContent || _h1.innerText;}var ga = document.createElement("script"); ga.type = "text/javascript";
        ga.src = "//live.vnpgroup.net/js/web_client_box.php?hash=5fae10239172918a62dab2e4d330c339&data=eyJoYXNoIjoiODY5ZmViOWVhOWYxOGViZDNlNDhhNmZhMDQ3NjdkMWMiLCJzc29faWQiOjExM30-&pname="+product_name;
        var s = document.getElementsByTagName("script");s[0].parentNode.insertBefore(ga, s[0]);})();
</script>';
}
$tpl_constants = array('css_global' => $css_global, 'js_global' => $js_global, 'loading_image' => '<span class="fa fa-refresh fa-spin"></span>', 'string_time' => getDateTime(), 'string_wday' => getDateTime(1, 1, 0, 0, ''), 'string_date' => 'Ngày ' . date('d/m'), 'fanpage_link' => 'https://www.facebook.com/suckhoeankhang');
Пример #8
0
    foreach ($client_comments as $comment) {
        ?>
						<div class="box-comment">
					
							<img class="img-circle img-sm" alt="User Image" src="<?php 
        echo get_user_avatar_url($comment['created_by'], '50');
        ?>
" />
			<div class="comment-text">
							<span class="username">
								<?php 
        echo get_user_full_name($comment['created_by']);
        ?>
								<span class="text-muted pull-right">
									<?php 
        echo getDateTime($comment['created_on'], "dtShort");
        ?>
								</span>
							</span>
							<?php 
        echo $comment['comment'];
        ?>
			</div>						
						</div>
						<?php 
    }
} else {
    echo '<div class="box-comment"><div class="comment-text">No Client Notes Added</div></div>';
}
?>
			
Пример #9
0
 /**
  * Check Post-Vars und Data Validation
  *
  * @return Boolean
  */
 function getPostVars()
 {
     $todo_foo = new todo_foo();
     $event = true;
     if (empty($_POST['todotitle'])) {
         $this->errors[] = 'err_100';
         $event = false;
     } else {
         $todo_foo->todo_title = clearVars($_POST['todotitle']);
     }
     if (empty($_POST['todoprio'])) {
         $this->errors[] = 'err_101';
         $event = false;
     } else {
         $todo_foo->todo_prio = clearVars($_POST['todoprio']);
     }
     if (!empty($_POST['todostart'])) {
         $todo_foo->todo_start = getDateTime($_POST['todostart']);
         $todo_foo->show_start = $_POST['todostart'];
     }
     if (!empty($_POST['todofinish'])) {
         $todo_foo->todo_finish = getDateTime($_POST['todofinish'], true);
         $todo_foo->show_finish = $_POST['todofinish'];
     }
     if (!empty($_SESSION['edit_todo_id'])) {
         $todo_foo->todo_id = (int) $_SESSION['edit_todo_id'];
     }
     if (!empty($_POST['movefield'])) {
         $todo_foo->move = $_POST['movefield'];
     }
     if (!empty($_POST['todoproject'])) {
         $todo_foo->todo_pr_id = $_POST['todoproject'];
     } else {
         $todo_foo->todo_pr_id = '0';
     }
     $todo_foo->todo_warndiff = isset($_POST['todowarndiff']) ? $_POST['todowarndiff'] : 0;
     $todo_foo->todo_privat = isset($_POST['todoprivat']) ? $_POST['todoprivat'] : 0;
     if (!empty($_POST['tododof'])) {
         $todo_foo->todo_statusbar = $_POST['tododof'];
     }
     if (isset($_POST['todoagreed'])) {
         $todo_foo->todo_status = $_POST['todoagreed'];
     }
     if (!empty($_POST['todocomment'])) {
         $todo_foo->todo_comment = clearVars($_POST['todocomment']);
     }
     $this->todo_foo = $todo_foo;
     return $event;
 }
Пример #10
0
unset($db_detail);
if (!$detail_data) {
    error_404_document();
}
//tăng view cho tin
$db_update_view = new db_execute('UPDATE news SET new_view = new_view + 1 WHERE new_id = ' . $iNews);
unset($db_update_view);
//lấy chi tiết tin
$sql_news_content = 'SELECT ndt_content FROM news_detail WHERE ndt_id = ' . $iNews;
$db_content = new db_query($sql_news_content);
$row = mysqli_fetch_assoc($db_content->result);
unset($db_content);
$detail_data['new_detail'] = $row['ndt_content'];
$datetime_facebook = $detail_data['new_date'];
$datetime_detail_timestamp = $detail_data['new_date'];
$detail_data['new_date'] = getDateTime(1, 1, 1, 1, '', $detail_data['new_date']);
$detail_data['link_cat'] = generate_cat_url($detail_data);
$detail_data['new_picture'] = get_picture_path($detail_data['new_picture'], 'large');
$detail_data['facebook_share_link'] = 'http://khang.vn' . generate_news_detail_url($detail_data);
$detail_data['facebook_social'] = array();
$detail_data['facebook_social']['like'] = get_facebook_like_button($detail_data['facebook_share_link']);
$detail_data['facebook_social']['comment'] = get_facebook_comment_frame($detail_data['facebook_share_link']);
$detail_data['facebook_social']['embed'] = get_facebook_embedded_post($detail_data['facebook_share_link']);
$detail_data['new_teaser'] = $detail_data['new_teaser'] ? $detail_data['new_teaser'] : cut_string(removeHTML($detail_data['new_detail']), 200, '...');
$color_cat = get_color_category($detail_data['cat_id']);
$rainTpl->assign('color_cat', $color_cat);
$rainTpl->assign('page_title', $detail_data['new_title']);
$rainTpl->assign('detail_data', $detail_data);
//query ra các tin cùng chuyên mục
$sql_cat_list_news = 'SELECT new_id,
                             new_picture,
Пример #11
0
 function errorLog(string $msg)
 {
     logError("[err]{$msg};request ip:" . onLineIp() . ";url:" . getUrl() . ";ReferUrl:" . getReferUrl() . ";time:" . getDateTime());
     // throw new Exception("[err]$msg;request ip:".onLineIp().";url:".getUrl().";ReferUrl:".getReferUrl().";time:".getDateTime());
 }
Пример #12
0
						<abbr class="timeago" title="<?php 
echo $company['last_modified_on'];
?>
">
						</abbr></td>
                        <td width="65%"><p><strong>Last modified</strong> by User :<b>[ <?php 
echo $company['last_modified_by'];
?>
 ]</b> at <b>[ <?php 
echo getDateTime($company['last_modified_on'], 'dtLong');
?>
 ]</b>. Record was <b>first created</b> by User : <b>[  <?php 
echo $company['created_by'];
?>
 ]</b> at <b>[ <?php 
echo getDateTime($company['created_on'], 'dtShort');
?>
 ]</b>. Company <b>Status</b> is<b> [ <?php 
echo $company['company_status'];
?>
 ] </b>. Click here to view history of changes to company ID: <strong><?php 
echo $company['company_id'];
?>
</strong> .
						</p>		
						</td>
                    </tr>
				</tbody>
			</table>
            
     
Пример #13
0
 function detail()
 {
     # form validation settings
     $rules = array(array('field' => 'body', 'label' => 'Comment', 'rules' => 'trim|required|min_length[3]|max_length[1500]|htmlspecialchars|xss_clean'));
     $this->form_validation->set_message('required', '%s required');
     $this->form_validation->set_message('min_length', '%s too short');
     $this->form_validation->set_message('max_length', '%s too long');
     $this->form_validation->set_rules($rules);
     # valid input
     if ($this->form_validation->run() == TRUE) {
         # verify humanity and redirect if bot
         if ($_POST['human'] != "") {
             redirect('shout');
         } else {
             # remove value from array
             unset($_POST['human']);
         }
         # get IP
         $ip = $_SERVER['REMOTE_ADDR'];
         # seed array with post data and extend
         $data = $_POST;
         $data['ip'] = $ip;
         $data['date'] = getDateTime();
         # format urls and mailtos: auto_link([input string], [url, email, both], [open links in new window?])
         $data['body'] = auto_link($data['body'], 'both', TRUE);
         $this->db->insert('comments', $data);
         $this->db->update('submissions', array('lastpost' => getDateTime()), array('id' => $data['submission_id']));
         redirect('shout/detail/' . $data['submission_id']);
     }
     # get comments
     $data['submission_id'] = $this->uri->segment(3);
     # verify that shout exists before continuing
     $this->db->where('id', $data['submission_id']);
     $results = $this->db->count_all_results('submissions');
     if ($results < 1) {
         redirect('shout');
     }
     # prep pagination
     $config['per_page'] = '10';
     $config['uri_segment'] = 5;
     $config['base_url'] = base_url() . 'shout/detail/' . $data['submission_id'] . '/more';
     $config['first_link'] = '';
     $config['last_link'] = '';
     $config['prev_link'] = '&larr; Newer';
     $config['next_link'] = 'Older &rarr;';
     $config['full_tag_open'] = "<div id='page_nav_links'>";
     $config['full_tag_close'] = "</div>";
     $this->db->select('id');
     $this->db->where('submission_id', $data['submission_id']);
     $config['total_rows'] = $this->db->count_all_results('comments');
     $this->pagination->initialize($config);
     # get uri data
     $data['db_offset'] = $this->uri->segment(5);
     # get(table, limit, offset)
     $this->db->select('id, body, ip, date');
     $this->db->where('submission_id', $data['submission_id']);
     $this->db->order_by("date", "desc");
     $data['comments'] = $this->db->get('comments', $config['per_page'], $data['db_offset']);
     $data['before'] = $config['total_rows'];
     $data['after'] = $data['comments']->num_rows;
     $data['pageNavLinks'] = $this->pagination->create_links();
     # get the shout's content
     $this->db->select('id, title, body, ip, date');
     $data['shout'] = $this->db->get_where('submissions', array('id' => $data['submission_id']));
     # finally...
     $this->load->view('detail_view', $data);
 }
Пример #14
0
    case 1:
        $tip = "sin(60 is" . sin(6);
        break;
    case 2:
        $tip = "The square root of {$r} is " . sqrt($r);
        break;
    case 3:
        $tip = "987654321 is formatted to " . number_format('987654321', $r, '.', ',');
        break;
    case 4:
        $tip = "Your digital ID is " . uniqid();
        break;
    case 5:
        $tip = "2<sup>{$r}</sup> is " . pow(2, $r);
        break;
    case 6:
        $tip = "{$r} in binary format is " . decbin($r);
        break;
    default:
        $tip = "Natural logarithms, <i>e</i>, to the power of {$r} is " . exp($r);
        break;
}
echo $tip;
echo "<hr size='1'>";
function getDateTime()
{
    date_default_timezone_set("America/Los_Angeles");
    echo date('l jS \\of F Y h:i:s A');
}
getDateTime();
Пример #15
0
function compatibleDateTimes($baseArray, $otherArray)
{
    $baseDates = getDateTime($baseArray);
    $otherDates = getDateTime($baseArray);
    $found = true;
    for ($i = 1; $i < count($baseDates) && $found; $i++) {
        //for each item in base array, search for its counterpart; stop searching if one entry cannot be found
        $found = false;
        for ($j = 0; $j < count($otherDates) && !$found; $j++) {
            //keep searching if the element has not been found
            if ($baseDates[$i] == $otherDates[$j]) {
                $found = true;
            }
        }
    }
    return $found;
}
Пример #16
0
     * 
     ***************  ADD PHOTOS FORM   **********************
     * 
     ***********************************************************/
 /*********************************************************
 * 
 ***************  ADD PHOTOS FORM   **********************
 * 
 ***********************************************************/
 case "add_talent_photo":
     $talent_id = $_POST['talent_id'];
     $photo_caption = $_POST['photo_caption'];
     $created_by = $_SESSION['user_id'];
     $created_on = getDateTime(NULL, "mySQL");
     $last_modified_by = $_SESSION['user_id'];
     $last_modified_on = getDateTime(NULL, "mySQL");
     if ($talent_id > 0 and $talent_id != "") {
         //check if the file is uploaded and process the file if file is uploaded
         if (!file_exists($_FILES['talent_photo']['tmp_name']) || !is_uploaded_file($_FILES['talent_photo']['tmp_name'])) {
             // do nothing
         } else {
             //if photo is uploaded process the file with upload class
             // process Talent Photos Information edit form
             DB::insert('tams_talent_photos', array('talent_id' => $talent_id, 'photo_caption' => $photo_caption, 'created_by' => $created_by, 'created_on' => $created_on, 'last_modified_by' => $last_modified_by, 'last_modified_on' => $last_modified_on));
             $photo_id = DB::insertId();
             $photo_name .= $talent_id . "_" . $photo_id;
             $handle = new upload($_FILES['talent_photo']);
             if ($handle->uploaded) {
                 $handle->file_new_name_body = $photo_name;
                 $handle->allowed = array('image/*');
                 //	$handle->file_overwrite = true;
                <p><?php 
echo $voucher_desc;
?>
</p>
            </div><!-- /.col -->
			<div class="col-sm-4  ">
              <b>JV ID: </b> <?php 
echo $voucher_id;
?>
</b><br/>
              <b>Voucher Ref#:</b> <?php 
echo $voucher_ref;
?>
<br/>
              <b>Voucher Date:</b> <?php 
echo getDateTime($voucher_date, "dLong");
?>
<br/>
              
            </div><!-- /.col -->
			 
          </div><!-- /.row -->
          
          
             </div><!-- /.box-body -->
            <div class="box-footer">
             <small> Explanation text for JV header</small>
            </div><!-- /.box-footer-->
          </div><!-- /.box -->
     	 </section><!-- /.content -->
 
Пример #18
0
     ob_flush();
 }
 if (empty($usrcfg->language)) {
     $language = DEFAULTLANGUAGE;
 } else {
     $language = $usrcfg->language;
 }
 require_once ROOT_PATH . 'includes/lang/' . $language . '.php';
 if (isset($_POST['users'])) {
     $users = $user->empl_position >= 50 ? $_POST['users'] : array($user->empl_id);
 } else {
     $users = array($user->empl_id);
 }
 $taet = new taet();
 $expstart = getDateTime($_POST['expstart']);
 $expfinish = getDateTime($_POST['expfinish']) + 60 * 60 * 24;
 $projectsarr = $_POST['expprojectid'];
 $groupby = $_POST['groupby'];
 $options1 = isset($_POST['options1']) ? $_POST['options1'] : array();
 if (isset($_POST['taetexport'])) {
     $options1[] = 'users';
 }
 $options2 = isset($_POST['options2']) ? $_POST['options2'] : array();
 $options3 = isset($_POST['options3']) ? $_POST['options3'] : array();
 switch ($groupby) {
     case 'userprojects':
         $options = $options1;
         $zusatz = '';
         $xsl_template = 'export.xsl';
         break;
     case 'projects':
Пример #19
0
function updatePoints($id, $id2)
{
    if (empty($id) || empty($id2)) {
        return false;
    }
    if ($id == $id2) {
        //return false;
    }
    //$modelGeneral = new Models_General();
    global $modelGeneral;
    $return = array();
    $params = array();
    $t = 60 * 60 * 24 * 365 * 5;
    $params['where'] = sprintf(" AND ((user1 = %s AND user2 = %s) OR (user1 = %s AND user2 = %s))", $modelGeneral->qstr($id), $modelGeneral->qstr($id2), $modelGeneral->qstr($id2), $modelGeneral->qstr($id), $t);
    $check = $modelGeneral->getDetails('user_points', 1, $params);
    if (empty($check)) {
        $modelGeneral->clearCache($modelGeneral->sql);
    }
    if (!empty($check)) {
        foreach ($check as $k => $v) {
            $return[$v['user1']][$v['user2']]['points'] = $v['points'];
            $return[$v['user1']][$v['user2']]['results'] = $v['results'];
        }
        return $return;
    }
    //getting points from api
    $params = array();
    $params['where'] = sprintf(" AND (settings.uid = %s OR settings.uid = %s)", $modelGeneral->qstr($id), $modelGeneral->qstr($id2));
    $settingsDetail = $modelGeneral->getDetails('settings LEFT JOIN geo_cities ON settings.birth_city_id = geo_cities.cty_id', 1, $params, $t);
    if (count($settingsDetail) == 1) {
        $settingsDetail[1] = $settingsDetail[0];
    }
    if (count($settingsDetail) == 2) {
        $sql = $modelGeneral->sql;
        if (empty($settingsDetail[0]['extraDetails'])) {
            $tmp = findCity($settingsDetail[0]['cty_id']);
            $settingsDetail[0] = array_merge($settingsDetail[0], $tmp);
        }
        if (empty($settingsDetail[1]['extraDetails'])) {
            $tmp = findCity($settingsDetail[1]['cty_id']);
            $settingsDetail[1] = array_merge($settingsDetail[1], $tmp);
        }
        if (!empty($settingsDetail[0]['dob']) && !empty($settingsDetail[1]['dob']) && !empty($settingsDetail[0]['birth_city_id']) && !empty($settingsDetail[1]['birth_city_id'])) {
            $Kundali = new Library_Kundali();
            //fetching for first user
            $fromDate = getDateTime($settingsDetail[0]['dob']);
            $toDate = getDateTime($settingsDetail[1]['dob']);
            $returnArrFrom = $Kundali->precalculate($fromDate['month'], $fromDate['day'], $fromDate['year'], $fromDate['hour'], $fromDate['minute'], $settingsDetail[0]['zone_h'], $settingsDetail[0]['zone_m'], $settingsDetail[0]['lon_h'], $settingsDetail[0]['lon_m'], $settingsDetail[0]['lat_h'], $settingsDetail[0]['lat_m'], $settingsDetail[0]['dst'], $settingsDetail[0]['lon_e'], $settingsDetail[0]['lat_s']);
            $returnArrTo = $Kundali->precalculate($toDate['month'], $toDate['day'], $toDate['year'], $toDate['hour'], $toDate['minute'], $settingsDetail[0]['zone_h'], $settingsDetail[1]['zone_m'], $settingsDetail[1]['lon_h'], $settingsDetail[1]['lon_m'], $settingsDetail[1]['lat_h'], $settingsDetail[1]['lat_m'], $settingsDetail[1]['dst'], $settingsDetail[1]['lon_e'], $settingsDetail[1]['lat_s']);
            $pts = $Kundali->getpoints($returnArrFrom[9], $returnArrTo[9]);
            $finalPoints = array('points' => $pts, 'result' => $Kundali->interpret($pts));
            $d = array();
            $d['user1'] = $settingsDetail[0]['uid'];
            $d['user2'] = $settingsDetail[1]['uid'];
            $d['points'] = $finalPoints['points'];
            $d['results'] = $finalPoints['result'];
            $v = array('from' => $returnArrFrom, 'to' => $returnArrTo, 'pts' => $pts, 'result' => $finalPoints);
            $d['details'] = json_encode($v);
            $modelGeneral->addDetails('user_points', $d);
            $return[$d['user1']][$d['user2']]['points'] = $d['points'];
            $return[$d['user1']][$d['user2']]['results'] = $d['results'];
            //fetching for second user
            $fromDate = getDateTime($settingsDetail[1]['dob']);
            $toDate = getDateTime($settingsDetail[0]['dob']);
            $returnArrFrom = $Kundali->precalculate($fromDate['month'], $fromDate['day'], $fromDate['year'], $fromDate['hour'], $fromDate['minute'], $settingsDetail[1]['zone_h'], $settingsDetail[1]['zone_m'], $settingsDetail[1]['lon_h'], $settingsDetail[1]['lon_m'], $settingsDetail[1]['lat_h'], $settingsDetail[1]['lat_m'], $settingsDetail[1]['dst'], $settingsDetail[1]['lon_e'], $settingsDetail[1]['lat_s']);
            $returnArrTo = $Kundali->precalculate($toDate['month'], $toDate['day'], $toDate['year'], $toDate['hour'], $toDate['minute'], $settingsDetail[0]['zone_h'], $settingsDetail[0]['zone_m'], $settingsDetail[0]['lon_h'], $settingsDetail[0]['lon_m'], $settingsDetail[0]['lat_h'], $settingsDetail[0]['lat_m'], $settingsDetail[0]['dst'], $settingsDetail[0]['lon_e'], $settingsDetail[0]['lat_s']);
            $pts = $Kundali->getpoints($returnArrFrom[9], $returnArrTo[9]);
            $finalPoints = array('points' => $pts, 'result' => $Kundali->interpret($pts));
            $d = array();
            $d['user1'] = $settingsDetail[1]['uid'];
            $d['user2'] = $settingsDetail[0]['uid'];
            $d['points'] = $finalPoints['points'];
            $d['results'] = $finalPoints['result'];
            $v = array('from' => $returnArrFrom, 'to' => $returnArrTo, 'pts' => $pts, 'result' => $finalPoints);
            $d['details'] = json_encode($v);
            $modelGeneral->addDetails('user_points', $d);
            $return[$d['user1']][$d['user2']]['points'] = $d['points'];
            $return[$d['user1']][$d['user2']]['results'] = $d['results'];
            $modelGeneral->clearCache($sql);
        }
    }
    return $return;
}
Пример #20
0
 /**
  * 更新
  * @param unknown_type $newRecord
  */
 public static function updateIt($id, $newRecord)
 {
     $oldRecord = self::getDetail($id);
     if ($oldRecord == null) {
         //旧记录不存在
         return false;
     }
     //比较新旧记录
     $updateStr = DBQuery::toUpdateStr($oldRecord, $newRecord);
     if ($updateStr == "") {
         //没有变化,无需更新
         return true;
     }
     $updateStr .= ",ChangeTime='" . getDateTime() . "'";
     $sql = "UPDATE fastphp_SampleTable SET {$updateStr} WHERE ID='{$id}'";
     DBQuery::instance()->executeUpdate($sql);
     return true;
 }
Пример #21
0
?>
</head>
<body>
<div data-role='page'>
<?php 
include 'header.php';
?>
<div data-role='content'>
<h1>Notifications</h1>
<?php 
$query = "SELECT * FROM Notifications WHERE mid = " . $_SESSION['mid'] . " AND status = 1 ORDER BY NotificationIssued DESC;";
$result = mysql_query($query);
if (!$result) {
    error_log(mysql_error());
} else {
    if (!mysql_num_rows($result)) {
        echo "<h3>" . _("You have no unread notifications") . "</h3>";
    }
    while ($row = mysql_fetch_assoc($result)) {
        echo "<b>Date & Time:</b> " . getDateTime($row['NotificationIssued']) . "    <br /><b>Problem:</b> " . notificationTitle($row['ntype']) . "<br />";
        echo notificationText($row['ntype']);
        echo "<form method=\"post\" action=\"m.notifications.post.php\"><input type=\"hidden\" name=\"MarkRead\" value=\"" . $row['nid'] . "\"/><input value=\"" . _("Mark As Read") . "\" type=\"submit\"></form><br/>";
    }
}
include 'footer.php';
?>
</div>
</div>
</body>
</html>
 public function userSave()
 {
     $user_id = getFormGetPostValue("user_id");
     $user_name = getFormGetPostValue("user_name");
     $real_name = getFormGetPostValue("real_name");
     $password = getFormGetPostValue("password");
     $mail = getFormGetPostValue("mail");
     $role_ids = getFormGetPostValue("role_ids");
     $data["user_name"] = $user_name;
     $data["real_name"] = $real_name;
     $data["mail"] = $mail;
     $Model = M("SysUser");
     $RoleUser = M("sysRoleUser");
     $Model->startTrans();
     $result = false;
     if (!empty($user_id)) {
         if (!empty($password)) {
             $data["password"] = md5($password);
         }
         $data["update_time"] = getDateTime();
         $result = $Model->where("user_id=%u", $user_id)->save($data);
     } else {
         if (empty($password)) {
             $data["password"] = md5('123456');
         } else {
             $data["password"] = md5($password);
         }
         $time = getDateTime();
         $data["create_time"] = $time;
         $data["update_time"] = $time;
         $result = $Model->data($data)->add();
     }
     if ($result !== false) {
         if (!empty($user_id)) {
             $RoleUser->where("user_id=%u", $user_id)->delete();
         }
         if (!empty($user_id) && !empty($role_ids)) {
             $map = array();
             $rolesIds = explode(',', $role_ids);
             foreach ($rolesIds as $value) {
                 $map[] = array('id' => getGuid(), 'role_id' => $value, 'user_id' => $user_id);
             }
             if ($RoleUser->addAll($map) === false) {
                 $Model->rollback();
                 $this->returnStatus(false, '设置权限失败');
             }
         }
     } else {
         $Model->rollback();
         $this->returnStatus(false, '修改用户信息失败');
     }
     $Model->commit();
     $this->ajaxReturn(returnStatus());
 }
Пример #23
0
    /**
     * Check Post-Vars und Data Validation
     *
     * @return Boolean
     */
	function getPostVars ()
    {
        $taet_foo = new taet_foo();
        $event = true;

        if (empty($_POST['activitydescription']))
        {
            $this->errors[] = 'err_300';
            $event = false;
        }
        else
        {
            $taet_foo->taet_short_desc = clearVars($_POST['activitydescription']);
        }

        $taet_foo->taet_full_desc = empty($_POST['description']) ? '' : clearVars($_POST['description']);

        if (!empty($_POST['taetid']))
        {
            $taet_foo->taet_id = $_POST['taetid'];
        }

        $taet_foo->shourActive = $_POST['shour'];
        $taet_foo->sminActive  = $_POST['smin'];
        $taet_foo->dhourActive = $_POST['dhour'];
        $taet_foo->dminActive  = $_POST['dmin'];
        $taet_foo->fhourActive = $_POST['fhour'];
        $taet_foo->fminActive  = $_POST['fmin'];

        if ($taet_foo->fhourActive > 23) $taet_foo->fminActive = 0;

        if (!empty($_POST['taetdate']))
        {
            $taet_start = getDateTime($_POST['taetdate']);
            if (!$taet_start)
            {
                $this->errors[] = 'err_302';
                $event = false;
            }

            $taet_foo->show_taetdate = $_POST['taetdate'];
            $taet_foo->taet_start = mktime($taet_foo->shourActive,$taet_foo->sminActive,0,(int) date('m',$taet_start),(int) date('d',$taet_start),(int) date('Y',$taet_start));
            $taet_foo->taet_finish = mktime($taet_foo->fhourActive,$taet_foo->fminActive,0,(int) date('m',$taet_start),(int) date('d',$taet_start),(int) date('Y',$taet_start));
            $_SESSION['taetdate'] = $taet_foo->taet_start;
        }
        else
        {
            $taet_foo->show_taetdate = '';
            $this->errors[] = 'err_302';
            $event = false;
        }




        if (empty($_POST['projectposid']) || empty($_POST['projectid']))
        {
            $this->errors[] = 'err_301';
            $event = false;
        }
        else
        {
            $taet_foo->taet_prpos_id   = $_POST['projectposid'];
            $_SESSION['prpos_id']      = $_POST['projectposid'];
            $_SESSION['projectnr']     = $_POST['projectid'];
            $taet_foo->projectActive   = $_POST['projectid'];
        }

        $this->taet_foo =  $taet_foo;

        return $event;
    }
Пример #24
0
            -->
          </div>

          <div id="past" class="content supplement">
            <h1><img src="image/rnotification.gif" width=48 height=48 alt=""/> <?php 
echo _("Read Notifications");
?>
</h1>
            <div class='notificationText'>
            </div>
            <!--
            <?php 
$query = "SELECT * FROM Notifications WHERE mid = " . $_SESSION['mid'] . " AND status = 2 ORDER BY NotificationIssued DESC;";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
    echo "<b>" . _("Date &amp; Time") . ":</b> " . getDateTime($row['NotificationIssued']) . "    <br /><b>" . _("Problem") . ":</b> " . notificationTitle($row['ntype']) . "<br />";
    echo notificationText($row['ntype']);
}
?>
            -->
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php 
page_footer();
?>
  </div>
  <script type='text/javascript' src='js/notifications.js'></script>
  <script type='text/javascript'>
Пример #25
0
$tbl_draft->addCell('Date', '', 'header');
$tbl_draft->addCell('Ref #', '', 'header');
$tbl_draft->addCell('Description', '', 'header');
$tbl_draft->addCell('Debit', '', 'header');
$tbl_draft->addCell('Credit', '', 'header');
$tbl_draft->addCell('Info', '', 'header');
$tbl_draft->addCell('Actions', '', 'header');
?>

<?php 
$sql = 'SELECT * FROM ' . DB_PREFIX . $_SESSION['co_prefix'] . 'journal_vouchers  WHERE voucher_status="draft" ORDER by voucher_id DESC';
$draft_jvs = DB::query($sql);
foreach ($draft_jvs as $draft_jv) {
    $tbl_draft->addRow();
    $tbl_draft->addCell($draft_jv['voucher_id']);
    $tbl_draft->addCell(getDateTime($draft_jv['voucher_date'], "dShort"));
    $tbl_draft->addCell($draft_jv['voucher_ref_no']);
    $tbl_draft->addCell($draft_jv['voucher description']);
    $tbl_draft->addCell($draft_jv['debits_total']);
    $tbl_draft->addCell($draft_jv['credits_total']);
    $tbl_draft->addCell("More info here like created on, last modify etc");
    $tbl_draft->addCell("<a class='pull btn btn-primary btn-xs' href ='" . SITE_ROOT . "?route=modules/gl/transactions/journal_vouchers/add_journal_voucher_detail&voucher_id=" . $draft_jv['voucher_id'] . "'>Edit&nbsp;&nbsp;<span class='glyphicon glyphicon-edit'></span></a> <a class='pull btn btn-danger btn-xs' href ='#'>Delete&nbsp;&nbsp;<span class='glyphicon glyphicon-trash'></span></a>");
}
//Journal Vouchers Pending Approvel
$tbl_pending = new HTML_Table('', 'table table-striped table-bordered');
$tbl_pending->addRow();
$tbl_pending->addCell('Voucher ID', '', 'header');
$tbl_pending->addCell('Ref #', '', 'header');
$tbl_pending->addCell('Voucher Description', '', 'header');
$tbl_pending->addCell('Total Amount', '', 'header');
$tbl_pending->addCell('Voucher Approved By', '', 'header');
Пример #26
0
 function findHoroInfo($data)
 {
     if (empty($data['dob'])) {
         return false;
     }
     $Kundali = new Library_Kundali();
     $fromDate = getDateTime($data['dob']);
     $returnArrFrom = $Kundali->precalculate($fromDate['month'], $fromDate['day'], $fromDate['year'], $fromDate['hour'], $fromDate['minute'], $data['zone_h'], $data['zone_m'], $data['lon_h'], $data['lon_m'], $data['lat_h'], $data['lat_m'], $data['dst'], $data['lon_e'], $data['lat_s']);
     return $returnArrFrom;
 }
Пример #27
0
$tbl->addCell('FY Description', '', 'header');
$tbl->addCell('Start Date', '', 'header');
$tbl->addCell('End Date', '', 'header');
$tbl->addCell('Status', '', 'header');
$tbl->addCell('Actions', '', 'header');
?>

<?php 
$sql = 'SELECT * FROM ' . DB_PREFIX . $_SESSION['co_prefix'] . 'fiscal_years ORDER by fiscal_year_start_date';
$get_fy = DB::query($sql);
foreach ($get_fy as $fy) {
    $tbl->addRow();
    $tbl->addCell($fy['fiscal_year_id']);
    $tbl->addCell($fy['fiscal_year_desc']);
    $tbl->addCell(getDateTime($fy['fiscal_year_start_date'], "dLong"));
    $tbl->addCell(getDateTime($fy['fiscal_year_end_date'], "dLong"));
    $tbl->addCell($fy['fy_status']);
    $tbl->addCell("<a class='pull btn btn-danger btn-xs' href ='" . $_SERVER['PHP_SELF'] . "?route=modules/gl/setup/financial_periods/edit_fiscal_year&fisca_year_id=" . $fy['fiscal_year_id'] . "'>Edit Fiscal Year&nbsp;&nbsp;<span class='glyphicon glyphicon-edit'></span></a>\n\t\t\t   ");
}
?>
 <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
          		Fiscal Years 
            <small>Defined Fiscal Years for Company Accounts.</small>
          </h1>
          <ol class="breadcrumb">
            <li><a href="<?php 
echo SITE_ROOT;
?>
"><i class="fa fa-dashboard"></i> Home</a></li>
Пример #28
0
                WHERE new_active = 1
                    AND new_picture <> ""
                    AND new_date <= ' . TIMESTAMP . '
                    AND new_cat_id = ' . $iCat . $string_query_unique . '
                ORDER BY new_date DESC
                LIMIT ' . $limit_start . ',' . $limit_size;
$db_list_news = new db_query($sql_list_news);
$top_list_left = array();
$category_list_news = array();
$count_i = 0;
while ($row = mysqli_fetch_assoc($db_list_news->result)) {
    //xử lý dữ liệu
    $row['new_title'] = htmlspecialbo($row['new_title']);
    $row['new_picture'] = get_picture_path($row['new_picture'], 'medium2');
    $row['new_teaser'] = htmlspecialbo($row['new_teaser']);
    $row['new_date'] = getDateTime(1, 1, 1, 1, '', $row['new_date']);
    $row['link_detail'] = generate_news_detail_url($row);
    if (!$row['new_teaser']) {
        //không có teaser - query từ detail tin
        $db_detail = new db_query('SELECT * FROM news_detail WHERE new_id = ' . $row['new_id']);
        $row['new_teaser'] = mysqli_fetch_assoc($db_detail->result);
        unset($db_detail);
        $row['new_teaser'] = removeHTML($row['new_teaser']);
        $row['new_teaser'] = cut_string($row['new_teaser'], 130);
        $row['new_teaser'] = htmlspecialbo($row['new_teaser']);
    }
    $count_i++;
    if ($count_i <= 4) {
        //add vào list trên
        $top_list_left[] = $row;
    } else {
Пример #29
0
								<strong>
									<?php 
echo getDateTime($created_on, "dtLong");
?>
								</strong>by
								<strong>
									<?php 
echo get_user_name($created_by);
?>
								</strong>.
							</p>
							<p>
								It was last modified on
								<strong>
									<?php 
echo getDateTime($last_modified_on, "dtLong");
?>
								</strong>by
								<strong>
									<?php 
echo get_user_name($last_modified_by);
?>
								</strong>.
							</p>
						</div>
					</div>
					<!-- Hidden Fields -->
					<input type="hidden" name="form_name" id="form_name" value="edit_client_form" />
					<input type="hidden" name="client_id" id="client_id" value="<?php 
echo $client_id;
?>
Пример #30
0
//link hỏi đáp
$link_hoidap = generate_qaa_url();
$rainTpl->assign('css_global', $css_global);
$rainTpl->assign('js_global', $js_global);
$rainTpl->assign('page_title', $page_title);
$rainTpl->assign('meta_description', 'Cẩm nang sức khỏe, dinh dưỡng cho gia đình, cộng đồng và xã hội');
$rainTpl->assign('meta_keyword', GENERAL_KEYWORD);
$rainTpl->assign('list_categories', $list_category);
$rainTpl->assign('list_categories_slice', $list_category2);
$rainTpl->assign('link_hoidap', $link_hoidap);
$rainTpl->assign('base_search_url', $base_search_url);
//assign quảng cáo
$rainTpl->assign('adv_top', $adv_top);
$rainTpl->assign('adv_right', $adv_right);
//quảng cáo banner
$rainTpl->assign('adv_banner_list', $adv_banner_list);
$rainTpl->assign('time_now', getDateTime());
include_once '../includes/inc_home.php';
$facebook_og = '
<meta property="og:site_name" content="Khang.vn - Cẩm nang sức khỏe cho mọi nhà"/>
<meta property="og:title" content="Thông tin y tế, sức khỏe cộng đồng"/>
<meta property="og:type" content="website" />
<meta property="og:url" content="http://khang.vn/home/" />
<meta property="og:locale " content="vi_VN"/>
<meta property="fb:app_id" content="1561038610796934" />
<meta property="og:image" content="' . DOMAIN_URL . '/themes/pc/img/logo1.png"/>
<meta property="og:site_name" content="Khang.vn"/>
<meta property="og:description" content="Cẩm nang sức khỏe, dinh dưỡng cho gia đình, cộng đồng và xã hội">
<meta property="og:updated_time" content="' . time() . '">';
$rainTpl->assign('facebook_og', $facebook_og);
$rainTpl->draw('index');