• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP go_home函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中go_home函数的典型用法代码示例。如果您正苦于以下问题:PHP go_home函数的具体用法?PHP go_home怎么用?PHP go_home使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了go_home函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: api_active

/**
 * Verify API active. If invalid terminate execution and redirect to public calendar homepage with a 301 response.
 * @since 2.2.0
 * @version 2.2.0
 * @return void
 */
function api_active()
{
    global $hc_cfg;
    if ($hc_cfg[127] != '1') {
        go_home();
    }
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:13,代码来源:api.php


示例2: location_fetch

/**
 * Retrieves array of location data.
 * @since 2.0.0
 * @version 2.0.0
 * @return array Location Data
 */
function location_fetch()
{
    global $lID, $hc_cfg, $hc_lang_event, $title, $desc;
    location_add_session_view($lID);
    $result = doQuery("SELECT PkID, Name, Address, Address2, City, State, Country, Zip, URL, Phone, Email, Descript, Lat, Lon, ShortURL, LastMod, Image From " . HC_TblPrefix . "locations WHERE PkID = '" . cIn($lID) . "' AND IsActive = 1");
    if (!hasRows($result) || mysql_result($result, 0, 0) <= 0) {
        go_home();
    }
    $loc = array('LocID' => mysql_result($result, 0, "PkID"), 'Name' => mysql_result($result, 0, "Name"), 'Description' => mysql_result($result, 0, "Descript"), 'Address' => mysql_result($result, 0, "Address"), 'Address2' => mysql_result($result, 0, "Address2"), 'City' => mysql_result($result, 0, "City"), 'Region' => mysql_result($result, 0, "State"), 'Postal' => mysql_result($result, 0, "Zip"), 'Country' => mysql_result($result, 0, "Country"), 'Email' => mysql_result($result, 0, "Email"), 'Phone' => mysql_result($result, 0, "Phone"), 'Lat' => mysql_result($result, 0, "Lat"), 'Lon' => mysql_result($result, 0, "Lon"), 'Bitly' => mysql_result($result, 0, "ShortURL"), 'CommentsURL' => CalRoot . '/index.php?com=location&amp;lID=' . $lID, 'CommentsID' => $lID, 'Link_This' => CalRoot . '/index.php?com=location&amp;lID=' . $lID, 'Link_URL' => mysql_result($result, 0, "URL") != '' && mysql_result($result, 0, "URL") != 'http://' ? CalRoot . '/link/index.php?tID=4&amp;oID=' . mysql_result($result, 0, "PkID") : NULL, 'Link_Weather' => CalRoot . '/link/index.php?tID=3&amp;oID=0&amp;lID=' . mysql_result($result, 0, "PkID"), 'Link_Directions' => CalRoot . '/link/index.php?tID=2&amp;oID=0&amp;lID=' . mysql_result($result, 0, "PkID"), 'Link_Calendar' => CalRoot . '/index.php?lID=' . $lID, 'LastMod' => mysql_result($result, 0, "LastMod"), 'Image' => mysql_result($result, 0, "Image"));
    $title = cOut(mysql_result($result, 0, "Name"));
    $desc = cOut(mysql_result($result, 0, "Descript"));
    return array_map('cOut', $loc);
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:19,代码来源:locations.php


示例3: classes

function classes($classno, $branch)
{
    go_home();
    echo "<ul class='nav nav-tabs nav-stacked'>";
    echo '<li><a href="?all">All Students<i class="icon-chevron-right pull-left" style="padding-top:5px;"></i></a></li>';
    echo '<li><a href="?allcrs">All CRs<i class="icon-chevron-right pull-left" style="padding-top:5px;"></i></a></li>';
    for ($i = 1; $i <= $classno; $i++) {
        echo <<<a
\t<li><a href="?{$branch}{$i}">{$branch}{$i}<i class="icon-chevron-right pull-left" style="padding-top:5px;"></i></a> </li>

a;
    }
    echo "</ul>";
}
开发者ID:0xc0d3r,项目名称:Attendance-Portal,代码行数:14,代码来源:sendnotice.php


示例4: login_user

function login_user($name, $password)
{
    global $model, $s;
    $password = md5($password);
    $result = $model['user']['login']($name, $password);
    if ($result) {
        $user = mysqli_fetch_assoc($result);
        $s['user'] = $user;
        add_flash('info', "You're now logged in");
        go_home();
    } else {
        add_flash('danger', "Wrong credentials");
    }
}
开发者ID:alexkurilo77,项目名称:Alex1,代码行数:14,代码来源:functions.php


示例5: exit_if

function exit_if($state = false)
{
    $is_loggen_in = isset($_SESSION['user']);
    if ($state) {
        if (!$is_loggen_in) {
            return;
        }
    } else {
        if ($is_loggen_in) {
            return;
        }
    }
    go_home();
    exit;
}
开发者ID:nceregao,项目名称:new_portal,代码行数:15,代码来源:init.php


示例6: changecr


//.........这里部分代码省略.........
                $key = addslashes($_POST['Key']);
                if (strlen(trim($id)) == 0) {
                    echo "<script>show_error('Error : Id should not be null');</script>";
                    exit;
                }
                if (strlen(trim($gender)) == 0) {
                    echo "<script>show_error('Error : CR Gender should not be null');</script>";
                    exit;
                }
                if (strlen(trim($key)) == 0) {
                    echo "<script>show_error('Error : Key should not be null');</script>";
                    exit;
                }
                include 'config/db.php';
                include 'config/settings.php';
                $dbname = $branchyear . '_Users';
                $table = $branchyear . '_Students';
                //if(!mysql_select_db($dbname)) {die(mysql_error());}
                $userid = $id;
                $q = "select Name,Branch,Class,Gender from {$table} where Id = '{$userid}'";
                $res = mysql_query($q) or die(mysql_error());
                $row = mysql_fetch_array($res);
                $name = ucwords(strtolower($row['Name']));
                $branch = $row['Branch'];
                $class1 = $row['Class'];
                $gender1 = $row['Gender'];
                $branch = $globalbranch;
                $d = $dict[$gender . '1'];
                if ($class1 == $class && $gender1 == $gender) {
                    $table = $branchyear . '_CRs';
                    $old_id = mysql_fetch_array(mysql_query("Select Id from {$table} where Class = '{$class}'  and Gender = '{$gender}';"))['Id'];
                    $q = mysql_query("delete from {$table} where Class = '{$class}'  and Gender = '{$gender}';") or die(mysql_error());
                    $q1 = mysql_query("insert into {$table} ( `Id`, `Name`, `Gender`, `Branch`,`Class`, `Key`) values ( '{$id}', '{$name}' , '{$gender}', '{$branch}', '{$class}', '{$key}');") or die(mysql_error());
                    insert_log("Changing {$branch} {$class} {$d} CR to {$id}");
                    $dbname = $branchyear . '_Logs';
                    $table = $branchyear . '_Notifications';
                    //if(!mysql_select_db($dbname)) {die(mysql_error());}
                    $datetime = date('d/m/Y H:m:s');
                    $ip = $_SERVER['REMOTE_ADDR'];
                    $to1 = $branch . $class . "@students";
                    $query = mysql_query("INSERT INTO " . $table . "(`To`,`From`,`Subject`,`Message`,`DateTime`,`IP`) VALUES('{$to1}','" . $_SESSION['UserId'] . "','Changing the {$d} CR of {$branch} {$class}','Dear Students,<br>Please Notice that, {$branch} {$class} {$d} CR has been changed to <br> {$name}, {$id}.','{$datetime}','{$ip}');") or die(mysql_error());
                    $table = $dbname = $branchyear . '_Students';
                    $query = mysql_query("update {$table} set Position = 'CR' where Id = '{$id}'") or die(mysql_error());
                    $query1 = mysql_query("update {$table} set Position = 'S' where Id = '{$old_id}'") or die(mysql_error());
                    echo "<script>show_success('{$branch} {$class} {$d} CR has been updated with {$name} and security key <u class=\\'text-error\\'>{$key}</u> ');</script>";
                } else {
                    echo "<script>show_error('<b>Error </b> : <b>{$id}</b> is not from the <b>{$branch} {$class} {$d}</b>  Please try again.. ');</script>";
                }
            }
            echo <<<a
\t\t\t<div id="step1">    
\t\t\t<h4>Change CR of {$branch} {$class} </h4>
\t\t\t<h6> &emsp;&emsp;&emsp;&emsp; Provide Details of New CR  </h6><br>
\t\t\t<form action="?{$p}" method="POST" onsubmit="return viewcr('{$branch}',{$class});"  id="changecr">
\t\t\t<h5>Gender : </h5>  
\t\t\t<label class="radio inline"><input type="radio"  value="M" name="Gender" id="Male" /> Male </label>
\t\t\t<label class="radio inline"><input type="radio"  value="F" name="Gender" id="Female" /> Female </label> 
\t\t\t<br><br>
\t\t\t<h5>New CR ID No : </h5>
\t\t\t<input type="text" class="input-large" placeholder="N090001"  id="Idno" name="IdNo" maxlength="7" /><br>
\t\t\t<!--<h5>Security Key : </h5>-->
\t\t\t<input type="hidden" class="input-large" placeholder="Password" readonly=readonly name="Key" value="{$crkey}" ><br>
\t\t\t<input type="submit" class="btn btn-primary" name="change" value = "Continue &rarr;" />
\t\t\t</form>\t
\t\t\t<form action="?{$p}" method='post' id='sub2'>
\t\t\t<div id="confirm">
\t\t\t\t<div id="cr" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="useridlabel" aria-hidden="true">
\t\t\t\t<div class="modal-header">
\t\t\t\t<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
\t\t\t\t<h4 id="useridlabel">Caution</h4>
\t\t\t\t</div>
\t\t\t\t<div class="modal-body" id='mbody'></div>
\t\t\t\t<div class="modal-footer">
\t\t\t\t<button class="btn btn-danger"  aria-hidden="true" type="submit" onclick="a();">Confirm & Replace </button> 
\t\t\t\t<button class="btn btn-primary"  aria-hidden="true"  data-dismiss='modal' > Cancel </button>
\t\t\t\t</div>
\t\t\t</div>
\t\t\t\t<input type="hidden"  placeholder="Password" readonly=readonly name="Gender" value="" id='gender1'>
\t\t\t\t<input type="hidden"  placeholder="Password" readonly=readonly name="Idno" value="" id='idno1'>
\t\t\t\t<input type="hidden" class="input-large" placeholder="Password" readonly=readonly name="Key" value="{$crkey}" >
\t\t\t</form>
\t\t\t</div>
\t\t\t</div>\t\t
a;
            echo <<<b
\t\t\t\t
\t\t\t\t</div>\t
\t\t\t\t</div>
\t\t\t\t<div class='span3'>
b;
            go_home();
            cr_classes($classno, $globalbranch);
            echo "</div></div></div>";
            display_footer();
            echo "\n</body>\n</html>";
        } else {
            echo "<script type='text/javascript'>document.location.href='404.php';</script>";
        }
    }
}
开发者ID:0xc0d3r,项目名称:Attendance-Portal,代码行数:101,代码来源:changecr.php


示例7: changeprofile


//.........这里部分代码省略.........
                }
                if ($pass1 != $pass) {
                    echo "<script>show_error('Error : Your Current Password does not matched ... Please try again....');</script>";
                } else {
                    if ($newpass1 != $newpass2) {
                        echo "<script>show_error('Error : New Password both does not matched ... Please try again....');</script>";
                    } else {
                        $q = mysql_query("update {$table} set Password = '{$newpass1}' where Id = '{$userid}';") or die(mysql_error());
                        insert_log("{$userid} changed his Password ");
                        echo "<script>show_success('Password has been updated');</script>";
                    }
                }
            }
            if ($p == 'contact') {
                display_contact();
            }
            if (isset($_POST['Contact'])) {
                $pass1 = md5($_POST['OPass']);
                $contact1 = $_POST['MNo'];
                if (strlen(trim($pass1)) < 7) {
                    echo "<script>show_error('Error : Password should not be null');</script>";
                    exit;
                }
                if (strlen(trim($contact1)) == 0) {
                    echo "<script>show_error('Error : Contact No should not be null');</script>";
                    exit;
                }
                if ($pass1 != $pass) {
                    echo "<script>show_error('Error : Your Current Password does not matched ... Please try again....');</script>";
                } else {
                    if (strlen($contact1) != 10) {
                        echo "<script>show_error('Error : New Contact No. to short... Please try again....');</script>";
                    } else {
                        $q = mysql_query("update {$table} set PhoneNo = '{$contact1}' where Id = '{$userid}';") or die(mysql_error());
                        insert_log("{$userid} changed his Contact No");
                        echo "<script>show_success('Contact No has been updated');</script>";
                    }
                }
            }
            if ($p == 'photo') {
                display_photo();
            }
            if (isset($_POST['Photo'])) {
                $pass1 = md5($_POST['OPass']);
                if (strlen(trim($pass1)) < 7) {
                    echo "<script>show_error('Error : Password should not be null');</script>";
                    exit;
                }
                if ($pass1 != $pass) {
                    echo "<script>show_error('Error : Your Current Password does not matched ... Please try again....');</script>";
                } else {
                    if (isset($_FILES['PhotoFile'])) {
                        $fname = $_FILES['PhotoFile']["name"];
                        $fsize = $_FILES['PhotoFile']["size"];
                        $fext = strtolower(end(explode(".", $fname)));
                        if ($fsize > 102400) {
                            echo "<script>show_error('Error : Input file is larger than 100KB ... Please try again....');</script>";
                        } else {
                            if (!in_array($fext, $ex)) {
                                echo "<script>show_error('Error : Input file is not a image file ... Please try again....');</script>";
                            } else {
                                $fname_new = "assets/img/users/" . $userid . ".png";
                                if (!move_uploaded_file($_FILES["PhotoFile"]["tmp_name"], $fname_new)) {
                                    echo "<script>show_error('Error : In moving the input file ... Please try again....');</script>";
                                } else {
                                    exec("chmod 777 {$fname_new}");
                                    $q = mysql_query("update {$table} set Picture = '{$fname_new}' where Id = '{$userid}';") or die(mysql_error());
                                    insert_log("{$userid} changed his profile photo");
                                    echo "<script>show_success('Profile Photo Updated ');</script>";
                                }
                            }
                        }
                    } else {
                        echo "<script>show_error('Error : No input file ... Please try again....');</script>";
                    }
                }
            }
            echo <<<b
\t\t</div>\t
\t\t</div>
\t\t<div class='span3'>
b;
            go_home();
            echo <<<b
\t\t<ul class="nav nav nav-tabs nav-stacked">
\t\t
\t\t<li><a href='?password'>Change Password <i class="icon-chevron-right pull-left" style="padding-top:5px;"></i></a> </li>
\t\t<li><a href='?contact'>Change Contact No<i class="icon-chevron-right pull-left" style="padding-top:5px;"></i></a> </li>
\t\t<li><a href='?photo'>Change Photo <i class="icon-chevron-right pull-left" style="padding-top:5px;"></i></a> </li>
\t\t
\t\t</ul>
b;
            echo "</div></div></div>";
            display_footer();
            echo "\n</body>\n</html>";
        } else {
            echo "<script type='text/javascript'>document.location.href='404.php';</script>";
        }
    }
}
开发者ID:0xc0d3r,项目名称:Attendance-Portal,代码行数:101,代码来源:profile.php


示例8: homepage


//.........这里部分代码省略.........
                                        }
                                    }
                                }
                            } else {
                                $dbname = $branchyear . '_Cache';
                                $table = $qs . '_Cache';
                                //if(!mysql_select_db($dbname)) die(mysql_error());
                                $q3 = mysql_query("SELECT RNo, `" . $a . $j . "` FROM {$table}") or die(mysql_error());
                                $Rnos = array("Absents" => array(), "Presents" => array());
                                $aindex = 0;
                                $pindex = 0;
                                while ($individual = mysql_fetch_array($q3)) {
                                    if ($individual[$a . $j] == "A") {
                                        $Rnos["Absents"][$aindex] = $individual["RNo"];
                                        $aindex++;
                                    }
                                    if ($individual[$a . $j] == "P") {
                                        $Rnos["Presents"][$pindex] = $individual["RNo"];
                                        $pindex++;
                                    }
                                }
                            }
                            $pc = count($Rnos["Presents"]);
                            $ac = count($Rnos["Absents"]);
                            $tot = $pc + $ac;
                            echo "<td>";
                            for ($i = 0; $i < $pc; $i++) {
                                if ($i % 8 == 0 && $i != 0) {
                                    echo "<br>";
                                }
                                if ($i == $pc - 1) {
                                    echo $Rnos["Presents"][$i];
                                } else {
                                    echo $Rnos["Presents"][$i] . ",";
                                }
                            }
                            echo "</td><td>";
                            for ($i = 0; $i < $ac; $i++) {
                                if ($i % 8 == 0 && $i != 0) {
                                    echo "<br>";
                                }
                                if ($i == $ac - 1) {
                                    echo $Rnos["Absents"][$i];
                                } else {
                                    echo $Rnos["Absents"][$i] . ",";
                                }
                            }
                            echo <<<confirm1
\t\t\t\t\t\t\t</td></tr>
\t\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t\t<td style="text-align:center;" >Total (<b>{$tot}</b>)</td>
\t\t\t\t\t\t\t\t\t<td style="text-align:center;" class='text-success'> {$pc}</td>
\t\t\t\t\t\t\t\t\t<td style="text-align:center;" class='text-error'>{$ac}</td>
\t\t\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t\t\t</tbody>
\t\t\t\t\t\t\t</table>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t<div class="modal-footer">
\t\t\t\t\t\t<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Close</button>
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
confirm1;
                        }
                    }
                }
            }
            echo "</div></div>";
            echo "<div class='span3'>";
            go_home();
            echo "<ul class='nav nav-tabs nav-stacked'>";
            for ($i = 1; $i <= $classno; $i++) {
                $branch = $globalbranch;
                $cls = $branch . $i;
                $table = $cls . '_Dates';
                $remaining = array();
                $j = 0;
                $q = mysql_query("select * from {$table} ; ") or die(mysql_error());
                while ($res = mysql_fetch_array($q)) {
                    if ($res["P1_Con"] != 'ok' or $res["P2_Con"] != 'ok' or $res["P3_Con"] != 'ok' or $res["P4_Con"] != 'ok') {
                        $remaining[$j++] = $res['Date'];
                    }
                }
                $str1 = count($remaining) != 0 ? "<i class='icon-remove pull-right text-error' style='padding-top:5px;'></i>" : "<i class='icon-ok pull-right text-success' style='padding-top:5px;'></i>";
                //echo $str1;
                echo <<<a
\t\t\t\t<li><a href="?{$branch}{$i}">{$branch}{$i}<i class="icon-chevron-right pull-left" style="padding-top:5px;"></i> {$str1} </a> </li>

a;
            }
            echo "</ul>";
            echo "</div></div></div>";
            display_footer();
            echo "\n</body>\n</html>";
        } else {
            echo "<script type='text/javascript'>document.location.href='404.php';</script>";
        }
    }
}
开发者ID:0xc0d3r,项目名称:Attendance-Portal,代码行数:101,代码来源:upload.php


示例9: sr_event_browse_valid

function sr_event_browse_valid($sort_featured = 1, $nav_function = 'event_browse_nav')
{
    global $lID, $hc_cfg, $hc_lang_event, $favQ1, $favQ2, $resultEB, $myNav;
    $location = $lQuery = '';
    if ($lID > 0) {
        $location = '&amp;lID=' . $lID;
        $lQuery = " AND e.LocID = '" . $lID . "'";
    }
    //added to allow for filtering of KAC Class events
    $unwanted_cats = [35, 37, 38, 39, 40, 41];
    $unwanted_cats = implode(",", $unwanted_cats);
    $custom_filter = isset($_SESSION['hc_favCat']) ? '' : ' AND c.PkID NOT IN (' . cIn($unwanted_cats) . ') ';
    if (isset($_GET['m']) || $_SESSION['BrowseType'] == 2) {
        $sqlStart = $sqlEnd = strtotime(HCDATE);
        $startDate = $endDate = strtotime(HCDATE);
        $window = 0;
    } else {
        if ($_SESSION['BrowseType'] == 1) {
            $window = (date("t", strtotime(HCDATE)) - 1) * 86400;
            $remove = $hc_cfg[48] == 0 ? (date("j", strtotime(HCDATE)) - 1) * 86400 : 0;
        } else {
            $window = 6 * 86400;
            $remove = $hc_cfg[48] == 0 ? (date("w", strtotime(HCDATE)) - 1) * 86400 : 0;
        }
        $startDate = strtotime(HCDATE) - $remove;
        $endDate = $sqlEnd = $startDate + $window;
        $sqlStart = HCDATE != SYSDATE ? $startDate : strtotime(SYSDATE);
    }
    if ($endDate < $hc_cfg['First'] && $startDate != $hc_cfg['First']) {
        go_home();
    } else {
        $myNav = call_user_func($nav_function, $startDate, $endDate, $window, $location);
        $resultEB = doQuery("SELECT e.PkID, e.Title, e.StartDate, e.StartTime, e.EndTime, e.TBD, e.Image, e.IsFeature, e.HideDays, \r\n                            e.LocID, e.LocationName, e.LocationCity, e.LocationState, e.LocCountry,\r\n                            l.Name, l.City, l.State, l.Country, e.Cost, e.SeriesID, GROUP_CONCAT(c.CategoryName), e.Description, l.Address2\r\n                        FROM " . HC_TblPrefix . "events e\r\n                            LEFT JOIN " . HC_TblPrefix . "eventcategories ec ON (e.PkID = ec.EventID)\r\n                            LEFT JOIN " . HC_TblPrefix . "categories c ON (ec.CategoryID = c.PkID)\r\n                            LEFT JOIN " . HC_TblPrefix . "locations l ON (e.LocID = l.PkID) \r\n                        WHERE e.StartDate BETWEEN '" . date("Y-m-d", $sqlStart) . "' AND '" . date("Y-m-d", $sqlEnd) . "'" . $lQuery . $favQ1 . $favQ2 . " AND e.IsActive = 1 AND e.IsApproved = 1" . $custom_filter . "\r\n                        GROUP BY e.PkID, e.Title, e.StartDate, e.StartTime, e.EndTime, e.TBD, e.Image, e.IsFeature, e.HideDays, e.LocID, e.LocationName, e.LocationCity, e.LocationState, e.LocCountry, l.Name, l.City, l.State, l.Country, e.Cost, e.SeriesID\r\n                        ORDER BY e.StartDate, " . ($sort_featured == 1 ? "e.IsFeature DESC, " : "") . "e.TBD, e.StartTime, e.Title");
    }
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:35,代码来源:simonsrock.php


示例10: changecr

function changecr($title)
{
    /* checks the user login and  
     * redirecting user to login page */
    if (!check_login()) {
        header('location:login.php');
    } else {
        include 'config/globals.php';
        /* taking the query string by using the regular expression */
        $p = $_SERVER['QUERY_STRING'];
        $reg = "/^" . $globalbranch . "[1-" . $classno . "]{1}\$/";
        $reg1 = "/^all\$/";
        if (preg_match($reg, $p) or preg_match($reg1, $p)) {
            /* including the necessary configuration php files */
            include 'config/db.php';
            include 'config/settings.php';
            /* defining the table names  */
            $dbname = $branchyear . '_Users';
            $table = $branchyear . '_CRs';
            $table1 = $branchyear . '_Students';
            //if(!mysql_select_db($dbname)) die(mysql_error());
            //$branch = $row['Branch']; its not required
            $class = substr($p, -1);
            /* Getting the users details from joining the two tables */
            if ($p == 'all') {
                $q = "select {$table}.Name as Name, {$table}.Gender as Gender, {$table}.Id as Id,PhoneNo, `{$table1}`.`Class` as `Class` from {$table},{$table1} where `{$table}`.`Id` = `{$table1}`.`Id` order by `{$table1}`.`Class` Desc;";
            } else {
                $q = "select {$table}.Name as Name, {$table}.Gender as Gender, {$table}.Id as Id,PhoneNo from {$table},{$table1} where `{$table}`.`Id` = `{$table1}`.`Id` and `{$table}`.`Class` = '{$class}';";
            }
            $res = mysql_query($q) or die(mysql_error());
            echo "<!DOCTYPE html>\n<html>\n";
            /* including the header java scripts and css files  */
            display_headers($title);
            echo "\n<body>";
            /* displayin the header menu */
            menu();
            $br = $p == 'all' ? $globalbranch : $p;
            $cls1 = $p == 'all' ? '<th style="text-align:center;" class="span1"> Class </th>' : "";
            echo <<<a
\t\t<div class='container'>
\t\t\t<div id="error" style="display:none;"></div>
\t\t\t<div class='row'>
\t\t\t<div class='span9'>
\t\t\t\t<div class="well well-large" style="background:#FFF;">
\t\t\t\t<h5 class='text-info'>CRs @ {$br}  </h5>
\t\t\t\t<h6> &emsp;&emsp;&emsp; - &emsp; Listing all CRs in {$br}  </h6><br>
\t\t\t\t<table class="table  table-hover table-bordered "  style="padding:0px;">
\t\t\t\t<thead>
\t\t\t\t\t<tr> <th class="span1" style="text-align:center;" > Id </th><th style="text-align:center;" class="span3"> Name   </th> {$cls1}
\t\t\t\t\t<th style="text-align:center;" class="span1"> Gender  </th>  <th class="span1" style="text-align:center;"> Contact No </th> </tr>
\t\t\t\t</thead>
\t\t\t\t<tbody>
a;
            while ($row = mysql_fetch_array($res)) {
                $gender = $row['Gender'];
                $d = $dict[$gender . '1'];
                $id = $row['Id'];
                $contact = $row['PhoneNo'];
                $cls = $p == 'all' ? '<td style="text-align:center;">' . $globalbranch . " " . $row['Class'] . '</td>' : "";
                $name = ucwords(strtolower($row['Name']));
                echo <<<a
\t\t\t\t\t
\t\t\t<tr >  
\t\t\t<td style="text-align:center;" > {$id} </td> 
\t\t\t<td > {$name} </td>
\t\t\t{$cls}
\t\t\t<td style="text-align:center;"> {$d}  </td> 
\t\t\t<td style="text-align:center;" class="text-success"><b> {$contact} </b> </td>  
\t\t\t</tr>
a;
            }
            echo <<<a
\t\t\t\t</tbody>
\t\t\t   </table>
\t\t\t</div>\t
\t\t\t</div>
\t\t\t<div class='span3'>
a;
            go_home();
            echo '<ul class="nav nav nav-tabs nav-stacked"> <li><a href=\'?all\'>All CRs &nbsp; <i class="icon-chevron-right pull-left" style="padding-top:5px;"></i></a> </li></ul>';
            cr_classes($classno, $globalbranch);
            echo "</div></div></div>";
            display_footer();
            echo "\n</body>\n</html>";
        } else {
            echo "<script type='text/javascript'>document.location.href='404.php';</script>";
        }
    }
}
开发者ID:0xc0d3r,项目名称:Attendance-Portal,代码行数:89,代码来源:browsecrs.php


示例11: event_browse_bs_valid

/**
 * Validate current browse options against available events and build nav markup string & event browse results object. If invalid redirect to browse default (current week/month - depeneding on default settings).
 * @since 2.1.0
 * @version 2.2.1
 * @param integer $sort_featured Sort featured events first before all other events occuring on each day. 0 = List events chronologically regardless of featured status, 1 = List featured events first. (Default: 1)
 * @param string $nav_function [optional] Browse Navigation function to use. (Default: event_browse_bs_nav)
 * @return void 
 */
function event_browse_bs_valid($sort_featured = 1, $nav_function = 'event_browse_bs_nav')
{
    global $lID, $hc_cfg, $hc_lang_event, $favQ1, $favQ2, $resultEB, $mybsNav;
    $location = $lQuery = '';
    if ($lID > 0) {
        $location = '&amp;lID=' . $lID;
        $lQuery = " AND e.LocID = '" . $lID . "'";
    }
    if (isset($_GET['m']) || $_SESSION['BrowseType'] == 2) {
        $sqlStart = $sqlEnd = strtotime(HCDATE);
        $startDate = $endDate = strtotime(HCDATE);
        $window = 0;
    } else {
        if ($_SESSION['BrowseType'] == 1) {
            $window = (date("t", strtotime(HCDATE)) - 1) * 86400;
            $remove = $hc_cfg[48] == 0 ? (date("j", strtotime(HCDATE)) - 1) * 86400 : 0;
        } else {
            $window = 6 * 86400;
            $remove = $hc_cfg[48] == 0 ? (date("w", strtotime(HCDATE)) - 1) * 86400 : 0;
        }
        $startDate = strtotime(HCDATE) - $remove;
        $endDate = $sqlEnd = $startDate + $window;
        $sqlStart = HCDATE != SYSDATE ? $startDate : strtotime(SYSDATE);
    }
    if ($endDate < $hc_cfg['First'] && $startDate != $hc_cfg['First']) {
        go_home();
    } else {
        $mybsNav = call_user_func($nav_function, $startDate, $endDate, $window, $location);
        $resultEB = doQuery("SELECT DISTINCT e.PkID, e.Title, e.StartDate, e.StartTime, e.EndTime, e.TBD, e.Image, e.IsFeature, e.HideDays, \r\n\t\t\t\t\t\t\t\te.LocID, e.LocationName, e.LocationCity, e.LocationState, e.LocCountry,\r\n\t\t\t\t\t\t\t\tl.Name, l.City, l.State, l.Country, e.Cost, e.SeriesID, e.Description\r\n\t\t\t\t\t\t\tFROM " . HC_TblPrefix . "events e\r\n\t\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "eventcategories ec ON (ec.EventID = e.PkID)\r\n\t\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "locations l ON (e.LocID = l.PkID)\r\n\t\t\t\t\t\t\tWHERE e.StartDate BETWEEN '" . date("Y-m-d", $sqlStart) . "' AND '" . date("Y-m-d", $sqlEnd) . "'" . $lQuery . $favQ1 . $favQ2 . " AND e.IsActive = 1 AND e.IsApproved = 1\r\n\t\t\t\t\t\t\tGROUP BY e.PkID, e.Title, e.StartDate, e.StartTime, e.EndTime, e.TBD, e.Image, e.IsFeature, e.HideDays, e.LocID, e.LocationName, e.LocationCity, e.LocationState, e.LocCountry, l.Name, l.City, l.State, l.Country, e.Cost, e.SeriesID\r\n\t\t\t\t\t\t\tORDER BY e.StartDate, " . ($sort_featured == 1 ? "e.IsFeature DESC, " : "") . "e.TBD, e.StartTime, e.Title");
    }
}
开发者ID:pvidali,项目名称:BCSR-1,代码行数:39,代码来源:bootstrap.php


示例12: get_question_content

function get_question_content($examID, $examName, $examCat, $questionID, $questionName, $questionType)
{
    $answers = get_answers($questionID, $questionType);
    $html = "<input type='hidden' id='exam_name' value='{$examName}' />";
    $html .= "<input type='hidden' id='exam_cat' value='{$examCat}' />";
    $html .= "<input type='hidden' id='exam_id' value='{$examID}' />";
    $html .= "<input type='hidden' id='question_id' value='{$questionID}' />";
    $html .= "<input id='old_question' type='text' autocomplete='off' placeholder='What is the question?' size='100' maxlength='200' value='{$questionName}'/>";
    switch ($questionType) {
        case 'single_answers':
            $html .= "<h4>The Answer</h4>\n";
            $html .= "<input type='text' maxlength='100' placeholder='What is the answer?' autocomplete='off' id='single_answer_text' value='{$answers[0][0]}'>\n";
            $html .= "<script>var selected = 'single';</script>";
            break;
        case 'mult_answers':
            $html .= "<h4>The Answers</h4>";
            $limit = count($answers);
            for ($i = 0; $i < 10; $i++) {
                $value = "";
                $checked = "";
                if ($i < $limit) {
                    $value = $answers[$i][0];
                    if ($answers[$i][2] == 'true') {
                        $checked = "checked";
                    }
                }
                $html .= "<input type='checkbox' name='mult_answer[]' value='{$i}' {$checked}>\t<input type='text' maxlength='100' autocomplete='off' name='mult_answer_text[]' class='mult_answer_text' value=\"{$value}\"><br /><br />\n";
            }
            $html .= "<script>var selected = 'multiple';</script>";
            break;
        case 'keyword_answers':
            $html .= "<h4>The Keywords</h4>";
            $limit = count($answers);
            for ($i = 0; $i < 10; $i++) {
                $value = "";
                if ($i < $limit) {
                    $value = $answers[$i][0];
                }
                $html .= "<input type='text' value='{$value}' maxlength='100' autocomplete='off' name='keyword_text[]' class='keyword_text'><br /><br />\n";
            }
            $html .= "<script>var selected = 'written';</script>";
            break;
        default:
            go_home();
            // prevent users accesses an invalid category
    }
    $html .= "<br /><button id='edit_question_button'>edit Question</button>\n";
    return $html;
}
开发者ID:alexanderpugh,项目名称:exam-simulator,代码行数:49,代码来源:templates.php


示例13: changecr


//.........这里部分代码省略.........
\t\t\t\t\t\t<div id="error" style="display:none;"></div>
\t\t\t\t\t\t<div class='row'>
\t\t\t\t\t\t\t<div class='span9'>
\t\t\t\t\t\t\t\t<div class="well well-large" style="background:#FFF;height:450px;">
a;
                if (isset($_POST["Generate"])) {
                    $id = addslashes($_POST['IdNo']);
                    $key = addslashes($_POST['Key']);
                    $Skey = addslashes($_POST['Skey']);
                    $dbname = $branchyear . '_Users';
                    $table = $branchyear . '_Students';
                    //if(!mysql_select_db($dbname)) die(mysql_error());
                    $userid1 = $_SESSION['UserId'];
                    $userid = $id;
                    $q = "select Name,Branch,Class,Gender from {$table} where Id = '{$userid}'";
                    $res = mysql_query($q) or die(mysql_error());
                    $row = mysql_fetch_array($res);
                    $name = ucwords(strtolower($row['Name']));
                    $branch = $row['Branch'];
                    $class2 = $row['Class'];
                    $dbname = $branchyear . '_Users';
                    $table = $branchyear . '_CRs';
                    //if(!mysql_select_db($dbname)) die(mysql_error());
                    $q = "select Id,`Key` from {$table} where Id = '{$userid1}'";
                    $res = mysql_query($q) or die(mysql_error());
                    $row = mysql_fetch_array($res);
                    $key1 = $row['Key'];
                    if ($key1 != $Skey) {
                        echo "<script>show_error('<b>Error </b> : CR Security Key does not matched.  Please try again.. ');</script>";
                    } else {
                        if ($class2 == $class) {
                            $dbname = $branchyear . '_Logs';
                            $table = $branchyear . '_Passwords';
                            //if(!mysql_select_db($dbname)) die(mysql_error());
                            $q = "select `EndTime`, `Code` from `{$table}` where `To` = '{$userid}';";
                            $res = mysql_query($q) or die(mysql_error());
                            $n = mysql_num_rows($res);
                            $StartTime = date('d-m-Y H:i:s');
                            $end = "";
                            $dif = 0;
                            $code = "";
                            while ($row = mysql_fetch_array($res)) {
                                $end = $row['EndTime'];
                                $dif = strtotime($end) - strtotime($StartTime);
                                $code = $row['Code'];
                            }
                            if ($dif <= 7200 && $dif > 0 && $n) {
                                echo "<script>show_error('<b>Error </b> : <b>{$userid}</b> is already assigned <b class=\\'text-success\\'>{$code}</b> till <b class=\\'text-success\\'>{$end}</b> ');</script>";
                            } else {
                                $EndTime = date('d-m-Y H:i:s', mktime(date('H') + 2));
                                $ip = $_SERVER['REMOTE_ADDR'];
                                $q1 = mysql_query("insert into {$table} ( `To`, `Code`, `CreatedBy`, `StartTime`,`EndTime`, `Status`,`IP` ) values ( '{$id}', '{$key}' , '{$userid1}', '{$StartTime}', '{$EndTime}', 'valid','{$ip}');") or die(mysql_error());
                                insert_log($_SESSION['UserId'] . "created security key for {$id} ");
                                echo "<script>show_success('To change password of {$id}  use the security pin <u class=\\'text-error\\'>{$key}</u> valid up to <u class=\\'text-error\\'>{$EndTime}</u>  ');</script>";
                            }
                        } else {
                            echo "<script>show_error('<b>Error </b> : <b>{$userid}</b> is not from the <b>{$branch} {$class} </b>  Please try again.. ');</script>";
                        }
                    }
                }
                echo <<<a
\t\t\t\t\t\t<div id="step1">    
\t\t\t\t\t\t\t<h4>Security Codes @ {$branch} {$class} </h4>
\t\t\t\t\t\t\t<h6> &emsp;&emsp;&emsp;&emsp; Provide  requesting Student  Id </h6>
\t\t\t\t\t\t   
\t\t\t\t\t\t\t<form action="?{$p}" method="POST" onsubmit="return check_id();"  id="password">
\t\t\t\t\t\t\t<br>
\t\t\t\t\t\t\t<h5>Student ID No : </h5>
\t\t\t\t\t\t\t<input type="text" class="input-large" placeholder="N090001"  id="Idno" name="IdNo" maxlength="7" /><br>
\t\t\t\t\t\t\t<h5>Your Security Key : </h5>
\t\t\t\t\t\t\t<input type="text" class="input-large" placeholder="Security Key"  id="Skey" name="Skey" maxlength="9" /><br>
\t\t\t\t\t\t\t<!--<h5>Security Key : </h5>-->
\t\t\t\t\t\t\t<input type="hidden" class="input-large" readonly=readonly name="Key" value="{$crkey}" >
\t\t\t\t\t\t\t<br><input type="submit" class="btn btn-primary" name="Generate" value = "Continue &rarr;" />
\t\t\t\t\t\t\t</form>\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t\t<div class='span3'>
a;
                go_home();
                sidepanel();
                echo <<<a
\t\t\t</div>
\t\t\t</div>
\t\t\t
\t\t\t</div>
\t\t\t</div>
\t\t\t
a;
                echo "</div></div>";
                display_footer();
                echo "\n</body>\n</html>";
            }
        } else {
            echo "<script type='text/javascript'>document.location.href='404.php';</script>";
        }
    }
}
开发者ID:0xc0d3r,项目名称:Attendance-Portal,代码行数:101,代码来源:password.php


示例14: homepage


//.........这里部分代码省略.........
                }
            }
            /* End of Period Wise Attendance*/
            /* SUbjects Wise Attendance */
            if (strtolower($mode) == "sub") {
                //mysql_select_db($branchyear."_Subjects") or die(mysql_error());
                $query = mysql_query("Select * from " . $branch . $class . "_Subjects where RNo='{$RNo}';") or die(mysql_error());
                $subjectwise = mysql_fetch_array($query) or die(mysql_error());
                $tr = '';
                $strXML = "<graph caption='Subject Wise Attendance Report' formatNumberScale='1' rotateValues='1' decimalPrecision='1' numberSuffix='%' xAxisName='Subjects' yAxisName='Performance'>";
                $datasetp = '';
                $nc_cls = 0;
                for ($i = 0; $i < count($allowed_subjects); $i++) {
                    $tnoc = $subjectwise[$allowed_subjects[$i] . "_P"] + $subjectwise[$allowed_subjects[$i] . "_A"];
                    if ($tnoc == 0) {
                        $nc_cls++;
                        $performance = "N/A  ";
                        $st = "error";
                        $remarks = "CNYS";
                    } else {
                        $per 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP go_return_options函数代码示例发布时间:2022-05-15
下一篇:
PHP goURL函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap