From: Steve Sutton Date: Fri, 5 Feb 2010 21:47:19 +0000 (+0000) Subject: adding Contact Admin X-Git-Tag: v1.0.0~121 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=5b255a8a2778be7a40ad06c352dd83ec638945b5;p=web%2FTroutCreek.git adding Contact Admin --- diff --git a/admin/Contact/class_html.phtml b/admin/Contact/class_html.phtml new file mode 100755 index 0000000..5ec2f5e --- /dev/null +++ b/admin/Contact/class_html.phtml @@ -0,0 +1,352 @@ + +** Filename......: html_mime_mail.class +** Last changed..: 28/01/01 +** Notes.........: Based upon mime_mail.class +** by Tobias Ratschiller +** and Sascha Schumann . +** See http://www.heyes-computing.net/scripts/ +** for full tar/zip if you haven't got one. +***************************************/ + +class html_mime_mail{ + + var $mime; + var $html; + var $body; + var $do_html; + var $multipart; + var $html_text; + var $html_images; + var $headers; + var $parts; + var $charset; + var $charsetlist; + +/*************************************** +** Constructor function. Sets the headers +** if supplied. +***************************************/ + + function html_mime_mail($headers = ''){ + + $this->html_images = array(); + $this->headers = array(); + $this->parts = array(); + $this->charsetlist = array('iso' => 'us-ascii', + 'big5' => 'big5', + 'gb' => 'gb2312'); + + $this->charset = 'us-ascii'; + + if($headers == '') return TRUE; + if(is_string($headers)) $headers = explode("\n", trim($headers)); + for($i=0; $iheaders[] = $headers[$i][$j]; + if($headers[$i] != '') $this->headers[] = $headers[$i]; + } + } + +/*************************************** +** Accessor function to set the body text. +** Body text is used if it's not an html +** mail being sent. +***************************************/ + + function set_body($text = ''){ + if(is_string($text)){ + $this->body = $text; + return TRUE; + } + return FALSE; + } + +/*************************************** +** Accessor function to return the mime +** class variable. Purely for debug. +***************************************/ + + function get_mime(){ + if(!isset($this->mime)) $this->mime = ''; + return $this->mime; + } + +/*************************************** +** Function to set a header. Shouldn't +** really be necessary as you could use +** the constructor and send functions, +** it's here nonetheless. Takes any number +** of arguments, which can be either +** strings or arrays full of strings. +** this function is php4 only and will +** return false otherwise. Will return +** true upon finishing. +***************************************/ + + function add_header(){ + if((int)phpversion() < 4) return FALSE; + $args = func_get_args(); + for($i=0; $iheaders[] = $args[$i][$j]; + if($args[$i] != '') $this->headers[] = $args[$i]; + } + return TRUE; + } + +/*************************************** +** Accessor function to set the content charset. +** Matt add 2000/10/19 +***************************************/ + function set_charset($charset = '', $raw = FALSE){ + + if($raw == TRUE){ + $this->charset = $charset; + return TRUE; + } + + if(is_string($charset)){ + while(list($k,$v) = each($this->charsetlist)){ + if($k == $charset){ + $this->charset = $v; + return TRUE; + } + } + } + return FALSE; + } + +/*************************************** +** Adds a html part to the mail. +** Also replaces image names with +** content-id's. +***************************************/ + function add_html($html, $text){ + $this->do_html = 1; + $this->html = $html; + $this->html_text = $text; + if(is_array($this->html_images) AND count($this->html_images) > 0){ + for($i=0; $ihtml_images); $i++) $this->html = ereg_replace($this->html_images[$i]['name'], 'cid:'.$this->html_images[$i]['cid'], $this->html); + } + } + +/*************************************** +** Builds html part of email. +***************************************/ + function build_html($orig_boundary){ + $sec_boundary = '=_'.md5(uniqid(time())); + $thr_boundary = '=_'.md5(uniqid(time())); + + if(count($this->html_images) == 0){ + $this->multipart.= '--'.$orig_boundary."\n"; + $this->multipart.= 'Content-Type: multipart/alternative;'.chr(10).chr(9).'boundary="'.$sec_boundary."\"\n\n\n"; + + $this->multipart.= '--'.$sec_boundary."\n"; + $this->multipart.= 'Content-Type: text/plain; charset="'.$this->charset.'"'."\n"; + $this->multipart.= 'Content-Transfer-Encoding: base64'."\n\n"; + $this->multipart.= chunk_split(base64_encode($this->html_text))."\n\n"; + + $this->multipart.= '--'.$sec_boundary."\n"; + $this->multipart.= 'Content-Type: text/html; charset="'.$this->charset.'"'."\n"; + $this->multipart.= 'Content-Transfer-Encoding: base64'."\n\n"; + $this->multipart.= chunk_split(base64_encode($this->html))."\n\n"; + $this->multipart.= '--'.$sec_boundary."--\n\n"; + }else{ + $this->multipart.= '--'.$orig_boundary."\n"; + $this->multipart.= 'Content-Type: multipart/related;'.chr(10).chr(9).'boundary="'.$sec_boundary."\"\n\n\n"; + + $this->multipart.= '--'.$sec_boundary."\n"; + $this->multipart.= 'Content-Type: multipart/alternative;'.chr(10).chr(9).'boundary="'.$thr_boundary."\"\n\n\n"; + + $this->multipart.= '--'.$thr_boundary."\n"; + $this->multipart.= 'Content-Type: text/plain; charset="'.$this->charset.'"'."\n"; + $this->multipart.= 'Content-Transfer-Encoding: base64'."\n\n"; + $this->multipart.= chunk_split(base64_encode($this->html_text))."\n\n"; + + $this->multipart.= '--'.$thr_boundary."\n"; + $this->multipart.= 'Content-Type: text/html'."\n"; + $this->multipart.= 'Content-Transfer-Encoding: base64'."\n\n"; + $this->multipart.= chunk_split(base64_encode($this->html))."\n\n"; + $this->multipart.= '--'.$thr_boundary."--\n\n"; + + for($i=0; $ihtml_images); $i++){ + $this->multipart.= '--'.$sec_boundary."\n"; + $this->build_html_image($i); + } + + $this->multipart.= "--".$sec_boundary."--\n\n"; + } + } +/*************************************** +** Adds an image to the list of embedded +** images. +***************************************/ + function add_html_image($file, $name = '', $c_type='application/octet-stream'){ + $this->html_images[] = array( 'body' => $file, + 'name' => $name, + 'c_type' => $c_type, + 'cid' => md5(uniqid(time())) ); + } + + +/*************************************** +** Adds a file to the list of attachments. +***************************************/ + function add_attachment($file, $name = '', $c_type='application/octet-stream'){ + $this->parts[] = array( 'body' => $file, + 'name' => $name, + 'c_type' => $c_type ); + } + +/*************************************** +** Builds an embedded image part of an +** html mail. +***************************************/ + function build_html_image($i){ + $this->multipart.= 'Content-Type: '.$this->html_images[$i]['c_type']; + + if($this->html_images[$i]['name'] != '') $this->multipart .= '; name="'.$this->html_images[$i]['name']."\"\n"; + else $this->multipart .= "\n"; + + $this->multipart.= 'Content-Transfer-Encoding: base64'."\n"; + $this->multipart.= 'Content-ID: <'.$this->html_images[$i]['cid'].">\n\n"; + $this->multipart.= chunk_split(base64_encode($this->html_images[$i]['body']))."\n"; + } + +/*************************************** +** Builds a single part of a multipart +** message. +***************************************/ + function build_part($i){ + $message_part = ''; + $message_part.= 'Content-Type: '.$this->parts[$i]['c_type']; + if($this->parts[$i]['name'] != '') + $message_part .= '; name="'.$this->parts[$i]['name']."\"\n"; + else + $message_part .= "\n"; + + // Determine content encoding. + if($this->parts[$i]['c_type'] == 'text/plain'){ + $message_part.= 'Content-Transfer-Encoding: base64'."\n\n"; + $message_part.= chunk_split(base64_encode($this->parts[$i]['body']))."\n"; + }elseif($this->parts[$i]['c_type'] == 'message/rfc822'){ + $message_part.= 'Content-Transfer-Encoding: 7bit'."\n\n"; + $message_part.= $this->parts[$i]['body']."\n"; + }else{ + $message_part.= 'Content-Transfer-Encoding: base64'."\n"; + $message_part.= 'Content-Disposition: attachment; filename="'.$this->parts[$i]['name']."\"\n\n"; + $message_part.= chunk_split(base64_encode($this->parts[$i]['body']))."\n"; + } + + return $message_part; + } + +/*************************************** +** Builds the multipart message from the +** list ($this->_parts). +***************************************/ + function build_message(){ + $boundary = '=_'.md5(uniqid(time())); + + $this->headers[] = 'MIME-Version: 1.0'; + $this->headers[] = 'Content-Type: multipart/mixed;'.chr(10).chr(9).'boundary="'.$boundary.'"'; + $this->multipart = "This is a MIME encoded message.\n\n"; + + if(isset($this->do_html) AND $this->do_html == 1) $this->build_html($boundary); + if(isset($this->body) AND $this->body != '') $this->parts[] = array('body' => $this->body, 'name' => '', 'c_type' => 'text/plain'); + + for($i=(count($this->parts)-1); $i>=0; $i--){ + $this->multipart.= '--'.$boundary."\n".$this->build_part($i); + } + + $this->mime = $this->multipart."--".$boundary."--\n"; + } + +/*************************************** +** Sends the mail. +***************************************/ + function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = ''){ + + if($to_name != '') $to = '"'.$to_name.'" <'.$to_addr.'>'; + else $to = $to_addr; + + if($from_name != '') $from = '"'.$from_name.'" <'.$from_addr.'>'; + else $from = $from_addr; + + if(is_string($headers)) $headers = explode("\n", trim($headers)); + for($i=0; $imime, 'From: '.$from."\n".implode("\n", $this->headers)."\n".implode("\n", $xtra_headers)); + } + +/*************************************** +** Use this method to deliver using direct +** smtp connection. Relies upon Manuel Lemos' +** smtp mail delivery class available at: +** http://phpclasses.upperdesign.com +** +** void smtp_send( string *Name* of smtp object, +** string From address, +** array To addresses, +** string Subject, +** array Extra headers) +***************************************/ + function smtp_send($smtp_obj, $from_addr, $to_addr, $subject, $xtra_headers = ''){ + global $$smtp_obj; + $smtp_obj = $$smtp_obj; + + $headers = $this->headers; + $headers[] = 'From: '.$from_addr; + $headers[] = 'Subject: '.$subject; + if(is_array($xtra_headers)) for(reset($xtra_headers); list(,$header) = each($xtra_headers); ) $headers[] = $header; + + // the following: sendmessage(string from address, array to addresses, array headers, string body) + $smtp_obj->sendmessage($from_addr, $to_addr, $headers, $this->mime); + } + +/*************************************** +** Use this method to return the email +** in message/rfc822 format. Useful for +** adding an email to another email as +** an attachment. there's a commented +** out example in example.php. +** +** string get_rfc822(string To name, +** string To email, +** string From name, +** string From email, +** [string Subject, +** string Extra headers]) +***************************************/ + function get_rfc822($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = ''){ + + // Make up the date header as according to RFC822 + $date = 'Date: '.date('D, d M y H:i:s'); + + if($to_name != '') $to = 'To: "'.$to_name.'" <'.$to_addr.'>'; + else $to = $to_addr; + + if($from_name != '') $from = 'From: "'.$from_name.'" <'.$from_addr.'>'; + else $from = $from_addr; + + if(is_string($subject)) $subject = 'Subject: '.$subject; + + if(is_string($headers)) $headers = explode("\n", trim($headers)); + for($i=0; $iheaders)."\n".implode("\n", $xtra_headers)."\n\n".$this->mime; + } + + +} // End of class. +?> diff --git a/admin/Contact/contact_inquiry.phtml b/admin/Contact/contact_inquiry.phtml new file mode 100644 index 0000000..802e435 --- /dev/null +++ b/admin/Contact/contact_inquiry.phtml @@ -0,0 +1,72 @@ + + + + + + 0) +{ + for($i=0;$i + + + + + + + +
+
+ +
+
[Edit] + "; + for($newpos=1;$newpos<=$maxpos;$newpos++) { + $string = "Command=Move&id=$data[id]&newpos=$newpos"; + $pos .= " +
Nothing in the database yet
+ diff --git a/admin/Contact/contact_setup.inc b/admin/Contact/contact_setup.inc new file mode 100755 index 0000000..2a79eea --- /dev/null +++ b/admin/Contact/contact_setup.inc @@ -0,0 +1,264 @@ +$value) + { + $template = str_replace( "", $value, $template ); + } + } + + return $template; + } +} +if(!function_exists("add_image")) +{ + function add_image($image,$align,$url) + { + if($image != "") + { + $output .= '
'; + if( $url != '' ) + { + $output .= ''; + } + $output .= ''; + if( $url != '' ) + { + $output .= ''; + } + $output .= '
'; + } + return($output); + } +} +// Navigation array +$nav = array( + "Add Contact" => "edit_contact.phtml", + "Saved Reports" => "list_query.phtml", + "Compose Email" => "edit_autoresponse.phtml?id=1", + "List Contacts" => "list_contact.phtml", + "Contact Inquiry Fields" => "contact_inquiry.phtml", + "Report Builder" => "index.phtml", + "Preview Email" => "view_newsletter.phtml",); + + +function interest($field) +{ + global $interest2; + if( !is_array( $interest2 ) ) + { + return( false ); + } + echo ""; + $count = 0; + foreach($interest2 as $key=>$value) + { + if($count==0) + echo ""; + $count++; + } + echo "
"; + echo "$value
"; + if($count==5) + echo "
"; + if($count==11) + echo "
"; +} + +// default query on create_date +$c_date_from = contact_date_entry("","","","fc_month","fc_day","fc_year"); +$c_date_to = contact_date_entry("","","","tc_month","tc_day","tc_year"); +/* The following is for setting up the defines and arrays that are needed + * based on which table ( customer or contact ) in use + * formats for arrays + * $DB_fields[] = array( name =>"{FIELD NAME}", title => "{FIELD TITLE}", type => "{FIELD TYPE}") + * $fields["{FIELD_NAME}"] = "{FIELD TITLE}"; + * + * must have these defines + * ID - The primary key + * SEQUENCE - sequence name + * WHERE - where clause + */ +if(TABLE==CUSTOMER_TABLE) +{ + define("ID","cust_id"); + define("MAILOK","mail_ok"); + define("SEQUENCE","custkey"); + define("WHERE","fname != '-Guest-'"); + // $DB_fields are used for edit and updating contacts + $DB_fields[] = array( name => "cust_id", title => "cust_id", type => "hide"); + $DB_fields[] = array( name => "purch_date",title => "Last Purchase Date", type => "static"); + $DB_fields[] = array( name => "access_date",title => "Last Access Date",type => "static"); + $DB_fields[] = array( name => "create_date",title => "Create Date",type => "static"); + $DB_fields[] = array( name => "fname", title => "First Name", type => "text"); + $DB_fields[] = array( name => "lname", title => "Last Name", type => "text"); + $DB_fields[] = array( name => "add1", title => "Address 1", type => "text"); + $DB_fields[] = array( name => "add2", title => "Address 2", type => "text"); + $DB_fields[] = array( name => "city", title => "City", type => "text"); + $DB_fields[] = array( name => "state", title => "State", type => "text"); + $DB_fields[] = array( name => "zip", title => "Zip", type => "text"); + $DB_fields[] = array( name => "email", title => "Email", type => "text"); + $DB_fields[] = array( name => "phone", title => "Phone", type => "text"); + $DB_fields[] = array( name => "fax", title => "Fax", type => "text"); + $DB_fields[] = array( name => "org", title => "Org", type => "text"); + $DB_fields[] = array( name => "referred_by",title => "Refered By", type => "text"); + $DB_fields[] = array( name => "mail_ok", title => "Mail Ok?", type => "radio"); + // $fields are used for building the query page + foreach($DB_fields as $key=>$value){ + if($value['type'] == "text") + $fields[$value['name']] = $value['title']; + } + // date query fields + $p_date_from = contact_date_entry("","","","fp_month","fp_day","fp_year"); + $p_date_to = contact_date_entry("","","","tp_month","tp_day","tp_year"); + $a_date_from = contact_date_entry("","","","fa_month","fa_day","fa_year"); + $a_date_to = contact_date_entry("","","","ta_month","ta_day","ta_year"); +} +else +{ + define("ID","id"); + define("MAILOK","mail_ok"); + define("SEQUENCE","contact_id_seq"); + define("WHERE",ID." IS NOT NULL"); + // $DB_fields are used for edit and updating contacts + $DB_fields[] = array( name => "id", title => "id", type => "hide"); + $DB_fields[] = array( name => "create_date",title => "Create Date",type => "static"); + $DB_fields[] = array( name => "fname", title => "First Name", type => "text"); + $DB_fields[] = array( name => "lname", title => "Last Name", type => "text"); + $DB_fields[] = array( name => "address", title => "Address", type => "text"); + $DB_fields[] = array( name => "city", title => "City", type => "text"); + $DB_fields[] = array( name => "state", title => "State", type => "text"); + $DB_fields[] = array( name => "zip", title => "Zip", type => "text"); + $DB_fields[] = array( name => "phone", title => "Phone", type => "text"); + $DB_fields[] = array( name => "email", title => "Email", type => "text"); + $DB_fields[] = array( name => "arrive_date",title => "Arrival Date",type => "date"); + $DB_fields[] = array( name => "depart_date",title => "Departure Date",type => "date"); + $DB_fields[] = array( name => "unit_size", title => "Unit Size", type => "array_drop",drop=>$unit_size2); + $DB_fields[] = array( name => "referred_by",title => "Referred By",type => "array_drop",drop=>$referred_by2); + $DB_fields[] = array( name => "other", title => "Referred By Other",type => "text"); + $DB_fields[] = array( name => "interest", title => "Interest", type=> "interest"); + $DB_fields[] = array( name => "questions", title => "Additional Questions",type => "desc"); + $DB_fields[] = array( name => "mail_ok", title => "Mail Ok?", type => "radio"); + //$DB_fields[] = array( name => "contestant",title => "Contestant?", type => "radio"); + + // $fields are used for building the query page + foreach($DB_fields as $key=>$value){ + if($value['type'] == "text" || $value['type'] == "array_drop") + $fields[$value['name']] = $value['title']; + } + $fields["questions"] = "Questions"; + $p_date_from = contact_date_entry("","","","fp_month","fp_day","fp_year"); + $p_date_to = contact_date_entry("","","","tp_month","tp_day","tp_year"); + $a_date_from = contact_date_entry("","","","fa_month","fa_day","fa_year"); + $a_date_to = contact_date_entry("","","","ta_month","ta_day","ta_year"); +} +?> diff --git a/admin/Contact/convert-inq.php b/admin/Contact/convert-inq.php new file mode 100644 index 0000000..49607ef --- /dev/null +++ b/admin/Contact/convert-inq.php @@ -0,0 +1,85 @@ +db_exec( $intQuery ) ) +{ + while( $iRow = pg_fetch_object( $iRes ) ) + { + $tKey = array_search( $iRow->header, $interest ); + $intArray["$tKey"] = (string)$iRow->id; + $intArray["$iRow->header"] = (string)$iRow->id; + } +} +//echo '
';
+//print_r( $intArray );
+//echo '
'; +$query = "select id,interest from contact where interest != '' and interest is not null order by id;"; +$DB->db_exec("BEGIN WORK;"); +if( $res = $DB->db_exec( $query ) ) +{ + while( $row = pg_fetch_object( $res ) ) + { + unset( $mArr ); + unset( $fkey ); + unset( $match ); + $mArr = explode( ':',ereg_replace(":$","",$row->interest) ); + if( is_array( $mArr ) ) + { + foreach( $mArr as $key => $val ) + { + $val = trim( $val ); + $fkey = array_search( $val, $interest, true ); + if( is_numeric( $val ) && $interest[$val] ) + { + echo '

matched '.$interest[$val].'

'; + $mArr[$key] = $intArray[$val]; + } + elseif( $fkey == '0' ) + { + echo '

matched -> null val '.$interest[$fkey].'

'; + $mArr[$key] = $intArray[$interest[$fkey]]; + } + elseif( $fkey !== false ) + { + echo '

matched '.$interest[$fkey].'

'; + $mArr[$key] = $intArray[$fkey]; + } + else + { + echo '

not matched '; + var_dump( $val ); + var_dump( $interest[0] ); + echo '

'; + } + } + } + $newQuery = "update contact set interest = ':".implode(":",$mArr).":' where id = ".$row->id; + $DB->db_exec($newQuery); + echo $newQuery; + //$dObj[] = $row; + } +} +$DB->db_exec("ABORT WORK;"); +?> diff --git a/admin/Contact/del_query.phtml b/admin/Contact/del_query.phtml new file mode 100755 index 0000000..f9b7fab --- /dev/null +++ b/admin/Contact/del_query.phtml @@ -0,0 +1,18 @@ + + +Query is Deleted +
Close This +Window
diff --git a/admin/Contact/download.phtml b/admin/Contact/download.phtml new file mode 100755 index 0000000..545b033 --- /dev/null +++ b/admin/Contact/download.phtml @@ -0,0 +1,108 @@ +".$query_string; + if(pg_numrows($res)>0) { + for($i=0;$i&1",$result_array,$result); + if($result != 0){ + echo $result_array[0]; + exit; + } + chmod("report.tar.gz",0660); + } + + if($file == "zip") { + $output = "report.zip"; + exec("zip report report.csv 2>&1",$result_array,$result); + if($result != 0){ + echo $result_array[0]; + exit; + } + chmod("report.zip",0660); + } + if($file == "rpt") { + $output = "report.csv"; + chmod("report.csv",0660); + } +if(ini_get('zlib.output_compression')) +{ + ini_set('zlib.output_compression', 'Off'); +} + header("Content-Type: application/force-download\n"); + /* Correction for the stupid MSIE thing */ + if(strstr(getenv('HTTP_USER_AGENT'), 'MSIE')) + { + header("Content-Disposition: inline; filename=\"$output\""); + } + else + { + header("Content-Disposition: attachment; filename=\"$output\""); + } + //header("Location: $output"); + $fn=fopen($output , "r"); + fpassthru($fn); + @fclose($fn); + exit(); +} +else { + header("Location: list_contact.phtml"); +} +?> diff --git a/admin/Contact/edit_autoresponse.phtml b/admin/Contact/edit_autoresponse.phtml new file mode 100755 index 0000000..dc7d283 --- /dev/null +++ b/admin/Contact/edit_autoresponse.phtml @@ -0,0 +1,270 @@ + + _editor_url = "'.URL_BASE.'admin/htmlarea/"; + '; +echo ''; +echo ''; +echo ''; +echo ''; +?> + + +
+'; +for($i = 0; $i < db_numrows($res); $i++) { + $row = db_fetch_array($res,$i, PGSQL_ASSOC); + + if(!$row[id]) + html_error(DB_ERROR_MSG,1); + + foreach($row as $key=>$value) { + switch($key) { + + case "id": + echo ""; + break; + + case "subject": + echo "Subject:"; + text_box("subject",$value); + echo ""; + break; + + case "coupon_link": + echo "Coupon Link Address:\n"; + text_box("coupon_link",$value); + break; + + case "response": + echo "Response:"; + echo ''; + //text_area("response",$value,8,60); + echo ""; + echo " NOTE: Insert COUPON IMAGE1 IMAGE2 IMAGE3 etc. in the body of + your text where you want the images to appear."; + break; + + case "image": + case "image2": + case "image3": + case "coupon": + break; + + default: + break; + } + } +} + +echo ""; + + + if ($row["coupon"] != "") + { + echo "" + ." " + ."" + ."
" + ."
" + ."

" + ."
" + ."$FT1 This is the current coupon attached to this newsletter." + ."To change the coupon, select a new one by clicking the browse button below." + ."To delete the coupon without uploading a new one, select " + ."Yes below and click the Update Category button. In addition, + if you'd like readers to be able to click the coupon to go to a site, enter + the address into "Coupon Link Address"." + ."
" + ."

" + ."" + ."$TDFT Delete Coupon?   Yes " + ."   " + ."$TDFT No " + ."
" + ."" + .""; + } + +?> + + Coupon: + + + + +" + ." " + ."" + ."
" + ."
" + ."

" + ."
" + ."$FT1 This is the current image attached to this newsletter." + ."To change the image, select a new one by clicking the browse button below." + ."To delete the image without uploading a new one, select " + ."Yes below and click the Update Category button." + ."
" + ."

" + ."" + ."$TDFT Delete Item Image?   Yes " + ."   " + ."$TDFT No " + ."
" + ."" + .""; + } + +?> + + IMAGE1: + + + + + Image1 Link: + + +" + ." " + ."" + ."
" + ."
" + ."

" + ."
" + ."$FT1 This is the second image attached to this newsletter." + ."To change the image, select a new one by clicking the browse button below." + ."To delete the image without uploading a new one, select " + ."Yes below and click the Update Category button." + ."
" + ."

" + ."" + ."$TDFT Delete Item Image?   Yes " + ."   " + ."$TDFT No " + ."
" + ."" + .""; + } + +?> + + IMAGE2: + + + + + Image2 Link: + + +" + ." " + ."" + ."
" + ."
" + ."

" + ."
" + ."$FT1 This is the third image attached to this newsletter." + ."To change the image, select a new one by clicking the browse button below." + ."To delete the image without uploading a new one, select " + ."Yes below and click the Update Category button." + ."
" + ."

" + ."" + ."$TDFT Delete Item Image?   Yes " + ."   " + ."$TDFT No " + ."
" + ."" + .""; + } + +?> + + IMAGE3: + + + + + Image3 Link: + + + + + + +

+ + + diff --git a/admin/Contact/edit_contact.phtml b/admin/Contact/edit_contact.phtml new file mode 100755 index 0000000..0e5fa53 --- /dev/null +++ b/admin/Contact/edit_contact.phtml @@ -0,0 +1,193 @@ +0){ + $row = db_fetch_array($res,0, PGSQL_ASSOC); + } + else{ + die("No such record"); + } +} +else { // else new entry + // Grab the array of name from $DB_fields and stick it into $row + // Any default values must be placed inside this loop + $row = array(); + for($i=0;$i + +
+'; +echo "
"; + +foreach($DB_fields as $key=>$value) { + if($value[type] == "text") { + ?> + + + + + (MM/DD/YYYY) + + + + + + + + + + + + + "; + if($row[$value[name]] != "") { + echo "Current Image:"; + echo " + + + + Delete this image: + + Yes + No + + "; + } + echo "New $value[title]:"; + echo ""; + echo ""; + } + elseif($value[type] == "file") { + ?> + + "; + if($row[$value[name]] != "") { + echo "Current File:"; + echo "".$row[$value[name]]." + + + + Delete this File: + + Yes + No + + "; + } + echo "New $value[title]:"; + echo ""; + echo ""; + } + if($value[type] == "desc") { + if($value[name] == "description") { + echo "
"; + echo "Description and Images"; + } + echo "$value[title]:"; + text_area("$value[name]",$row[$value[name]]); + echo ""; + } + elseif($value[type] == "hide") { + echo ""; + } + elseif($value[type] == "radio") { + echo "$value[title]:"; + echo "Yes"; + echo "No"; + echo ""; + } + elseif($value[type] == "array_drop"){ + echo "$value[title]:"; + echo ""; + if(is_array($value[drop])){ + echo ''; + } + echo ""; + } +} + +if(isset($id)) { +?> + + + + + + +
"; + +footer(); +?> diff --git a/admin/Contact/edit_inquiry.phtml b/admin/Contact/edit_inquiry.phtml new file mode 100644 index 0000000..663dec2 --- /dev/null +++ b/admin/Contact/edit_inquiry.phtml @@ -0,0 +1,87 @@ + + + + + + + "; + echo ""; + echo ""; + */ + echo ""; + echo ""; + /* + if($image != "") { + echo ""; + echo " + + + + + "; + } + echo ""; + echo ""; + echo ""; + */ + ?> + + + + +
Header: +
+ +
Description:
Current Image: +
Delete this image: + Yes + No +
New Image:
+ + +
+ + + + + + +
Header:
+ + +
+
+ diff --git a/admin/Contact/form.js b/admin/Contact/form.js new file mode 100755 index 0000000..0bbabf0 --- /dev/null +++ b/admin/Contact/form.js @@ -0,0 +1,42 @@ +function reshow(object) { + artist = object.options[object.selectedIndex].text; + for (var i = document.track.names.length;i > 0;i--) + document.track.names.options[0] = null; + reloading = true; + showlinks(); + document.track.names.options[0].selected = true; + return false; +} + +function load(object) { + alert('Just testing: ' + object.options[object.selectedIndex].value); + //window.location.href = object.options[object.selectedIndex].value; + return false; +} + +function showlinks() { + if (artist == 'Chris Rea') { + opt('cr/one.zip','The Road To Hell'); + opt('cr/two.zip','Let\'s Dance'); + } + + if (artist == 'Annie Lennox') { + opt('al/why.zip','Why'); + opt('al/wobg.zip','Walking on Broken Glass'); + } + + if (artist == 'Dina Carrol') { + opt('dc/track1.zip','Escaping'); + opt('dc/track2.zip','Only Human'); + } +} + +function opt(href,text) { + if (reloading) { + var optionName = new Option(text, href, false, false) + var length = document.track.names.length; + document.track.names.options[length] = optionName; + } + else + document.write('