function ShowIndexCategories() { global $context, $txt, $smcFunc, $user_info, $boardurl, $scripturl, $modSettings; //Update Link Tree setLinktree('downloads', 'adkdown_downloads'); //Load categories getDownloadCategories(); //Important $context['unApprove'] = getTotal('adk_down_file', 'approved = {int:cero}', array('cero' => 0)); $context['last_downloads'] = LastTenDownloads(); $context['downloads_popular'] = PopularViewDownloads(); //Load main trader template. $context['sub_template'] = 'main'; $context['page_title'] = $txt['adkdown_downloads']; }
function view_icons() { global $context, $txt, $smcFunc, $scripturl; checkSession('get'); $context['sub_template'] = 'view_icons'; $context['page_title'] = $txt['adkadmin_name'] . ': ' . $txt['adkadmin_icons']; $context['start'] = !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0; $limit = 10; $total = getTotal('adk_icons'); $context['load_icons'] = getIcons('', array(), 'id_icon ASC', $context['start'], $limit); $context['page_index'] = constructPageIndex($scripturl . '?action=admin;area=adkadmin;sa=manageicons;' . $context['session_var'] . '=' . $context['session_id'], $context['start'], $total, $limit); }
// SETS POINTS function setPoints($conn, $userid, $points) { $query = "update users set points={$points} where fbid ='{$userid}'"; $result = $conn->query($query); if ($result == TRUE) { } else { echo "error" . $sql . "<br>" . $conn->error; } } //----------------------------------------------------------------------- //------1 month alone------- // steak counter $count = getCount($conn, $userid); // streak total $total = getTotal($conn, $userid); // get start date $start = getStart($conn, $userid); // date = start date $date = $start; $todayts = strtotime(date("Y-m-d")); //$tommrts = strtotime("+1 day", $todayts); // this is the formatted date for tomorrow: date("Y-m-d", $tommrts); while (true) { $datets = strtotime($date); // if date not equal tomorrow's date -- edit: todays date - day not completed if ($datets != $todayts) { // get day steps $steps = getSteps($date, $conn); if ($steps >= 7000) { // add steps to streak total
<?php // include db connect class require_once __DIR__ . '/functions.php'; if (!empty($_POST['id'])) { $id = $_POST['id']; $result = mysql_query("SELECT vehicules.nom as nom,vehicules.prenom as prenom,factures.id as id FROM factures , vehicules WHERE id_vehicule = {$id} and id_vehicule=vehicules.id ") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $nom = $row['nom']; $prenom = $row['prenom']; $total = getTotal($row['id']); $id = $row['id']; echo "<tr><td>{$nom} {$prenom} ( {$total} DH) <a class='btn btn-primary blue_b btn-rounded pull-right' href='facture.php?id={$id}'><i class='fa fa-file-pdf-o'></i></a></td></tr>"; } }
/** * Calculate the average value. * @param mixed timestamp value */ function getAverage($statsArray) { return floor(getTotal($statsArray) / count($statsArray)); }
/** * Retrieve the data needed for computation of this form */ function prepareStatsData() { global $statsinfo; $timeRange = $statsinfo->getRangeArray(); $this->dateFormat = $statsinfo->getDateFormat($timeRange['interval']); $timeRange['interval'] = $statsinfo->getIntervalTicks($timeRange['interval']); $diagram = $this->summaryType; $paramArray = array('api_call' => $this->summaryType); if (substr($diagram, 0, 8) == "nxhours:") { $paramArray = array('what' => substr($diagram, 8), 'api_call' => "hours"); $this->hours = true; } else { if (substr($diagram, 0, 11) == "nxweekdays:") { $paramArray = array('what' => substr($diagram, 11), 'api_call' => "weekdays"); $this->weekdays = true; } } if (substr($diagram, 0, 11) == "nxweekdays:") { $weekdays = true; $diagram = substr($diagram, 11); } $constraint = array(); if ($this->spid != "") { $constraint["constraints"] = array('document_string' => $this->spid); } $this->data = phpOpenTracker::get(array_merge($paramArray, $timeRange, $constraint)); $this->minTs = getMinTs($this->data); $this->maxTs = getMaxTs($this->data); $this->median = getMedian($this->data); $this->total = getTotal($this->data); $this->average = getAverage($this->data); }
<?php function getTotal($value1, $value2 = 5) { return $value1 + $value2; } $mathTotal = getTotal(5); assert(mathTotal, 10); testEnd();
function adk_newsadk() { global $scripturl, $txt, $smcFunc, $adkportal, $boardurl, $context, $adkFolder, $current_load; //Set the limit $limit = $adkportal['adk_news']; //And create multippages $context['start'] = isset($_REQUEST['pag']) ? !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0 : 0; //Count all news $total = getTotal('adk_news'); $context['page_index'] = constructPageIndex($scripturl . '?pag', $context['start'], $total, $limit); $quest = $smcFunc['db_query']('', ' SELECT n.id, n.new, n.autor, n.titlepage, n.time, IFNULL(t.id_new, 0) AS id_new, t.id_topic, IFNULL(m.body, n.new) AS new FROM {db_prefix}adk_news AS n LEFT JOIN {db_prefix}topics AS t ON (t.id_new = n.id) LEFT JOIN {db_prefix}messages AS m ON (t.id_first_msg = m.id_msg) ORDER BY id DESC LIMIT {int:start}, {int:limit}', array('start' => $context['start'], 'limit' => $limit)); $adkportal['adknews'] = array(); while ($fila = $smcFunc['db_fetch_assoc']($quest)) { $adkportal['adknews'][] = array('id' => $fila['id'], 'index' => parse_bbc($fila['new']), 'member' => un_CleanAdkStrings($fila['autor']), 'title' => un_CleanAdkStrings($fila['titlepage']), 'time' => timeformat($fila['time']), 'id_topic' => $fila['id_topic']); } foreach ($adkportal['adknews'] as $poster) { if (!empty($context['block']['b'])) { echo ' <span class="clear upperframe"> <span> </span> </span> <div class="roundframe"> <div>'; } echo ' <img src="' . $adkFolder['images'] . '/feed.png" alt="' . $poster['title'] . '" style="vertical-align: top;" /> ', !empty($poster['id_topic']) ? '<a href="' . $scripturl . '?topic=' . $poster['id_topic'] . '.0">' : '', ' <strong>', $poster['title'], '</strong> ', !empty($poster['id_topic']) ? '</a>' : '', ' <div style="float: right;">'; if (!empty($poster['id_topic'])) { echo ' <a href="' . $scripturl . '?topic=' . $poster['id_topic'] . '.0"><img src="' . $adkFolder['images'] . '/comment_add.png" title="' . $txt['sendtopic_comment'] . ': ' . $poster['title'] . '" alt="' . $txt['sendtopic_comment'] . ': ' . $poster['title'] . '" /></a>'; } if (allowedTo('adk_portal')) { if (empty($poster['id_topic'])) { echo ' <a href="' . $scripturl . '?action=admin;area=blocks;sa=showeditnews;id=' . $poster['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '"><img src="' . $adkFolder['images'] . '/edit.png" title="' . $txt['adkmod_block_editar'] . ' ' . $poster['title'] . '" alt="' . $txt['adkmod_block_editar'] . ' ' . $poster['title'] . '" /></a>'; } echo ' <a onclick="return confirm(\'', $txt['adkmod_block_remove_message'], '\');" href="' . $scripturl . '?action=admin;area=blocks;sa=showdeletenews;del=' . $poster['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '"><img src="' . $adkFolder['images'] . '/delete.png" title="' . $txt['adkmod_block_borrar'] . ' ' . $poster['title'] . '" alt="' . $txt['adkmod_block_borrar'] . ' ' . $poster['title'] . '" /></a>'; } echo ' </div> <hr /> <div class="adk_padding_8"> ' . $poster['index'] . ' </div> <br />'; if (!empty($adkportal['adk_bookmarks_news']) && !empty($poster['id_topic'])) { adk_bookmarks('right', 'auto_news', $poster['id_topic']); } if (empty($adkportal['adk_disable_autor'])) { if (empty($context['block']['b'])) { echo ' <span class="clear upperframe"> <span> </span> </span> <div class="roundframe"> <div>'; } else { echo '<hr />'; } echo ' <div class="smalltext text_align_center adk_padding_5"> ' . $txt['adkmod_block_added_portal'] . ': <b>' . $poster['member'] . '</b> - ' . $poster['time'] . ' </div>'; if (empty($context['block']['b'])) { echo ' </div> </div> <span class="lowerframe"> <span> </span> </span> <br />'; } } if (!empty($context['block']['b'])) { echo ' </div> </div> <span class="lowerframe"> <span> </span> </span>'; } } if ($current_load[0] == 'default') { if (!empty($context['block']['b'])) { echo ' <span class="clear upperframe"> <span> </span> </span> <div class="roundframe"> <div>'; } echo ' <div class="adk_align_right">' . $txt['pages'] . ': ' . $context['page_index'] . '</div> <div class="adk_height_1"></div>'; if (!empty($context['block']['b'])) { echo ' </div> </div> <span class="lowerframe"> <span> </span> </span>'; } } $smcFunc['db_free_result']($quest); }
function getMonth($month, &$tree) { $months = array('jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'); $currentMonth = --$month; global $monthName; $monthName = $months[$currentMonth]; getTotal($tree); //print_r($tree); //console.debug(tree[0].children[0].value.toFixed(2)) }
<?php if (is_ajax()) { if (isset($_POST["action"]) && !empty($_POST["action"])) { //Checks if action value exists $action = $_POST["action"]; switch ($action) { //Switch case for value of action case "insert": addNewAcufene(); break; case "getData": getInfoForm(); break; case "getTotal": getTotal(); break; case "getListOfZips": getZips(); break; } } } //Function to check if the request is an AJAX request function is_ajax() { return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'; } function addNewAcufene() { include_once dirname(__FILE__) . '/database/handlerDb.php';
mysql_query("DELETE FROM tbl_tag WHERE category_id = '{$category_child}'", $conn); } } mysql_query("DELETE FROM tbl_tag_relation WHERE category_child = '{$category_id}' OR category_parent = '{$category_id}'", $conn); } //END CHECK $_SESSION['alert'] = "success"; $_SESSION['msg'] = "Item(s) has been successfully deleted."; } else { if ($_POST['btn-index-category'] == "GO") { if ($_POST['category-action'] == "delete" || $_POST['category-option'] == "yes") { foreach ($_POST['category_id'] as $category_id) { // CALL FUNCTION $check_delete = check_delete($category_id); $category_check_name = check_delete_get_category_name($category_id); $validate_delete = getTotal($category_id); if ($validate_delete['total_product'] > 0) { $_SESSION['alert'] = "error"; $_SESSION['msg'] = "Can't delete because it contains one or more items."; } else { mysql_query("DELETE FROM tbl_tag WHERE category_id = '{$category_id}'", $conn); $_SESSION['alert'] = "success"; $_SESSION['msg'] = "Item(s) has been successfully deleted."; } } } } } } // SHOW CATEGORY function listCategory($level, $parent, $current_category)
function ShowShoutbox() { global $txt, $adkportal, $context, $smcFunc, $scripturl, $user_info, $boardurl; //Load our Custom language adkLanguage('Adk-echomodules'); //id_group? $continue = shoutboxPermissions('view'); //Are you allowed to view shoutbox? if (!$continue) { fatal_lang_error('adkfatal_shout_now_allowed', false); } //Load Linktree setLinktree('adk_shoutbox', 'adkmodules_shouts'); //Delete any? if (!empty($_REQUEST['del']) && $user_info['is_admin']) { deleteShouts((int) $_REQUEST['del']); } //Template adktemplate('Adk-echomodules'); //Load our css $context['html_headers'] .= getCss('modules'); //Shouts limit $shout_limit = 20; //Start from? $context['start'] = !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0; //Load total shoutbox $total = getTotal('adk_shoutbox'); //Well.... construct page index. $context['page_index'] = constructPageIndex($scripturl . '?action=adk_shoutbox', $context['start'], $total, $shout_limit); //Load shouts $context['shouts'] = getShouts($context['start'], $shout_limit); //Show the page_title $context['page_title'] = $txt['adkmodules_shouts']; //Sub_template $context['sub_template'] = 'load_shout'; }
public function getSearchTimesheetJsObjectPerMonth($employeeId, $dayDateArr) { //$employeeId = Session::get('userEmployeeId'); //$dayDateArr = str_replace(array('<br>', '<br/>', '<br />'), '', $dayDateArr); foreach ($dayDateArr as $dayDate) { Session::put('dayDate', $dayDate); //$timeSheet[] = DB::table('employee_timesheet')->where('employee_id', $employeeId)->where('daydate', trim($dayDate))->get(); $schedule[] = DB::table('employee_schedule')->where('employee_id', $employeeId)->where('schedule_date', trim($dayDate))->get(); $timeSheet[] = DB::table('employee_timesheet')->join('overtime', 'employee_timesheet.id', '=', 'overtime.timesheet_id')->where('employee_timesheet.employee_id', '=', $employeeId)->where('employee_timesheet.daydate', '=', trim($dayDate))->get(); } //Generate Json object for data tables jquery plugin //http://www.datatables.net/examples/ajax/objects.html $ctr = 1; $output = '{'; $output .= '"data": ['; for ($i = 0; $i <= sizeof($timeSheet) - 1; $i++) { $output .= '{'; //http://datatables.net/examples/server_side/ids.html $output .= '"DT_RowId": ' . '"' . $timeSheet[$i][0]->timesheet_id . '",'; $output .= '"id": ' . '"' . $timeSheet[$i][0]->timesheet_id . '",'; //Date $output .= '"daydate": ' . '"' . date('D, M d', strtotime($timeSheet[$i][0]->daydate)) . '",'; //Schedule if (!empty($timeSheet[$i][0]->schedule_in) && !empty($timeSheet[$i][0]->schedule_out)) { $output .= '"schedule": ' . '"' . date('H:i', strtotime($timeSheet[$i][0]->schedule_in)) . ' - ' . date('H:i', strtotime($timeSheet[$i][0]->schedule_out)) . '",'; } else { $output .= '"schedule": ' . '"' . '00:00:00 - 00:00:00' . '",'; } //in-out 1 /*if ( !empty($timeSheet[$i][0]->time_in_1) && !empty($timeSheet[$i][0]->time_out_1) ) { $output .= '"in_out_1": '. '"'.date('H:i', strtotime($timeSheet[$i][0]->time_in_1)). ' - ' .date('H:i', strtotime($timeSheet[$i][0]->time_out_1)).'",'; } elseif ( !empty($timeSheet[$i][0]->time_in_1) && empty($timeSheet[$i][0]->time_out_1) ) { $output .= '"in_out_1": '. '"'.date('H:i', strtotime($timeSheet[$i][0]->time_in_1)). ' - ' .'",'; } elseif ( empty($timeSheet[$i][0]->time_in_1) && !empty($timeSheet[$i][0]->time_out_1) ) { $output .= '"in_out_1": '. '"'. ' - ' .date('H:i', strtotime($timeSheet[$i][0]->time_out_1)).'",'; } else { $output .= '"in_out_1": '. '"'. ' - ' .'",'; }*/ if (!empty($timeSheet[$i][0]->time_in_1)) { $output .= '"in_1": ' . '"' . date('H:i', strtotime($timeSheet[$i][0]->time_in_1)) . '",'; } /*else { $output .= '"in_1": '. '"'. ' --:-- ' .'",'; }*/ if (!empty($timeSheet[$i][0]->time_out_1)) { $output .= '"out_1": ' . '"' . date('H:i', strtotime($timeSheet[$i][0]->time_out_1)) . '",'; } /*else { $output .= '"out_1": '. '"'. ' --:-- ' .'",'; }*/ //in-out 2 /*if ( !empty($timeSheet[$i][0]->time_in_2) && !empty($timeSheet[$i][0]->time_out_2) ) { $output .= '"in_out_2": '. '"'.date('H:i', strtotime($timeSheet[$i][0]->time_in_2)). ' - ' .date('H:i', strtotime($timeSheet[$i][0]->time_out_2)).'",'; } elseif ( !empty($timeSheet[$i][0]->time_in_2) && empty($timeSheet[$i][0]->time_out_2) ) { $output .= '"in_out_2": '. '"'.date('H:i', strtotime($timeSheet[$i][0]->time_in_2)). ' - ' .'",'; } elseif ( empty($timeSheet[$i][0]->time_in_2) && !empty($timeSheet[$i][0]->time_out_2) ) { $output .= '"in_out_2": '. '"'. ' - ' .date('H:i', strtotime($timeSheet[$i][0]->time_out_2)).'",'; } else { $output .= '"in_out_2": '. '"'. ' - ' .'",'; }*/ if (!empty($timeSheet[$i][0]->time_in_2)) { $output .= '"in_2": ' . '"' . date('H:i', strtotime($timeSheet[$i][0]->time_in_2)) . '",'; } /*else { $output .= '"in_2": '. '"'. ' --:-- ' .'",'; }*/ if (!empty($timeSheet[$i][0]->time_out_2)) { $output .= '"out_2": ' . '"' . date('H:i', strtotime($timeSheet[$i][0]->time_out_2)) . '",'; } /*else { $output .= '"out_2": '. '"'. ' --:-- ' .'",'; }*/ //in-out 3 /*if ( !empty($timeSheet[$i][0]->time_in_3) && !empty($timeSheet[$i][0]->time_out_3) ) { $output .= '"in_out_3": '. '"'.date('H:i', strtotime($timeSheet[$i][0]->time_in_3)). ' - ' .date('H:i', strtotime($timeSheet[$i][0]->time_out_3)).'",'; } elseif ( !empty($timeSheet[$i][0]->time_in_3) && empty($timeSheet[$i][0]->time_out_3) ) { $output .= '"in_out_3": '. '"'.date('H:i', strtotime($timeSheet[$i][0]->time_in_3)). ' - ' .'",'; } elseif ( empty($timeSheet[$i][0]->time_in_3) && !empty($timeSheet[$i][0]->time_out_3) ) { $output .= '"in_out_3": '. '"'. ' - ' .date('H:i', strtotime($timeSheet[$i][0]->time_out_3)).'",'; } else { $output .= '"in_out_3": '. '"'. ' - ' .'",'; }*/ if (!empty($timeSheet[$i][0]->time_in_3)) { $output .= '"in_3": ' . '"' . date('H:i', strtotime($timeSheet[$i][0]->time_in_3)) . '",'; } /*else { $output .= '"in_3": '. '"'. ' --:-- ' .'",'; }*/ if (!empty($timeSheet[$i][0]->time_out_3)) { $output .= '"out_3": ' . '"' . date('H:i', strtotime($timeSheet[$i][0]->time_out_3)) . '",'; } /*else { $output .= '"out_3": '. '"'. ' --:-- ' .'",'; }*/ //Night Differential if (!empty($timeSheet[$i][0]->night_differential_1) && !empty($timeSheet[$i][0]->night_differential_3)) { $output .= '"night_differential": ' . '"' . getTotal($timeSheet[$i][0]->night_differential_1, $timeSheet[$i][0]->night_differential_3) . '",'; } elseif (!empty($timeSheet[$i][0]->night_differential_2) && !empty($timeSheet[$i][0]->night_differential_3)) { //$output .= '"night_differential": '. '"'. getTotal($timeSheet[$i][0]->night_differential_1, $timeSheet[$i][0]->night_differential_3).'",'; $output .= '"night_differential": ' . '"' . getTotal($timeSheet[$i][0]->night_differential_2, $timeSheet[$i][0]->night_differential_3) . '",'; } elseif (!empty($timeSheet[$i][0]->night_differential_1)) { $output .= '"night_differential": ' . '"' . number_format((double) $timeSheet[$i][0]->night_differential_1, 2, '.', '') . '",'; } elseif (!empty($timeSheet[$i][0]->night_differential_2)) { $output .= '"night_differential": ' . '"' . number_format((double) $timeSheet[$i][0]->night_differential_2, 2, '.', '') . '",'; } elseif (!empty($timeSheet[$i][0]->night_differential_3)) { $output .= '"night_differential": ' . '"' . number_format((double) $timeSheet[$i][0]->night_differential_3, 2, '.', '') . '",'; } else { $output .= '"night_differential": ' . '"' . ' - ' . '",'; } //Total Hours if (!empty($timeSheet[$i][0]->total_hours_1) && !empty($timeSheet[$i][0]->total_hours_3)) { $output .= '"total_hours": ' . '"' . getTotal($timeSheet[$i][0]->total_hours_1, $timeSheet[$i][0]->total_hours_3) . '",'; } elseif (!empty($timeSheet[$i][0]->total_hours_2) && !empty($timeSheet[$i][0]->total_hours_3)) { //$output .= '"total_hours": '. '"'. getTotal($timeSheet[$i][0]->total_hours_1, $timeSheet[$i][0]->total_hours_3).'",'; $output .= '"total_hours": ' . '"' . getTotal($timeSheet[$i][0]->total_hours_2, $timeSheet[$i][0]->total_hours_3) . '",'; } elseif (!empty($timeSheet[$i][0]->total_hours_1)) { $output .= '"total_hours": ' . '"' . number_format((double) $timeSheet[$i][0]->total_hours_1, 2, '.', '') . '",'; } elseif (!empty($timeSheet[$i][0]->total_hours_2)) { $output .= '"total_hours": ' . '"' . number_format((double) $timeSheet[$i][0]->total_hours_2, 2, '.', '') . '",'; } else { $output .= '"total_hours": ' . '"' . ' - ' . '",'; } //Work Hours if (!empty($timeSheet[$i][0]->work_hours_1) && !empty($timeSheet[$i][0]->work_hours_3)) { $output .= '"work_hours": ' . '"' . getTotal($timeSheet[$i][0]->work_hours_1, $timeSheet[$i][0]->work_hours_3) . '",'; } elseif (!empty($timeSheet[$i][0]->work_hours_2) && !empty($timeSheet[$i][0]->work_hours_3)) { //$output .= '"work_hours": '. '"'. getTotal($timeSheet[$i][0]->work_hours_1, $timeSheet[$i][0]->work_hours_3).'",'; $output .= '"work_hours": ' . '"' . getTotal($timeSheet[$i][0]->work_hours_2, $timeSheet[$i][0]->work_hours_3) . '",'; } elseif (!empty($timeSheet[$i][0]->work_hours_1)) { $output .= '"work_hours": ' . '"' . number_format((double) $timeSheet[$i][0]->work_hours_1, 2, '.', '') . '",'; } elseif (!empty($timeSheet[$i][0]->work_hours_2)) { $output .= '"work_hours": ' . '"' . number_format((double) $timeSheet[$i][0]->work_hours_2, 2, '.', '') . '",'; } else { $output .= '"work_hours": ' . '"' . ' - ' . '",'; } //Total Overtime if (!empty($timeSheet[$i][0]->total_overtime_1) && !empty($timeSheet[$i][0]->total_overtime_3)) { $output .= '"total_overtime": ' . '"' . getTotal($timeSheet[$i][0]->total_overtime_1, $timeSheet[$i][0]->total_overtime_3) . '",'; } elseif (!empty($timeSheet[$i][0]->total_overtime_2) && !empty($timeSheet[$i][0]->total_overtime_3)) { //$output .= '"total_overtime": '. '"'. getTotal($timeSheet[$i][0]->total_overtime_1, $timeSheet[$i][0]->total_overtime_3).'",'; $output .= '"total_overtime": ' . '"' . getTotal($timeSheet[$i][0]->total_overtime_2, $timeSheet[$i][0]->total_overtime_3) . '",'; } elseif (!empty($timeSheet[$i][0]->total_overtime_1)) { $output .= '"total_overtime": ' . '"' . number_format((double) $timeSheet[$i][0]->total_overtime_1, 2, '.', '') . '",'; } elseif (!empty($timeSheet[$i][0]->total_overtime_2)) { $output .= '"total_overtime": ' . '"' . number_format((double) $timeSheet[$i][0]->total_overtime_2, 2, '.', '') . '",'; } elseif (!empty($timeSheet[$i][0]->total_overtime_3)) { $output .= '"total_overtime": ' . '"' . number_format((double) $timeSheet[$i][0]->total_overtime_3, 2, '.', '') . '",'; } else { $output .= '"total_overtime": ' . '"' . ' - ' . '",'; } //Tardiness if (!empty($timeSheet[$i][0]->tardiness_1) && !empty($timeSheet[$i][0]->tardiness_3)) { $output .= '"tardiness": ' . '"' . getTotal($timeSheet[$i][0]->tardiness_1, $timeSheet[$i][0]->tardiness_3) . '",'; } elseif (!empty($timeSheet[$i][0]->tardiness_2) && !empty($timeSheet[$i][0]->tardiness_3)) { //$output .= '"tardiness": '. '"'. getTotal($timeSheet[$i][0]->tardiness_1, $timeSheet[$i][0]->tardiness_3).'",'; $output .= '"tardiness": ' . '"' . getTotal($timeSheet[$i][0]->tardiness_2, $timeSheet[$i][0]->tardiness_3) . '",'; } elseif (!empty($timeSheet[$i][0]->tardiness_1)) { $output .= '"tardiness": ' . '"' . number_format((double) $timeSheet[$i][0]->tardiness_1, 2, '.', '') . '",'; } elseif (!empty($timeSheet[$i][0]->tardiness_2)) { $output .= '"tardiness": ' . '"' . number_format((double) $timeSheet[$i][0]->tardiness_2, 2, '.', '') . '",'; } else { $output .= '"tardiness": ' . '"' . ' - ' . '",'; } //Undertime if (!empty($timeSheet[$i][0]->undertime_1) && !empty($timeSheet[$i][0]->undertime_3)) { $output .= '"undertime": ' . '"' . getTotal($timeSheet[$i][0]->undertime_1, $timeSheet[$i][0]->undertime_3) . '",'; } elseif (!empty($timeSheet[$i][0]->undertime_2) && !empty($timeSheet[$i][0]->undertime_3)) { //$output .= '"undertime": '. '"'. getTotal($timeSheet[$i][0]->undertime_1, $timeSheet[$i][0]->undertime_3).'",'; $output .= '"undertime": ' . '"' . getTotal($timeSheet[$i][0]->undertime_2, $timeSheet[$i][0]->undertime_3) . '",'; } elseif (!empty($timeSheet[$i][0]->undertime_1)) { $output .= '"undertime": ' . '"' . number_format((double) $timeSheet[$i][0]->undertime_1, 2, '.', '') . '",'; } elseif (!empty($timeSheet[$i][0]->undertime_2)) { $output .= '"undertime": ' . '"' . number_format((double) $timeSheet[$i][0]->undertime_2, 2, '.', '') . '",'; } else { $output .= '"undertime": ' . '"' . ' - ' . '",'; } /*otStatus -1 applied ot 0 denied 1 approved*/ /*$overtimeStatus1 = (string) $timeSheet[$i][0]->overtime_status_1; $overtimeStatus2 = (string) $timeSheet[$i][0]->overtime_status_2; $overtimeStatus3 = (string) $timeSheet[$i][0]->overtime_status_3;*/ /*if( !empty($timeSheet[$i][0]->total_overtime_1) && is_null($timeSheet[$i][0]->overtime_status_1) ) { $cellContent = '<button class=\"ot-apply-btn btn btn-success\" type=\"button\">Apply OT</button>'; $output .= '"overtime_status": '. '"'.gettype($timeSheet[$i][0]->overtime_status_1).'"'; } elseif ( !empty($timeSheet[$i][0]->total_overtime_1) && (!is_null($timeSheet[$i][0]->overtime_status_1) && $timeSheet[$i][0]->overtime_status_1 === -1) ) { $cellContent = '<button class=\"ot-apply-btn btn btn-success\" type=\"button\">Applied OT</button>'; $output .= '"overtime_status": '. '"'.$cellContent.'"'; } elseif( !empty($timeSheet[$i][0]->total_overtime_1) && (!is_null($timeSheet[$i][0]->overtime_status_1) && $timeSheet[$i][0]->overtime_status_1 === 0) ) { $cellContent = '<button class=\"ot-apply-btn btn btn-success\" type=\"button\">Denied OT</button>'; $output .= '"overtime_status": '. '"'.$cellContent.'"'; } elseif( !empty($timeSheet[$i][0]->total_overtime_1) && (!is_null($timeSheet[$i][0]->overtime_status_1) && $timeSheet[$i][0]->overtime_status_1 === 1) ) { $cellContent = '<button class=\"ot-apply-btn btn btn-success\" type=\"button\">Approved OT</button>'; $output .= '"overtime_status": '. '"'.$cellContent.'"'; } else { $cellContent = '<button class=\"ot-apply-btn btn btn-success\" type=\"button\" disabled>Apply OT</button>'; $output .= '"overtime_status": '. '"'.$cellContent.'"'; } */ if (!empty($timeSheet[$i][0]->total_overtime_1) && is_null($timeSheet[$i][0]->overtime_status_1) || !empty($timeSheet[$i][0]->total_overtime_2) && is_null($timeSheet[$i][0]->overtime_status_2) || !empty($timeSheet[$i][0]->total_overtime_1) && is_null($timeSheet[$i][0]->overtime_status_1) && (!empty($timeSheet[$i][0]->total_overtime_3) && is_null($timeSheet[$i][0]->overtime_status_3)) || !empty($timeSheet[$i][0]->total_overtime_2) && is_null($timeSheet[$i][0]->overtime_status_2) && (!empty($timeSheet[$i][0]->total_overtime_3) && is_null($timeSheet[$i][0]->overtime_status_3))) { $cellContent = '<button class=\\"ot-apply-btn btn btn-success\\" type=\\"button\\">Apply OT</button>'; $output .= '"overtime_status": ' . '"' . $cellContent . '"'; } elseif (!empty($timeSheet[$i][0]->total_overtime_1) && (!is_null($timeSheet[$i][0]->overtime_status_1) && $timeSheet[$i][0]->overtime_status_1 === -1) || !empty($timeSheet[$i][0]->total_overtime_2) && (!is_null($timeSheet[$i][0]->overtime_status_2) && $timeSheet[$i][0]->overtime_status_2 === -1) || !empty($timeSheet[$i][0]->total_overtime_1) && (!is_null($timeSheet[$i][0]->overtime_status_1) && $timeSheet[$i][0]->overtime_status_1 === -1) && (!empty($timeSheet[$i][0]->total_overtime_3) && (!is_null($timeSheet[$i][0]->overtime_status_3) && $timeSheet[$i][0]->overtime_status_3 === -1)) || !empty($timeSheet[$i][0]->total_overtime_2) && (!is_null($timeSheet[$i][0]->overtime_status_2) && $timeSheet[$i][0]->overtime_status_2 === -1) && (!empty($timeSheet[$i][0]->total_overtime_3) && (!is_null($timeSheet[$i][0]->overtime_status_3) && $timeSheet[$i][0]->overtime_status_3 === -1))) { $cellContent = '<button class=\\"ot-apply-btn btn btn-success\\" type=\\"button\\" disabled>Applied OT</button>'; $output .= '"overtime_status": ' . '"' . $cellContent . '"'; } elseif (!empty($timeSheet[$i][0]->total_overtime_1) && (!is_null($timeSheet[$i][0]->overtime_status_1) && $timeSheet[$i][0]->overtime_status_1 === 0) || !empty($timeSheet[$i][0]->total_overtime_2) && (!is_null($timeSheet[$i][0]->overtime_status_2) && $timeSheet[$i][0]->overtime_status_2 === 0) || !empty($timeSheet[$i][0]->total_overtime_1) && (!is_null($timeSheet[$i][0]->overtime_status_1) && $timeSheet[$i][0]->overtime_status_1 === 0) && (!empty($timeSheet[$i][0]->total_overtime_3) && (!is_null($timeSheet[$i][0]->overtime_status_3) && $timeSheet[$i][0]->overtime_status_3 === 0)) || !empty($timeSheet[$i][0]->total_overtime_2) && (!is_null($timeSheet[$i][0]->overtime_status_2) && $timeSheet[$i][0]->overtime_status_2 === 0) && (!empty($timeSheet[$i][0]->total_overtime_3) && (!is_null($timeSheet[$i][0]->overtime_status_3) && $timeSheet[$i][0]->overtime_status_3 === 0))) { $cellContent = '<button class=\\"ot-apply-btn btn btn-success\\" type=\\"button\\" disabled>Denied OT</button>'; $output .= '"overtime_status": ' . '"' . $cellContent . '"'; } elseif (!empty($timeSheet[$i][0]->total_overtime_1) && (!is_null($timeSheet[$i][0]->overtime_status_1) && $timeSheet[$i][0]->overtime_status_1 === 1) || !empty($timeSheet[$i][0]->total_overtime_2) && (!is_null($timeSheet[$i][0]->overtime_status_2) && $timeSheet[$i][0]->overtime_status_2 === 1) || !empty($timeSheet[$i][0]->total_overtime_1) && (!is_null($timeSheet[$i][0]->overtime_status_1) && $timeSheet[$i][0]->overtime_status_1 === 1) && (!empty($timeSheet[$i][0]->total_overtime_3) && (!is_null($timeSheet[$i][0]->overtime_status_3) && $timeSheet[$i][0]->overtime_status_3 === 1)) || !empty($timeSheet[$i][0]->total_overtime_2) && (!is_null($timeSheet[$i][0]->overtime_status_2) && $timeSheet[$i][0]->overtime_status_2 === 1) && (!empty($timeSheet[$i][0]->total_overtime_3) && (!is_null($timeSheet[$i][0]->overtime_status_3) && $timeSheet[$i][0]->overtime_status_3 === 1))) { $cellContent = '<button class=\\"ot-apply-btn btn btn-success\\" type=\\"button\\" disabled>Approved OT</button>'; $output .= '"overtime_status": ' . '"' . $cellContent . '"'; } else { $cellContent = '<button class=\\"ot-apply-btn btn btn-success\\" type=\\"button\\" disabled>Apply OT</button>'; $output .= '"overtime_status": ' . '"' . $cellContent . '"'; } if ($ctr == sizeof($timeSheet)) { $output .= '}'; } else { $output .= '},'; } $ctr++; } $output .= ']'; $output .= '}'; return (string) $output; //json_encode($timeSheetObj); }
function ManageImagesAdk() { checkSession('get'); global $context, $smcFunc, $txt, $scripturl; $context['sub_template'] = 'manages_images'; $context['page_title'] = $txt['adkmodules_opcion_img']; //Load Images $context['start'] = !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0; $limit = 4; //Get total $context['total'] = getTotal('adk_advanced_images'); //Load all images $context['load_img'] = getImages('', array(), 'id DESC', $context['start'], $limit); $context['page_index'] = constructPageIndex($scripturl . '?action=admin;area=modules;sa=manageimagesadk;' . $context['session_var'] . '=' . $context['session_id'], $context['start'], $context['total'], $limit); }
function getAllFactures($etat) { $char = ""; if ($etat == 0) { $char = "and etat = 0"; } elseif ($etat == 1) { $char = "and etat = 1"; } $result = mysql_query("SELECT factures.id , created , etat , id_vehicule , nom , prenom , immatriculation , marque , expere , assurance , date_entree , date_sortie FROM factures , vehicules WHERE factures.id_vehicule=vehicules.id {$char}") or die(mysql_error()); $factures = array(); while ($row = mysql_fetch_array($result)) { $row['total'] = getTotal($row['id']); $factures[] = $row; } return $factures; }
<?php ob_start(); require 'ChiffresEnLettres.php'; require 'functions.php'; $facture = ""; $designation = ""; $total = 0; if (isset($_GET['id'])) { $facture = getFacture($_GET['id']); $designations = getDesignationByIdFacture($_GET['id']); $total = getTotal($_GET['id']); if (!$facture) { echo "<script>location.href = 'factures.php';</script>"; } } $lettre = new ChiffreEnLettre(); ?> <style type="text/css"> <!-- table { width: 100%; border:none; border-collapse: collapse; } th { text-align: center; border: solid 1px #000; }
<div class="post-left"> <?php print __(_("Published")) . " " . howLong($post["Start_Date"]) . " " . $in . " " . $categories . " " . __(_("by")) . " " . $post["Author"]; ?> <br /> <?php if ($tags) { print __(_("Tags")) . ": " . $tags; } ?> </div> <div class="post-right"> <?php if ($post["Enable_Comments"]) { print getTotal($post["Comments"], "comment", "comments"); } ?> </div> <div class="clear"></div> <div class="post-content"> <?php print bbCode(pagebreak($post["Content"], $URL)); ?> </div> </div> <div class="clear"></div> <?php }
function afficheRecap($bdd, $idco) { /* Récupération des données personnelles du membre */ list($memberID, $nom, $prenom, $titre, $status, $district, $club, $num, $adressesup, $rue, $ville, $cp, $tel, $mobile, $mail, $positionclub, $positiondistrict, $train, $traindate) = getInfos($bdd, $idco); /* Récupération du follower */ list($fnom, $fprenom) = getFollower($bdd, $memberID); /* Récupération du nombre de personnes réservant l'activité */ $n = 1; if (!(empty($fom) && empty($fprenom))) { $n = $n + 1; } /* Affichage des informations personnelles */ echo ' <div class="row section-head"> <h2 style="color : #11ABB0;" > <FONT size="5"> Vos informations personnelles <FONT></h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Civilité</u> : ' . $titre . '</h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Nom</u> : ' . $nom . '</h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Prenom</u> : ' . $prenom . '</h2> </div> <div class="row section-head"> <h2 style="color : #8BB24C;" > <FONT size="5">Coordonnées <FONT></h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Adresse</u> : ' . $num . ' ' . $rue . ' (' . $adressesup . ') ' . $cp . ' ' . $ville . '</h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Téléphone</u> : ' . $tel . '</h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Mobile</u> : ' . $mobile . '</h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Mail</u> : ' . $mail . '</h2> </div> <div class="row section-head"> <h2 style="color : #8BB24C;"> <FONT size="5">Position dans le Lions Clubs <FONT></h2> </div>'; if ($status == 1) { echo '<div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Satut</u> : Lion </h2> </div>'; } else { echo '<div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Satut</u> : Leo </h2> </div>'; } echo ' <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>District</u> : ' . $district . '</h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Position au sein du district</u> : ' . $positiondistrict . '</h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Club</u> : ' . $club . '</h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Position au sein du club</u> : ' . $positionclub . '</h2> </div> '; if ($train == 1) { echo ' <div class="row section-head"> <h2 style="color : #8BB24C;"><FONT size="5"> Arrivée <FONT></h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > Par train le : ' . $traindate . '</h2> </div>'; } else { echo ' <div class="row section-head"> <h2 style="color : #8BB24C;"><FONT size="5"> Arrivée<FONT> </h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > Libre</h2> </div>'; } echo ' <div class="row section-head"> <h2 style="color : #8BB24C;"> <FONT size="5">Accompagnant<FONT></h2> </div> <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > ' . $fprenom . ' ' . $fnom . '</h2> </div>'; echo ' <div class="row section-head"> <br></br> <h2 style="color : #11ABB0;" > <FONT size="5"> Activités réservées <FONT></h2> </div> <div class="row section-head"> <h2 style="color : #8BB24C;"> <FONT size="5">Repas<FONT></h2> </div>'; /* * ****************************************** */ /* Récupération des activités du panier */ /* * ********************************************** */ /* Récupération du basketID et des totaux */ $basketID = getBasketID($bdd, $memberID); list($totalmeal, $totaltrip, $total) = getTotal($bdd, $basketID); $total = $n * $total; $totaltrip = $n * $totaltrip; $totalmeal = $n * $totalmeal; /* * ************************************************** */ /* Récupération des repas du panier et affichage */ /* * **************************************************** */ /* Récupération du nombre de repas réservés */ $cpt = getNbRepasPanier($bdd, $basketID); if ($cpt != 0) { $sql = 'SELECT Activity_Name, YEAR(Activity_Date), MONTH(Activity_Date), DAY(Activity_Date), Activity_Hour, Belong_Price FROM Activity ' . ' INNER JOIN Activity_Type ON (Activity_Type.Activity_Type_ID = Activity.Activity_Type_ID) ' . ' INNER JOIN Belong ON (Belong.Activity_ID = Activity.Activity_ID) ' . ' WHERE (Basket_ID = :id AND Belong_Paid = 0 AND Belong_Payement_Way IS NULL AND Activity_Type_Name = "Repas" AND Congress_ID = ' . congressID . ') ORDER BY (Activity_Date)'; $stmt = $bdd->prepare($sql, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL)); $stmt->execute(array(':id' => "{$basketID}")); echo ' <div> <TABLE id="tableau" border cols="4" style="border:1px solid black;width : 90%; margin-left : 0"> <TR class="row" > <Td class ="col" width=22% style="border:1px solid black;text-align : center;"><FONT size="4" style="color : #52574B"> Date </FONT></TH> <td class ="col" width= 40% style="border:1px solid black; text-align : center;"> <FONT size="4" style="color : #52574B"> Intitulé </FONT></th> <td class ="col" width= 10% style="border:1px solid black ; text-align : center;"><FONT size="4" style="color : #52574B"> Tarif </FONT></th> <td class ="col" width=253.41 style="border:1px solid black ; text-align : center;"><FONT size="4" style="color : #52574B"> Nombre de personnes </FONT></th> </TR>'; while ($row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) { $activite = $row["Activity_Name"]; $annee = $row["YEAR(Activity_Date)"]; $mois = $row["MONTH(Activity_Date)"]; $jour = $row["DAY(Activity_Date)"]; $heure = $row["Activity_Hour"]; $prix = $row["Belong_Price"]; if ($mois < 10) { $mois = "0" . $mois; } if ($jour < 10) { $jour = "0" . $jour; } $date = $jour . "-" . $mois . "-" . $annee . " à " . $heure; echo ' <TR class="row" > <Td class ="col" width=22% style="border:1px solid black; text-align : center;"> <FONT size="3.5">' . $date . '</FONT> </TH> <td class ="col" width=40% style="border:1px solid black; text-align : center;"> <FONT size="3.5">' . $activite . '</FONT> </th> <td class ="col" width=10% style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $prix . ' € </FONT> </th> <td class ="col" width=253.41 style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $n . ' </FONT> </th> </TR>'; } echo '</TABLE> </div>'; } else { echo ' <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > Aucun repas réservé</h2> </div>'; } /* * ****************************************************** */ /* Récupération des excursions du panier et affichage */ /* * ******************************************************** */ echo ' <div class="row section-head"> <br> <h2 style="color : #8BB24C;"> <FONT size="5"> Excursions<FONT></h2> </div>'; /* Récupération du nombre d'excursions réservées */ $cpt2 = getNbExcursionsPanier($bdd, $basketID); if ($cpt2 != 0) { $sql = 'SELECT Activity_Name, YEAR(Activity_Date), MONTH(Activity_Date), DAY(Activity_Date), Activity_Hour, Belong_Price FROM Activity ' . ' INNER JOIN Activity_Type ON (Activity_Type.Activity_Type_ID = Activity.Activity_Type_ID) ' . ' INNER JOIN Belong ON (Belong.Activity_ID = Activity.Activity_ID) ' . ' WHERE (Basket_ID = :id AND Belong_Paid = 0 AND Belong_Payement_Way IS NULL AND Activity_Type_Name = "Excursion" AND Congress_ID = ' . congressID . ') ORDER BY (Activity_Date)'; $stmt = $bdd->prepare($sql, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL)); $stmt->execute(array(':id' => "{$basketID}")); echo ' <div> <TABLE id="tableau" border cols="3" style="border:1px solid black;width : 90%; margin-left : 0"> <TR class="row" > <Td class ="col" width=22% style="border:1px solid black;text-align : center;"><FONT size="4" style="color : #52574B"> Date </FONT></TH> <td class ="col" width= 40% style="border:1px solid black; text-align : center;"> <FONT size="4" style="color : #52574B"> Intitulé </FONT></th> <td class ="col" width= 10% style="border:1px solid black ; text-align : center;"><FONT size="4" style="color : #52574B"> Tarif </FONT></th> <td class ="col" width=253.41 style="border:1px solid black ; text-align : center;"><FONT size="4" style="color : #52574B"> Nombre de personnes </FONT></th> </TR>'; while ($row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) { $activite = $row["Activity_Name"]; $annee = $row["YEAR(Activity_Date)"]; $mois = $row["MONTH(Activity_Date)"]; $jour = $row["DAY(Activity_Date)"]; $heure = $row["Activity_Hour"]; $prix = $row["Belong_Price"]; if ($mois < 10) { $mois = "0" . $mois; } if ($jour < 10) { $jour = "0" . $jour; } $date = $jour . "-" . $mois . "-" . $annee . " à " . $heure; echo ' <TR class="row" > <Td class ="col" width=22% style="border:1px solid black; text-align : center;"> <FONT size="3.5">' . $date . '</FONT> </TH> <td class ="col" width=40% style="border:1px solid black; text-align : center;"> <FONT size="3.5">' . $activite . '</FONT> </th> <td class ="col" width=10% style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $prix . ' € </FONT> </th> <td class ="col" width=253.41 style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $n . ' </FONT> </th> </TR>'; } echo '</TABLE> </div>'; } else { echo ' <div> <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > Aucune excursion réservée</h2> </div>'; } /* * ************************** */ /* Affichage des totaux */ /* * ********************** */ echo ' <div class="row section-head"> <br></br> <h2 style="color : #11ABB0;" > <FONT size="5"> Totaux <FONT></h2> </div> <div> <TABLE id="tableau" border width=50% cols="2" style="border:1px solid black;width : 40%; margin-left : 0" > <TR class="row" > <Td class ="col" width=300 height = 35 style="border:1px solid black;text-align : center;"><FONT size="4" style="color : #52574B"> Total des repas </Td> <td class ="col" width=101 style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $totalmeal . ' € </FONT></Td> </TR> <TR class="row" > <Td class ="col" width=300 height = 35 style="border:1px solid black;text-align : center;"><FONT size="4" style="color : #52574B"> Total des excursions </Td> <td class ="col" width=101 style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $totaltrip . ' € </FONT></Td> </TR> <TR class="row" > <Td class ="col" width=300 height = 35 style="border:1px solid black;text-align : center;"><FONT size="4" style="color : #52574B"> Total </b> </Td> <td class ="col" width=101 style="border:1px solid black; text-align : center;"><FONT size="3.5" style="color:#BA052C">' . $total . ' € </FONT></Td> </TR> </TABLE> </div> <br>'; /* * ******************************************* */ /* BOUTONS */ /* * ******************************************** */ if (!($cpt = 0 && ($cpt2 = 0))) { echo ' <div> <TABLE id="tableau" border width=50% cols="2" style="width : 100%; margin-left : 0" > <TR class="row" > <Td class ="col" width=200 height = 35 style=" text-align : left;"><FONT size="4" style="color : #52574B"> <form name="validPanier" id="contactForm" method="post" action="paiement.php"> <input type="submit" name="v" value="Valider et payer"> <input type="hidden" name="idco" value="' . $idco . '"> </form> </Td> <Td class ="col" width=200 height = 35 style=" text-align : left;"><FONT size="4" style="color : #52574B"> <form name="imprim" id="contactForm" method="post" action="recapPDF.php"> <input type="submit" name="i" value="Imprimer"> <input type="hidden" name="idco" value="' . $idco . '"> </form> </Td> </TR> </TABLE> <br> </div>'; } }
include '../../config/config.php'; mysql_close(); $link = mysqli_connect($server, $username, $password) or die("Koneksi gagal"); mysqli_select_db($link, $database) or die("Database tidak bisa dibuka"); $clientIP = $_SERVER['REMOTE_ADDR']; if ($_POST['tambah']) { $barcode = $_POST['barcode']; tambahBarang($link, $clientIP, $barcode); } elseif ($_POST['hapus']) { $barcode = $_POST['barcode']; hapusBarang($link, $clientIP, $barcode); } elseif ($_GET['refresh']) { refreshDetail($link, $clientIP); } elseif ($_GET['gettotal']) { getTotal($link, $clientIP); } elseif ($_POST['selesai']) { selesai($link, $clientIP); } elseif ($_POST['cekharga']) { cekHarga($link, $_POST['barcode']); } /** * Tambah barang self checkout, qty selalu 1, karena tidak ada input qty di user interface :) * @param mysqli $link myqli link * @param string $clientIP ip address v4 dari client ybs * @param string $barcode barcode barang */ function tambahBarang($link, $clientIP, $barcode) { if ($barcode != '') { $qty = 1;
function ApproveDownloadsAdmin() { global $smcFunc, $txt, $context, $scripturl, $total_Unapprove, $total_Approve; checkSession('get'); //Basic information $context['page_title'] = $txt['adkeds_approve']; $context['sub_template'] = 'approve_d'; //Request info $context['start_unapproved'] = isset($_REQUEST['adk_unapproved']) ? !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0 : 0; $context['start_approved'] = isset($_REQUEST['adk_approved']) ? !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0 : 0; $limit = 15; //Get total approved and unapproved $total_Unapprove = getTotal('adk_down_file', 'approved = {int:cero}', array('cero' => 0)); $total_Approve = getTotal('adk_down_file', 'approved = {int:cero}', array('cero' => 1)); //Get UnApproved && approved Files $context['unapproved'] = getInfoFileByApprove(0, $context['start_unapproved'], $limit); $context['approved'] = getInfoFileByApprove(1, $context['start_approved'], $limit); //Set the page index. $context['page_index_unapproved'] = constructPageIndex($scripturl . '?action=admin;area=adkdownloads;sa=approvedownloads;adk_unapproved;' . $context['session_var'] . '=' . $context['session_id'] . '', $context['start_unapproved'], $total_Unapprove, $limit); $context['page_index_approved'] = constructPageIndex($scripturl . '?action=admin;area=adkdownloads;sa=approvedownloads;adk_approved;' . $context['session_var'] . '=' . $context['session_id'], $context['start_approved'], $total_Approve, $limit); //Set the total Row $context['total_dow'] = $total_Approve + $total_Unapprove; }