cur_page: $cur_page"; if($cur_page != 'index.php') { if ($_SESSION['sess_admin_login_id']=='') { header('Location: index.php'); exit; } } } function getMailTemplate($templateName){ $file_Path = SITE_FS_PATH.DS.MAILTEMPLATE_DIR.DS.$templateName; if(file_exists($file_Path)){ ob_start(); $msg = file_get_contents($file_Path); ob_clean(); return $msg; } else{ return NULL; } } function replaceTextMessage($r, $rw, $content){ $cont = ''; if($content!=''){ $cont = str_replace($r,$rw, $content); } return $cont; } function protect_user_page() { if ($_SESSION['sess_userid']=='') { $_SESSION['sess_back']=basename($_SERVER['PHP_SELF'])."?".$_SERVER['QUERY_STRING']; header('Location: login.php'); exit; } } function protect_user_type() { if ($_SESSION['sess_usertype']=='basic') { header('Location: subscription_error.php'); exit; } } function str_stop($string, $max_length){ if (strlen($string) > $max_length){ $string = substr($string, 0, $max_length); $pos = strrpos($string, " "); if($pos === false) { return substr($string, 0, $max_length)."..."; } return substr($string, 0, $pos)."..."; }else{ return $string; } } function mail_format_dropdown($sel_value) { $arr = array( "text" => 'Text Format', 'html' => 'HTML Format'); return array_dropdown($arr, $sel_value, 'email_format','onchange="do_get_email_preview();" class="txtfield" '); } function rate_dropdown($sel_value) { $arr = array('0' => 'Please select', "1" => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10'); return array_dropdown($arr, $sel_value, 'rate'); } function status_dropdown() { $arr = array( "Active" => 'Active', 'Inactive' => 'Inactive'); return array_dropdown($arr, $sel_value, $name); } function usertype_dropdown($sel_value) { $arr = array( "basic" => 'Basic', 'upgraded' => 'Upgraded'); return array_dropdown($arr, $sel_value, 'u_type'); } function yes_no_dropdown($name,$sel_value){ $arr = array( 'yes' => 'yes', 'no' => 'no'); return array_dropdown($arr, $sel_value, $name); } /*function shipping_cost_dropdown($name,$sel_value){ //global $shipping; $shipping=array('7.95'=>'Ground Shipping - $7.95','14.95'=>'Priority Delivery - $14.95','16.50'=>'Canadian Delivery - $16.50','26.50'=>'International Delivery - $26.50'); return array_dropdown($shipping, $shipping_cost,'shipping_cost','class="txtfleid" style="width:200px;"'); }*/ function make_thumb_sb($file_path_old='',$file_path_new='', $width='', $height='') { if ($file_path_old!=''){ $size = getimagesize($file_path_old); if($size==''){ return false; } if( ($size[0]) < ($size[1])){ $new_width = $width; $crop_per = (100 - ((100*$new_width)/$size[0])); $new_height = intval($size[1]-(($size[1]*$crop_per)/100)); } else { $new_height = $height; $crop_per = (100 - ((100*$new_height)/$size[1])); $new_width = intval($size[0]-(($size[0]*$crop_per)/100)); } system("convert -sample ".$new_width. "x". $new_height."! -quality 100 ". $file_path_old. " ".$file_path_new." "); //system("convert -crop ".$width. "x". $height."+0+0 -quality 100 ". $file_path_old. " ".$file_path_new." "); //return $old_name; } } function SendMail($From,$FromName,$To,$ToName,$Subject,$Text,$Html,$AttmFiles){ $OB="----=_OuterBoundary_000"; $IB="----=_InnerBoundery_001"; $Html=$Html?$Html:preg_replace("/\n/","{br}",$Text) or die("neither text nor html part present."); $Text=$Text?$Text:"Sorry, but you need an html mailer to read this mail."; $From or die("sender address missing"); $To or die("recipient address missing"); $headers ="MIME-Version: 1.0\r\n"; $headers.="From: ".$FromName." <".$From.">\n"; $headers.="To: ".$ToName." <".$To.">\n"; $headers.="Reply-To: ".$FromName." <".$From.">\n"; $headers.="X-Priority: 1\n"; $headers.="X-MSMail-Priority: High\n"; $headers.="X-Mailer: My PHP Mailer\n"; $headers.="Content-Type: multipart/mixed;\n\tboundary=\"".$OB."\"\n"; //Messages start with text/html alternatives in OB $Msg ="This is a multi-part message in MIME format.\n"; $Msg.="\n--".$OB."\n"; $Msg.="Content-Type: multipart/alternative;\n\tboundary=\"".$IB."\"\n\n"; //plaintext section $Msg.="\n--".$IB."\n"; $Msg.="Content-Type: text/plain;\n\tcharset=\"iso-8859-1\"\n"; $Msg.="Content-Transfer-Encoding: quoted-printable\n\n"; // plaintext goes here $Msg.=$Text."\n\n"; // html section $Msg.="\n--".$IB."\n"; $Msg.="Content-Type: text/html;\n\tcharset=\"iso-8859-1\"\n"; $Msg.="Content-Transfer-Encoding: base64\n\n"; // html goes here $Msg.=chunk_split(base64_encode($Html))."\n\n"; // end of IB $Msg.="\n--".$IB."--\n"; // attachments if($AttmFiles){ foreach($AttmFiles as $AttmFile){ $patharray = explode ("/", $AttmFile); $FileName=$patharray[count($patharray)-1]; $Msg.= "\n--".$OB."\n"; $Msg.="Content-Type: application/octetstream;\n\tname=\"".$FileName."\"\n"; $Msg.="Content-Transfer-Encoding: base64\n"; $Msg.="Content-Disposition: attachment;\n\tfilename=\"".$FileName."\"\n\n"; //file goes here $fd=fopen ($AttmFile, "r"); $FileContent=fread($fd,filesize($AttmFile)); fclose ($fd); $FileContent=chunk_split(base64_encode($FileContent)); $Msg.=$FileContent; $Msg.="\n\n"; } } //message ends $Msg.="\n--".$OB."--\n"; if(@mail($To,$Subject,$Msg,$headers)): return true; else : return false; endif; /*if (mail($To,$Subject,$Msg,$headers)) { print "
Message sent ... ".$To; }*/ //syslog(LOG_INFO,"Mail: Message sent to $ToName <$To>"); } //************************************************************************************************ function getRposVal($match_string, $string){ $num = strrpos($string, $match_string); return $num; } function getposVal($match_string, $string){ $num = strpos($string, $match_string); return $num; } ?>'Jan' , '02'=>'Feb' , '03'=>'Mar' , '04'=>'Apr' , '05'=>'May' , '06'=>'Jun' , '07'=>'Jul' , '08'=>'Aug' , '09'=>'Sep' , '10'=>'Oct' , '11'=>'Nov' , '12'=>'Dec'); if ($handle = opendir(dirname(__FILE__).'/db_arrays')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { include(dirname(__FILE__).'/db_arrays/'.$file); } } closedir($handle); } $ARR_TASK_STATUS=array('Pending'=>'Pending','Completed'=>'Completed'); ?>