Esempio n. 1
0
function emptyDB($fh, $connection)
{
    if (emptyTable($fh, $connection, 'classes') == 1 && emptyTable($fh, $connection, 'teachers') == 1 && emptyTable($fh, $connection, 'teachers_lst') == 1 && emptyTable($fh, $connection, 'classes_lst')) {
        return "Yes";
    } else {
        return "No";
        fwrite($fh, PHP_EOL . date("m/d/Y h:i:s a", time()) . "...ERROR Line#13 (functions.php): Can't empty DB: ");
    }
}
Esempio n. 2
0
 * under the License.
 */
if (!defined('IS_VALID_PHPMYFAQ_ADMIN')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
require PMF_INCLUDE_DIR . '/Export.php';
?>
    <h2><?php 
print $PMF_LANG["ad_menu_export"];
?>
</h2>
    <form action="?action=exportfile" method="post">
<?php 
if (!emptyTable(SQLPREFIX . "faqdata")) {
    if (!emptyTable(SQLPREFIX . "faqcategories")) {
        $category = new PMF_Category($current_admin_user, $current_admin_groups);
        $category->buildTree();
        $helper = PMF_Helper_Category::getInstance();
        $helper->setCategory($category);
        ?>
        <fieldset><legend><?php 
        print $PMF_LANG['ad_export_which_cat'];
        ?>
</legend>
            <label class="left" for="rubrik"><?php 
        print $PMF_LANG["ad_entry_category"];
        ?>
</label>
            <select name="catid" id="catid" size="1">
<?php 
Esempio n. 3
0
//include our functions file
require_once 'functions.php';
//name of the text datafile
$datafile = $feedSettings[1]['file'];
//$datafile = 'download/inv.txt';
//open the file
$handle = fopen($datafile, "r");
$mpn_matches = 0;
$gtin_matches = 0;
//////////////////////////////
if ($handle) {
    echo "RPRO file downloaded. Opening...<br />";
    //empty the LOCAL_PRODUCT_LISTINGS table
    emptyTable('LOCAL_PRODUCT_LISTINGS');
    //empty the PRICE_QUANTITY table
    emptyTable('PRICE_QUANTITY');
    //declare a counter so we don't insert the first line
    $count = 0;
    ///////////////////////
    //loop through line by line
    while (($line = fgets($handle, 4096)) !== false) {
        ///////////////
        //hack so we don't insert the first line
        if ($count > 0) {
            $exploded_tab_array = explode("\t", $line);
            //echo "<pre>";
            //var_dump($exploded_tab_array);
            //echo '</pre><br>';
            //assign some reference variables
            $sku = $exploded_tab_array[0];
            $mpn = $exploded_tab_array[1];
Esempio n. 4
0
    $log->add("sending sms notification");
    avisoCel("could not clean up temp db: {$tableName}");
}
$tableName = "albums_generos";
$log->add("cleaning up temporary db table {$tableName}...");
if (emptyTable($dbc, $tableName) === TRUE) {
    $log->add("success!");
} else {
    $log->add("fail!");
    // enviar aviso cel
    $log->add("sending sms notification");
    avisoCel("could not clean up temp db: {$tableName}");
}
$tableName = "albums_temas";
$log->add("cleaning up temporary db table {$tableName}...");
if (emptyTable($dbc, $tableName) === TRUE) {
    $log->add("success!");
} else {
    $log->add("fail!");
    // enviar aviso cel
    $log->add("sending sms notification");
    avisoCel("could not clean up temp db: {$tableName}");
}
// PROCESAR GENEROS
sleep(5);
// pause 5 secs for db flush
include_once "sync-groups.php";
// TODO: PROCESAR TEMAS
sleep(5);
// pause 5 secs for db flush
include_once "sync-tracks.php";
Esempio n. 5
0
</a>:<br /><?php 
                print $row->comment;
                ?>
<br /><a href="<?php 
                print $_SERVER["PHP_SELF"] . $linkext;
                ?>
&amp;aktion=delcomment&amp;artid=<?php 
                print $row->id;
                ?>
&amp;cmtid=<?php 
                print $row->id_comment;
                ?>
&amp;lang=<?php 
                print $lang;
                ?>
"><img src="images/delete.gif" alt="<?php 
                print $PMF_LANG["ad_entry_delete"];
                ?>
" title="<?php 
                print $PMF_LANG["ad_entry_delete"];
                ?>
" border="0" width="17" height="18" align="right" /></a></p>
<?php 
            }
        }
    }
} elseif ($permission["editbt"] != 1 && !emptyTable(SQLPREFIX . "faqcategories")) {
    print $PMF_LANG["err_NotAuth"];
} elseif ($permission["editbt"] && emptyTable(SQLPREFIX . "faqcategories")) {
    print $PMF_LANG["no_cats"];
}
Esempio n. 6
0
         // arrays
         $days_array = $_GET['days_array'];
         $classes_array = $_GET['classes_array'];
         $css_top_array = $_GET['css_top_array'];
         $css_left_array = $_GET['css_left_array'];
         $css_bg_array = $_GET['css_bg_array'];
         $css_fore_array = $_GET['css_fore_array'];
         $css_width_array = $_GET['css_width_array'];
         // handle connection
         $connection = (include 'connection.php');
         if ($connection == null) {
             fwrite($fh, date("m/d/Y h:i:s a", time()) . "...ERROR Line#35 (store_classes.php): Can't get classes: " . PHP_EOL);
         } else {
             // emptyDB($fh, $connection);
             // store classes
             emptyTable($fh, $connection, 'classes');
             for ($i = 0; $i < count($classes_array); $i++) {
                 // add class
                 $class = $classes_array[$i];
                 $css_top = $css_top_array[$i];
                 $css_left = $css_left_array[$i];
                 $css_bg = $css_bg_array[$i];
                 $css_fore = $css_fore_array[$i];
                 $css_width = $css_width_array[$i];
                 $dayID = getClassDayID($fh, $connection, $days_array[$i]);
                 $class_id = addClass($fh, $connection, $class, $css_top, $css_left, $css_bg, $css_fore, $css_width, $dayID);
             }
         }
         fclose($fh);
     }
 }
Esempio n. 7
0
    if (!($fh = fopen($file, 'a'))) {
        print 'ERROR (store_new_teachers.php): Can\'t open file';
    } else {
        if (isset($_GET['teachers_array'])) {
            // writing to log file
            fwrite($fh, PHP_EOL . PHP_EOL . "---------------------------------------------------------------------------------------------------------------------" . PHP_EOL);
            fwrite($fh, date("m/d/Y h:i:s a", time()) . ": storing new teachers" . PHP_EOL);
            // arrays
            $teachers_array = $_GET['teachers_array'];
            $css_bg_array = $_GET['css_bg_array'];
            $css_fore_array = $_GET['css_fore_array'];
            // handle connection
            $connection = (include 'connection.php');
            if ($connection == null) {
                fwrite($fh, date("m/d/Y h:i:s a", time()) . "...ERROR Line#31 (store_new_teachers.php): Connection error: " . PHP_EOL);
            } else {
                emptyTable($fh, $connection, 'teachers_lst');
                // store new teachers
                for ($i = 0; $i < count($teachers_array); $i++) {
                    // add teacher
                    $teacher = $teachers_array[$i];
                    $css_bg = $css_bg_array[$i];
                    $css_fore = $css_fore_array[$i];
                    addTeacherList($fh, $connection, $teacher, $css_bg, $css_fore);
                }
            }
            fclose($fh);
        } else {
        }
    }
}
Esempio n. 8
0
//////////////////////////////
//this is parse_googlebase.php
//////////////////////////////
//increased error reporting
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 'On');
//include our functions file
require_once 'functions.php';
//name of the text datafile
$datafile = $feedSettings[0]['file'];
//open the file
$handle = fopen($datafile, "r");
//////////////////////////////
if ($handle) {
    //empty the ONLINE_LISTINGS table
    emptyTable('ONLINE_LISTINGS');
    $count = 0;
    $shipping_deal_count = 0;
    ///////////////////////
    // loop through line by line, and do any text processing required
    while (($line = fgets($handle, 4096)) !== false) {
        $exploded_tab_array = explode("\t", trim($line));
        //echo "<pre>";
        //var_dump($exploded_tab_array);
        //echo '</pre><br>';
        $shipping = "";
        $gender = '';
        $age_group = '';
        //assign some reference variables
        $link = $exploded_tab_array[0];
        $condition = $exploded_tab_array[1];
Esempio n. 9
0
            $replacedString = ltrim(ereg_replace('<br />', '', $row->artikel));
            $export->TableImageText($replacedString);
            $export->xmlContent .= '</article>';
        }
        $export->xmlContent .= '</part>';
    }
    $export->write_file();
    // Transformation of the articles
    $export->xmlContent .= '<part>' . '<title>Artikel</title>' . '<preface>' . '<title>Rubriken</title>';
    // Selection of the categories
    $export->recursive_category($parentID);
    $export->xmlContent .= '</preface>' . '</part>' . '</book>';
    $export->write_file();
    print "<p>XML DocBook file: <a href=\"../xml/docbook/docbook.xml\" target=\"_blank\">" . $PMF_CONF["title"] . "</a></p>";
}
if (!emptyTable(SQLPREFIX . "faqdata")) {
    ?>
	<form action="<?php 
    print $_SERVER["PHP_SELF"] . $linkext;
    ?>
" method="post">
	<input type="hidden" name="aktion" value="export" />
	
    <fieldset>
    <legend><?php 
    print $PMF_LANG["ad_menu_export"];
    ?>
</legend>
    
    <label class="left">XML export</label>
    <input class="submit" type="submit" name="submit[0]" value="XML export" /><br /><br />
Esempio n. 10
0
if (isset($auth)) {
    $pmf_hash = base64_encode($auth_user . ',' . $auth_pass);
    ?>
<iframe id="keepPMFSessionAlive" src="session.keepalive.php<?php 
    print $linkext;
    ?>
&amp;lang=<?php 
    print $LANGCODE;
    ?>
&amp;hash=<?php 
    print $pmf_hash;
    ?>
" frameBorder="no" width="0" height="0"></iframe>
<?php 
}
if (isset($_REQUEST["aktion"]) && ($_REQUEST["aktion"] == "editentry" || $_REQUEST["aktion"] == "news" || $_REQUEST["aktion"] == "editpreview" || $_REQUEST["aktion"] == "takequestion") && !emptyTable(SQLPREFIX . "faqcategories")) {
    ?>
<style type="text/css"> @import url(editor/htmlarea.css); </style>
<script type="text/javascript">
//<![CDATA[
_editor_url = "editor";
_editor_lang = "en";
//]]>
</script>
<script type="text/javascript" src="editor/htmlarea.js"></script>
<script type="text/javascript" src="editor/plugins/ImageManager/image-manager.js"></script>
<script type="text/javascript">
//<![CDATA[
    HTMLArea.init();
    HTMLArea.loadPlugin('ImageManager');
    HTMLArea.onload = function() {