コード例 #1
0
 public function test_names()
 {
     foreach ($this->names as $key => $val) {
         $this->assertEquals($val, titleCase($key));
         $this->assertEquals($val, titleCase(strtolower($key)));
         $this->assertEquals($val, titleCase(strtoupper($key)));
     }
 }
コード例 #2
0
ファイル: dates.php プロジェクト: aaryani/RD-Switchboard-Net
 function handle()
 {
     $result = array();
     if ($this->xml) {
         foreach ($this->xml->{$this->ro->class}->dates as $dates) {
             $eachDate = array();
             $displayType = titleCase(str_replace("dc.", "", (string) $dates['type']));
             foreach ($dates as $date) {
                 $eachDate[] = array('type' => (string) $date['type'], 'dateFormat' => (string) $date['dateFormat'], 'date' => (string) $date);
             }
             $result[] = array('type' => (string) $dates['type'], 'displayType' => $displayType, 'date' => $eachDate);
         }
     }
     return $result;
 }
コード例 #3
0
 function handle()
 {
     $result = array();
     if ($this->ro->status == 'PUBLISHED') {
         if ($this->index && isset($this->index['subject_value_resolved'])) {
             //subject_value_unresolved, subject_value_resolved, subject_type, subject_vocab_uri
             foreach ($this->index['subject_value_unresolved'] as $key => $sub) {
                 $result[] = array('subject' => $sub, 'resolved' => titleCase($this->index['subject_value_resolved'][$key]), 'type' => $this->index['subject_type'][$key], 'vocab_uri' => $this->index['subject_vocab_uri'][$key]);
             }
         }
     } else {
         $subjects = $this->ro->processSubjects();
         foreach ($subjects as $subject) {
             $result[] = array('subject' => $subject['value'], 'resolved' => $subject['resolved'], 'type' => $subject['type'], 'vocab_uri' => $subject['uri']);
         }
     }
     return $result;
 }
コード例 #4
0
ファイル: enomssl.php プロジェクト: billyprice1/whmcs
/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 * */
function enomssl_ConfigOptions()
{
    $result = select_query("tblemailtemplates", "COUNT(*)", array("name" => "SSL Certificate Configuration Required"));
    $data = mysql_fetch_array($result);
    if (!$data[0]) {
        full_query("INSERT INTO `tblemailtemplates` (`type` ,`name` ,`subject` ,`message` ,`fromname` ,`fromemail` ,`disabled` ,`custom` ,`language` ,`copyto` ,`plaintext` )VALUES ('product', 'SSL Certificate Configuration Required', 'SSL Certificate Configuration Required', '<p>Dear {\$client_name},</p><p>Thank you for your order for an SSL Certificate. Before you can use your certificate, it requires configuration which can be done at the URL below.</p><p>{\$ssl_configuration_link}</p><p>Instructions are provided throughout the process but if you experience any problems or have any questions, please open a ticket for assistance.</p><p>{\$signature}</p>', '', '', '', '', '', '', '0')");
    }
    $result = select_query("tblproducts", "configoption1,configoption2,configoption5", array("servertype" => "enomssl", "configoption1" => array("sqltype" => "NEQ", "value" => "")));
    $data = mysql_fetch_assoc($result);
    $enomusername = $data['configoption1'];
    $enompassword = $data['configoption2'];
    $testmode = $data['configoption5'];
    if ($enomusername && $enompassword) {
        $postfields = array();
        $postfields['uid'] = $enomusername;
        $postfields['pw'] = $enompassword;
        $postfields['command'] = "GetCerts";
        $postfields['ResponseType'] = "XML";
        $result = enomssl_call($postfields, $testmode);
        $certtypelist = "";
        foreach ($result['INTERFACE-RESPONSE']['GETCERTS']['CERTS'] as $cert => $details) {
            $certcode = $details['PRODCODE'];
            if ($certcode) {
                $certcode = str_replace("-", " ", $certcode);
                $certcode = titleCase($certcode);
                $certtypelist .= $certcode . ",";
                continue;
            }
        }
        $certtypelist = substr($certtypelist, 0, 0 - 1);
        if (!$certtypelist) {
            $certtypelist = "Certificate-Comodo-Essential,Certificate-Comodo-Instant,Certificate-Comodo-Premium-Wildcard,Certificate-Comodo-EV,Certificate-Comodo-EV-SGC,Certificate-GeoTrust-QuickSSL,Certificate-GeoTrust-QuickSSL-Premium,Certificate-GeoTrust-TrueBizID,Certificate-GeoTrust-TrueBizID-Wildcard,Certificate-GeoTrust-TrueBizID-EV,Certificate-RapidSSL-RapidSSL,Certificate-SBS-Instant,Certificate-SBS-Secure,Certificate-SBS-Secure-Plus,Certificate-SBS-EV,Certificate-SBS-SGC-EV,Certificate-VeriSign-Secure-Site,Certificate-VeriSign-Secure-Site-Pro,Certificate-VeriSign-Secure-Site-EV,Certificate-VeriSign-Secure-Site-Pro-EV";
        }
    } else {
        $certtypelist = "Please Enter your Username and Password";
    }
    $configarray = array("Username" => array("Type" => "text", "Size" => "25"), "Password" => array("Type" => "password", "Size" => "25"), "Certificate Type" => array("Type" => "dropdown", "Options" => $certtypelist), "Years" => array("Type" => "dropdown", "Options" => "1,2,3,4,5,6,7,8,9,10"), "Test Mode" => array("Type" => "yesno"));
    return $configarray;
}
コード例 #5
0
function inforesource()
{
    $type = 'unknown';
    if (isset($_REQUEST['type'])) {
        $type = $_REQUEST['type'];
    }
    $tab = 'overview';
    if (isset($_REQUEST['tab'])) {
        $tab = $_REQUEST['tab'];
    }
    if (isset($_REQUEST['topic'])) {
        $topic = $_REQUEST['topic'];
    } else {
        if (isset($_REQUEST['r'])) {
            $topic = str_rot13(base64_decode($_REQUEST['r']));
        } else {
            $topic = '';
        }
    }
    $title = titleCase($topic);
    $displayType = titleCase($type) . ' at ';
    if ($type == 'unknown') {
        $displayType = '';
    }
    $results = get_info($topic, $type);
    $resultsjs = 'var results = { ';
    //help from http://stackoverflow.com/questions/4329092/multi-dimensional-associative-arrays-in-javascript, http://stackoverflow.com/questions/22815511/foreach-loop-over-multidimensional-associative-array, and http://stackoverflow.com/questions/9833481/key-names-of-associative-arrays
    foreach ($results as $key => $value) {
        $resultsjs = $resultsjs . titleCase($key) . ': { ';
        foreach ($value as $vkey => $vvalue) {
            $resultsjs = $resultsjs . titleCase($vkey) . ': \'' . base64_encode($vvalue) . '\', ';
        }
        $resultsjs = $resultsjs . '}, ';
    }
    $resultsjs = $resultsjs . '};';
    //print_r($results);
    $title = $title . ' | ' . $displayType . 'Information Resource';
    $main = new FluidActive('inforesource', $title);
    $main->write(file_get_contents("inforesource.fluidScriptedUI"));
    $main->write("\n\n" . $resultsjs . ' 
var initialType = \'' . titleCase($type) . '\';
var initialTab = \'' . titleCase($tab) . '\';

//based on http://stackoverflow.com/questions/921789/how-to-loop-through-javascript-object-literal-with-objects-as-members
firsttabcreated = false;
prevkey = \'\';
//Make tabs work like Futuramerlin.com music page?
for (var key in results) {
	if(key.length > 0) {
		//IIRC (which I\'m pretty darn sure I do), "sttodo" meant "string to do", and "sttodp" was the successor of that alphabetically
		var obj = results[key];
		//alert(key);
		var set = new Object();
		if(firsttabcreated == false) {
			set["container"] = this.fub.id;
			alert(\'first tab created\');
			firsttabcreated = true;
		}
		else {
			var sttodo = "set[\\"container\\"] = this.tab"+prevkey+"Box.id;";
			console.debug(sttodo);
			eval(sttodo);
		}
		set["vpos"] = 3;
		set["vposunit"] = "rem";
		var sttodp = "var tab"+key+"Box = new Box(set);";
		console.debug(sttodp);
		eval(sttodp);
		set=null;
		eval("this.tab"+key+"Box.show(\\"none\\");");
		for (var prop in obj) {
			// important check that this is objects own property 
			// not from prototype prop inherited
			if(obj.hasOwnProperty(prop)){
				//alert(prop + " = " + obj[prop]);
			}
		}
		prevkey = key;
	}
}



var set = new Object();
set["container"] = this.contentPanel.id;
set["css"] = "overflow-x: scroll; overflow-y: scroll;";
this.pagecontents = new Box(set);
set=null;
this.pagecontents.show("none");

//help from http://stackoverflow.com/questions/2820249/base64-encoding-and-decoding-in-client-side-javascript / https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding
this.pagecontents.contents = atob(results[initialType][initialTab]);
console.debug(results[initialType][initialTab]);
this.pagecontents.compute();
console.debug(this.pagecontents);

var set = new Object();
set["container"] = this.Ember.id;
//based on http://stackoverflow.com/questions/3151974/highlight-entire-text-inside-text-field-with-single-click and http://stackoverflow.com/questions/2984311/delete-default-value-of-an-input-text-on-click
set["contents"] = "<span style=\\"font-size:1rem;color:#fff;line-height:1rem;font-weight:bold;\\"><form><input type=\\"hidden\\" name=\\"wint\\" value=\\"1\\" /><input type=\\"hidden\\" name=\\"wintNeeded\\" value=\\"inforesource\\" /><input type=\\"text\\" list=\\"prefilled\\" onblur=\\"if (this.value == \'\') {this.value = \'' . str_replace('\'', '\\\'', $topic) . '\';}\\" onfocus=\\"if (this.value == \'' . str_replace('\'', '\\\'', $topic) . '\') {this.value = \'\';}\\" style=\\"background-color: rgba(0,0,0,0); border-style: none; text-align:center;font-size:1rem;color:#fff;line-height:1rem;font-weight:bold;\\" name=\\"topic\\" value=\\"' . $topic . '\\"><datalist id=\\"prefilled\\"><option value=\\"' . $topic . '\\"></datalist></form></span>";
set["heighth"] = 3;
set["hunit"] = "rem";
set["vpos"] = 0.75;
set["vposunit"] = "rem";
this.sbform = new Box(set);
set=null;
this.sbform.show("none");

$(window).load(function() {
	Ember.show("zoomhalffade");
});');
    $main->close();
    //Pasting this next block here for archival purposes, lol, nothing to do with this project but I don't really have anywhere better to put it. This was a conversation via join.me (https://join.me/762-915-672 ) hosted by SupaYoshi who asked a question in Freenode's #css. I'm kyan / You@All :)
    /*
        Host@All: So it has a little distance
    Host@All: :D
    Viewer 1@All: looks better without
    Host@All: yes
    Host@All: So how do I make it without :)
    Host@All: Cus it is width now	
    Viewer 1@All: negative margin
    Host@All: O.o how to do tha
    Viewer 1@All: 1 sec let me load the page
    Host@All: sure tyt :O
    You@All: Kyan here watching the project :)
    Host@All: Awesomeeee :o
    Viewer 1@All: Im Blaster btw the guy who's skills pale in comparison to kyan
    You@All: I'm not really sure what to do now though, I'm pretty much at the limits of my abilites
    You@All: ummm no I'm not that good
    You@All: :P thanks though
    Host@All: lmao
    Viewer 1@All: .input-prepend.input-append .add-on:first-child, .input-prepend.input-append .btn:first-child { margin-right:-4px!important }
    Host@All: eh nuh?
    Viewer 1@All: is that what you wanted?
    Host@All: idk what changed?
    Viewer 1@All: little space between input addon
    Host@All: eh no that was fine already :D
    Host@All: heheh
    Host@All: XD
    Host@All: i mean this
    Viewer 1@All: oh sorry
    You@All: Ohhhh!
    You@All: I was confused too
    Host@All: hehe np :P
    Host@All: sorry!
    You@All: trying to figure what was going on, LOL
    You@All: it's ok :D
    Viewer 1@All: #form-login-remember label { margin-left:8px!important; }
    */
    //some js from http://stackoverflow.com/questions/4742746/jquery-open-new-window-on-page-load, http://www.4guysfromrolla.com/demos/OnBeforeUnloadDemo1.htm, http://kbeezie.com/cross-browser-exit-pop/, and http://forums.devarticles.com/javascript-development-22/how-to-stop-browser-from-closing-using-javascript-8458.html
    //some css from http://stackoverflow.com/questions/1150163/stretch-and-scale-a-css-image-in-the-background-with-css-only and http://stackoverflow.com/questions/13367403/background-image-doesnt-cover-entire-screen
    //some code from from active.fluid.php
    //help from http://www.w3schools.com/cssref/css3_pr_background-size.asp
    //     echo '<html><head><title>' . $ptitle . '</title><script src="/d/jquery-2.1.0.min.js" type="text/javascript"></script><script language="JavaScript">
    //   //window.onbeforeunload = confirmExit;
    //   function confirmExit()
    //   {
    //   	//document.write("<iframe width=\'100%\' height=\'100%\' frameborder=\'0\' src=\'http://futuramerlin.com/d/r/active.php?wint=1&wintNeeded=bnner\' marginwidth=\'0\' marginheight=\'0\' vspace=\'0\' hspace=\'0\' allowtransparency=\'true\' scrolling=\'no\'></iframe>");
    //     return "Are you sure you want to exit this page?";
    //
    //   }
    // //from http://stackoverflow.com/questions/7064998/how-to-make-a-link-open-multiple-pages-when-clicked
    // $(\'a\').click(function(e) {
    // 	//e.preventDefault();
    //     window.open(\'http://futuramerlin.com/d/r/active.php?wint=1&wintNeeded=bnner\');
    //
    // });
    // </script><link type="text/css" rel="stylesheet" href="css/flat-ui.css"/><style type="text/css"> body {background: url(\'4278136735_20329c6cb7_o.jpg\')  no-repeat center center fixed; background-size:cover;} #content { position: fixed; left: 1em; top:1em; right: 1em; bottom: 1em; background-color: rgba(255,255,255,0); overflow-x: scroll; overflow-y:scroll; } </style></head><body><script language="javascript" src="http://chelhi.ptp33.com/pop.php?username=chelhi&max=1"></script><noscript><a href="http://www.paid-to-promote.net/" target="_blank">Paid To Popup</a></noscript><div id="content">
    // <div id="header" style=" position: fixed; left: 1em; top:1em; right: 1em; bottom: 1em; background-color: rgba(255,255,255,0.6); "></div>
    // <h1>Information on '.$topic.'</h1>'.$results.'<h1>Website attribution</h1><ul><li>Theme: <a href="http://designmodo.github.io/Flat-UI/">Flat UI</a> from <a href="http://designmodo.com">Designmodo</a></li><li>Background image: <a href="http://www.flickr.com/photos/caseyyee/4278136735/">"4278136735_20329c6cb7_o.jpg": by Casey Yee</a>. CC Attribution Share-Alike 2.0.</li><li><a href="http://www.paid-to-promote.net/member/signup.php?r=chelhi" target="_blank"><img src="http://www.paid-to-promote.net/images/ptp.gif" alt="Get Paid To Promote, Get Paid To Popup, Get Paid Display Banner" width="468" height="60" border="0" longdesc="http://www.paid-to-promote.net/" /></a></li></ul></div></body></html>';
}
コード例 #6
0
ファイル: reports.php プロジェクト: billyprice1/whmcs
 * @ Website  : http://www.mtimer.cn
 *
 * */
if (!defined("WHMCS")) {
    exit("This file cannot be accessed directly");
}
echo $headeroutput;
echo "<h2>Reports</h2>";
if (!project_management_checkperm("View Reports")) {
    echo "<p>You do not have permission to view reports.</p>";
    return false;
}
$text_reports = array();
$dh = opendir("../modules/reports/");
while (false !== ($file = readdir($dh))) {
    if ($file != "index.php" && is_file("../modules/reports/" . $file)) {
        $file = str_replace(".php", "", $file);
        if (substr($file, 0, 5) != "graph" && substr($file, 0, 8) == "project_") {
            $nicename = str_replace("_", " ", $file);
            $nicename = titleCase($nicename);
            $text_reports[$file] = $nicename;
        }
    }
}
closedir($dh);
asort($text_reports);
echo "\n<div class=\"reports\">\n";
foreach ($text_reports as $k => $v) {
    echo "<a href=\"reports.php?report=" . $k . "\">" . $v . "</a>";
}
echo "</div>\n\n<br />\n\n<h2>Time Analysis by Staff Member</h2>\n\n<p align=\"center\"><img src=\"reports.php?displaygraph=graph_project_tasks\"></p>\n";
コード例 #7
0
    echo "{$state}";
}
function titleCase($string)
{
    $len = strlen($string);
    $i = 0;
    $last = "";
    $new = "";
    $string = strtoupper($string);
    while ($i < $len) {
        $char = substr($string, $i, 1);
        if (ereg("[A-Z]", $last)) {
            $new .= strtolower($char);
        } else {
            $new .= strtoupper($char);
        }
        $last = $char;
        $i++;
    }
    return $new;
}
?>
<div class="gradient-box" style="position:relative; height:400px; width:200px;">
<iframe src="http://en.wikipedia.org/w/index.php?title=<?php 
echo titleCase($call["city"]);
?>
,_<?php 
echo abbrstate($call["state"]);
?>
&printable=yes" width="200" height="400"></iframe>
</div>
コード例 #8
0
ファイル: Follett.php プロジェクト: therealchiko/getchabooks
 protected static function processItemText($item)
 {
     $details = array();
     if (preg_match('/Author\\:\\&nbsp\\;([^<]*)\\</', $item, $matches)) {
         $details['author'] = ucname(trim($matches[1]));
     }
     if (preg_match('/Edition\\:\\&nbsp\\;([^<]*)\\</', $item, $matches)) {
         $details['edition'] = trim($matches[1]);
     }
     if (preg_match('/src\\="(http[^"]+([X0-9]{10,13}|noBookImage)[^"]+?)"[^>]*?alt\\="([^"]+?)"/', $item, $matches)) {
         if (strpos($matches[1], 'noBookImage')) {
             $details['imageUrl'] = false;
             $details['isbn'] = null;
         } else {
             $details['imageUrl'] = trim($matches[1]);
             $details['isbn'] = Isbn::to13(Isbn::clean($matches[2]));
         }
         $details['title'] = titleCase(trim(html_entity_decode($matches[3])));
     }
     $details['newPrice'] = $details['usedPrice'] = null;
     if (!strpos($item, 'Buy Digital') && preg_match('/buynewradio[^>]+?\\>\\s*?\\$([\\d\\.]+)/', $item, $matches)) {
         $details['newPrice'] = $matches[1];
     }
     if (preg_match('/buyusedradio[^>]+?\\>\\s*?\\$([\\d\\.]+)/', $item, $matches)) {
         $details['usedPrice'] = $matches[1];
     }
     if (preg_match('/ISBN:\\s*(?:\\&nbsp\\;)?(\\d{10,13})/', $item, $matches)) {
         $details['isbn'] = Isbn::to13(Isbn::clean($matches[1]));
     }
     // lowercase c in catEntry ensures that the rental item id is not selected, because it is like rentalCatEntry.
     //  the new item id seems to always be exactly one less than the used
     // note: we don't use this as a unique identifier because we don't want to deal with which
     // is used and which is new, and because availability changes
     if (preg_match_all('/catEntryId_\\d+[^>]+?value\\="(\\d*)"/', $item, $matches)) {
         //$details['productId'] = count($matches[1] == 1) ? $matches[1][0] : call_user_func_array('min', $matches[1]);
     }
     $details['partNumber'] = null;
     $details['publisher'] = null;
     $details['isPackage'] = false;
     $details['components'] = array();
     return $details;
 }
コード例 #9
0
ファイル: addonmodules.php プロジェクト: billyprice1/whmcs
             }
             $aInt->assign("addon_module_sidebar", $sidebar);
             if (function_exists($module . "_output")) {
                 call_user_func($module . "_output", $modulevars);
             } else {
                 echo "<p>" . $aInt->lang("addonmodules", "nooutput") . "</p>";
             }
         } else {
             echo "<br /><br />\n<p align=\"center\"><b>" . $aInt->lang("permissions", "accessdenied") . "</b></p>\n<p align=\"center\">" . $aInt->lang("addonmodules", "noaccess") . "</p>\n<p align=\"center\">" . $aInt->lang("addonmodules", "howtogrant") . "</p>";
         }
     } else {
         echo "<p>" . $aInt->lang("addonmodules", "error") . "</p>";
     }
 } else {
     $pagetitle = str_replace("_", " ", $module);
     $pagetitle = titleCase($pagetitle);
     echo "<h2>" . $pagetitle . "</h2>";
     if (in_array($adminroleid, $allowedroles)) {
         if (!isValidforPath($module)) {
             exit("Invalid Addon Module Name");
         }
         $modulepath = ROOTDIR . ("/modules/admin/" . $module . "/" . $module . ".php");
         if (file_exists($modulepath)) {
             require $modulepath;
         } else {
             echo "<p>" . $aInt->lang("addonmodules", "nooutput") . "</p>";
         }
     } else {
         echo "<br /><br />\n<p align=\"center\"><b>" . $aInt->lang("permissions", "accessdenied") . "</b></p>\n<p align=\"center\">" . $aInt->lang("addonmodules", "noaccess") . "</p>\n<p align=\"center\">" . $aInt->lang("addonmodules", "howtogrant") . "</p>";
     }
 }
コード例 #10
0
                    $incMonth = $matches[3];
                    $incDay = $matches[4];
                    $struckYear = $matches[5];
                    $struckMonth = $matches[6];
                    $struckDay = $matches[7];
                    $revivedYear = $matches[8];
                    $revivedMonth = $matches[9];
                    $revivedDay = $matches[10];
                    $incorporationDate = $incYear . "-" . $incMonth . "-" . $incDay;
                    $struckDate = $struckYear . "-" . $struckMonth . "-" . $struckDay;
                    $revivedDate = $revivedYear . "-" . $revivedMonth . "-" . $revivedDay;
                    $record = array('Corporate Number' => $matches[11], 'Organization Name' => titleCase(strtolower($matches[1])), 'Incorporation Year' => $incYear, 'Incorporation Date' => date_create($incorporationDate), 'Struck Date' => date_create($struckDate), 'Revived Date' => date_create($revivedDate), 'Activity' => "Revived", 'Source' => $source);
                    scraperwiki::save(array('Corporate Number', 'Source'), $record);
                } elseif (preg_match("/(.*) Alberta Society Incorporated (\\d+)\\s([A-Z]{3})\\s(\\d+)\\. New Name: (.*) Effective Date: (\\d+)\\s([A-Z]{3})\\s(\\d+)\\. No: (\\d+)\\.\r/", $row, $matches)) {
                    $incYear = $matches[2];
                    $incMonth = $matches[3];
                    $incDay = $matches[4];
                    $effectiveYear = $matches[6];
                    $effectiveMonth = $matches[7];
                    $effectiveDay = $matches[8];
                    $incorporationDate = $incYear . "-" . $incMonth . "-" . $incDay;
                    $effectiveDate = $effectiveYear . "-" . $effectiveMonth . "-" . $effectiveDay;
                    $record = array('Corporate Number' => $matches[9], 'Organization Name' => titleCase(strtolower($matches[5])), 'Old Name' => titleCase(strtolower($matches[1])), 'Incorporation Year' => $incYear, 'Incorporation Date' => date_create($incorporationDate), 'Effective Date' => date_create($effectiveDate), 'Activity' => "Name Change", 'Source' => $source);
                    scraperwiki::save(array('Corporate Number', 'Source'), $record);
                }
            }
        }
    }
}
/* set source number of latest source scraped */
scraperwiki::save_var('last_source', $latestSource);
コード例 #11
0
sigform_link_11_linkedin:http://www.linkedin.com/edu/school?id=17875
sigform_link_11_youtube:http://www.youtube.com/loyolamarymount
sigform_link_11_pinterest:https://www.pinterest.com/loyolamarymount/
sigform_link_12_facebook:https://www.facebook.com/lmula
sigform_link_12_twitter:http://twitter.com/loyolamarymount
sigform_link_12_instagram:https://instagram.com/loyolamarymount/?hl=en
sigform_link_12_linkedin:http://www.linkedin.com/edu/school?id=17875
sigform_link_12_youtube:http://www.youtube.com/loyolamarymount
sigform_link_12_pinterest:https://www.pinterest.com/loyolamarymount/
*/
include 'organization_options.php';
$html = file_get_contents('sigform_base.html');
// convert to title case
$fields_to_convert = array('sigform_firstname', 'sigform_mi', 'sigform_lastname', 'sigform_title_1', 'sigform_title_2', 'sigform_department_1', 'sigform_department_2', 'sigform_building', 'sigform_suite');
foreach ($fields_to_convert as $fld) {
    $_REQUEST[$fld] = titleCase($_REQUEST[$fld]);
}
// step 1 fields
if ($_REQUEST['sigform_firstname'] != '') {
    $html = str_replace('{firstname}', $_REQUEST['sigform_firstname'], $html);
} else {
    $html = str_replace('{firstname}', 'First', $html);
}
if ($_REQUEST['sigform_mi'] != '') {
    $html = str_replace('{mi}', $_REQUEST['sigform_mi'] . '.', $html);
} else {
    $html = str_replace('{mi}', '', $html);
}
if ($_REQUEST['sigform_lastname'] != '') {
    $html = str_replace('{lastname}', $_REQUEST['sigform_lastname'], $html);
} else {
コード例 #12
0
 function getKeywords()
 {
     $keywords = array();
     if ($this->index && isset($this->index['subject_value_resolved'])) {
         foreach ($this->index['subject_value_resolved'] as $key => $sub) {
             $keywords[] = titleCase($this->index['subject_value_resolved'][$key]);
         }
     }
     return $keywords;
 }
コード例 #13
0
ファイル: configaddonmods.php プロジェクト: billyprice1/whmcs
    $dh = opendir(ROOTDIR . "/modules/addons/");
    while (false !== ($file = readdir($dh))) {
        $modfilename = ROOTDIR . ("/modules/addons/" . $file . "/" . $file . ".php");
        if (is_file($modfilename)) {
            require $modfilename;
            $configarray = call_user_func($file . "_config");
            $addon_modules[$file] = $configarray;
        }
    }
}
if (is_dir(ROOTDIR . "/modules/admin/")) {
    $dh = opendir(ROOTDIR . "/modules/admin/");
    while (false !== ($file = readdir($dh))) {
        if (is_file(ROOTDIR . ("/modules/admin/" . $file . "/" . $file . ".php")) && $file != "index.php") {
            $friendlytitle = str_replace("_", " ", $file);
            $friendlytitle = titleCase($friendlytitle);
            $addon_modules[$file] = array("name" => $friendlytitle, "version" => $aInt->lang("addonmodules", "legacy"), "author" => "-");
        }
    }
    closedir($dh);
}
ksort($addon_modules);
$action = $whmcs->get_req_var("action");
if ($action == "save") {
    check_token("WHMCS.admin.default");
    $exvars = array();
    $result = select_query("tbladdonmodules", "", "");
    while ($data = mysql_fetch_array($result)) {
        $exvars[$data['module']][$data['setting']] = $data['value'];
    }
    delete_query("tbladdonmodules", array("setting" => "access"));
コード例 #14
0
ファイル: funcoes.php プロジェクト: rojherio/legalmarte
function ctexto($texto, $frase = 'pal')
{
    switch ($frase) {
        case 'fra':
            //Apenas a a primeira letra em maiusculo
            $texto = ucfirst(strtolower($texto));
            break;
        case 'min':
            $texto = strtolower($texto);
            break;
        case 'mai':
            $texto = colocaAcentoMaiusculo(utf8_encode(strtoupper($texto)));
            break;
        case 'pal':
            //Todas as palavras com a primeira em maiusculo
            $texto = ucwords(strtolower($texto));
            break;
        case 'pri':
            //Todos os primeiros caracteres de cada palavra em maiusuclo, menos as junções
            $texto = titleCase($texto);
            break;
    }
    return $texto;
}
コード例 #15
0
 /**
  * @return  an array of item metadata: productId, partNumber, isbn, title, author,
  *                                      edition, publisher, imageUrl, usedPrice, newPrice, required
  */
 protected static function getItemMetadata($itemText)
 {
     $details = array();
     $productId = $partNumber = $isbn = $title = $author = $edition = $publisher = "";
     $usedPrice = $newPrice = $required = $isPackage = $isComponent = "";
     if (preg_match("/productId\\=(.+?)&/", $itemText, $matches)) {
         $details['productId'] = trim($matches[1]);
     }
     if (preg_match("/partNumber\\=(.+?)&/", $itemText, $matches)) {
         $details['partNumber'] = rtrim($matches[1], "&amp;");
     }
     if (preg_match("/ISBN\\:\\<\\/span\\>.+?(\\d+).+?\\</s", $itemText, $matches)) {
         $isbn = trim($matches[1]);
         $isbn = Isbn::validate($isbn) ? $isbn : "";
         if ($isbn[0] == '2') {
             $isbn = "";
         }
         $details['isbn'] = $isbn;
     }
     if (preg_match("/\\d{5}'\\stitle\\=\"(.+?)\"\\>.+?\\<img/s", $itemText, $matches)) {
         $details['title'] = titleCase(trim(htmlspecialchars_decode($matches[1], ENT_QUOTES)));
     }
     if (preg_match("/\\<span\\>Author:.*?\\<\\/span\\>(.+?)\\<\\/li/s", $itemText, $matches)) {
         $author = ucname(trim($matches[1]));
         $details['author'] = is_numeric($author) ? "" : $author;
     }
     if (preg_match("/Edition:\\<\\/span\\>(.+?)\\<br/", $itemText, $matches)) {
         $details['edition'] = strtolower(trim($matches[1]));
     }
     if (preg_match("/Publisher:\\<\\/span\\>(.+?)\\<br/", $itemText, $matches)) {
         $details['publisher'] = titleCase(trim($matches[1]));
     }
     if (preg_match("/Used.+?(\\d{1,3}\\.\\d{2})/s", $itemText, $matches)) {
         $details['usedPrice'] = $matches[1];
     }
     if (preg_match("/New.+?(\\d{1,3}\\.\\d{2})/s", $itemText, $matches)) {
         $details['newPrice'] = $matches[1];
     }
     if (strpos($itemText, "The price of the textbook is not yet available")) {
         $details['newPrice'] = $details['usedPrice'] = 0;
     }
     if (!$details['title'] && !$details['author']) {
         return false;
     }
     $details['imageUrl'] = "";
     // todo
     $options = array("REQUIRED\\sPACKAGE", "RECOMMENDED\\sPACKAGE", "REQUIRED", "RECOMMENDED", "PACKAGE\\sCOMPONENT", "GO\\sTO\\sCLASS FIRST", "BOOKSTORE\\sRECOMMENDED");
     preg_match("/" . implode('|', $options) . "/", $itemText, $matches);
     $required = trim($matches[0]);
     $details['isPackage'] = $required == "REQUIRED PACKAGE" || $required == "RECOMMENDED PACKAGE";
     $details['isComponent'] = $required == "PACKAGE COMPONENT";
     if ($required == "REQUIRED PACKAGE" || $required == "REQUIRED") {
         $required = SectionHasItem::REQUIRED;
     } else {
         if ($required == "RECOMMENDED PACKAGE" || $required == "RECOMMENDED") {
             $required = SectionHasItem::RECOMMENDED;
         } else {
             if ($required == "GO TO CLASS FIRST") {
                 $required = SectionHasItem::GO_TO_CLASS_FIRST;
             } else {
                 if ($required == "BOOKSTORE RECOMMENDED") {
                     $required = SectionHasItem::BOOKSTORE_RECOMMENDED;
                 } else {
                     $required = SectionHasItem::REQUIRED;
                 }
             }
         }
     }
     $details['requiredStatus'] = $required;
     return $details;
 }
コード例 #16
0
ファイル: scpanel.php プロジェクト: billyprice1/whmcs
function scpanel_CreateAccount($params)
{
    $sAuth = base64_encode($params['serverusername'] . ":" . $params['serverpassword']);
    if ($params['configoption15']) {
        $params['domain'] = $params['configoption5'] . $params['configoption15'];
        $params['username'] = "******" . $params['domain'];
        $params['username'] = str_replace(".", "", $params['username']);
        $params['username'] = str_replace("-", "", $params['username']);
        $params['username'] = substr($params['username'], 0, 8);
    }
    update_query("tblhosting", array("domain" => $params['domain'], "username" => $params['username']), array("id" => (int) $params['serviceid']));
    $cpanelpassword = createServerPassword();
    $sHTTP = "GET /scripts/wwwacct?domain=" . urlencode($params['domain']) . "&username="******"&password="******"&plan=" . urlencode($params['configoption12']) . ("&x=\n HTTP/1.0\nAuthorization: Basic " . $sAuth . "\n" . "\n");
    $ch = curl_init("http://" . $params['serverip'] . ":2086/xml-api/createacct?username="******"&plan=" . urlencode($params['configoption12']) . "&password="******"&domain=" . urlencode($params['domain']));
    $header = array("Authorization: Basic " . $sAuth);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    $output = curl_exec($ch);
    curl_close($ch);
    $output = simplexml_load_string($output);
    if ($output->result->status == 1) {
        $result = "success";
    } else {
        $result = $output->result->statusmsg;
    }
    if ($result == "success") {
        if ($params['configoption7'] == "on") {
            $params['configoption7'] = "yes";
        } else {
            $params['configoption7'] = "no";
        }
        if ($params['configoption9'] == "on") {
            $params['configoption9'] = "yes";
        } else {
            $params['configoption9'] = "no";
        }
        if ($params['configoption10'] == "on") {
            $params['configoption10'] = "yes";
        } else {
            $params['configoption10'] = "no";
        }
        if ($params['configoption11'] == "on") {
            $params['configoption11'] = "yes";
        } else {
            $params['configoption11'] = "no";
        }
        if ($params['configoption13']) {
            $params->configoption13 .= "M";
        }
        if ($params['configoption14']) {
            $params->configoption14 .= "M";
        }
        $access_url = $params['serverip'] . "/~" . $params['username'];
        $url = "http://" . $access_url . "/install.php";
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        $url = "http://" . $access_url . "/scp/index.php";
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        $url = "http://" . $access_url . "/scp/install/api/1.php?user="******"&pass="******"&os=" . $params['configoption3'];
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
            return $result;
        }
        $url = "http://" . $access_url . "/scp/install/api/2.php?user="******"&pass="******"&os=" . $params['configoption3'] . "&maxuser="******"&password="******"&portbase=" . $params['configoption5'] . "&destip=" . $params['serverip'];
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
            return $result;
        }
        $url = "http://" . $access_url . "/scp/install/api/3.php?user="******"&pass="******"&server_host=" . $params['serverip'] . "&server_port=" . $params['configoption5'];
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
            return $result;
        }
        $url = "http://" . $access_url . "/scp/install/api/4.php?user="******"&pass="******"&maxtraffic=" . $params['configoption6'] . "&trafficabuse=" . $params['configoption7'] . "&maxbitrate=" . $params['configoption8'] . "&bitrateabuse=" . $params['configoption9'] . "&intro_backup_max_size=" . $params['configoption13'] . "&ondemand_max_size=" . $params['configoption14'] . "&ondemand=" . $params['configoption10'] . "&proxy=" . $params['configoption11'];
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
            return $result;
        }
        $url = "http://" . $access_url . "/scp/install/api/5.php?user="******"&pass="******"&username="******"&password="******"&name=" . urlencode($params['clientsdetails']['firstname'] . " " . $params['clientsdetails']['lastname']) . "&user_mail=" . urlencode($params['clientsdetails']['email']) . "&allow_admin_mail=ON&allow_user_mail=OFF";
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
            return $result;
        }
        $url = "http://" . $access_url . "/scp/install/api/6.php?user="******"&pass="******"&action=start";
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
        }
        $url = "http://" . $access_url . "/scp/install/api/7.php?user="******"&pass="******"&action=cleanup";
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
        }
        $query = "UPDATE tblproducts SET configoption5=configoption5+2 WHERE id=" . (int) $params['packageid'];
        $result = full_query($query);
    }
    return $result;
}