예제 #1
0
function getSources($data, $hit, $name)
{
    $dom = (new Dom())->load($data);
    $randomId = function () {
        return mt_rand(1, 999999999999999999);
    };
    // Images.
    foreach ($dom->find('img') as $img) {
        $value = $img->getAttribute('src');
        $filename = $randomId();
        $storage = archive($name, $filename);
        $file = fopen($storage, 'w');
        $publicUrl = '/' . $name . '/' . $filename;
        $hitting = $hit;
        if (substr($value, 0, 2) === '//') {
            $hitting = 'http:' . $value;
        } elseif (substr($value, 0, 1) === '/') {
            $hitting .= $value;
        } else {
            $hitting = $value;
        }
        fwrite($file, curl($hitting));
        fclose($file);
        $data = str_replace($value, $publicUrl, $data);
    }
    // Styleheets.
    foreach ($dom->find('link') as $stylesheet) {
        $value = $stylesheet->getAttribute('href');
        // If the link is to root, skip it.
        if ($value === '/') {
            continue;
        }
        $filename = $randomId();
        $storage = archive($name, $filename);
        $publicUrl = '/' . $name . '/' . $filename;
        $hitting = $hit;
        if (substr($value, 0, 1) === '/') {
            $hitting .= $value;
        } else {
            $hitting = $value;
        }
        $contents = curl($hitting);
        $file = fopen($storage, 'w');
        fwrite($file, $contents);
        fclose($file);
        $data = str_replace($value, $publicUrl, $data);
    }
    return $data;
}
예제 #2
0
<div id="main-content">

	<div class="container header-bump">
      

	        <h1 class="hotfire">That Hotfire</h1>



	<?php 
require "config.php";
require "classes/article.php";
$action = isset($_GET['action']) ? $_GET['action'] : "";
switch ($action) {
    case 'archive':
        archive();
        break;
    case 'viewArticle':
        viewArticle();
        break;
    default:
        homepage();
}
function archive()
{
    $results = array();
    $data = Article::getList();
    $results['articles'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    $results['pageTitle'] = "Article Archive | Widget News";
    require "templates/archive.php";
예제 #3
0
#
#
#
# get settings
require "settings.php";
foreach ($_GET as $key => $value) {
    $_POST[$key] = $value;
}
# decide what to do
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "account_info":
            $OUTPUT = account_info($_POST);
            break;
        case "archive":
            $OUTPUT = archive();
            break;
        default:
            $OUTPUT = order($_POST);
    }
} elseif (isset($_GET["id"])) {
    # Display default output
    $_POST["id"] = $_GET["id"];
    if (isset($_GET["tripid"])) {
        $_POST["tripid"] = $_GET["tripid"];
    }
    if (isset($_GET["proid"])) {
        $_POST["proid"] = $_GET["proid"];
    }
    if (isset($_GET["proid"])) {
        $_POST["busy"] = "No";
예제 #4
0
        $value = addPrevision($json);
    } else {
        if (isset($_GET['saveCarry'])) {
            $value = saveCarry($json);
        } else {
            if (isset($_GET['edit']) && isset($_GET['isNumeric'])) {
                $value = editDispatchPrevisionNumberField($json, $_GET['edit']);
            } else {
                if (isset($_GET['edit'])) {
                    $value = editDispatchPrevisionField($json, $_GET['edit']);
                } else {
                    if (isset($_GET['updatePrevisionCarry'])) {
                        $value = updateDispatchPrevisionCarry($json);
                    } else {
                        if (isset($_GET['archive'])) {
                            $value = archive($json);
                        } else {
                            if (isset($_GET['restore'])) {
                                $value = restore($json);
                            } else {
                                $value = saveDispatch($json);
                            }
                        }
                    }
                }
            }
        }
    }
    //return JSON array
    exit(json_encode($value));
}
        if (add($_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $db)) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            echo "<script> history.go(-1); </script>";
        }
        break;
    case 'edit':
        if (edit($_POST['id'], $_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $_POST['ledgeraccountnumber'], $_POST['taxcode'], $_POST['creditworthy'], $_POST['bkrcheck'], $_POST['open_project'], $db)) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            echo "<script> history.go(-1); </script>";
        }
        break;
    case 'archive':
        $id = filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT);
        if (archive($db, $_POST['id'])) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            header('location: ../../public/views/dashboard/dashboard.php');
        }
        break;
    case 'dearchive':
        $id = filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT);
        if (dearchive($db, $_POST['id'])) {
            header('location: ../../public/views/dashboard/dashboard.php');
        }
        break;
}
function add($contact_name, $contact_lastname, $companyname, $first_adress, $first_zipcode, $first_city, $first_housenumber, $second_adress, $second_zipcode, $second_city, $second_housenumber, $initials, $first_telephonenumber, $second_telephonenumber, $fax, $email, $db)
{
    global $messageBag;
예제 #6
0
파일: Form.php 프로젝트: HaldunA/phpwebsite
 /**
  * The action function for this PHAT_Form.
  *
  *
  * @return mixed  $content Returns the contents handed to it from functions called within.
  * @access public
  */
 function action()
 {
     if (isset($_SESSION['PHAT_Message'])) {
         $content = $_SESSION['PHAT_Message'];
         $GLOBALS['CNT_phatform']['content'] .= $content;
         $_SESSION['PHAT_Message'] = NULL;
     }
     switch ($_REQUEST['PHAT_FORM_OP']) {
         case 'SaveFormSettings':
             if (Current_User::allow('phatform', 'edit_forms')) {
                 if (isset($_REQUEST['PHAT_SaveSettings'])) {
                     $content = $this->_saveSettings();
                     $content = $_SESSION['PHAT_FormManager']->menu() . $content;
                 } else {
                     if ($_REQUEST['PHAT_EditElements']) {
                         if ($this->isSaved()) {
                             $content = $this->_confirmArchive();
                         } else {
                             $content = $_SESSION['PHAT_FormManager']->menu();
                             $content .= $this->view(TRUE);
                         }
                     }
                 }
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'editSettings':
             if (Current_User::allow('phatform', 'edit_forms')) {
                 $content = $_SESSION['PHAT_FormManager']->menu();
                 $content .= $this->editSettings();
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'editElements':
             if (Current_User::allow('phatform', 'edit_forms')) {
                 $content = $_SESSION['PHAT_FormManager']->menu();
                 $content .= $this->view(TRUE);
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'report':
             if (Current_User::allow('phatform', 'report_view')) {
                 $this->report = new PHAT_Report();
                 $content = $this->report->report();
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'archive':
             if (!Current_User::allow('phatform', 'archive_form')) {
                 $this->_accessDenied();
             } else {
                 include PHPWS_SOURCE_DIR . 'mod/phatform/inc/Archive.php';
                 $error = NULL;
                 $error = archive($this->getId());
                 if (PHPWS_Error::isError($error)) {
                     javascript('alert', array('content' => PHPWS_Error::printError($error)));
                 } else {
                     $_SESSION['PHAT_Message'] = sprintf(dgettext('phatform', 'The form %s was successfully archived.'), '<b><i>' . $this->getLabel() . '</i></b>');
                 }
                 $_REQUEST['PHAT_FORM_OP'] = 'report';
                 $this->action();
             }
             break;
         case 'ToolbarAction':
             if (Current_User::allow('phatform', 'edit_forms')) {
                 $content = $this->_toolbarAction();
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'EditAction':
             if (Current_User::allow('phatform', 'edit_forms')) {
                 if (isset($_REQUEST['PHAT_Submit']) || isset($_REQUEST['PHAT_Next']) || isset($_REQUEST['PHAT_Back'])) {
                     $content = $_SESSION['PHAT_FormManager']->menu();
                     $content .= $this->view(TRUE);
                 } else {
                     $content = $this->_editAction();
                 }
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'Action':
             $content = $this->_formAction();
             break;
         case 'ArchiveConfirm':
             $this->_confirmArchive();
             break;
     }
     // END PHAT_FORM_OP SWITCH
     if (isset($content)) {
         $GLOBALS['CNT_phatform']['content'] .= $content;
     }
 }
#The full software license can be found here:
#http://www.accounting-123.com/a.php?a=153/GPLv3
#
#
#
#
#
#
#
#
#
#
#
require "settings.php";
if (isset($_GET["id"])) {
    $OUTPUT = archive($_GET);
} else {
    $OUTPUT = "Invalid.";
}
require "template.php";
function archive($_GET)
{
    extract($_GET);
    $id += 0;
    db_conn('crm');
    $Sl = "SELECT * FROM crms WHERE userid='" . USER_ID . "'";
    $Ri = db_exec($Sl) or errDie("Unable to get data from system.");
    if (pg_num_rows($Ri) < 1) {
        return "Invalid.";
    }
    $crmdata = pg_fetch_array($Ri);
예제 #8
0
 public function archive()
 {
     $attributes = $this->attributes();
     $attributes['_content'] = $this->content();
     return archive($attributes);
 }
예제 #9
0
<?php

include "./modele/modele_connexion_bdd.php";
include "./modele/modele_fonction.php";
$affiche_relais_demande = affiche_relais_demande();
$archive = archive();
$nb_demande_mail = nb_demande();
$nb_ancienne_star = nb_ancienne_star();
$nb_demande = notifications();
if (isset($_POST["activer_blog"])) {
    $pseudo = $_POST["pseudo"];
    $id = id($pseudo);
    $alerte = "Le blog de cet utilisateur vient d'être activé.";
    $status = "1";
    active_blog($id, $status);
    exec('sudo /var/script/activation_vhost.sh ' . $pseudo);
    // On recupere la liste des utilisateurs
    $results = liste_utilisateur();
    foreach ($results as $cle => $result) {
        $results[$cle]["id_utilisateur"] = nl2br(htmlspecialchars($result["id_utilisateur"]));
        $results[$cle]["pseudo"] = nl2br(htmlspecialchars($result["pseudo"]));
    }
    //On recupere la liste des demandeurs de devenir star
    $liste_demande_star = liste_demande_star();
    foreach ($liste_demande_star as $cle => $result1) {
        $liste_demande_star[$cle]["id_utilisateur"] = nl2br(htmlspecialchars($result1["id_utilisateur"]));
        $liste_demande_star[$cle]["pseudo"] = nl2br(htmlspecialchars($result1["pseudo"]));
    }
    //On recupere la liste des anciennes stars
    $liste_ancienne_star = liste_ancienne_star();
    foreach ($liste_ancienne_star as $cle => $result2) {
예제 #10
0
파일: snews.php 프로젝트: retrofox/PCC
function center()
{
    // fatal session produced on failed login, and will display error message.
    if (isset($_SESSION[_SITE . 'fatal'])) {
        echo $_SESSION[_SITE . 'fatal'];
        unset($_SESSION[_SITE . 'fatal']);
    } else {
        global $categorySEF, $subcatSEF, $articleSEF;
        switch (true) {
            case isset($_GET['category']):
                $action = $categorySEF;
                break;
            case isset($_GET['action']):
                $action = $categorySEF == '404' ? $categorySEF : clean(cleanXSS($_GET['action']));
                break;
        }
        switch (true) {
            case isset($_POST['search_query']):
                search();
                return;
                break;
            case isset($_POST['comment']):
                comment('comment_posted');
                return;
                break;
            case isset($_POST['contactform']):
                contact();
                return;
                break;
            case isset($_POST['Loginform']):
                administration();
                return;
                break;
            case isset($_POST['submit_text']):
                processing();
                return;
                break;
        }
        if (_ADMIN) {
            switch ($action) {
                case 'administration':
                    administration();
                    return;
                    break;
                case 'snews_settings':
                    settings();
                    return;
                    break;
                case 'snews_categories':
                    admin_categories();
                    return;
                    break;
                case 'admin_category':
                    form_categories();
                    return;
                    break;
                case 'admin_subcategory':
                    form_categories('sub');
                    return;
                    break;
                case 'groupings':
                    admin_groupings();
                    return;
                    break;
                case 'admin_groupings':
                    form_groupings();
                    return;
                    break;
                case 'snews_articles':
                    admin_articles('article_view');
                    return;
                    break;
                case 'extra_contents':
                    admin_articles('extra_view');
                    return;
                    break;
                case 'snews_pages':
                    admin_articles('page_view');
                    return;
                    break;
                case 'admin_article':
                    form_articles('');
                    return;
                    break;
                case 'article_new':
                    form_articles('article_new');
                    return;
                    break;
                case 'extra_new':
                    form_articles('extra_new');
                    return;
                    break;
                case 'page_new':
                    form_articles('page_new');
                    return;
                    break;
                case 'editcomment':
                    edit_comment();
                    return;
                    break;
                case 'snews_files':
                    files();
                    return;
                    break;
                case 'process':
                    processing();
                    return;
                    break;
                case 'logout':
                    session_destroy();
                    echo '<meta http-equiv="refresh" content="2; url=' . _SITE . '">';
                    echo '<h2>' . l('log_out') . '</h2>';
                    return;
                    break;
            }
        }
        switch ($action) {
            case 'archive':
                archive();
                break;
            case 'sitemap':
                sitemap();
                break;
            case 'contact':
                contact();
                break;
            case 'login':
                login();
                break;
            case '404':
                echo l('error_404');
                break;
            default:
                articles();
                break;
        }
    }
}
예제 #11
0
<?php

/**
 * Manually run an SQL patch outside of the general updaters.
 * This ensures that the DB options (charset, prefix, engine) are correctly set.
 *
 * @file
 * @ingroup Maintenance
 */
require_once 'commandLine.inc';
require_once "{$IP}/maintenance/updaters.inc";
if ($args) {
    foreach ($args as $arg) {
        $files = array($arg, archive($arg), archive("patch-{$arg}.sql"));
        foreach ($files as $file) {
            if (file_exists($file)) {
                echo "{$file} ...\n";
                dbsource($file);
                continue 2;
            }
        }
        echo "Could not find {$arg}\n";
    }
    echo "done.\n";
} else {
    echo "Run an SQL file into the DB, replacing prefix and charset vars.\n";
    echo "Usage:\n";
    echo "  php maintenance/patchSql.php file1.sql file2.sql ...\n";
    echo "\n";
    echo "Paths in maintenance/archive are automatically expanded if a local file isn't found.\n";
}
예제 #12
0
    if($('#scroll a').length > 0){
$('#scroll').bxSlider({
auto: true,
displaySlideQty:4,
prevText: '',
nextText: '',
moveSideQty: 1
});
}
});
</script>

<div class="scroll">
<ul id="scroll" class="list-view">
<?php 
foreach (archive($topid, 0, 0, '0,0,0', 20, 'rand()', 10, true, 0) as $i => $archive) {
    ?>
<li><div class="img-wrap"><a title="<?php 
    echo $archive['stitle'];
    ?>
" target="_blank" href="<?php 
    echo $archive['url'];
    ?>
"><img alt="<?php 
    echo $archive['stitle'];
    ?>
" src="<?php 
    echo $archive['thumb'];
    ?>
" onerror='this.src="<?php 
    echo config::get('onerror_pic');
        if (add($_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $db)) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            header('Location: ' . $_SERVER['HTTP_REFERER']);
        }
        break;
    case 'edit':
        if (edit($_POST['id'], $_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $_POST['ledgeraccountnumber'], $_POST['taxcode'], $_POST['creditworthy'], $_POST['bkrcheck'], $_POST['open_project'], $db)) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            header('Location: ' . $_SERVER['HTTP_REFERER']);
        }
        break;
    case 'archive':
        $id = filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT);
        archive($db, $_POST['id']);
        break;
}
function alert($string)
{
    echo '<script type="text/javascript">alert("' . $string . '");</script>';
    echo '<script type="text/javascript">history.go(-1);</script>';
}
function add($contact_name, $contact_lastname, $companyname, $first_adress, $first_zipcode, $first_city, $first_housenumber, $second_adress, $second_zipcode, $second_city, $second_housenumber, $initials, $first_telephonenumber, $second_telephonenumber, $fax, $email, $db)
{
    global $messageBag;
    $controle = 2;
    $created_at = time();
    $sql = "SELECT * FROM tbl_customer WHERE companyname = :companyname";
    $q = $db->prepare($sql);
    $q->bindParam(':companyname', $companyname);
예제 #14
0
    move_file(PATH_TMP . "/" . AREA_OUT, PATH_CSV);
    move_file(PATH_TMP . "/" . AREA . "_html_hash", PATH_VAR);
    move_file(PATH_TMP . "/" . AREA . "_lzh_hash", PATH_VAR);
    unlink_files(array(PATH_TMP . "/" . AREA . ".csv"));
    $updated = true;
} else {
    unlink_files(array(PATH_TMP . "/" . AREA . "_html_hash", PATH_TMP . "/" . AREA . "_lzh_hash"));
}
/*
 * 事業所データの処理
 */
if (capture(FIRM_PAGE, FIRM_URL, FIRM, FIRM_UTF8)) {
    if (!normalize_firm()) {
        exit(1);
    }
    if (!archive($firm_arc_list)) {
        exit(1);
    }
    if (!update_arc_index()) {
        exit(1);
    }
    move_file(PATH_TMP . "/" . FIRM_UTF8, PATH_CSV);
    move_file(PATH_TMP . "/" . FIRM_OUT, PATH_CSV);
    move_file(PATH_TMP . "/" . FIRM . "_html_hash", PATH_VAR);
    move_file(PATH_TMP . "/" . FIRM . "_lzh_hash", PATH_VAR);
    unlink_files(array(PATH_TMP . "/" . FIRM . ".csv"));
    $updated = true;
} else {
    unlink_files(array(PATH_TMP . "/" . FIRM . "_html_hash", PATH_TMP . "/" . FIRM . "_lzh_hash"));
}
/*