public function check_and_modify($context)
 {
     $rtrn = true;
     $dir = $context->get("components_directory");
     foreach (dirs($dir) as $component) {
         print $dir . "{$component}/check-database-schema.php\n";
         if (file_exists($dir . "{$component}/check-database-schema.php")) {
             echo "Checking db schema for table '{$component}'\n";
             mysql_select_db($component);
             // the included code uses the context to check (and perhaps modify) the database(s) schemas
             include_once $dir . "{$component}/check-database-schema.php";
             $checkername = $component . "_SchemaChecker";
             $obj = new $checkername();
             if (!$obj->check_and_modify($context)) {
                 echo "***Trouble during checking database schema for table: '{$component}' ****\n";
                 $rtrn = false;
             }
         }
     }
     return $rtrn;
 }
function dirs($dir, $abs_path)
{
    $d = dir($dir);
    $dirs = array();
    while (false !== ($entry = $d->read())) {
        if (is_dir($dir . '/' . $entry) && substr($entry, 0, 1) != '.') {
            $path['path'] = $dir . '/' . $entry;
            $path['name'] = $entry;
            $dirs[$entry] = $path;
        }
    }
    $d->close();
    ksort($dirs);
    $cntDir = count($dirs);
    for ($i = 0; $i < $cntDir; $i++) {
        $name = key($dirs);
        $current_dir = $abs_path . '/' . $dirs[$name]['name'];
        echo ", '" . sanitize($current_dir) . "/'\n";
        dirs($dirs[$name]['path'], $current_dir);
        next($dirs);
    }
}
Example #3
0
</p>
HTML;
$google_extra = <<<EXTRA
<li class="arrow"><a href="http://maps.google.com/maps?f=q&q=1+Waterfront+Pl,+Morgantown+WV+26505" class="external">WVU on Google Maps</a></li>
EXTRA;
$car = <<<HTML
<p>At the intersection of I-79 and I-68, <span class="caps">WVU</span> is approximately 70 miles south of Pittsburgh or 200 miles northwest of Washington, DC. The Visitors Resource Center is accessible from Exit 1 of Interstate 68 (University Ave. exit). If you exit from I-68 West turn left at the end of the exit ramp on to Route 119 North; go straight for three stoplights. If you exit from I-79 onto I-68 East turn left at the light on Route 119 North; go straight for three stoplights. At the fourth traffic light turn left into One Waterfront Place. You will see a large blue sign labeled Visitors Resource Center.</p>
<p>As you turn left, make a quick right into the parking garage. You will receive a parking ticket that you will need to bring inside with you to have validated for your time at the Visitors Resource Center. The Visitors Resource Center is located on the first floor.</p>
HTML;
$air = <<<HTML
<p>The closest airports are the <a href="http://www.morgantownairport.com/">Morgantown Airport</a> and the <a href="http://www.pitairport.com/redirect.jsp">Pittsburgh International Airport</a>.  The <a href="http://www.busride.org/">Gray Line Mountain Line Bus</a> runs a shuttle from Pittsburgh to Morgantown daily.</p>
HTML;
$train = <<<HTML
<p>The closest <a href="http://www.amtrak.com/servlet/ContentServer?pagename=Amtrak/HomePage">Amtrak</a> station is in Greensburg, Pa., located 51.5 miles from Morgantown.
HTML;
$directions = array("google" => dirs($google, "Using Google Maps", "Google")->google($google_extra), "car" => dirs($car, "By Car", "By Car"), "air" => dirs($air, "By Air", "By Air"), "train" => dirs($train, "By Train", "By Train"));
class DirectionPage
{
    public $header;
    public $html;
    public $breadcrumb;
    public $google_html;
    public $link_text;
    public function __construct($html, $link_text, $breadcrumb)
    {
        $this->html = $html;
        $this->link_text = $link_text;
        $this->breadcrumb = $breadcrumb;
        $this->header = $this->link_text;
    }
    public function heading($header)
Example #4
0
                        var param = new Object();
                        var selection = document.forms[0].newpath;
                        var newDir = selection.options[selection.selectedIndex].value;
                        param['newpath'] = newDir;
                          __dlg_close(param);
                          return false;
                }

                function Init() {
                        __dlg_init();
                }

                function refreshDirs() {
                        var allPaths = document.forms[0].newpath.options;
                        var fields = ["/" <?php 
dirs($MY_DOCUMENT_ROOT, '');
?>
];
                        for(i=0; i<fields.length; i++) {
                                var newElem =        document.createElement("OPTION");
                                var newValue = fields[i];
                                newElem.text = newValue;
                                newElem.value = newValue;
                                allPaths.add(newElem);
                        }
                }
/*]]>*/
</script>
</head>
<body onload="Init()">
        <div class="title"><?php 
Example #5
0
<?php

/*Написать функцию, которая выводит список файлов в заданной директории, которые содержат искомое слово. Директория и искомое слово задаются как параметры функции.*/
function dirs($dirName, $search)
{
    $scanDir = scandir($dirName);
    foreach ($scanDir as $index => $item) {
        if (!stristr($scanDir[$index], $search)) {
            unset($scanDir[$index]);
        }
    }
    echo "<pre>";
    print_r($scanDir);
}
dirs('D:\\xampp7\\htdocs\\homework\\functions_forms_tasks', "txt");
</div>


	<iframe src="/index.php/home/Choose/main_content.html" frameborder="0" style="float:right;width:calc(100% - 280px);height:100%;" id="right_bt"></iframe> 
	</div>

</div>

<div class="clear"></div>
<div id="foot">
  <ul>
    <li class="logo_f">uTeach</li>
    <li class="nav_f">会考</li>
    <?php 
echo dirs($row['pid'], $row['top_pid']);
?>
    <li class="grasj"></li>
    <li><?php 
echo $row["header"];
?>
  <?php 
echo $row["subject"];
?>
</li>
	<li class="greesj"></li>
	 <li>开始选题</li>
  </ul>
</div>
</div>
</body>
Example #7
0
function dirs($dir, $abs_path)
{
    $d = dir($dir);
    //echo "Handle: ".$d->handle."<br>\n";
    //echo "Path: ".$d->path."<br>\n";
    $dirs = array();
    while (false !== ($entry = $d->read())) {
        if (is_dir($dir . '/' . $entry) && substr($entry, 0, 1) != '.') {
            //dirs($dir.'/'.$entry, $prefix.$prefix);
            //echo $prefix.$entry."<br>\n";
            $path['path'] = $dir . '/' . $entry;
            $path['name'] = $entry;
            $dirs[$entry] = $path;
        }
    }
    $d->close();
    ksort($dirs);
    for ($i = 0; $i < count($dirs); $i++) {
        $name = key($dirs);
        $current_dir = $abs_path . '/' . $dirs[$name]['name'];
        echo ", \"{$current_dir}\"\n";
        dirs($dirs[$name]['path'], $current_dir);
        next($dirs);
    }
}
<p>Parking in Cambridge and Boston is generally not an enjoyable experience. Whenever possible, park your car at the hotel 
at which you are staying, and use <a href="directions.php?page=t">public transportation</a> to get to the MIT campus. 
If you must drive to the campus, there is both on- and off-street parking available, but most public 
parking is not very close to the center of the MIT campus (unless you arrive early in the morning or late in the evening).</p>
<p>There is metered parking on Massachusetts Avenue for short stays and evenings/weekends, as well as a number of lots at 
which you may park for a fee. These include <a href="detail.php?selectvalues=P16">Vassar St. Public Parking</a> at the 
corner of 
Massachusetts Avenue and Vassar Street, <a href="detail.php?selectvalues=P37">University Park / Star Market Public 
Parking</a>, and 
the <a href="detail.php?selectvalues=P10">Marriott Parking Garage</a> on Ames St. and Broadway.</p>

<p>If you were invited to campus and a visitor parking hang tag was given to you, you may park in the lots specified on the 
hang tag. Please check the <a href="./?category=parking">parking lot</a> listing and plan your trip 
accordingly.</p>
HTML;
$directions = array("location" => dirs($location, "Where in the World is MIT?", "Whereis")->heading("Where is MIT?"), "google" => dirs($google, "Finding MIT using Google Maps", "Google")->google($google_extra), "logan" => dirs($logan, "From Logan Airport", "Logan")->google($logan_extra), "t" => dirs($t, 'By Public Transportation - MBTA ("The T")', "By T")->short_link('By Public Transport ("The T")', $page), "car" => dirs($car, "By Car", "By Car"), "hood" => dirs($hood, "By Hood Blimp", "Blimp"), "parking" => dirs($parking, "Parking Suggestions", "Parking"));
class DirectionPage
{
    public $header;
    public $html;
    public $breadcrumb;
    public $google_html;
    public $link_text;
    public function __construct($html, $link_text, $breadcrumb)
    {
        $this->html = $html;
        $this->link_text = $link_text;
        $this->breadcrumb = $breadcrumb;
        $this->header = $this->link_text;
    }
    public function heading($header)
Example #9
0
$project = preg_replace('/[^(0-9A-Za-z)]*/', '', $project_raw);
if ($project != $project_raw) {
    echo "ERR 007\n";
    echo "project name mismatch";
    exit;
}
$project_dir = $feedback_dir . $project . '/';
if (!is_dir($project_dir)) {
    // no project directory
    if (!$create_project_dirs) {
        // no project directory (and not configured to create one)
        echo "ERR 002\n";
        echo "no such project";
        exit;
    }
    if (count(dirs($feedback_dir)) > $feedback_max_project) {
        // too many projects
        echo "ERR 009\n";
        echo "too many projects";
        exit;
    }
    // create project dir
    if (!mkdir($project_dir)) {
        // failed to create project directory
        echo "ERR 008\n";
        echo "could not create project dir";
        exit;
    }
}
$submission_dir = $project_dir . uniq() . '/';
if (!mkdir($submission_dir)) {
Example #10
0
function plug_publish_site()
{
    $r = dirs();
    //p($r);
    if ($_SESSION['auth'] < 6) {
        return 'no';
    }
    if (!is_dir('_public')) {
        mkdir('_public');
    }
    echo divc('panel', 'this will backup program files in public directory to let users upgrade Philum from this server - ' . lka('/plug/_zip_prog.php?createzip=', 'tar.gz'));
    echo update_msql();
    echo plugin('coreflush') . br();
    echo plugin('philumsize') . br();
    foreach ($r as $k => $v) {
        $xt = substr($v, -3);
        if ($xt == 'php' or $xt == 'css' or $xt == 'txt' or $xt == '.js' or strpos($v, 'philum')) {
            //$pos=strrpos($v,'/'); $j=substr($v,0,$pos); $va=substr($v,$pos+1);
            list($j, $va) = split_one('/', $v, 1);
            funcb($j, $k, $va, '');
            funcc('_public/' . $j, $k, $va, '');
        } else {
            walk_dir('' . $v, 'funcb');
        }
        walk_dir('_public/' . $v, 'funcc');
    }
}
		<div class="head_yes"><a href="javascript:void(0);" class="yes">确定</a></div>
</div>
<!-- 试卷头设置 end -->
<div id="foot">
<div id="yema">
	<p><span>化学试卷</span>第<span id="now_page_one"></span>页(共<span class="shijiu_all_page"></span>页)</p>
	<p><span>化学试卷</span>第<span id="now_page_two"></span>页(共<span class="shijiu_all_page"></span>页)</p>
</div>
  <ul>
    <li class="logo_f">uTeach</li>
    <li class="nav_f"><a href="<?php 
echo U('Volume/index');
?>
" style="color:#a5dba7">会考</a></li>
    <?php 
echo dirs($epaper['pid'], $epaper['top_pid']);
?>
    <li class="grasj"></li>
    <li><?php 
echo $epaper["header"];
?>
 <?php 
echo $epaper["subject"];
?>
</li>
     <li class="grasj"></li>
	<li>生成试卷</li>
  </ul>
</div>

<script>
function dirs($dir, $abs_path)
{
    $d = dir($dir);
    $dirs = array();
    while (false !== ($entry = $d->read())) {
        if (is_dir($dir . '/' . $entry) && substr($entry, 0, 1) != '.') {
            $path['path'] = $dir . '/' . $entry;
            $path['name'] = $entry;
            $dirs[$entry] = $path;
        }
    }
    $d->close();
    ksort($dirs);
    for ($i = 0; $i < count($dirs); $i++) {
        $name = key($dirs);
        $current_dir = $abs_path . '/' . $dirs[$name]['name'];
        echo "<option value=\"{$current_dir}\">{$current_dir}</option>\n";
        dirs($dirs[$name]['path'], $current_dir);
        next($dirs);
    }
}
    
    
    
</div>

<div class="clear"></div>

<div id="foot" style="position:fixed; ">
<ul>
      <li class="logo_f">uTeach</li>
      <li class="nav_f"><a href="<?php 
echo U('Volume/index');
?>
"  style="color:#a5dba7">会考</a></li>
      <?php 
echo dirs();
?>
</ul>

</div>
<div id="mask"></div>
<div class="delete_del">
    <div class="img_icon img_delete"></div>
  <div class="delete_del_content">
          <div class="popu_text">
          </div>

        <div class="delete_del_opt">
              <a href="javascript:void(0);" class="delete_del_yes">删除</a>
              <a href="javascript:void(0);" class="delete_del_no">取消</a>
        </div>
Example #14
0
    if (!is_dir($dir)) {
        mkdir($dir);
    }
    foreach ($_FILES["pictures"]["error"] as $key => $error) {
        if ($error == UPLOAD_ERR_OK) {
            $tmp_name = $_FILES["pictures"]["tmp_name"][$key];
            $name = $_FILES["pictures"]["name"][$key];
            move_uploaded_file($tmp_name, $dir . DS . $name);
        }
    }
    echo "<pre>";
    print_r($_FILES);
}
function dirs($dirName, $gif, $jpg, $png)
{
    global $dir;
    $scanDir = scandir($dirName);
    foreach ($scanDir as $index => $item) {
        if (stristr($scanDir[$index], $gif) || stristr($scanDir[$index], $jpg) || stristr($scanDir[$index], $png)) {
            echo "<img src='" . $dir . "/{$item}' width='200px'>";
        } else {
            unset($scanDir[$index]);
        }
    }
}
dirs($dir, "gif", 'jpg', 'png');
?>



Example #15
0
hang tag. Please check the <a href="./?category=parking">parking lot</a> listing and plan your trip 
accordingly.</p>
HTML;

$directions = array(
  "location" => dirs($location, "Where in the World is MIT?", "Whereis")
      ->heading("Where is MIT?"),
  "google" => dirs($google, "Finding MIT using Google Maps", "Google")
      ->google($google_extra),
  "logan" => dirs($logan, "From Logan Airport", "Logan")
      ->google($logan_extra),
  "t" => dirs($t, 'By Public Transportation - MBTA ("The T")', "By T")
      ->short_link('By Public Transport ("The T")', $page),
  "car" => dirs($car, "By Car", "By Car"),
  "hood" => dirs($hood, "By Hood Blimp", "Blimp"),
  "parking" => dirs($parking, "Parking Suggestions", "Parking")
);


class DirectionPage {
  public $header;
  public $html;
  public $breadcrumb;
  public $google_html;
  public $link_text;

  public function __construct($html, $link_text, $breadcrumb) {
    $this->html = $html;
    $this->link_text = $link_text;
    $this->breadcrumb = $breadcrumb;
    $this->header = $this->link_text;