Пример #1
0
$nc = count($NL);
for ($ncc = 0; $ncc < $nc; $ncc++) {
    if (!empty($NL[$ncc]['clicks'])) {
        $shownlURLPara->addParam("nl_id", $NL[$ncc]['id']);
        $shownlURLPara_ = $shownlURLPara->getAllParams();
        $_MAIN_OUTPUT .= "<br>" . ($ncc + 1) . ".) <a href=\"" . $tm_URL . "/" . $shownlURLPara_ . "\">" . $NL[$ncc]['subject'] . "</a> (" . $NL[$ncc]['clicks'] . ")";
    }
}
////////////////////////////////////////////////////////////////////////////////////////
//FORMS
////////////////////////////////////////////////////////////////////////////////////////
$_MAIN_OUTPUT .= "<h2>" . sprintf(___("TOP %s - Formulare"), $show_top_x) . "</h2>";
$_MAIN_OUTPUT .= "<b>" . ___("Anmeldungen") . "</b>";
$showformURLPara->addParam("act", "statistic");
$showformURLPara->addParam("set", "frm");
$FRM = $FORMULAR->getForm(0, 0, $show_top_x, 0, "subscriptions", 1);
$fc = count($FRM);
for ($fcc = 0; $fcc < $fc; $fcc++) {
    if (!empty($FRM[$fcc]['subscriptions'])) {
        $showformURLPara->addParam("frm_id", $FRM[$fcc]['id']);
        $showformURLPara_ = $showformURLPara->getAllParams();
        $_MAIN_OUTPUT .= "<br>" . ($fcc + 1) . ".) <a href=\"" . $tm_URL . "/" . $showformURLPara_ . "\">" . $FRM[$fcc]['name'] . "</a> (" . $FRM[$fcc]['subscriptions'] . ")";
    }
}
////////////////////////////////////////////////////////////////////////////////////////
//LESER - Views
////////////////////////////////////////////////////////////////////////////////////////
$_MAIN_OUTPUT .= "</td></tr><tr><td valign=top align=left>";
// width=50%
$_MAIN_OUTPUT .= "<h2>" . sprintf(___("TOP %s - Abonnenten"), $show_top_x) . "</h2>";
$_MAIN_OUTPUT .= "<b>" . ___("Views") . "</b>";
    $Form->add_InputOption($FormularName, $InputName_Group, $GRP[$accg]['id'], $GRP[$accg]['name'] . " (" . $GRP[$accg]['adr_count'] . ")");
}
//Author bzw Formular! Form_[ID]
$Form->new_Input($FormularName, $InputName_Author, "select", "");
$Form->set_InputJS($FormularName, $InputName_Author, " onChange=\"flash('submit','#ff0000');\" ");
$Form->set_InputDefault($FormularName, $InputName_Author, ${$InputName_Author});
$Form->set_InputStyleClass($FormularName, $InputName_Author, "mFormSelect", "mFormSelectFocus");
$Form->set_InputDesc($FormularName, $InputName_Author, ___("Herkunft / Quelle"));
$Form->set_InputReadonly($FormularName, $InputName_Author, false);
$Form->set_InputOrder($FormularName, $InputName_Author, 6);
$Form->set_InputLabel($FormularName, $InputName_Author, ___("Herkunft / Quelle") . "<br>");
$Form->set_InputSize($FormularName, $InputName_Author, 0, 1);
$Form->set_InputMultiple($FormularName, $InputName_Author, false);
//add Data
$FORMULAR = new tm_FRM();
$FRM = $FORMULAR->getForm();
$fcg = count($FRM);
$Form->add_InputOption($FormularName, $InputName_Author, "", "-- " . ___("Alle"));
for ($fccg = 0; $fccg < $fcg; $fccg++) {
    //	$Form->add_InputOption($FormularName,$InputName_Author,$FRM[$fccg]['id'],$FRM[$fccg]['name']."(".$FRM[$fccg]['id'].")");
    $Form->add_InputOption($FormularName, $InputName_Author, $FRM[$fccg]['id'], "Formular ID " . $FRM[$fccg]['id']);
}
//Status
$Form->new_Input($FormularName, $InputName_Status, "select", "");
$Form->set_InputJS($FormularName, $InputName_Status, " onChange=\"flash('submit','#ff0000');\" ");
$Form->set_InputDefault($FormularName, $InputName_Status, ${$InputName_Status});
$Form->set_InputStyleClass($FormularName, $InputName_Status, "mFormSelect", "mFormSelectFocus");
$Form->set_InputDesc($FormularName, $InputName_Status, ___("Suche nach Adress-Status"));
$Form->set_InputReadonly($FormularName, $InputName_Status, false);
$Form->set_InputOrder($FormularName, $InputName_Status, 4);
$Form->set_InputLabel($FormularName, $InputName_Status, ___("Status") . "<br>");
Пример #3
0
$InputName_F3_expr = "f3_expr";
${$InputName_F3_expr} = getVar($InputName_F3_expr);
$InputName_F4_expr = "f4_expr";
${$InputName_F4_expr} = getVar($InputName_F4_expr);
$InputName_F5_expr = "f5_expr";
${$InputName_F5_expr} = getVar($InputName_F5_expr);
$InputName_F6_expr = "f6_expr";
${$InputName_F6_expr} = getVar($InputName_F6_expr);
$InputName_F7_expr = "f7_expr";
${$InputName_F7_expr} = getVar($InputName_F7_expr);
$InputName_F8_expr = "f8_expr";
${$InputName_F8_expr} = getVar($InputName_F8_expr);
$InputName_F9_expr = "f9_expr";
${$InputName_F9_expr} = getVar($InputName_F9_expr);
$FORMULAR = new tm_FRM();
$FRM = $FORMULAR->getForm($frm_id);
$check = true;
if ($set == "save") {
    //checkinput
    if (empty($name)) {
        $check = false;
        $_MAIN_MESSAGE .= "<br>" . ___("Name sollte nicht leer sein.");
    }
    if (!check_dbid($nl_id_doptin)) {
        $check = false;
        $_MAIN_MESSAGE .= "<br>" . ___("Wählen Sie ein Newsletter für die Double-Opt-In Mail.");
    }
    if (!check_dbid($nl_id_greeting)) {
        $check = false;
        $_MAIN_MESSAGE .= "<br>" . ___("Wählen Sie ein Newsletter für die Bestätigungsmail.");
    }
Пример #4
0
 /**
  * save log
  * @param
  * @return boolean
  */
 function log($arr)
 {
     //indexes:
     //author_id = given author id, if not given, check data array for author id, if not given, check login, if not given, set to 0=system
     //action = text = new/edit/delete
     //object = contact/ticket/contact_group/object/contact_type etc
     //data = array with data, e.g. from $contact array addContact Method etc.
     $Return = false;
     //check values
     //set log date
     $this->LOG['date'] = date("Y-m-d H:i:s");
     //chekc for author id
     $this->LOG['author_id'] = 0;
     //default is 0=system
     if (isset($arr['author_id']) && check_dbid($arr['author_id'])) {
         //if valid author_id in arr
         $this->LOG['author_id'] = $arr['author_id'];
     } else {
         //else check for author_id in data array
         if (isset($arr['data']['author_id']) && check_dbid($arr['data']['author_id'])) {
             $this->LOG['author_id'] = $arr['data']['author_id'];
         } else {
             // else, if not set at all get author id from logged in user
             global $LOGIN;
             if (isset($LOGIN->USER['id']) && check_dbid($LOGIN->USER['id'])) {
                 $this->LOG['author_id'] = $LOGIN->USER['id'];
             }
         }
     }
     //action
     //action should always be set, default is --
     $this->LOG['action'] = "--";
     if (isset($arr['action']) && !empty($arr['action'])) {
         //wenn aktion definiert
         $this->LOG['action'] = $arr['action'];
     }
     //object
     //object should always be set, default is --
     $this->LOG['object'] = "--";
     if (isset($arr['object']) && !empty($arr['object'])) {
         //wenn aktion definiert
         $this->LOG['object'] = $arr['object'];
     }
     //edit_id, die id des geaenderten datensatzes! oder neuen datensatzes, defakto muss log() erst am ende einer add methode aufgerufen werden wenn die id bekannt ist!
     //edit_id should always be set, default is 0
     $this->LOG['edit_id'] = 0;
     if (isset($arr['data']['id']) && !empty($arr['data']['id'])) {
         //wenn id
         $this->LOG['edit_id'] = $arr['data']['id'];
     }
     $this->LOG['memo'] = "";
     if (isset($arr['memo'])) {
         $this->LOG['memo'] = $arr['memo'];
     }
     $this->LOG['s_data'] = serialize($arr['data']);
     //hmmm, falls loeschung, daten aus altem datensatz anhand id ermitteln.... hmmmm
     if ($this->LOG['action'] == "delete" && check_dbid($this->LOG['edit_id'])) {
         switch ($this->LOG['object']) {
             //default:
             #no default, default : require_once (TM_INCLUDEPATH."/Welcome.inc.php"); break;
             case 'usr':
                 $LINK = new tm_CFG();
                 $DATA = $LINK->getUser("", $this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA);
                 break;
             case 'adr':
                 $LINK = new tm_ADR();
                 $DATA = $LINK->getAdr($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'adr_grp':
                 $LINK = new tm_ADR();
                 $DATA = $LINK->getGroup($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'nl':
                 $LINK = new tm_NL();
                 $DATA = $LINK->getNL($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'nl_grp':
                 $LINK = new tm_NL();
                 $DATA = $LINK->getGroup($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'bl':
                 $LINK = new tm_BLACKLIST();
                 $DATA = $LINK->getBL($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'frm':
                 $LINK = new tm_FRM();
                 $DATA = $LINK->getForm($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'host':
                 $LINK = new tm_HOST();
                 $DATA = $LINK->getHost($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'q':
                 $LINK = new tm_Q();
                 $DATA = $LINK->getQ($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'lnk':
                 $LINK = new tm_LNK();
                 $DATA = $LINK->get($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
             case 'lnk_grp':
                 $LINK = new tm_LNK();
                 $DATA = $LINK->getGroup($this->LOG['edit_id']);
                 $this->LOG['s_data'] = serialize($DATA[0]);
                 break;
         }
         //switch
     }
     //if action=delete
     //serialisierte werte speichern, ein eintrag in die db pro aktion!
     $Query = "INSERT INTO " . TM_TABLE_LOG . " (\n\t\t\t\t\t\tdate,\n\t\t\t\t\t\tauthor_id,\n\t\t\t\t\t\taction,\n\t\t\t\t\t\tobject,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tx_value,\n\t\t\t\t\t\tedit_id,\n\t\t\t\t\t\tdata,\n\t\t\t\t\t\tmemo,\n\t\t\t\t\t\tsiteid\n\t\t\t\t\t\t)\n\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t'" . dbesc($this->LOG["date"]) . "',\n\t\t\t\t\t\t" . checkset_int($this->LOG["author_id"]) . ",\n\t\t\t\t\t\t'" . dbesc($this->LOG["action"]) . "',\n\t\t\t\t\t\t'" . dbesc($this->LOG["object"]) . "',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t" . checkset_int($this->LOG["edit_id"]) . ",\n\t\t\t\t\t\t'" . dbesc($this->LOG['s_data']) . "',\n\t\t\t\t\t\t'" . dbesc($this->LOG['memo']) . "',\n\t\t\t\t\t\t'" . TM_SITEID . "')";
     if ($this->DB->Query($Query)) {
         $Return = true;
     } else {
         $Return = FALSE;
         return $Return;
     }
     /*		
     //jeden wert einzeln speichern, ist aber unsinnn!!!!
     //iterate data array, fetch all indexes and values and save...... yes, it becomes a very very big table!!!!! anders gehts halt nicht!
     foreach ($arr['data'] as $data_key => $data_val) {
     	    	if (DEBUG) $_MAIN_MESSAGE.= "$data_key => $data_val\n, ";
     	$Query ="INSERT INTO ".TM_TABLE_LOG." (
     				date,
     				author_id,
     				action,
     				object,
     				property,
     				x_value,
     				edit_id,
     				siteid
     				)
     				VALUES (
     				'".dbesc($this->LOG["date"])."',
     				'".checkset_int($this->LOG["author_id"])."',
     				'".dbesc($this->LOG["action"])."',
     				'".dbesc($this->LOG["object"])."',
     				'".dbesc($data_key)."',
     				'".dbesc($data_val)."',
     				'".checkset_int($this->LOG["edit_id"])."',
     				'".TM_SITEID."')";
     	if (DEBUG_SQL) $_MAIN_MESSAGE.="\n".$Query."<br>";
     	if ($this->DB->Query($Query)) {
     		$Return=true;
     	} else {
     		$Return=FALSE;
     		return $Return;			
     	}
     }//foreach
     */
     return $Return;
 }
Пример #5
0
if ($set == "standard") {
    $FORMULAR->setStd($frm_id);
    $_MAIN_MESSAGE .= "<br>" . ___("Neues Standardformular wurde definiert.");
}
if ($set == "delete" && $doit == 1) {
    if (!DEMO) {
        $FORMULAR->delForm($frm_id);
    }
    $_MAIN_MESSAGE .= "<br>" . ___("Eintrag wurde gelöscht.");
}
if ($set == "copy" && $doit == 1) {
    $FORMULAR->copyForm($frm_id);
    $_MAIN_MESSAGE .= "<br>" . ___("Eintrag wurde kopiert.");
}
if ($adr_grp_id != 0) {
    $FRM = $FORMULAR->getForm(0, 0, 0, $adr_grp_id);
    //id,offset,limit,group
} else {
    $FRM = $FORMULAR->getForm(0, 0, 0, 0);
    //id,offset,limit,group
}
$ac = count($FRM);
$sortIndex = getVar("si");
if (empty($sortIndex)) {
    $sortIndex = "id";
}
$sortType = getVar("st");
if (empty($sortType)) {
    $sortType = "0";
    //asc
}