function render_log_table($log_array, $row) { if (!$log_array or !$row) { return false; } foreach ($log_array as $L) { $table .= $row; //print_r($overtime_hours_all); $table = str_replace("##FIRST##", $L["first"], $table); $table = str_replace("##LAST##", $L["last"], $table); $table = str_replace("##WORKING_DAYS##", empty_table($L["working_days"]), $table); $table = str_replace("##WORKING_HOURS##", empty_table(change_sec_hm($L["working_hours"])), $table); $table = str_replace("##HOLIDAY_HOURS##", empty_table(change_sec_hm($L["holiday_hours"])), $table); $table = str_replace("##OVERTIME_HOURS##", empty_table(change_sec_hm($L["overtime_hours"])), $table); $table = str_replace("##OVERTIME_HOURS_ALL##", empty_table(change_sec_hm($L["overtime_hours_all"])), $table); $table = str_replace("##OFFTIME_HOURS##", empty_table(change_sec_hm($L["offtime_hours"])), $table); $table = str_replace("##HOURS_LEFT##", empty_table(change_sec_hm($L["overtime_hours_all"] - $L["offtime_hours_all"] - $L["compensation_hours_all"])), $table); $table = str_replace("##SICK_DAYS##", empty_table($L["sick_days"]), $table); $table = str_replace("##SICK_HOURS##", empty_table(change_sec_hm($L["sick_hours"])), $table); $table = str_replace("##HOLIDAY_DAYS##", empty_table($L["holiday_days"]), $table); $table = str_replace("##HOLIDAYS_LEFT##", empty_table($person_holiday - $L["holiday_days"]), $table); $table = str_replace("##CARE##", empty_table($L["care"]), $table); $table = str_replace("##CARE_HOURS##", empty_table(change_sec_hm($L["care_hours"])), $table); $table = str_replace("##PREGNANCY##", empty_table($L["pregnancy"]), $table); $table = str_replace("##PREGNANCY_HOURS##", empty_table($L["pregnancy_hours"]), $table); $table = str_replace("##EDUCATION##", empty_table($L["education"]), $table); $table = str_replace("##EDUCATION_HOURS##", empty_table(change_sec_hm($L["education_hours"])), $table); $table = str_replace("##PUBLIC_HOLIDAY##", empty_table($L["public_holiday"]), $table); $table = str_replace("##HOLIDAYS_DAYS_ALL##", empty_table($L["holiday_days_all"]), $table); $table = str_replace("##MISSION_DAYS##", empty_table($L["mission"]), $table); $table = str_replace("##MISSION_HOURS##", empty_table(change_sec_hm($L["mission_hours"])), $table); $table = str_replace("##HOLID_ALL_RES##", empty_table($L["holid_all_res"] - $L["holiday_days_all"] - $L["compensation_wdays_all"]), $table); $table = str_replace("##BLOODAY##", empty_table($L["blooday"]), $table); $table = str_replace("##BLOODAY_HOURS##", empty_table($L["blooday_hours"]), $table); $table = str_replace("##SABBATICAL_ALL_RES##", empty_table($L["sabbatical_leave_all_res"] - $L["sabbatical_leave_all"]), $table); $table = str_replace("##SPECIALEAVE##", empty_table($L["special_leave"]), $table); $table = str_replace("##SPECIALLEAVE_LEFT##", empty_table($L["special_leave_all_res"] - $L["special_leave_all"]), $table); $table = str_replace("##WORKINJURY##", empty_table($L["work_injury"]), $table); $table = str_replace("##SABBATICAL##", empty_table($L["sabbatical_leave"]), $table); } return $table; }
include_once 'ressources/class.mysql.inc'; include_once 'ressources/class.ini.inc'; if (isset($_GET["events-table"])) { events_table(); exit; } if (isset($_GET["ShowID"])) { ShowID(); exit; } if (isset($_GET["ShowID-js"])) { ShowID_js(); exit; } if (isset($_POST["empty-table"])) { empty_table(); exit; } popup(); function ShowID_js() { $id = $_GET["ShowID-js"]; if (!is_numeric($id)) { return; } $tpl = new templates(); header("content-type: application/x-javascript"); $page = CurrentPageName(); $sql = "SELECT subject FROM hotspot_admin_mysql WHERE ID={$id}"; $q = new mysql(); $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, "artica_events"));
$LOG[$person_id_db]['first'] = $day_r["ime"]; $LOG[$person_id_db]['last'] = $day_r["priimek"]; } //izpis za userja.... foreach ($persons_id as $person_id_db) { $table .= $row; $table = str_replace("##FIRST##", $LOG[$person_id_db]["first"], $table); $table = str_replace("##LAST##", $LOG[$person_id_db]["last"], $table); $table = str_replace("##WORKING_DAYS##", count($LOG[$person_id_db]) - 2, $table); for ($i = 1; $i <= 31; $i++) { if ($i < 10) { $ix = '0' . $i; } else { $ix = $i; } $table = str_replace("##D" . $i . "##", empty_table($LOG[$person_id_db][$ix]), $table); } } $table2 .= $rownot; for ($stevec = 1; $stevec <= 31; $stevec++) { $spremenljivka = 0; if ($stevec < 10) { $stevecy = '0' . $stevec; } else { $stevecy = $stevec; } foreach ($persons_id as $person_id_db) { $spremenljivka = $spremenljivka + count($LOG[$person_id_db][$stevecy]); } $sumday[$stevecy] = $spremenljivka; if ($sumday[$stevecy] == 0) {
function db_clean($db_name, $verbose = true) { $res = true; $mysqli = server_connect(); if ($mysqli) { if (!$mysqli->select_db($db_name)) { $res = false; if ($verbose) { echo "<br/><p>Warning: Could not open database " . $db_name; } } if ($res) { $mysqli->autocommit(FALSE); if (!$mysqli->query("update recThreadedComments set cmt_ParentCmtID = NULL where cmt_ID>0")) { $res = false; if ($verbose) { echo "<br/><p>Warning: Unable to set parent IDs to null for Comments" . " - SQL error: " . $mysqli->error . "</p>"; } } if ($res) { $tables = array("recThreadedComments" => "Comments", "recForwarding" => "Forwarding", "recRelationshipsCache" => "Relationships Cache", "recSimilarButNotDupes" => "List of Similar Records", "usrRecTagLinks" => "Tag Links", "usrReminders" => "Reminders", "usrRemindersBlockList" => "Reminders Block List", "recDetails" => "Details", "usrBookmarks" => "Bookmarks", "Records" => "Records"); foreach ($tables as $name => $remark) { if (!empty_table($mysqli, $name, $remark, $verbose)) { $res = false; break; } } if ($res) { $res = $mysqli->query("ALTER TABLE Records AUTO_INCREMENT = 0"); if ($res) { $mysqli->commit(); } } } } if (!$res) { $mysqli->rollback(); } $mysqli->close(); } else { $res = false; } return $res; }
<?php include_once('ressources/class.templates.inc'); include_once('ressources/class.ldap.inc'); include_once('ressources/class.users.menus.inc'); include_once('ressources/class.mysql.inc'); include_once('ressources/class.ini.inc'); //ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null); if(isset($_GET["items"])){items();exit;} if(isset($_GET["ShowID"])){ShowID();exit;} if(isset($_GET["ShowID-js"])){ShowID_js();exit;} if(isset($_POST["empty-table"])){empty_table();exit;} popup(); function ShowID_js(){ $id=$_GET["ShowID-js"]; if(!is_numeric($id)){ return; }$tpl=new templates(); header("content-type: application/x-javascript"); $page=CurrentPageName(); $sql="SELECT subject FROM artica_update_task WHERE ID=$id"; $q=new mysql(); $ligne=@mysql_fetch_array($q->QUERY_SQL($sql,"artica_events")); $subject=$tpl->javascript_parse_text($ligne["subject"]);
<?php include '../config.php'; include '../db_functions.php'; extract($_GET); if ($_GET['tname']) { empty_table($tname); } else { echo "use 'tname' to send table name values"; }