function updateInfo($org, $id, $ans)
{
    $new = array();
    if ($id == $org['id']) {
        $org['funcion'] = $ans['funcion'];
        $org['titulo'] = $ans['titulo'];
        $org['glosa'] = $ans['glosa'];
        $org['url'] = $ans['url'];
        return $org;
    }
    $hijos = $org['hijos'];
    if ($hijos != array()) {
        foreach ($hijos as $X) {
            $new[] = updateInfo($X, $id, $ans);
        }
    }
    $org['hijos'] = $new;
    return $org;
}
Example #2
0
function dbUtil($type, $paramList = null)
{
    global $retArray;
    try {
        $mongo = new MongoClient('mongodb://nb403:27127/admin:admin');
        $db = $mongo->adtestClassicBugs;
        if ($type == SaveCategory) {
            saveCategory($db, $paramList);
        } elseif ($type == ReadCategory) {
            return readCateList($db);
        } elseif ($type == SaveInputContent) {
            saveInputContent($db, $paramList);
        } elseif ($type == ReadAllContents) {
            return listContent($db);
        } elseif ($type == ReadSpecificContent) {
            return listContent2($db, $paramList);
        } elseif ($type == UpdateSpecificContent) {
            updateInfo($db, $paramList);
        }
    } catch (MongoConnectionException $e) {
        $retArray = array("1", $e->getMessage());
    }
}
Example #3
0
$smarty->assign('MODULE', $currentModule);
// TODO: Update Single Module Instance name here.
$smarty->assign('SINGLE_MOD', 'SINGLE_' . $currentModule);
$smarty->assign('CATEGORY', $category);
$smarty->assign("THEME", $theme);
$smarty->assign('IMAGE_PATH', "themes/{$theme}/images/");
$smarty->assign('ID', $focus->id);
$smarty->assign('MODE', $focus->mode);
$smarty->assign('CREATEMODE', isset($_REQUEST['createmode']) ? vtlib_purify($_REQUEST['createmode']) : '');
$smarty->assign('CHECK', Button_Check($currentModule));
$smarty->assign('DUPLICATE', $isduplicate);
if ($focus->mode == 'edit' || $isduplicate) {
    $recordName = array_values(getEntityName($currentModule, $record));
    $recordName = $recordName[0];
    $smarty->assign('NAME', $recordName);
    $smarty->assign('UPDATEINFO', updateInfo($record));
}
if ($focus->mode == 'edit') {
    $associated_prod = getAssociatedProducts("PurchaseOrder", $focus);
    $smarty->assign('ASSOCIATEDPRODUCTS', $associated_prod);
} elseif (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
    $smarty->assign('ASSOCIATEDPRODUCTS', $PO_associated_prod);
    $smarty->assign('AVAILABLE_PRODUCTS', 'true');
    $smarty->assign('MODE', $focus->mode);
}
if (isset($_REQUEST['return_module'])) {
    $smarty->assign("RETURN_MODULE", vtlib_purify($_REQUEST['return_module']));
} else {
    $smarty->assign("RETURN_MODULE", "PurchaseOrder");
}
if (isset($_REQUEST['return_action'])) {
Example #4
0
$smarty->assign("OP_MODE", $disp_view);
$smarty->assign("MODULE", $currentModule);
$smarty->assign("SINGLE_MOD", 'Vendor');
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("ID", $focus->id);
if (isset($focus->name)) {
    $smarty->assign("NAME", $focus->name);
}
if (isset($cust_fld)) {
    $smarty->assign("CUSTOMFIELD", $cust_fld);
}
$smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']);
$smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
if ($focus->mode == 'edit') {
    $smarty->assign("UPDATEINFO", updateInfo($focus->id));
    $smarty->assign("MODE", $focus->mode);
}
if (isset($_REQUEST['return_module'])) {
    $smarty->assign("RETURN_MODULE", vtlib_purify($_REQUEST['return_module']));
}
if (isset($_REQUEST['return_action'])) {
    $smarty->assign("RETURN_ACTION", vtlib_purify($_REQUEST['return_action']));
}
if (isset($_REQUEST['return_id'])) {
    $smarty->assign("RETURN_ID", vtlib_purify($_REQUEST['return_id']));
}
if (isset($_REQUEST['return_viewname'])) {
    $smarty->assign("RETURN_VIEWNAME", vtlib_purify($_REQUEST['return_viewname']));
}
$smarty->assign("THEME", $theme);
    if (!$_SESSION['rlvs'][$currentModule]) {
        unset($_SESSION['rlvs']);
    }
    // Identify this module as custom module.
    $smarty->assign('CUSTOM_MODULE', true);
    $smarty->assign('APP', $app_strings);
    $smarty->assign('MOD', $mod_strings);
    $smarty->assign('MODULE', $currentModule);
    // TODO: Update Single Module Instance name here.
    $smarty->assign('SINGLE_MOD', getTranslatedString($currentModule));
    $smarty->assign('CATEGORY', $category);
    $smarty->assign('IMAGE_PATH', "themes/{$theme}/images/");
    $smarty->assign('THEME', $theme);
    $smarty->assign('ID', $focus->id);
    $smarty->assign('MODE', $focus->mode);
    $smarty->assign('CHECK', $tool_buttons);
    $smarty->assign('NAME', $focus->column_fields[$focus->def_detailview_recname]);
    $smarty->assign('UPDATEINFO', updateInfo($focus->id));
    // Module Sequence Numbering
    $mod_seq_field = getModuleSequenceField($currentModule);
    if ($mod_seq_field != null) {
        $mod_seq_id = $focus->column_fields[$mod_seq_field['name']];
    } else {
        $mod_seq_id = $focus->id;
    }
    $smarty->assign('MOD_SEQ_ID', $mod_seq_id);
    // END
    $related_array = getRelatedLists($currentModule, $focus);
    $smarty->assign('RELATEDLISTS', $related_array);
    $smarty->display('RelatedLists.tpl');
}
<?php

session_start();
require '../model/db.php';
require 'define.php';
if (isset($_POST['editInfo'])) {
    $name = $_POST['userName'];
    $email = $_POST['email'];
    $contact = $_POST['contact'];
    $user = $_SESSION['user'];
    $userId = $_SESSION['id'];
    $exp = explode(" ", $name);
    $fname = $exp[0];
    $lname = '';
    for ($i = 1; $i < count($exp); $i++) {
        $lname .= $exp[$i] . ' ';
    }
    if (!checkEditedEmail($email, $userId)) {
        updateInfo($fname, $lname, $email, $contact, $user);
        echo '<script language="javascript">
                        alert("Successfully Updated !!");
                        window.location="' . SERVER . '/profile";
                      </script>';
    } else {
        echo '<script language="javascript">
                        alert("Email has been used by another user !!");
                        window.location="' . SERVER . '/editProfile";
                      </script>';
    }
}
    $organik['glosa'] = "";
    $organik['id'] = 1;
    $organik['hijos'] = array();
    $organik['url'] = "";
}
if (isset($_GET['n']) && isset($_GET['q'])) {
    if ($_GET['q'] == 'new') {
        $organik = addChild($organik, $_GET['n']);
    }
    if ($_GET['q'] == 'del') {
        $organik = deleteNode($organik, $_GET['n']);
    }
}
if (isset($_POST['funcion'])) {
    $info = array('funcion' => $_POST['funcion'], 'titulo' => $_POST['titulo'], 'glosa' => $_POST['glosa'], 'url' => $_POST['url']);
    $organik = updateInfo($organik, $_POST['id'], $info);
}
$_SESSION['data'] = $organik;
org_header("Editor de Estructuras Org&aacute;nicas");
?>

<form action="organica-d.php" method="post">
<input type="button" value="Volver"
onclick="location.href='organica2.php';" />
<input type="button" value="Generar"
onclick="location.href='organica-d.php';" />
</form>


<?php 
echo toListaEditor2($organik, "fin");
$smarty = new vtigerCRM_Smarty();
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$focus->id = $_REQUEST['record'];
if (isset($focus->name)) {
    $smarty->assign("NAME", $focus->name);
} else {
    $smarty->assign("NAME", "");
}
$smarty->assign("BLOCKS", getBlocks($currentModule, "detail_view", '', $focus->column_fields));
$smarty->assign("TICKETID", vtlib_purify($_REQUEST['record']));
$smarty->assign("CUSTOMFIELD", $cust_fld);
$smarty->assign("SINGLE_MOD", 'HelpDesk');
$category = getParentTab();
$smarty->assign("CATEGORY", $category);
$smarty->assign("UPDATEINFO", updateInfo($_REQUEST['record']));
if (isPermitted("HelpDesk", "EditView", $_REQUEST['record']) == 'yes') {
    $smarty->assign("EDIT_DUPLICATE", "permitted");
}
if (isPermitted("HelpDesk", "Delete", $_REQUEST['record']) == 'yes') {
    $smarty->assign("DELETE", "permitted");
}
//Added button for Convert the ticket to FAQ
if (isPermitted("Faq", "EditView", '') == 'yes') {
    $smarty->assign("CONVERTASFAQ", "permitted");
}
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("PRINT_URL", "phprint.php?jt=" . session_id() . $GLOBALS['request_string']);
// Module Sequence Numbering
$mod_seq_field = getModuleSequenceField($currentModule);
Example #9
0
<?php

require_once '../init.php';
$queueInfo = new RedisQueue('queueInfo');
$queueSocial = new RedisQueue('queueSocial');
$queueStats = new RedisQueue('queueStats');
$killmails = $mdb->getCollection('killmails');
$rawmails = $mdb->getCollection('rawmails');
$information = $mdb->getCollection('information');
$statArray = ['characterID', 'corporationID', 'allianceID', 'factionID', 'shipTypeID', 'groupID'];
while (!Util::exitNow()) {
    $killID = $queueInfo->pop();
    if ($killID !== null) {
        updateInfo($killID);
        updateStatsQueue($killID);
        $queueSocial->push($killID);
    }
}
function updateStatsQueue($killID)
{
    global $killmails, $statArray, $queueStats;
    $kill = $killmails->findOne(['killID' => $killID]);
    $involved = $kill['involved'];
    $sequence = $kill['sequence'];
    // solar system
    addToStatsQueue('solarSystemID', $kill['system']['solarSystemID'], $sequence);
    addToStatsQueue('regionID', $kill['system']['regionID'], $sequence);
    foreach ($involved as $inv) {
        foreach ($statArray as $stat) {
            if (isset($inv[$stat])) {
                addToStatsQueue($stat, $inv[$stat], $sequence);
Example #10
0
            Database::get()->query("ALTER TABLE poll_question ADD q_scale INT(11) NULL DEFAULT NULL");
        }
        //Add course image field
        if (!DBHelper::fieldExists('course_image', 'course')) {
            Database::get()->query("ALTER TABLE course ADD course_image VARCHAR(400) NULL");
        }
        // Move course description from unit_resources to new course.description field
        if (!DBHelper::fieldExists('description', 'course')) {
            Database::get()->query("ALTER TABLE course ADD description MEDIUMTEXT NOT NULL");
            $result = Database::get()->query("UPDATE course, course_units, unit_resources\n                SET course.description = unit_resources.comments\n                WHERE course.id = course_units.course_id AND\n                      course_units.id = unit_resources.unit_id AND\n                      course_units.`order` = -1 AND\n                      unit_resources.res_id = -1");
            if ($result->affectedRows) {
                Database::get()->query("DELETE FROM unit_resources WHERE res_id = -1");
                Database::get()->query("DELETE FROM course_units WHERE `order` = -1");
            }
        }
        set_config('theme', 'default');
        set_config('theme_options_id', 0);
    }
    // update eclass version
    Database::get()->query("UPDATE config SET `value` = '" . ECLASS_VERSION . "' WHERE `key`='version'");
    updateInfo(1, $langUpgradeSuccess);
    $logdate = date("Y-m-d_G:i:s");
    $output_result = "<br/><div class='alert alert-success'>{$langUpgradeSuccess}<br/><b>{$langUpgReady}</b><br/><a href=\"../courses/log-{$logdate}.html\" target=\"_blank\">Log output</a></div><p/>";
    if ($debug_error) {
        $output_result .= "<div class='alert alert-danger'>" . $langUpgSucNotice . "</div>";
    }
    updateInfo(1, $output_result, false);
    $debug_output = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/><title>Open eClass upgrade log of {$logdate}</title></head><body>{$debug_output}</body></html>";
    file_put_contents($webDir . "/courses/log-{$logdate}.html", $debug_output);
}
// end of if not submit
Example #11
0
                }
                if (!empty($topic_info)) {
                    $mail = $mystep->getInstance("MyEmail", $topic_info['email'], $setting['gen']['charset']);
                    $mail->addEmail($topic_info['email'], $setting['web']['title'], "reply");
                    $mail->setFrom($topic_info['email'], $setting['web']['title'], true);
                    $mail->setSubject("RE: " . $_POST['subject']);
                    $mail->setContent($_POST['reply'], false);
                    $mail->addEmail($_POST['email']);
                    $flag = $mail->send($setting['email']);
                    unset($mail);
                    unset($_POST['sendmail']);
                }
            }
        }
        $db->update($setting['db']['pre'] . "ticket", $_POST, array("id", "n=", $id));
        updateInfo($idx);
        $goto_url = $setting['info']['self'] . "?method=list&idx=" . $idx;
        break;
    default:
        $goto_url = $setting['info']['self'];
}
function updateInfo($idx)
{
    global $ticket_list, $db, $setting;
    for ($i = 0, $m = count($ticket_list); $i < $m; $i++) {
        if ($ticket_list[$i]['idx'] == $idx) {
            $ticket_list[$i]['lastpost'] = $db->result($setting['db']['pre'] . "ticket", "max(add_date)", array("idx", "=", $idx));
            $ticket_list[$i]['total'] = $db->result($setting['db']['pre'] . "ticket", "count(*)", array("idx", "=", $idx));
            $ticket_list[$i]['untreated'] = $db->result($setting['db']['pre'] . "ticket", "count(*)", array(array("idx", "=", $idx), array("status", "n=", 0, "and")));
            $ticket_list[$i]['processing'] = $db->result($setting['db']['pre'] . "ticket", "count(*)", array(array("idx", "=", $idx), array("status", "n=", 1, "and")));
            $ticket_list[$i]['done'] = $db->result($setting['db']['pre'] . "ticket", "count(*)", array(array("idx", "=", $idx), array("status", "n=", 2, "and")));
Example #12
0
    $page = $_POST["page"];
    $title = $_POST["title"];
    $content = $_POST["content"];
    $menu = $_POST["menu"];
    $menuorder = (int) $_POST["menuorder"];
    $id = $_POST["id"];
    $template = $_POST["template"];
    $onder = $_POST["onder"];
    if ($onder == 'none') {
        $onder = 'NULL';
        $onder = mysql_real_escape_string($onder);
        $sql = "UPDATE pagecontent SET page='{$page}', title='{$title}', content='{$content}', menu='{$menu}', menuorder='{$menuorder}', template='{$template}', pagecontent_id=NULL WHERE id='{$id}'";
    } else {
        $sql = "UPDATE pagecontent SET page='{$page}', title='{$title}', content='{$content}', menu='{$menu}', menuorder='{$menuorder}', template='{$template}', pagecontent_id='{$onder}' WHERE id='{$id}'";
    }
    updateInfo($page, $title, $content, $menu, $menuorder, $template, $id, $onder, $sql);
    header("Location: index.php");
}
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $results = getInfo($id);
    $id = $results["id"];
    $page = $results["page"];
    $title = $results["title"];
    $content = $results["content"];
    $menu = $results["menu"];
    $menuorder = $results["menuorder"];
    $template = $results["template"];
    $db = new mysqli(SERVERNAME, USERNAME, PASSWORD, DBNAME);
    $sql2 = "SELECT id, menu FROM pagecontent WHERE pagecontent_id IS NULL";
    $menuitem = $db->query($sql2);
Example #13
0
/* String that represents number of current connections */
$Number_Of_Connections = "";
/* String that represents CPU usage percent */
$cpuUsageStr = "";
/* Result String to output */
$Outputed = "";
/* String that represents number of source addresses that are connected to host */
$Number_Of_Sources = 0;
clearApacheLogs();
// Clear logs at first
for (;;) {
    // Start reading info and output it
    updateInfo();
    printInfo();
    checkNetworkConnection();
    updateInfo();
    usleep($SLEEP_TIME);
    printInfo();
    usleep($SLEEP_TIME);
    checkNetworkConnection();
}
/* Clear Apache2 logs */
function clearApacheLogs()
{
    shell_exec("echo > /var/log/apache2/access.log");
}
/* Update information: cpu_usage, number_of_connections, sources */
/* Save new info as global values */
function updateInfo()
{
    global $MAX;
Example #14
0
<?php

include_once '../include/headers.php';
include_once '../include/dbutils.php';
include_once '../include/main.php';
include_once 'domain/orders.php';
db_connect();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $request_payload = file_get_contents('php://input');
    //var_dump($request_payload);
    $json = json_decode($request_payload);
    if (isset($_GET['update'])) {
        $value = updateInfo($json);
    } else {
        if (isset($_GET['validate'])) {
            $value = validate($json);
        } else {
            if (isset($_GET['updateProductAmount'])) {
                $value = updateProductAmount($json);
            } else {
                $value = changeStatus($json);
            }
        }
    }
    //return JSON array
    exit(json_encode($value));
}