/** * updateStatus */ public function updateStatus($table = '', $arrCheck = array(), $status = 1) { $this->db->trans_start(); $cnt = count($arrCheck); for ($i = 0; $i < $cnt; $i++) { $arrEdit['status'] = $status; setTime($arrEdit, MODE_EDIT); $this->db->where('id', $arrCheck[$i]); $this->db->update($table, $arrEdit); } if ($this->db->trans_complete()) { return true; } }
/** * getInsertUpdate * * @param type $arrData * @return boolean */ public function getRenameFolder($arrData = array()) { $this->db->trans_start(); setTime($arrData['data'], MODE_ADD); // Update folders $this->db->where($arrData['wheres']); $this->db->update('folders', $arrData['data']); // Update files $this->db->where('path', $arrData['wheres']['parent_path'] . $arrData['wheres']['name'] . '/'); $this->db->update('files', array('path' => $arrData['wheres']['parent_path'] . $arrData['data']['name'] . '/')); if ($this->db->trans_complete()) { return true; } }
/** * getDelete */ public function getRefresh() { $this->db->trans_start(); $arrCheck = $this->input->post('checkAll'); for ($i = 0; $i < count($arrCheck); $i++) { $arrBrands = array('id' => $arrCheck[$i]); $arrDt = array('delete_flg' => 0); setTime($arrDt, MODE_EDIT); $this->db->update('modules', $arrDt, $arrBrands); } if ($this->db->trans_complete()) { return true; } }
/** * get video content for feed * * @param INT $id * @param ARRAY $content */ function get_content($content, $cond = NULL) { if (is_array($content)) { if ($content['title'] && $content['videoid']) { $the_content = $content; } elseif ($content['videoid']) { $id = $content['videoid']; } else { return false; } } else { $id = $content; } if (!$the_content) { $the_content = $this->get_video($id); } if (!$the_content) { return false; } $video_feed_fields = array('title', 'description', 'duration', 'videoid', 'date_added', 'file_server_path', 'files_thumbs_path', 'file_directory', 'file_thumbs_count', 'tags', 'category', 'privacy', 'userid', 'username', 'email', 'fullname'); $video_feed_fields = apply_filters($video_feed_fields, 'video_content_fields_unsorted'); $video_fields = array(); foreach ($video_feed_fields as $vid_field) { $video_fields[$vid_field] = $the_content[$vid_field]; } $video_fields['link'] = VideoLink($the_content); $video_fields['thumb'] = get_thumb($the_content); $video_fields['sub_title'] = setTime($the_content['duration']); return $video_fields; }
if ($carrot->getLifeTime() == 0) { delPrize($carrot); } else { $carrot->setLifeTime($carrot->getLifeTime() - 1); } } // Regeneration of carrots if ($GLOBALS['vars']['moreCarrot'] > 1) { $GLOBALS['vars']['moreCarrot']--; } else { for ($i = 0; $i < $_POST['amountMoreCarrot']; $i++) { addCarrot(); } $GLOBALS['vars']['moreCarrot'] = $_POST['timeMoreCarrot']; } setTime(); writeWorld(); if (getTime() == getiTime() * (getLengthDay() + getLengthNight())) { setiTime(); } // Statistics - Weather switch (getWeather()) { case 'sunny': $GLOBALS['vars']['countWeather'][0]++; break; case 'rainy': $GLOBALS['vars']['countWeather'][1]++; break; case 'windy': $GLOBALS['vars']['countWeather'][2]++; break;
public function import($arrData) { $this->db->trans_start(); foreach ($arrData as $data) { setTime($data, MODE_ADD); $this->db->insert('brands', $data); } if ($this->db->trans_complete()) { return true; } }
} ?> <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"> <channel> <?php if ($related_videos) { foreach ($related_videos as $video) { ?> <item> <title><?php echo $video['title']; ?> </title> <link><?php echo videoLink($video); ?> </link> <media:thumbnail url="<?php echo get_thumb($video); ?> " height="90" width="120" time="<?php echo setTime($video['duration']); ?> "/> </item> <?php } } ?> </channel> </rss>
case "2ok": $resultatGlobal = toOk(); break; case "2paulo": case "ok2ko": $resultatGlobal = toPaulo(); break; case "2ko": case "ok2ko-keep": $resultatGlobal = toKo(); break; case "seturl": $resultatGlobal = setUrl(); break; case "settime": $resultatGlobal = setTime(); break; default: $resultatGlobal = ''; break; } } catch (Exception $e) { // En cas d'erreur précédemment, on affiche un message et on arrête tout die('Erreur : ' . $e->getMessage()); } switch ($data->getMethod()) { case 'get': RestUtils::sendResponse(200, json_encode($resultatGlobal, JSON_HEX_APOS), 'application/json'); break; case 'post': RestUtils::sendResponse(200, json_encode($resultatGlobal, JSON_HEX_APOS), 'application/json');
$sql2 = "select COUNT(Id) from userinfo "; $where_2 = " where sex ='M' "; if (setTime($startTime, $endTime)) { $where_2 = getTime($where_2, $startTime, $endTime); } $sql2 .= $where_2; $query2 = mysql_query($sql2); $rs2 = mysql_fetch_array($query2); if ($rs2) { $countM = $rs2[0]; } else { $countM = 0; } $sql3 = "select COUNT(Id) from userinfo "; $where_3 = " where sex ='F' "; if (setTime($startTime, $endTime)) { $where_3 = getTime($where_3, $startTime, $endTime); } $sql3 .= $where_3; $query3 = mysql_query($sql3); $rs3 = mysql_fetch_array($query3); if ($rs3) { $countF = $rs3[0]; } else { $countF = 0; } $sex = "[{value:'" . $countM . "', name:'male'},{value:'" . $countF . "',name:'female'},]"; $json_sex = json_encode($sex); echo $json_sex; } else { if ($flag == "f5") {
/** * getDelete */ public function getDelete($mode = '') { $this->db->trans_start(); $arrCheck = $this->input->post('checkAll'); for ($i = 0; $i < count($arrCheck); $i++) { $arrWhere = array('id' => $arrCheck[$i]); if ($mode == MODE_DELETE) { $arrDt = array('delete_flg' => 1); setTime($arrDt, MODE_DELETE); $this->db->update('orders', $arrDt, $arrWhere); } else { if ($mode == MODE_DELETE_DB) { $this->db->delete('orders', $arrWhere); } } } if ($this->db->trans_complete()) { return true; } }
if (hasConfirmFlag($confirmFlag)) { $where2 = setConfirmFlag($where2, $confirmStartMonth, $confirmEndMonth); } } else { if ($question == "confirmed") { $sql = "select COUNT(Id) from userinfo"; if (hasCondition($sex, $state, $country)) { $where1 = setCondition($where1, $sex, $state, $country); } if (setTime($fromTime, $toTime)) { $where1 = getTime($where1, $fromTime, $toTime); } if (hasCondition($dump_sex, $dump_state, $dump_country)) { $where2 = setCondition($where2, $dump_sex, $dump_state, $dump_country); } if (setTime($fromTime, $toTime)) { $where2 = getTime($where2, $fromTime, $toTime); } } else { if ($question == "firsttimeuser") { $sql = "select COUNT(id) from action "; $where1 .= " and isfirst = 'T' "; $where2 .= " and isfirst = 'T' "; if (hasCondition($sex, $state, $country)) { $where1 = setFirstCondition($where1, $sex, $state, $country); } if (hasUser($user)) { $where1 = setUser($where1, $user); } if (setInsertTime1($fromTime, $toTime)) { $where1 = getInsertTime1($where1, $fromTime, $toTime);