Create($crm_db,$crm_user,$crm_host,$crm_pass); $gc_sql=$crm; // session handling $db_foo = $crm; // template handling $cdc = new MySQL_class; $cdc->Create($cdc_db,$cdc_user,$cdc_host,$cdc_pass); $tmp = new MySQL_class; $tmp->Create($template_db,$template_user,$template_host_2,$template_pass); // foil hackers unset($u_type,$u_id,$session_email); // start session start_session($php_sessid); if(page_auth(3,$u_type,$cdc) == "yes") { $staging = "yes"; } // test login unset($u_type,$u_id,$session_email); start_session($sessid); app_log('donation',$PHP_SELF,$search_word,$u_id,'view',$code,$array); // if only one campaign is active is just show that campaign ... if multiple active campaigns show that one if(!$campaign_id) { $query = "select id, name, description from $CAMPAIGN where brand = '$code' and hide != 'Y' "; $data = $crm->mydata($query); } // page starts // start template engine $tpl = new rFastTemplate("."); $tpl->no_strict(); $tpl->quiet(); $tpl->define_raw( array( main => get_template('40',$TEMPLATE,$tmp,$code,$staging), body => get_template('225',$TEMPLATE,$tmp,$code,$staging) )); $tpl = show_login($u_id,$tpl); $tpl = html_chunks($staging,$tpl,$code,$brnd); // asign basic stuff $tpl->assign( array( SELF => $PHP_SELF, MESSAGE => $message, ALT_MESSAGE => strip_tags($alt_message) )); $tpl->assign(array( PAGE_TITLE => 'Donation' )); // get a donation id ... $query = "select d.id, d.name, d.description from $DONATION d, $CAMPAIGN c where c.activates_on <= '".gmdate("Y-m-d")."' and c.disables_on >= '".gmdate("Y-m-d")."' and d.campaign_id = c.id and c.brand = '$code' limit 0,1 "; $data = $crm->mydata($query); $tpl->assign(array( DONATION_ID => $data[id][0] )); $tpl->parse( MAIN, array( "body", "main" )); $tpl->FastPrint(); exit(); ?>