Ganteng Doang Upload Shell Gak Bisa


Linux server.jmdstrack.com 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
/ home/ jmdstrac/ public_html/ devices/ src/

/home/jmdstrac/public_html/devices/src/Certificate_Item.php

<?php

/**
 * ---------------------------------------------------------------------
 *
 * GLPI - Gestionnaire Libre de Parc Informatique
 *
 * http://glpi-project.org
 *
 * @copyright 2015-2023 Teclib' and contributors.
 * @copyright 2003-2014 by the INDEPNET Development Team.
 * @licence   https://www.gnu.org/licenses/gpl-3.0.html
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * ---------------------------------------------------------------------
 */

/**
 * Class to link a certificate to an item
 */
class Certificate_Item extends CommonDBRelation
{
   // From CommonDBRelation
    public static $itemtype_1    = "Certificate";
    public static $items_id_1    = 'certificates_id';
    public static $take_entity_1 = false;

    public static $itemtype_2    = 'itemtype';
    public static $items_id_2    = 'items_id';
    public static $take_entity_2 = true;

    /**
     * @since 9.2
     *
     **/
    public function getForbiddenStandardMassiveAction()
    {
        $forbidden   = parent::getForbiddenStandardMassiveAction();
        $forbidden[] = 'update';
        return $forbidden;
    }


    /**
     * @param CommonDBTM $item
     */
    public static function cleanForItem(CommonDBTM $item)
    {
        $temp = new self();
        $temp->deleteByCriteria(['itemtype' => $item->getType(),
            'items_id' => $item->getField('id')
        ]);
    }

    /**
     * @param CommonGLPI $item
     * @param int $withtemplate
     * @return string
     */
    public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
    {

        if (!$withtemplate) {
            if (
                $item->getType() == 'Certificate'
                && count(Certificate::getTypes(false))
            ) {
                if ($_SESSION['glpishow_count_on_tabs']) {
                    return self::createTabEntry(
                        _n('Associated item', 'Associated items', Session::getPluralNumber()),
                        self::countForMainItem($item)
                    );
                }
                return _n('Associated item', 'Associated items', Session::getPluralNumber());
            } else if (
                in_array($item->getType(), Certificate::getTypes(true))
                && Certificate::canView()
            ) {
                if ($_SESSION['glpishow_count_on_tabs']) {
                    return self::createTabEntry(
                        Certificate::getTypeName(2),
                        self::countForItem($item)
                    );
                }
                return Certificate::getTypeName(2);
            }
        }
        return '';
    }


    /**
     * @param CommonGLPI $item
     * @param int $tabnum
     * @param int $withtemplate
     * @return bool
     */
    public static function displayTabContentForItem(
        CommonGLPI $item,
        $tabnum = 1,
        $withtemplate = 0
    ) {

        if ($item->getType() == 'Certificate') {
            self::showForCertificate($item);
        } else if (in_array($item->getType(), Certificate::getTypes(true))) {
            self::showForItem($item);
        }
        return true;
    }


    /**
     * @param $certificates_id
     * @param $items_id
     * @param $itemtype
     * @return bool
     */
    public function getFromDBbyCertificatesAndItem($certificates_id, $items_id, $itemtype)
    {

        $certificate  = new self();
        $certificates = $certificate->find([
            'certificates_id' => $certificates_id,
            'itemtype'        => $itemtype,
            'items_id'        => $items_id
        ]);
        if (count($certificates) != 1) {
            return false;
        }

        $cert         = current($certificates);
        $this->fields = $cert;

        return true;
    }

    /**
     * Link a certificate to an item
     *
     * @since 9.2
     * @param $values
     */
    public function addItem($values)
    {

        $this->add(['certificates_id' => $values["certificates_id"],
            'items_id'        => $values["items_id"],
            'itemtype'        => $values["itemtype"]
        ]);
    }

    /**
     * Delete a certificate link to an item
     *
     * @since 9.2
     *
     * @param integer $certificates_id the certificate ID
     * @param integer $items_id the item's id
     * @param string $itemtype the itemtype
     */
    public function deleteItemByCertificatesAndItem($certificates_id, $items_id, $itemtype)
    {

        if (
            $this->getFromDBbyCertificatesAndItem(
                $certificates_id,
                $items_id,
                $itemtype
            )
        ) {
            $this->delete(['id' => $this->fields["id"]]);
        }
    }

    /**
     * Show items linked to a certificate
     *
     * @since 9.2
     *
     * @param Certificate $certificate Certificate object
     *
     * @return void|boolean (display) Returns false if there is a rights error.
     **/
    public static function showForCertificate(Certificate $certificate)
    {

        $instID = $certificate->fields['id'];
        if (!$certificate->can($instID, READ)) {
            return false;
        }
        $canedit = $certificate->can($instID, UPDATE);
        $rand    = mt_rand();

        $types_iterator = self::getDistinctTypes($instID, ['itemtype' => Certificate::getTypes(true)]);
        $number = count($types_iterator);

        if (Session::isMultiEntitiesMode()) {
            $colsup = 1;
        } else {
            $colsup = 0;
        }

        if ($canedit) {
            echo "<div class='firstbloc'>";
            echo "<form method='post' name='certificates_form$rand'
                     id='certificates_form$rand'
                     action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";

            echo "<table class='tab_cadre_fixe'>";
            echo "<tr class='tab_bg_2'>";
            echo "<th colspan='" . ($canedit ? (5 + $colsup) : (4 + $colsup)) . "'>" .
               __('Add an item') . "</th></tr>";

            echo "<tr class='tab_bg_1'><td colspan='" . (3 + $colsup) . "' class='center'>";
            Dropdown::showSelectItemFromItemtypes(
                ['items_id_name'   => 'items_id',
                    'itemtypes'       => Certificate::getTypes(true),
                    'entity_restrict' => ($certificate->fields['is_recursive']
                                      ? getSonsOf(
                                          'glpi_entities',
                                          $certificate->fields['entities_id']
                                      )
                                       : $certificate->fields['entities_id']),
                    'checkright'      => true,
                ]
            );
            echo "</td><td colspan='2' class='center' class='tab_bg_1'>";
            echo Html::hidden('certificates_id', ['value' => $instID]);
            echo Html::submit(_x('button', 'Add'), ['name' => 'add']);
            echo "</td></tr>";
            echo "</table>";
            Html::closeForm();
            echo "</div>";
        }

        echo "<div class='spaced'>";
        if ($canedit && $number) {
            Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
            $massiveactionparams = [];
            Html::showMassiveActions($massiveactionparams);
        }
        echo "<table class='tab_cadre_fixe'>";
        echo "<tr>";

        if ($canedit && $number) {
            echo "<th width='10'>" .
            Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand) . "</th>";
        }

        echo "<th>" . _n('Type', 'Types', 1) . "</th>";
        echo "<th>" . __('Name') . "</th>";
        if (Session::isMultiEntitiesMode()) {
            echo "<th>" . Entity::getTypeName(1) . "</th>";
        }
        echo "<th>" . __('Serial number') . "</th>";
        echo "<th>" . __('Inventory number') . "</th>";
        echo "</tr>";

        foreach ($types_iterator as $type_row) {
            $itemtype = $type_row['itemtype'];

            if (!($item = getItemForItemtype($itemtype))) {
                continue;
            }

            if ($item->canView()) {
                $iterator = self::getTypeItems($instID, $itemtype);

                if (count($iterator)) {
                    Session::initNavigateListItems($itemtype, Certificate::getTypeName(2) . " = " . $certificate->fields['name']);
                    foreach ($iterator as $data) {
                        $item->getFromDB($data["id"]);
                        Session::addToNavigateListItems($itemtype, $data["id"]);
                        $ID = "";
                        if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) {
                            $ID = " (" . $data["id"] . ")";
                        }

                        $link = $itemtype::getFormURLWithID($data["id"]);
                        $name = "<a href=\"" . $link . "\">" . $data["name"] . "$ID</a>";

                        echo "<tr class='tab_bg_1'>";

                        if ($canedit) {
                            echo "<td width='10'>";
                            Html::showMassiveActionCheckBox(__CLASS__, $data["linkid"]);
                            echo "</td>";
                        }
                        echo "<td class='center'>" . $item->getTypeName(1) . "</td>";
                        echo "<td class='center' " . (isset($data['is_deleted']) && $data['is_deleted'] ? "class='tab_bg_2_2'" : "") .
                        ">" . $name . "</td>";
                        if (Session::isMultiEntitiesMode()) {
                            $entity = ($item->isEntityAssign() ?
                            Dropdown::getDropdownName("glpi_entities", $data['entity']) :
                            '-');
                             echo "<td class='center'>" . $entity . "</td>";
                        }
                        echo "<td class='center'>" . (isset($data["serial"]) ? "" . $data["serial"] . "" : "-") . "</td>";
                        echo "<td class='center'>" . (isset($data["otherserial"]) ? "" . $data["otherserial"] . "" : "-") . "</td>";
                        echo "</tr>";
                    }
                }
            }
        }
        echo "</table>";

        if ($canedit && $number) {
            $paramsma = [
                'ontop' => false,
            ];
            Html::showMassiveActions($paramsma);
            Html::closeForm();
        }
        echo "</div>";
    }

    /**
     * Show certificates associated to an item
     *
     * @since 9.2
     *
     * @param $item  CommonDBTM object for which associated certificates must be displayed
     * @param $withtemplate (default 0)
     *
     * @return bool
     */
    public static function showForItem(CommonDBTM $item, $withtemplate = 0)
    {

        $ID = $item->getField('id');

        if (
            $item->isNewID($ID)
            || !Certificate::canView()
            || !$item->can($item->fields['id'], READ)
        ) {
            return false;
        }

        $certificate  = new Certificate();

        if (empty($withtemplate)) {
            $withtemplate = 0;
        }

        $canedit      = $item->canAddItem('Certificate');
        $rand         = mt_rand();
        $is_recursive = $item->isRecursive();

        $iterator = self::getListForItem($item);
        $number   = $iterator->numrows();
        $i        = 0;

        $certificates = [];
        $used         = [];

        foreach ($iterator as $data) {
            $certificates[$data['linkid']] = $data;
            $used[$data['id']] = $data['id'];
        }

        if ($canedit && $withtemplate < 2) {
            if ($item->maybeRecursive()) {
                $is_recursive = $item->fields['is_recursive'];
            } else {
                $is_recursive = false;
            }
            $entity_restrict = getEntitiesRestrictCriteria(
                "glpi_certificates",
                'entities_id',
                $item->fields['entities_id'],
                $is_recursive
            );

            $nb = countElementsInTable(
                'glpi_certificates',
                [
                    'is_deleted'  => 0
                ] + $entity_restrict
            );

            echo "<div class='firstbloc'>";

            if (Certificate::canView() && (!$nb || ($nb > count($used)))) {
                echo "<form name='certificate_form$rand'
                        id='certificate_form$rand'
                        method='post'
                        action='" . Toolbox::getItemTypeFormURL('Certificate_Item')
                  . "'>";
                echo "<table class='tab_cadre_fixe'>";
                echo "<tr class='tab_bg_1'>";
                echo "<td colspan='4' class='center'>";
                echo Html::hidden(
                    'entities_id',
                    ['value' => $item->fields['entities_id']]
                );
                 echo Html::hidden(
                     'is_recursive',
                     ['value' => $is_recursive]
                 );
                 echo Html::hidden(
                     'itemtype',
                     ['value' => $item->getType()]
                 );
                 echo Html::hidden(
                     'items_id',
                     ['value' => $ID]
                 );
                if ($item->getType() == 'Ticket') {
                     echo Html::hidden('tickets_id', ['value' => $ID]);
                }
                 Dropdown::show('Certificate', ['entity' => $item->fields['entities_id'],
                     'is_recursive'       => $is_recursive,
                     'used'               => $used
                 ]);

                 echo "</td><td class='center' width='20%'>";
                 echo Html::submit(_sx('button', 'Associate'), ['name' => 'add']);
                 echo "</td>";
                 echo "</tr>";
                 echo "</table>";
                 Html::closeForm();
            }

            echo "</div>";
        }

        echo "<div class='spaced table-responsive'>";
        if ($canedit && $number && ($withtemplate < 2)) {
            $massiveactionparams = ['num_displayed' => $number];
            Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
            Html::showMassiveActions($massiveactionparams);
        }
        echo "<table class='tab_cadre_fixe'>";

        echo "<tr>";
        if ($canedit && $number && ($withtemplate < 2)) {
            echo "<th width='10'>";
            echo Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand);
            echo "</th>";
        }
        echo "<th>" . __('Name') . "</th>";
        if (Session::isMultiEntitiesMode()) {
            echo "<th>" . Entity::getTypeName(1) . "</th>";
        }
        echo "<th>" . _n('Type', 'Types', 1) . "</th>";
        echo "<th>" . __('DNS name') . "</th>";
        echo "<th>" . __('DNS suffix') . "</th>";
        echo "<th>" . __('Creation date') . "</th>";
        echo "<th>" . __('Expiration date') . "</th>";
        echo "<th>" . __('Status') . "</th>";
        echo "</tr>";

        $used = [];

        if ($number) {
            Session::initNavigateListItems(
                'Certificate',
                sprintf(
                    __('%1$s = %2$s'),
                    $item->getTypeName(1),
                    $item->getName()
                )
            );

            foreach ($certificates as $data) {
                $certificateID = $data["id"];
                $link = NOT_AVAILABLE;

                if ($certificate->getFromDB($certificateID)) {
                    $link = $certificate->getLink();
                }

                Session::addToNavigateListItems('Certificate', $certificateID);

                $used[$certificateID] = $certificateID;

                echo "<tr class='tab_bg_1" . ($data["is_deleted"] ? "_2" : "") . "'>";
                if ($canedit && ($withtemplate < 2)) {
                    echo "<td width='10'>";
                    Html::showMassiveActionCheckBox(__CLASS__, $data["linkid"]);
                    echo "</td>";
                }
                echo "<td class='center'>$link</td>";
                if (Session::isMultiEntitiesMode()) {
                     echo "<td class='center'>" . Dropdown::getDropdownName("glpi_entities", $data['entities_id']) .
                     "</td>";
                }
                echo "<td class='center'>";
                echo Dropdown::getDropdownName(
                    "glpi_certificatetypes",
                    $data["certificatetypes_id"]
                );
                 echo "</td>";
                 echo "<td class='center'>" . $data["dns_name"] . "</td>";
                 echo "<td class='center'>" . $data["dns_suffix"] . "</td>";
                 echo "<td class='center'>" . Html::convDate($data["date_creation"]) . "</td>";
                if (
                    $data["date_expiration"] <= date('Y-m-d')
                     && !empty($data["date_expiration"])
                ) {
                     echo "<td class='center'>";
                     echo "<div class='deleted'>" . Html::convDate($data["date_expiration"]) . "</div>";
                     echo "</td>";
                } else if (empty($data["date_expiration"])) {
                    echo "<td class='center'>" . __('Does not expire') . "</td>";
                } else {
                    echo "<td class='center'>" . Html::convDate($data["date_expiration"]) . "</td>";
                }
                echo "<td class='center'>";
                echo Dropdown::getDropdownName("glpi_states", $data["states_id"]);
                echo "</td>";
                echo "</tr>";
                $i++;
            }
        }

        echo "</table>";
        if ($canedit && $number && ($withtemplate < 2)) {
            $massiveactionparams['ontop'] = false;
            Html::showMassiveActions($massiveactionparams);
            Html::closeForm();
        }
        echo "</div>";

        return true;
    }
}
			
			


Thanks For 0xGh05T - DSRF14 - Mr.Dan07 - Leri01 - FxshX7 - AlkaExploiter - xLoveSyndrome'z - Acep Gans'z

JMDS TRACK – Just Another Diagnostics Lab Site

Home

JMDS TRACK Cameroon

Boost the productivity of your mobile ressources


Make An Appointment


Fleet management

  1. Reduce the operting cost and the unavailability of your vehicles
  2. reduce the fuel consumption of your fleet
  3. Improve the driving dehavior and safety of your drivers
  4. optimize the utilization rate of your equipment 
  5. protect your vehicle against theft
  6. Improve the quality of your customer service


Find out more

Assets management

  1. Track the roaming of your equipment
  2. Optimise the management of your assets on site and during transport
  3. Secure the transport of your goods
  4. Make your team responsible for preventing the loss of tools, equipment
  5. Take a real-time inventory of your equipment on site
  6. Easily find your mobile objects or equipment



Find out more



Find out more

Antitheft solutions

  1. Secure your vehicles and machinery and increase your chances of recovering them in the event of theft
  2. Protect your assets and reduce the costs associated with their loss
  3. Combine immobiliser and driver identification and limit the risk of theft
  4. Identify fuel theft and reduce costs
  5. Protect your goods and take no more risks
  6. Be alerted to abnormal events

Our Location

 Douala BP cité 

     and

Yaoundé Total Essos


Make An Appointment


Get Directions

682230363/ 677481892

What makes us different from others

  • young and dynamic team
  • call center 24/24 7/7
  • roaming throughout Africa
  • team of developers who can develop customer-specific solutions
  • diversity of services
  • reactive and prompt after-sales service when soliciting a customer or a malfunction
  • Free Maintenance and installation in the cities of Douala and Yaounde

https://youtu.be/xI1cz_Jh2x8

15+
years of experience in GPS system development, production and deployment.

15 Collaborators

More than 15 employees dedicated to the research and development of new applications and to customer care

5 000 Vehicles and mobile assets

5 000 vehicles and mobile assets under management, in Africa

Our Partners










Latest Case Studies

Our current projects 

5/5
Bon SAV , SATISFAIT DU TRAITEMENT DES REQUETES

M DIPITA CHRISTIAN
Logistic Safety Manager Road Safety Manager
5/5
La réactivité de JMDS est excellente
Nous restons satisfait dans l’ensemble des prestations relatives a la couverture de notre parc automobile

Hervé Frédéric NDENGUE
Chef Service Adjoint de la Sécurité Générale (CNPS)
5/5
L’APPLICATION EMIXIS est convivial A L’utilisation
BEIG-3 SARL
DIRECTOR GENERAL
5/5
Nevertheless I am delighted with the service
MR. BISSE BENJAMIN
CUSTOMER

Subsribe To Our Newsletter

Stay in touch with us to get latest news and special offers.



Address JMDS TRACK

Douala bp cité



and

YAOUNDE Total Essos

Call Us

+237682230363



Email Us


info@jmdstrack.cm