Exemple #1
0
 $bold = "normal";
 if ($inf["active"] == "yes") {
     $bold = "bold";
 }
 //link color for number of votes
 $votescolor = linkcolor($inf["COUNT(memberID)"]);
 //ending date color for inactive polls
 if ($inf["endDate"] == "0") {
     $endDate = "<span style=\"color:green\">" . $language["POLL_STILL_ACTIVE"] . "</span>";
 } else {
     $endDate = "<span style=\"color:red\">" . get_date_time($inf["endDate"]) . "</span>";
 }
 //find out how long a poll has been active
 if ($inf["endDate"] >= "1") {
     $lasted = $inf["endDate"] - $inf["startDate"];
     $duration = DateFormat($lasted);
 } else {
     $duration = "<span style=\"color:green\">" . $language["POLL_STILL_ACTIVE"] . "</span>";
 }
 //color for poll state (active or not)
 if ($inf["active"] == "yes") {
     $active = "<span style=\"color:#009900\">" . $language["YES"] . "</span>";
 } else {
     $active = "<span style=\"color:orange\">" . $language["NO"] . "</span>";
 }
 //votes per day
 $elapseddays = max(1, round((time() - $inf["startDate"]) / 86400));
 $votes_per_day = number_format(round($inf["COUNT(memberID)"] / $elapseddays, 2), 2);
 //link for votes page
 if ($inf["COUNT(memberID)"] == "0") {
     $vote = "<span style=\"color:" . linkcolor($inf["COUNT(memberID)"]) . "\">" . $inf["COUNT(memberID)"] . "</span>";
 function view_logs($user, $start = 0, $limit = 10)
 {
     //GRAB AND STORE USER MODULE ID
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_modules WHERE name = 'class_users'";
     $results = $this->db->DB_Q_C($sql);
     $row = mysql_fetch_array($results);
     $user_mod_id = $row[0];
     //GRAB PERMISSIONS FOR THE USER - A USER CAN ONLY SEE ACCESS LOGS THAT THEY HAVE PERMISSION TOO SEE
     $mods .= "(";
     for ($i = 0; $i < count($user->user_perms); $i++) {
         if ($user->user_perms[$i][0] == 1) {
             $tmp_var = $i + 1;
             $mods .= "module_id = {$tmp_var} OR ";
         }
     }
     $mods = substr($mods, 0, strlen($mods) - 4);
     $mods .= ")";
     $sql = "SELECT * FROM \r\r\n                  " . $this->config->db_prefix . "_logs, \r\r\n                  " . $this->config->db_prefix . "_object, \r\r\n                  " . $this->config->db_prefix . "_user \r\r\n              WHERE\r\r\n                  " . $this->config->db_prefix . "_logs.object_id =  " . $this->config->db_prefix . "_object.id AND\r\r\n                  " . $this->config->db_prefix . "_logs.user_id =  " . $this->config->db_prefix . "_user.id AND {$mods}\r\r\n              ORDER BY " . $this->config->db_prefix . "_logs.id DESC LIMIT {$start}, {$limit}";
     $results = $this->db->DB_Q_C($sql);
     $count = mysql_affected_rows();
     //COUNT ALL THE RECORDS IN THE SYSTEM
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_logs, " . $this->config->db_prefix . "_object, " . $this->config->db_prefix . "_user WHERE\r\r\n                " . $this->config->db_prefix . "_logs.object_id =  " . $this->config->db_prefix . "_object.id AND\r\r\n                " . $this->config->db_prefix . "_logs.user_id =  " . $this->config->db_prefix . "_user.id AND {$mods}\r\r\n                    ORDER BY " . $this->config->db_prefix . "_logs.id DESC";
     $results2 = $this->db->DB_Q_C($sql);
     $total = mysql_affected_rows();
     //
     print "<div id='records'><div id='content'>";
     print "<table cellpadding='0' cellspacing='0'>";
     print "<tr><th class='record_head'>Access Logs</th></tr>";
     if ($count > 0) {
         if ($total > $count) {
             $name = array("pid", "cid");
             $data = array($_REQUEST['pid'], $_REQUEST['cid']);
             print "<tr><th colspan='3' class='record_footer'>";
             pageNav($start, $limit, $total, $name, $data);
             print "</th></tr>";
         }
         print "<tr><th>User</th><th>Action</th></tr>";
         while ($row = mysql_fetch_array($results)) {
             //GET AND CONVERT DATE ACCORDINGLY
             $tmp_date = $this->time->convertTime($user->user_timezone, $row['create_date']);
             $create_date = DateFormat($tmp_date, $this->config->date_format);
             if ($striper) {
                 $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\"";
             } else {
                 $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\"";
             }
             $striper = !$striper;
             //DETERMINE THE ACTION
             $sql = "SELECT * FROM " . $this->config->db_prefix . "_modules WHERE id = " . $row['module_id'];
             $results2 = $this->db->DB_Q_C($sql);
             $row2 = mysql_fetch_array($results2);
             //
             //if($user->user_perms[$row2[0]-1][0]=='1'){
             $module = new $row2['name']($this->db, $this->config, $this->time);
             //}
             //if($user->user_perms[$mod_id]==1){
             print "<tr {$effect}>\r\r\n                      <td><a class='toolTipElement' title='View::View details about this user.' href='?pid={$user_mod_id}&cid=2&theid=" . $row['user_id'] . "'>" . $row['username'] . "</a></td>\r\r\n                      <td>" . $module->display_log($row['action'], $row['sub_module_id'], $create_date, $row['record_id']) . "</td>\r\r\n                      </tr>";
             //}
         }
         if ($total > $count) {
             print "<tr><th align='right' colspan='3' class='record_footer'>";
             $name = array("pid", "cid");
             $data = array($_REQUEST['pid'], $_REQUEST['cid']);
             pageNav($start, $limit, $total, $name, $data);
             print "</th></tr>";
             print "<tr><th colspan='3' class='record_footer'>";
             print "Showing {$count} out of a total of <b>{$total}</b> records in the system</th></tr>";
         } else {
             if ($count > 1) {
                 print "<tr><th colspan='3' class='record_footer'>There are a total of <b>{$total}</b> records in the system</th></tr>";
             } else {
                 print "<tr><th colspan='3' class='record_footer'>There is <b>{$total}</b> record in the system</th></tr>";
             }
         }
     } else {
         print "<tr><td>There are no records in the system.</td></tr>";
     }
     print "</table>";
     print "</div></div>";
 }
    }
    if ($row_back['Duration']) {
        ?>
                            <div class="show_divider special_font"><span class="font_small">Duration:</span> <?php 
        echo formatduration($row_back['Duration']);
        ?>
</div>
                        <?php 
    }
    ?>
                        

                        <div class="about_show_timer_box">
                            <div class="font_header show_divider"> Showtime </div>
                            <div class="show_divider font_content about_show_timer_box_timing"> <?php 
    echo DateFormat($row_back['AiringDateTime']);
    ?>
                            
                            
                            </div>
                        </div>                       
                    </div>
                </div>
                <?php 
}
?>
        </div>
        <script>
		$(function() {
			$("#alert-me").submit(function() {
				var datastrg = $( "#alert-me" ).serialize();
        }
        print "</select>\r            </td></tr>";
        //SUBMIT
        print "<tr><th colspan='2' align='right'>\r                <input type='submit' name='submitok' value='Save Article' onclick=\"clicked='submitok'\"/>\r                <input type='submit' name='submitexitok' value='Save Article & Exit'  onclick=\"clicked='submitexitok'\"/></th></tr>\r              </table>\r              </form>\r              </div></div>\r                <script>new FormValidator ('create_news', {\r                  onFormValidate: function(pass, form){ \r                    if(pass==true){\r                      form.submitok.disabled=true;\r                      form.submitexitok.disabled=true;\r                    }\r                  }\r                });</script>";
    }
    /******************************************************************************************
		about
		******************************************************************************************/
    function about()
    {
        print "<div id='forms'><div id='content'>";
        print "<h1>News FAQ (Frequently Asked Questions)</h1>";
        print "<div id='about'>";
        print "<ul>";
        print "<li><a href='#1'>Should I enter a summary with my article?</a></li>";
        print "<li><a href='#2'>What is the publishing status of an article all about?</a></li>";
        print "<li><a href='#3'>How does the category of a news article effect the article?</a></li>";
        print "<li><a href='#4'>What does an RSS Feed have to do with anything?</a></li>";
        print "<li><a href='#5'>What is a category?</a></li>";
        print "<li><a href='#6'>What does an RSS Feed have to do with anything?</a></li>";
        print "<li><a href='#7'>Why can't I delete the general category?</a></li>";
        print "<hr noshade='noshade' />";
        //
        print "<a name='1'></a><li>Should I enter a summary with my article?";
        print "<p>The summary field is optional though if you leave it blank a summary will be automatically generated from the\r            content you entered in the body field. All auto-generated summaries will have images and any other sort of formatting\r            removed, so if you want to create a summary with certain formatting and images enter it yourself.</p>\r            <p>Your rss feed automatically will use the summary field as the content that is displayed in the feed. For more information\r            about that subject please look at the category section of the site</p>";
 function view_content($user, $theid)
 {
     //SET THE DIRECTORY
     if (!isset($_REQUEST['dir'])) {
         $directory = "../../../../../../../" . $this->config->file_dir . "/";
     } else {
         $directory = "../../../../../../../" . $this->config->file_dir . "/" . $_REQUEST['dir'];
     }
     //TRIM OFF OUR ../ OFF OF OUR DIRECTORY
     $tmp = substr($directory, 21);
     $dir_pos = explode("/", $tmp);
     //GRAB THE DATA FOR THIS RECORD FROM THE DATABASE
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_files  WHERE\r\r\n                  " . $this->config->db_prefix . "_files.id = {$theid}\r\r\n                  LIMIT 1";
     $result = $this->db->DB_Q_C($sql);
     $row = mysql_fetch_array($result);
     print "<div id='forms'><div id='content'>";
     print "<table cellpadding='0' cellspacing='0' width='100%'>";
     print "<tr><th colspan='2' class='record_head'>";
     //DISPLAY OUR DIRECTOY LINKS
     $add = "";
     for ($i = 0; $i < count($dir_pos) - 1; $i++) {
         //SPECIAL FOR OUR FIRST, DOESNT NEED ANY DIR VAR
         if ($i == 0) {
             print "<a href='?pid=" . $this->id . "'>" . $dir_pos[$i] . "</a><b>&raquo;</b>";
         } else {
             print "<a href='?pid=" . $this->id . "&amp;dir={$add}" . $dir_pos[$i] . "/'>" . $dir_pos[$i] . "</a><b>&raquo;</b>";
             $add .= $dir_pos[$i] . "/";
         }
     }
     print $row['name'] . "</th></tr>";
     print "<tr><td colspan='2'>View the details of this file below or <a href='" . $row['location'] . $row['sys_name'] . "'>view the file by clicking here.</a></td></tr>";
     //DISPLAY THUMBNAIL IF IT IS AN IMAGE
     $ext = $row['extension'];
     if ($ext == "gif" || $ext == "jpg" || $ext == "jpeg" || $ext == "png" || $ext == "wbmp") {
         $num = strlen($row['location']);
         if (substr($row['location'], $num - 7, $num) == "thumbs/") {
             print "<tr><td colspan='2'><a href='" . $row['location'] . "" . $row['sys_name'] . "' target='_blank'>";
             print "<img src='" . $row['location'] . $row['sys_name'] . "' alt=" . $row['name'] . " border='0' />";
             print "</a></td></tr>";
         } else {
             print "<tr><td colspan='2'><a href='" . $row['location'] . "" . $row['sys_name'] . "' target='_blank'>";
             print "<img src='" . $row['location'] . "thumbs/" . $row['sys_name'] . "' alt=" . $row['name'] . " border='0' />";
             print "</a></td></tr>";
         }
     }
     //
     print "<tr><th>Name</th><td>" . $row['name'] . "</td></tr>";
     print "<tr><th>System Name</th><td>" . $row['sys_name'] . "</td></tr>";
     print "<tr><th>Location</th><td>" . $row['location'] . "</td></tr>";
     print "<tr><th>Note</th><td>" . $row['note'] . "</td></tr>";
     print "</table>";
     //DISPLAY THE HISTORY OF THIS RECORD
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_logs, " . $this->config->db_prefix . "_object, " . $this->config->db_prefix . "_user WHERE\r\r\n                " . $this->config->db_prefix . "_logs.record_id = {$theid} AND \r\r\n                " . $this->config->db_prefix . "_logs.module_id = " . $this->id . " AND\r\r\n                " . $this->config->db_prefix . "_logs.sub_module_id = 1 AND\r\r\n                " . $this->config->db_prefix . "_logs.object_id =  " . $this->config->db_prefix . "_object.id AND\r\r\n                " . $this->config->db_prefix . "_logs.user_id =  " . $this->config->db_prefix . "_user.id\r\r\n                    ORDER BY " . $this->config->db_prefix . "_logs.id DESC";
     $result2 = $this->db->DB_Q_C($sql);
     print "<div id='records'><div id='content'>";
     print "<table cellpadding='0' cellspacing='0'>";
     print "<tr><th class='record_head'>Article History</th></tr>";
     print "<tr><th>action</th></tr>";
     while ($row2 = mysql_fetch_array($result2)) {
         if ($striper) {
             $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\"";
         } else {
             $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\"";
         }
         $striper = !$striper;
         //GET AND CONVERT DATE ACCORDINGLY
         $tmp_date = $this->time->convertTime($user->user_timezone, $row2['create_date']);
         $create_date = DateFormat($tmp_date, $this->config->date_format);
         if ($row2['action'] == 1) {
             //CREATE
             print "<tr {$effect}><td colspan='2'>\r\r\n                      This file was created by <b>" . $row2['username'] . "</b> on {$create_date}.\r\r\n                  </td></tr>";
         } else {
             if ($row2['action'] == 2) {
                 //EDIT
                 print "<tr {$effect}><td colspan='2'>\r\r\n                      This file was edited by <b>" . $row2['username'] . "</b> on {$create_date}.\r\r\n                  </td></tr>";
             } else {
                 if ($row2['action'] == 4) {
                     //PUBLISHED
                     print "<tr {$effect}><td colspan='2'>\r\r\n                      This file was published by <b>" . $row2['username'] . "</b> on {$create_date}.\r\r\n                  </td></tr>";
                 }
             }
         }
     }
     print "</table></div></div>";
     print "</div></div>";
 }
$to_time = date('Y-m-d H:i:s', strtotime($from_time . "+ 10 minute"));
$sql = "SELECT id,name,email,movie_id,sending_time,alert_hour FROM alertme WHERE alert = '1' AND sending_time BETWEEN '{$from_time}' AND '{$to_time}'";
$res = mysql_query($sql);
while ($row = mysql_fetch_array($res)) {
    $alertid = $row['id'];
    $movie_id = $row['movie_id'];
    $name = $row['name'];
    $email = $row['email'];
    $hour = $row['alert_hour'];
    $sending_time = $row['sending_time'];
    //select movie details
    $sql_alert = "SELECT * FROM b_movies WHERE MovieID = '{$movie_id}' AND Status = '1'";
    $res_movie_alert = mysql_query($sql_alert);
    if (mysql_num_rows($res_movie_alert) > 0) {
        $row_movie_alert = mysql_fetch_array($res_movie_alert);
        $ariving_time = DateFormat($row_movie_alert['AiringDateTime']);
        //sending email
        $headers = "From: HBO India <*****@*****.**>";
        $headers = $headers . "\r\n";
        $headers = $headers . 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $to = "{$email}";
        $subject = "Movie Alert!";
        $body = ' <html>
		 <body>
		 <table width="80%" border="0" align="center" cellpadding="2" cellspacing="2" >

         <tr valign="top" class="text">
             <td valign="middle">Hello ' . $name . '</td>         
          </tr>

                  
 function view($user, $ret_code = 0, $start = 0, $limit = 10)
 {
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_user\r\r\n                    ORDER BY id DESC LIMIT {$start}, {$limit}";
     $results = $this->db->DB_Q_C($sql);
     $count = mysql_affected_rows();
     //COUNT ALL THE RECORDS IN THE SYSTEM
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_user\r\r\n                    ORDER BY id DESC";
     $results2 = $this->db->DB_Q_C($sql);
     $total = mysql_affected_rows();
     //
     print "<div id='records'><div id='content'>";
     if ($ret_code == 0) {
     } else {
         if ($ret_code == 1) {
             print "<table width='100%'>\r\r\n        <tr><th class='notice_record_head'>The user has been saved.</th></tr>\r\r\n        </table>";
         } else {
             if ($ret_code == 2) {
                 print "<table width='100%'>\r\r\n        <tr><th class='notice_record_head'>The user has been deleted.</th></tr>\r\r\n        </table>";
             } else {
                 if ($ret_code == -2) {
                     print "<table width='100%'>\r\r\n        <tr><th class='notice_record_head'>The user has not been deleted.</th></tr>\r\r\n        </table>";
                 }
             }
         }
     }
     print "<table cellpadding='0' cellspacing='0'>";
     print "<tr><th colspan='6' class='record_head'>Site Users</th></tr>";
     if ($count > 0) {
         print "<tr><th>User Name</th><th>Last Login</th><th colspan='3'>Options</th></tr>";
         while ($row = mysql_fetch_array($results)) {
             //GET AND CONVERT DATE ACCORDINGLY
             $tmp_date = $this->time->convertTime($user->user_timezone, $row['last_log']);
             $last_log = DateFormat($tmp_date, $this->config->date_format);
             if ($striper) {
                 $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\"";
             } else {
                 $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\"";
             }
             $striper = !$striper;
             print "<tr {$effect}>\r\r\n                    <td>" . $row['username'] . "</td>\r\r\n                    <td>" . $last_log . "</td>\r\r\n                    <td width='23'><a class='toolTipElement' title='User Details::View details about this user.' href='?pid=" . $this->id . "&amp;cid=2&amp;theid=" . $row[0] . "'><img src='images/preview.png' border='0' alt='view' /></a></td>";
             if ($user->user_perms[$this->id - 1][2] == 1) {
                 //ONLY THE ADMIN USER AND THIS USER CAN EDIT
                 if ($user->user_id == 1 || $row[0] == $user->user_id) {
                     print "<td width='23'><a class='toolTipElement' title='Edit User::Edit this user.' href='?pid=" . $this->id . "&amp;cid=3&amp;theid=" . $row[0] . "'><img src='images/edit.png' border='0' alt='edit' /></a></td>";
                 } else {
                     print "<td width='23'><img src='images/edit_disabled.png' border='0' alt='' /></td>";
                 }
             } else {
                 print "<td width='23'><img src='images/edit_disabled.png' border='0' alt='' /></td>";
             }
             if ($user->user_perms[$this->id - 1][3] == 1) {
                 //ONLY THE ADMIN USER CAN DELETE
                 if ($user->user_id == 1) {
                     print "<td width='23'><a class='toolTipElement' title='Delete User::Delete this user from the system.' href='?pid=" . $this->id . "&amp;cid=4&amp;theid=" . $row[0] . "'><img src='images/delete.png' border='0' alt='delete' /></a></td>";
                 } else {
                     print "<td width='23'><img src='images/delete_disabled.png' border='0' alt='' /></td>";
                 }
             } else {
                 print "<td width='23'><img src='images/delete_disabled.png' border='0' alt='' /></td>";
             }
             print "</tr>";
         }
         if ($total > $count) {
             $name = array("pid", "cid");
             $data = array($_REQUEST['pid'], $_REQUEST['cid']);
             pageNav($start, $limit, $total, $name, $data);
             print "<tr><th colspan='5' class='record_footer'>";
             print "Showing {$count} out of a total of <b>{$total}</b> records in the system</th></tr>";
         } else {
             if ($count > 1) {
                 print "<tr><th colspan='7' class='record_footer'>There are a total of <b>{$total}</b> records in the system</th></tr>";
             } else {
                 print "<tr><th colspan='7' class='record_footer'>There is <b>{$total}</b> record in the system</th></tr>";
             }
         }
     } else {
         print "<tr><td>There are no users in the system.</td></tr>";
     }
     print "</table>";
     print "</div></div>";
 }
 function view($user, $ret_code = 0, $start = 0, $limit = 10)
 {
     print "<div id='records'><div id='content'>";
     /******************************************************************************************
      		EXPIRED EVENTS
      		******************************************************************************************/
     print "<table cellpadding='0' cellspacing='0'>\r\r\n          <tr><th colspan='5' class='record_head'>Expired Events</th></tr>";
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_events \r\r\n                  WHERE\r\r\n                    " . $this->config->db_prefix . "_events.id NOT IN\r\r\n                    (\r\r\n                      SELECT event_id \r\r\n                      FROM " . $this->config->db_prefix . "_events_data \r\r\n                      WHERE \r\r\n                        event_date >= '" . date('Y-m-d') . "'\r\r\n                    ) \r\r\n                  ORDER BY (\r\r\n                              SELECT event_date \r\r\n                              FROM " . $this->config->db_prefix . "_events_data \r\r\n                              WHERE \r\r\n                                event_id = " . $this->config->db_prefix . "_events.id\r\r\n                              ORDER BY event_date DESC LIMIT 1 \r\r\n                            ) ASC";
     $results = $this->db->DB_Q_C($sql);
     $count = mysql_affected_rows();
     //COUNT ALL THE RECORDS IN THE SYSTEM
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_events \r\r\n                  WHERE\r\r\n                    " . $this->config->db_prefix . "_events.id NOT IN\r\r\n                    (\r\r\n                      SELECT event_id \r\r\n                      FROM " . $this->config->db_prefix . "_events_data \r\r\n                      WHERE \r\r\n                        event_date >= '" . date('Y-m-d') . "'\r\r\n                    ) \r\r\n                  ORDER BY (\r\r\n                              SELECT event_date \r\r\n                              FROM " . $this->config->db_prefix . "_events_data \r\r\n                              WHERE \r\r\n                                event_id = " . $this->config->db_prefix . "_events.id\r\r\n                              ORDER BY event_date DESC LIMIT 1 \r\r\n                            ) ASC\r\r\n                  LIMIT {$start}, {$limit}";
     $results2 = $this->db->DB_Q_C($sql);
     $total = mysql_affected_rows();
     if ($count > 0) {
         print "<tr><th>Title</th><th colspan='3'>Options</th></tr>";
         while ($row = mysql_fetch_array($results)) {
             if ($striper) {
                 $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\"";
             } else {
                 $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\"";
             }
             $striper = !$striper;
             print "<tr {$effect}>\r\r\n                    <td>" . stripslashes($row['title']) . "</td>\r\r\n                    <td width='23'><a class='toolTipElement' title='View Details::View details about the event.' href='?pid=" . $this->id . "&amp;cid=2&amp;theid=" . $row[0] . "'><img src='images/preview.png' border='0' alt='view' /></a></td>";
             //
             if ($user->user_perms[$this->id - 1][2] == 1) {
                 print "<td width='23'><a class='toolTipElement' title='Edit Events::Edit this event.' href='?pid=" . $this->id . "&amp;cid=3&amp;theid=" . $row[0] . "'><img src='images/edit.png' border='0' alt='' /></a></td>";
             } else {
                 print "<td width='23'><img src='images/edit_disabled.png' border='0' alt='' /></td>";
             }
             //
             if ($user->user_perms[$this->id - 1][3] == 1) {
                 print "<td width='23'><a class='toolTipElement' title='Delete Events::Delete this event from the system.' href='?pid=" . $this->id . "&amp;cid=4&amp;theid=" . $row[0] . "'><img src='images/delete.png' border='0' alt='' /></a></td>";
             } else {
                 print "<td width='23'><img src='images/delete_disabled.png' border='0' alt='' /></td>";
             }
             print "</tr>";
         }
         if ($count > 1) {
             print "<tr><th colspan='5' class='record_footer'>There are a total of <b>{$total}</b> records in the system</th></tr>";
         } else {
             print "<tr><th colspan='5' class='record_footer'>There is <b>{$total}</b> record in the system</th></tr>";
         }
     } else {
         print "<tr><td colspan='5'>There are no expired events in the system.</td></tr>";
     }
     print "</table>";
     /******************************************************************************************
      		ACTIVE/UPCOMING EVENTS
      		******************************************************************************************/
     print "<table cellpadding='0' cellspacing='0'>\r\r\n          <tr><th colspan='6' class='record_head'>Active/Upcoming Events</th></tr>";
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_events \r\r\n                  WHERE\r\r\n                    " . $this->config->db_prefix . "_events.id IN\r\r\n                    (\r\r\n                      SELECT event_id \r\r\n                      FROM " . $this->config->db_prefix . "_events_data \r\r\n                      WHERE \r\r\n                        event_date >= '" . date('Y-m-d') . "'\r\r\n                    ) \r\r\n                  ORDER BY (\r\r\n                              SELECT event_date \r\r\n                              FROM " . $this->config->db_prefix . "_events_data \r\r\n                              WHERE \r\r\n                                event_id = " . $this->config->db_prefix . "_events.id\r\r\n                              ORDER BY event_date DESC LIMIT 1 \r\r\n                            ) ASC\r\r\n                  LIMIT {$start}, {$limit}";
     $results = $this->db->DB_Q_C($sql);
     $count = mysql_affected_rows();
     //COUNT ALL THE RECORDS IN THE SYSTEM
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_events \r\r\n                  WHERE\r\r\n                    " . $this->config->db_prefix . "_events.id IN\r\r\n                    (\r\r\n                      SELECT event_id \r\r\n                      FROM " . $this->config->db_prefix . "_events_data \r\r\n                      WHERE \r\r\n                        event_date >= '" . date('Y-m-d') . "'\r\r\n                    ) \r\r\n                  ORDER BY (\r\r\n                              SELECT event_date \r\r\n                              FROM " . $this->config->db_prefix . "_events_data \r\r\n                              WHERE \r\r\n                                event_id = " . $this->config->db_prefix . "_events.id\r\r\n                              ORDER BY event_date DESC LIMIT 1 \r\r\n                            ) ASC\r\r\n                  LIMIT {$start}, {$limit}";
     $results2 = $this->db->DB_Q_C($sql);
     $total = mysql_affected_rows();
     if ($count > 0) {
         print "<tr><th>Title</th><th>Event Date/Times</th><th colspan='3'>Options</th></tr>";
         $check_date = date('Y-m-d');
         while ($row = mysql_fetch_array($results)) {
             if ($striper) {
                 $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\"";
             } else {
                 $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\"";
             }
             $striper = !$striper;
             //COUNT THE NUMBER OF THE EVENT DATES
             //IF MORE THEN ONE DISPLAY EARLIEST TO THE LATEST
             $sql = "SELECT * FROM " . $this->config->db_prefix . "_events_data \r\r\n                            WHERE event_id = " . $row[0] . " \r\r\n                            ORDER BY event_date ASC";
             $results3 = $this->db->DB_Q_C($sql);
             $total_dates = mysql_affected_rows();
             $more_dates = "";
             while ($row3 = mysql_fetch_array($results3)) {
                 $tmp1 = explode(" ", $row3['event_date']);
                 //ADD OUR START DATE'S TIME WITH THE DURATION OF THE EVENT TO GET THE END TIME
                 $tmp_start = explode(":", $tmp1[1]);
                 $tmp_end = explode(":", $row3['duration']);
                 $tmp_min = $tmp_start[1] + $tmp_end[1];
                 $tmp_hour1 = $tmp_start[0] + $tmp_end[0];
                 $tmp_hour = floor($tmp_min / 60) + $tmp_hour1;
                 if ($tmp_hour < 10) {
                     $tmp_hour = "0{$tmp_hour}";
                 }
                 $tmp_min = ($tmp_min / 60 - $tmp_hour_add) * 60;
                 $tmp3 = $tmp_hour . ":" . $tmp_min . ":00";
                 $end_time = $tmp1[0] . " " . $tmp3;
                 //CONVERT OUR DATES FOR DISPLAy
                 if ($user->user_timezone != $row3['tz']) {
                     $tmp_date = $this->time->convertTime($user->user_timezone, $row3['event_date']);
                     $event_date = DateFormat($tmp_date, "l m/d/Y");
                     $time_start = DateFormat($tmp_date, "g:ia");
                     $tmp_date = $this->time->convertTime($user->user_timezone, $end_time);
                     $time_end = DateFormat($tmp_date, "g:ia");
                 } else {
                     $event_date = DateFormat($row3['event_date'], "l m/d/Y");
                     $time_start = DateFormat($row3['event_date'], "g:ia");
                     $time_end = DateFormat($end_time, "g:ia");
                 }
                 //
                 if ($row3['event_date'] >= $check_date) {
                     if ($time_start == $time_end) {
                         $time_str = $time_start;
                     } else {
                         $time_str = "{$time_start} - {$time_end}";
                     }
                     $more_dates .= "<a href='#' class='toolTipElement' title='{$event_date}::{$time_str}'><img src='images/calendar_view_day.png' /></a>";
                 } else {
                     $more_dates .= "<a href='#' class='toolTipElement' title='{$event_date}::This event has expired.'><img src='images/calendar_view_day_expired.png' /></a>";
                 }
                 //$more_dates.= "<a href='#' class='toolTipElement' title='$event_date::$time_start - $time_end'><img src='images/calendar_view_day.png' /></a>";
             }
             //$more_dates.=" - <i>$total_dates</i>";
             print "<tr {$effect}>\r\r\n                    <td>" . stripslashes($row['title']) . "</td>\r\r\n                    <td>{$more_dates}</td>\r\r\n                    <td width='23'><a class='toolTipElement' title='View Details::View details about the event.' href='?pid=" . $this->id . "&amp;cid=2&amp;theid=" . $row[0] . "'><img src='images/preview.png' border='0' alt='view' /></a></td>\r\r\n                    <td width='23'><a class='toolTipElement' title='Edit Events::Edit this event.' href='?pid=" . $this->id . "&amp;cid=3&amp;theid=" . $row[0] . "'><img src='images/edit.png' border='0' alt='' /></a></td>\r\r\n                    <td width='23'><a class='toolTipElement' title='Delete Events::Delete this event from the system.' href='?pid=" . $this->id . "&amp;cid=4&amp;theid=" . $row[0] . "'><img src='images/delete.png' border='0' alt='' /></a></td>\r\r\n                    </tr>";
         }
         if ($total > $count) {
             $name = array("pid", "cid");
             $data = array($_REQUEST['pid'], $_REQUEST['cid']);
             pageNav($start, $limit, $total, $name, $data);
             print "<tr><th colspan='5' class='record_footer'>\r\r\n              Showing {$count} out of a total of <b>{$total}</b> records in the system</th></tr>";
         } else {
             if ($count > 1) {
                 print "<tr><th colspan='6' class='record_footer'>There are a total of <b>{$total}</b> records in the system</th></tr>";
             } else {
                 print "<tr><th colspan='6' class='record_footer'>There is <b>{$total}</b> record in the system</th></tr>";
             }
         }
     } else {
         print "<tr><td>There are no events in the system.</td></tr>";
     }
     print "</table>";
     print "</div></div>";
 }
Exemple #9
0
 function Draw($theDrawColor = "", $theTextColor = "000000", $isScaleText = false, $theTooltipText = "", $theOnClickAction = "", $theOnMouseoverAction = "", $theOnMouseoutAction = "")
 {
     if ($theDrawColor != "") {
         if (($ee = strchr($theDrawColor, ".")) != "") {
             if ($ee == ".gif") {
                 $ii = imagecreatefromgif($theDrawColor);
             }
             if ($ee == ".png") {
                 $ii = imagecreatefrompng($theDrawColor);
             }
             if ($ee == ".jpg") {
                 $ii = imagecreatefromjpeg($theDrawColor);
             }
             if ($ee == ".jpeg") {
                 $ii = imagecreatefromjpeg($theDrawColor);
             }
             $ww = imagesx($ii);
             $hh = imagesy($ii);
             imagecopyresized($this->Img, $ii, $this->left, $this->top, 0, 0, $this->right - $this->left + 1, $this->bottom - $this->top + 1, $ww, $hh);
             imagedestroy($ii);
         } else {
             $ccDraw = $this->GetImgColorIndex($theDrawColor);
             imagefilledrectangle($this->Img, $this->left, $this->top, $this->right, $this->bottom, $ccDraw);
         }
     }
     $ccText = $this->GetImgColorIndex($theTextColor);
     if ($this->XGridColor != "") {
         $ccGridX = $this->GetImgColorIndex($this->XGridColor);
     }
     if ($this->YGridColor != "") {
         $ccGridY = $this->GetImgColorIndex($this->YGridColor);
     }
     if ($this->XSubGridColor != "") {
         $ccSubGridX = $this->GetImgColorIndex($this->XSubGridColor);
     }
     if ($this->YSubGridColor != "") {
         $ccSubGridY = $this->GetImgColorIndex($this->YSubGridColor);
     }
     if ($this->XScale == 1 || is_string($this->XScale)) {
         $u = "";
         $fn = "";
         if (is_string($this->XScale)) {
             if (substr($this->XScale, 0, 9) == "function ") {
                 $fn = substr($this->XScale, 9);
             } else {
                 $u = $this->XScale;
             }
         }
         $dx = $this->xmax - $this->xmin;
         if (abs($dx) > 0) {
             $invdifx = ($this->right - $this->left) / ($this->xmax - $this->xmin);
             $r = 1;
             while (abs($dx) >= 100) {
                 $dx /= 10;
                 $r *= 10;
             }
             while (abs($dx) < 10) {
                 $dx *= 10;
                 $r /= 10;
             }
             if (abs($dx) >= 50) {
                 $this->SubGrids = 5;
                 $deltax = 10 * $r * sign($dx);
             } else {
                 if (abs($dx) >= 20) {
                     $this->SubGrids = 5;
                     $deltax = 5 * $r * sign($dx);
                 } else {
                     $this->SubGrids = 4;
                     $deltax = 2 * $r * sign($dx);
                 }
             }
             if ($this->XGridDelta != 0) {
                 $deltax = $this->XGridDelta;
             }
             if ($this->XSubGrids != 0) {
                 $this->SubGrids = $this->XSubGrids;
             }
             $sub = $deltax * $invdifx / $this->SubGrids;
             $sshift = 0;
             if ($this->XScalePosition == "top-left" || $this->XScalePosition == "bottom-left") {
                 $sshift = -abs($deltax * $invdifx / 2);
             }
             if ($this->XScalePosition == "top-right" || $this->XScalePosition == "bottom-right") {
                 $sshift = abs($deltax * $invdifx / 2);
             }
             $x = floor($this->xmin / $deltax) * $deltax;
             $itext = 0;
             if ($deltax != 0) {
                 $this->MaxGrids = floor(abs(($this->xmax - $this->xmin) / $deltax)) + 2;
             } else {
                 $this->MaxGrids = 0;
             }
             for ($j = $this->MaxGrids; $j >= -1; $j--) {
                 $xr = $x + $j * $deltax;
                 $x0 = round($this->left + (-$this->xmin + $xr) * $invdifx);
                 if ($this->XSubGridColor != "") {
                     for ($k = 1; $k < $this->SubGrids; $k++) {
                         if ($x0 - $k * $sub > $this->left + 1 && $x0 - $k * $sub < $this->right - 1) {
                             imageline($this->Img, round($x0 - $k * $sub), $this->top + 1, round($x0 - $k * $sub), $this->bottom - 1, $ccSubGridX);
                         }
                     }
                     if ($this->SubGrids == -1) {
                         for ($k = 0; $k < 8; $k++) {
                             if ($x0 - $this->logsub[$k] * $sub * sign($deltax) > $this->left + 1 && $x0 - $this->logsub[$k] * $sub * sign($deltax) < $this->right - 1) {
                                 imageline($this->Img, round($x0 - $this->logsub[$k] * $sub * sign($deltax)), $this->top + 1, round($x0 - $this->logsub[$k] * $sub * sign($deltax)), $this->bottom - 1, $ccSubGridX);
                             }
                         }
                     }
                 }
                 if ($x0 >= $this->left && $x0 <= $this->right) {
                     $itext++;
                     if ($itext != 2 || !$isScaleText) {
                         if ($r > 1) {
                             if ($fn != "") {
                                 $l = call_user_func($fn, $xr);
                             } else {
                                 $l = $xr . $u;
                             }
                         } else {
                             if ($fn != "") {
                                 $l = call_user_func($fn, round(10 * $xr / $r) / round(10 / $r));
                             } else {
                                 $l = round(10 * $xr / $r) / round(10 / $r) . $u;
                             }
                         }
                         if (substr($l, 0, 1) == ".") {
                             $l = "0" . $l;
                         }
                         if (substr($l, 0, 2) == "-.") {
                             $l = "-0" + substr($l, 1);
                         }
                     } else {
                         $l = $this->xtext;
                     }
                     $dd = imagefontwidth(abs($this->Font)) * strlen($l);
                     $hh = imagefontheight(abs($this->Font));
                     if (substr($this->XScalePosition, 0, 3) != "top") {
                         if ($x0 + $sshift >= $this->left && $x0 + $sshift <= $this->right) {
                             if ($this->Font >= 0) {
                                 imagestring($this->Img, $this->Font, $x0 - $dd / 2 + $sshift, $this->bottom + 8, $l, $ccText);
                             } else {
                                 imagestringup($this->Img, -$this->Font, $x0 - $hh / 2 + $sshift, $this->bottom + 9 + $dd, $l, $ccText);
                             }
                         }
                         imageline($this->Img, $x0, $this->bottom - 5, $x0, $this->bottom + 6, $ccText);
                     } else {
                         if ($x0 + $sshift >= $this->left && $x0 + $sshift <= $this->right) {
                             if ($this->Font >= 0) {
                                 imagestring($this->Img, $this->Font, $x0 - $dd / 2 + $sshift, $this->top - 6 - $hh, $l, $ccText);
                             } else {
                                 imagestringup($this->Img, -$this->Font, $x0 - $hh / 2 + $sshift, $this->top - 9, $l, $ccText);
                             }
                         }
                         imageline($this->Img, $x0, $this->top - 5, $x0, $this->top + 6, $ccText);
                     }
                     if ($this->XGridColor != "" && $x0 > $this->left && $x0 < $this->right) {
                         imageline($this->Img, $x0, $this->top + 1, $x0, $this->bottom - 1, $ccGridX);
                     }
                 }
             }
         }
     }
     if (!is_string($this->XScale) && $this->XScale > 1) {
         $dx = $this->xmax - $this->xmin;
         if (abs($dx) > 0) {
             $invdifx = ($this->right - $this->left) / ($this->xmax - $this->xmin);
             $deltax = $this->DateInterval(abs($dx)) * sign($dx);
             if ($this->XGridDelta != 0) {
                 $deltax = $this->XGridDelta;
             }
             if ($this->XSubGrids != 0) {
                 $this->SubGrids = $this->XSubGrids;
             }
             $sub = $deltax * $invdifx / $this->SubGrids;
             $sshift = 0;
             if ($this->XScalePosition == "top-left" || $this->XScalePosition == "bottom-left") {
                 $sshift = -abs($deltax * $invdifx / 2);
             }
             if ($this->XScalePosition == "top-right" || $this->XScalePosition == "bottom-right") {
                 $sshift = abs($deltax * $invdifx / 2);
             }
             $x = floor($this->xmin / $deltax) * $deltax;
             $itext = 0;
             if ($deltax != 0) {
                 $this->MaxGrids = floor(abs(($this->xmax - $this->xmin) / $deltax)) + 2;
             } else {
                 $this->MaxGrids = 0;
             }
             for ($j = $this->MaxGrids; $j >= -2; $j--) {
                 $xr = $x + $j * $deltax;
                 $x0 = round($this->left + (-$this->xmin + $x + $j * $deltax) * $invdifx);
                 if ($this->XSubGridColor != "") {
                     for ($k = 1; $k < $this->SubGrids; $k++) {
                         if ($x0 - $k * $sub > $this->left + 1 && $x0 - $k * $sub < $this->right - 1) {
                             imageline($this->Img, round($x0 - $k * $sub), $this->top + 1, round($x0 - $k * $sub), $this->bottom - 1, $ccSubGridX);
                         }
                     }
                 }
                 if ($x0 >= $this->left && $x0 <= $this->right) {
                     $itext++;
                     if ($itext != 2 || !$isScaleText) {
                         $l = DateFormat($xr, abs($deltax), $this->XScale);
                     } else {
                         $l = $this->xtext;
                     }
                     $dd = imagefontwidth(abs($this->Font)) * strlen($l);
                     $hh = imagefontheight(abs($this->Font));
                     if (substr($this->XScalePosition, 0, 3) != "top") {
                         if ($x0 + $sshift >= $this->left && $x0 + $sshift <= $this->right) {
                             if ($this->Font >= 0) {
                                 imagestring($this->Img, $this->Font, $x0 - $dd / 2 + $sshift, $this->bottom + 8, $l, $ccText);
                             } else {
                                 imagestringup($this->Img, -$this->Font, $x0 - $hh / 2 + $sshift, $this->bottom + 9 + $dd, $l, $ccText);
                             }
                         }
                         imageline($this->Img, $x0, $this->bottom - 5, $x0, $this->bottom + 6, $ccText);
                     } else {
                         if ($x0 + $sshift >= $this->left && $x0 + $sshift <= $this->right) {
                             if ($this->Font >= 0) {
                                 imagestring($this->Img, $this->Font, $x0 - $dd / 2 + $sshift, $this->top - 6 - $hh, $l, $ccText);
                             } else {
                                 imagestringup($this->Img, -$this->Font, $x0 - $hh / 2 + $sshift, $this->top - 9, $l, $ccText);
                             }
                         }
                         imageline($this->Img, $x0, $this->top - 5, $x0, $this->top + 6, $ccText);
                     }
                     if ($this->XGridColor != "" && $x0 > $this->left && $x0 < $this->right) {
                         imageline($this->Img, $x0, $this->top + 1, $x0, $this->bottom - 1, $ccGridX);
                     }
                 }
             }
         }
     }
     if ($this->YScale == 1 || is_string($this->YScale)) {
         $u = "";
         $fn = "";
         if (is_string($this->YScale)) {
             if (substr($this->YScale, 0, 9) == "function ") {
                 $fn = substr($this->YScale, 9);
             } else {
                 $u = $this->YScale;
             }
         }
         $dy = $this->ymax - $this->ymin;
         if (abs($dy) > 0) {
             $invdify = ($this->bottom - $this->top) / ($this->ymax - $this->ymin);
             $r = 1;
             while (abs($dy) >= 100) {
                 $dy /= 10;
                 $r *= 10;
             }
             while (abs($dy) < 10) {
                 $dy *= 10;
                 $r /= 10;
             }
             if (abs($dy) >= 50) {
                 $this->SubGrids = 5;
                 $deltay = 10 * $r * sign($dy);
             } else {
                 if (abs($dy) >= 20) {
                     $this->SubGrids = 5;
                     $deltay = 5 * $r * sign($dy);
                 } else {
                     $this->SubGrids = 4;
                     $deltay = 2 * $r * sign($dy);
                 }
             }
             if ($this->YGridDelta != 0) {
                 $deltay = $this->YGridDelta;
             }
             if ($this->YSubGrids != 0) {
                 $this->SubGrids = $this->YSubGrids;
             }
             $sub = $deltay * $invdify / $this->SubGrids;
             $sshift = 0;
             if ($this->YScalePosition == "left-top" || $this->YScalePosition == "right-top") {
                 $sshift = -abs($deltay * $invdify / 2);
             }
             if ($this->YScalePosition == "left-bottom" || $this->YScalePosition == "right-bottom") {
                 $sshift = abs($deltay * $invdify / 2);
             }
             $y = floor($this->ymax / $deltay) * $deltay;
             $itext = 0;
             if ($deltay != 0) {
                 $this->MaxGrids = floor(abs(($this->ymax - $this->ymin) / $deltay)) + 2;
             } else {
                 $this->MaxGrids = 0;
             }
             for ($j = -1; $j <= $this->MaxGrids; $j++) {
                 $yr = $y - $j * $deltay;
                 $y0 = round($this->top + ($this->ymax - $yr) * $invdify);
                 if ($this->YSubGridColor != "") {
                     for ($k = 1; $k < $this->SubGrids; $k++) {
                         if ($y0 + $k * $sub > $this->top + 1 && $y0 + $k * $sub < $this->bottom - 1) {
                             imageline($this->Img, $this->left + 1, round($y0 + $k * $sub), $this->right - 1, round($y0 + $k * $sub), $ccSubGridY);
                         }
                     }
                     if ($this->SubGrids == -1) {
                         for ($k = 0; $k < 8; $k++) {
                             if ($y0 + $this->logsub[$k] * $sub * sign($deltay) > $this->top + 1 && $y0 + $this->logsub[$k] * $sub * sign($deltay) < $this->bottom - 1) {
                                 imageline($this->Img, $this->left + 1, round($y0 + $this->logsub[$k] * $sub * sign($deltay)), $this->right - 1, round($y0 + $this->logsub[$k] * $sub * sign($deltay)), $ccSubGridY);
                             }
                         }
                     }
                 }
                 if ($y0 >= $this->top && $y0 <= $this->bottom) {
                     $itext++;
                     if ($itext != 2 || !$isScaleText) {
                         if ($r > 1) {
                             if ($fn != "") {
                                 $l = call_user_func($fn, $yr);
                             } else {
                                 $l = $yr . $u;
                             }
                         } else {
                             if ($fn != "") {
                                 $l = call_user_func($fn, round(10 * $yr / $r) / round(10 / $r));
                             } else {
                                 $l = round(10 * $yr / $r) / round(10 / $r) . $u;
                             }
                         }
                         if (substr($l, 0, 1) == ".") {
                             $l = "0" . $l;
                         }
                         if (substr($l, 0, 2) == "-.") {
                             $l = "-0" + substr($l, 1);
                         }
                     } else {
                         $l = $this->ytext;
                     }
                     $dd = imagefontwidth(abs($this->Font)) * strlen($l);
                     $hh = imagefontheight(abs($this->Font));
                     if (substr($this->YScalePosition, 0, 5) != "right") {
                         if ($y0 + $sshift >= $this->top && $y0 + $sshift <= $this->bottom) {
                             imagestring($this->Img, abs($this->Font), $this->left - $dd - 10, $y0 - $hh / 2 + $sshift, $l, $ccText);
                         }
                         imageline($this->Img, $this->left - 5, $y0, $this->left + 6, $y0, $ccText);
                     } else {
                         if ($y0 + $sshift >= $this->top && $y0 + $sshift <= $this->bottom) {
                             imagestring($this->Img, abs($this->Font), $this->right + 10, $y0 - $hh / 2 + $sshift, $l, $ccText);
                         }
                         imageline($this->Img, $this->right - 5, $y0, $this->right + 6, $y0, $ccText);
                     }
                     if ($this->YGridColor != "" && $y0 > $this->top && $y0 < $this->bottom) {
                         imageline($this->Img, $this->left + 1, $y0, $this->right - 1, $y0, $ccGridY);
                     }
                 }
             }
         }
     }
     if (!is_string($this->YScale) && $this->YScale > 1) {
         $dy = $this->ymax - $this->ymin;
         if (abs($dy) > 0) {
             $invdify = ($this->bottom - $this->top) / ($this->ymax - $this->ymin);
             $deltay = $this->DateInterval(abs($dy)) * sign($dy);
             if ($this->YGridDelta != 0) {
                 $deltay = $this->YGridDelta;
             }
             if ($this->YSubGrids != 0) {
                 $this->SubGrids = $this->YSubGrids;
             }
             $sub = $deltay * $invdify / $this->SubGrids;
             $sshift = 0;
             if ($this->YScalePosition == "left-top" || $this->YScalePosition == "right-top") {
                 $sshift = -abs($deltay * $invdify / 2);
             }
             if ($this->YScalePosition == "left-bottom" || $this->YScalePosition == "right-bottom") {
                 $sshift = abs($deltay * $invdify / 2);
             }
             $y = floor($this->ymax / $deltay) * $deltay;
             $itext = 0;
             if ($deltay != 0) {
                 $this->MaxGrids = floor(abs(($this->ymax - $this->ymin) / $deltay)) + 2;
             } else {
                 $this->MaxGrids = 0;
             }
             for ($j = -2; $j <= $this->MaxGrids; $j++) {
                 $yr = $y - $j * $deltay;
                 $y0 = round($this->top + ($this->ymax - $y + $j * $deltay) * $invdify);
                 if ($this->YSubGridColor != "") {
                     for ($k = 1; $k < $this->SubGrids; $k++) {
                         if ($y0 + $k * $sub > $this->top + 1 && $y0 + $k * $sub < $this->bottom - 1) {
                             imageline($this->Img, $this->left + 1, round($y0 + $k * $sub), $this->right - 1, round($y0 + $k * $sub), $ccSubGridY);
                         }
                     }
                 }
                 if ($y0 >= $this->top && $y0 <= $this->bottom) {
                     $itext++;
                     if ($itext != 2 || !$isScaleText) {
                         $l = DateFormat($yr, abs($deltay), $this->YScale);
                     } else {
                         $l = $this->ytext;
                     }
                     $dd = imagefontwidth(abs($this->Font)) * strlen($l);
                     $hh = imagefontheight(abs($this->Font));
                     if (substr($this->YScalePosition, 0, 5) != "right") {
                         if ($y0 + $sshift >= $this->top && $y0 + $sshift <= $this->bottom) {
                             imagestring($this->Img, abs($this->Font), $this->left - $dd - 10, $y0 - $hh / 2 + $sshift, $l, $ccText);
                         }
                         imageline($this->Img, $this->left - 5, $y0, $this->left + 6, $y0, $ccText);
                     } else {
                         if ($y0 + $sshift >= $this->top && $y0 + $sshift <= $this->bottom) {
                             imagestring($this->Img, abs($this->Font), $this->right + 10, $y0 - $hh / 2 + $sshift, $l, $ccText);
                         }
                         imageline($this->Img, $this->right - 5, $y0, $this->right + 6, $y0, $ccText);
                     }
                     if ($this->YGridColor != "" && $y0 > $this->top && $y0 < $this->bottom) {
                         imageline($this->Img, $this->left + 1, $y0, $this->right - 1, $y0, $ccGridY);
                     }
                 }
             }
         }
     }
     imagerectangle($this->Img, $this->left, $this->top, $this->right, $this->bottom, $ccText);
     if ($this->title != "") {
         $dd = imagefontwidth(abs($this->Font)) * strlen($this->title);
         $hh = imagefontheight(abs($this->Font));
         if (substr($this->XScalePosition, 0, 3) != "top") {
             imagestring($this->Img, abs($this->Font), ($this->left + $this->right - $dd) / 2, $this->top - $hh - 4, $this->title, $ccText);
         } else {
             imagestring($this->Img, abs($this->Font), ($this->left + $this->right - $dd) / 2, $this->bottom + 4, $this->title, $ccText);
         }
     }
     if ($theTooltipText != "" || $theOnClickAction != "" || $theOnMouseoverAction != "" || $theOnMouseoutAction != "") {
         $tmpMapData = "<area shape=rect coords='" . $this->left . "," . $this->top . "," . $this->right . "," . $this->bottom . "' ";
         if ($theTooltipText != "") {
             $tmpMapData = $tmpMapData . " title='" . $theTooltipText . "' alt='" . $theTooltipText . "'";
         }
         if ($theOnClickAction != "") {
             $tmpMapData = $tmpMapData . " href='javascript:" . $theOnClickAction . "'";
         }
         if ($theOnMouseoverAction != "") {
             $tmpMapData = $tmpMapData . " onMouseover='" . $theOnMouseoverAction . "'";
         }
         if ($theOnMouseoutAction != "") {
             $tmpMapData = $tmpMapData . " onMouseout='" . $theOnMouseoutAction . "'";
         }
         $tmpMapData = $tmpMapData . ">\n";
         $this->ImgMapData = $tmpMapData . $this->ImgMapData;
     }
 }
 function view_pages_content($user, $theid)
 {
     //GRAB THE DATA FOR THIS RECORD FROM THE DATABASE
     $sql = "SELECT * FROM \n\n                    " . $this->config->db_prefix . "_block_page,\n\n                    " . $this->config->db_prefix . "_block_template\n\n                  WHERE\n\n                    " . $this->config->db_prefix . "_block_page.id = {$theid} AND\n\n                    " . $this->config->db_prefix . "_block_page.template_id = " . $this->config->db_prefix . "_block_template.id \n\n                  LIMIT 1";
     $result = $this->db->DB_Q_C($sql);
     $row = mysql_fetch_array($result);
     //CONSTRUCT OUR PAGE'S URL
     if ($row[0] == 1) {
         $url = $this->config->site_url;
     } else {
         $url = $this->config->site_url . $this->getParentName($row['parent_id']) . $row['file_title'] . "/";
     }
     //PRINT OUT THIS PAGES INFORMATION
     print "\n\n                <div id='records'>\n\n                  <div id='content'>\n\n                    <table cellpadding='0' cellspacing='0' width='100%'>\n\n                      <tr>\n\n                        <th class='record_head' colspan='2'>Page Information</th>\n\n                      </tr>\n\n                      <tr>\n\n                        <td>\n\n                          <table cellpadding='0' cellspacing='0' width='100%'>\n\n                            <tr>\n\n                              <th class='record_head' >" . $row['title'] . "</th>\n\n                            </tr>\n\n                            <tr>\n\n                              <td>\n\n                                <p>Located at: <a href='{$url}' target='_blank'><i>{$url}</i></a></p>\n\n                                <p>\n\n                                  Template used: <a href='?pid={$this->id}&cid=2&theid=" . $row['id'] . "'>" . $row['name'] . "</a> \n\n                                </p>\n\n                              </td>\n\n                            </tr>\n\n                          </table>\n\n                        </td>\n\n                      </tr>\n\n                    </table>\n\n                  </div>\n\n                </div>";
     //PRINT OUT THE BLOCKS USED ON THIS PAGE
     $this->view_blocks($user, 0, 0, -1, $theid);
     //DISPLAY THE HISTORY OF THIS RECORD
     $sql = "SELECT * FROM " . $this->config->db_prefix . "_logs, " . $this->config->db_prefix . "_object, " . $this->config->db_prefix . "_user WHERE\n\n                " . $this->config->db_prefix . "_logs.record_id = {$theid} AND \n\n                " . $this->config->db_prefix . "_logs.module_id = " . $this->id . " AND\n\n                " . $this->config->db_prefix . "_logs.sub_module_id = 2 AND\n\n                " . $this->config->db_prefix . "_logs.object_id =  " . $this->config->db_prefix . "_object.id AND\n\n                " . $this->config->db_prefix . "_logs.user_id =  " . $this->config->db_prefix . "_user.id\n\n                    ORDER BY " . $this->config->db_prefix . "_logs.id DESC";
     $result2 = $this->db->DB_Q_C($sql);
     print "<div id='records'><div id='content'>\n\n        <table cellpadding='0' cellspacing='0'>\n\n        <tr><th class='record_head'>Page History</th></tr>\n\n        <tr><th>action</th></tr>";
     while ($row2 = mysql_fetch_array($result2)) {
         if ($striper) {
             $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\"";
         } else {
             $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\"";
         }
         $striper = !$striper;
         //GET AND CONVERT DATE ACCORDINGLY
         $tmp_date = $this->time->convertTime($user->user_timezone, $row2['create_date']);
         $create_date = DateFormat($tmp_date, $this->config->date_format);
         if ($row2['action'] == 1) {
             //CREATE
             print "<tr {$effect}><td colspan='2'>\n\n                      This page was created by <b>" . $row2['username'] . "</b> on {$create_date}.\n\n                  </td></tr>";
         } else {
             if ($row2['action'] == 2) {
                 //EDIT
                 print "<tr {$effect}><td colspan='2'>\n\n                      This page was edited by <b>" . $row2['username'] . "</b> on {$create_date}.\n\n                  </td></tr>";
             } else {
                 if ($row2['action'] == 4) {
                     //PUBLISHED
                     print "<tr {$effect}><td colspan='2'>\n\n                      This page was published by <b>" . $row2['username'] . "</b> on {$create_date}.\n\n                  </td></tr>";
                 }
             }
         }
     }
     print "</table></div></div>\n\n        </div></div>";
 }
Exemple #11
0
        echo $row_search['Title'];
        ?>
" border="0" height="170" width="225" style="border:2px solid;"></a></div>
			<div class="span_11_of_15 font_content special_font" style="float:left;">
				<a class="shows_font special_font" href="<?php 
        echo getmoviename($row_search['Title'], $row_search['MovieID']);
        ?>
" title="<?php 
        echo $row_search['Title'];
        ?>
"><?php 
        echo $row_search['Title'];
        ?>
</a>
				<br><?php 
        echo DateFormat($row_search['AiringDateTime']);
        ?>
<br><br><?php 
        echo $row_search['Synopsis'];
        ?>
		
				</div>
			</div>
		</div>
<?php 
    }
}
?>
	</div>
<?php 
include "footerlink.php";
            ?>
">
                                    <div class="channel_block_description middle">
                                        <div class="small_txt">
                                            <div class="show_thumb_title_large timeline_wrap_text"><a title="<?php 
            echo $row['Title'];
            ?>
" href="<?php 
            echo getmoviename($row['Title'], $row['MovieID']);
            ?>
" class="shows_font"><?php 
            echo $row['Title'];
            ?>
</a></div>
                                            <span class="show_thumb_time"><?php 
            echo DateFormat($row['AiringDateTime']);
            ?>
</div>
                                    </div>
                                    <a title="<?php 
            echo $row['Title'];
            ?>
" href="<?php 
            echo getmoviename($row['Title'], $row['MovieID']);
            ?>
"><img width="225" height="150" border="0" alt="<?php 
            echo $row['Title'];
            ?>
" src="http://www.hbosouthasia.com/<?php 
            echo $row['FilePath'];
            ?>
<?php

$to1 = $InsertData['txtEmail1'];
//$to='*****@*****.**';
//$subject='Please confirm your registration'; // accessing subject part of email
$subject1 = 'Your subscription to 3 days movie schedule';
// accessing subject part of email
$emailcontent = '<html>
<head>
  <title>Your subscription to 3 days movie schedule</title>
</head>
<body align="left">
    <p>Hello ' . ucwords($InsertData['txtName1']) . ',<br /><br />

	You recently requested an email subscription from the IP Address ' . $InsertData['userIPAddress'] . ' on ' . DateFormat($InsertData['addDate']) . ' to receive 3 days HBO movies calendar. We can\'t wait to send the updates you want via email, so please click the following link to activate your subscription immediately:<br /><br />

	<a href="http://hbosouthasia.com/verification.php?email=' . $InsertData['txtEmail1'] . '&vcode=' . md5($InsertData['VerificationCode']) . '">http://hbosouthasia.com/verification.php?email=' . $InsertData['txtEmail1'] . '&vcode=' . md5($InsertData['VerificationCode']) . '</a><br /><br />

	(If the link above does not appear clickable or does not open a browser window when you click it, copy it and paste it into your web browser\'s Location bar.)<br /><br />

	As soon as your subscription is active, we will send an email every 3rd day in a month containing the list of movies coming in the next 3 days.<br /><br />

If you did not request this subscription, or no longer wish to activate it, take no action. Simply delete this message and that will be the end of it.<br /><br /><br />

Thank You,<br /><br />HBO South Asia
	</p>
</center>
</body>
</html>
';
$headers1 = "From:HBO South Asia<*****@*****.**>\nMIME-Version: 1.0\nContent-type:text/html;charset=iso-8859-1\nReturn-Path:hbosa@hboasia.com\nReturn-Receipt-To:hbosa@hboasia.com";
$res = mysql_query($sql);
if (mysql_num_rows($res) > 0) {
    if ($_REQUEST['movie_type'] == 'Album') {
        echo '<div class="highlight-pic">';
        while ($row = mysql_fetch_array($res)) {
            echo '<div class="highlight-pic8">
		  
		  <div class="pic2"><a href="movie-' . strtolower(preg_replace('![^a-z0-9]+!i', '-', $row['Title'])) . "-" . $row['MovieID'] . ".php" . '"><img src="' . $row['FilePath'] . '" /></a></div>
		  <p style="padding-right:5px;"><a href="movie-' . strtolower(preg_replace('![^a-z0-9]+!i', '-', $row['Title'])) . "-" . $row['MovieID'] . ".php" . '">' . $row['Title'] . '</a><br /><span>' . DateFormat($row['AiringDateTime']) . '</span></p>
		  </div>
		 ';
        }
    } elseif ($_REQUEST['movie_type'] == 'List') {
        echo '<div class="highlight-list"><ul>';
        while ($row = mysql_fetch_array($res)) {
            echo '<li><a href="movie-' . strtolower(preg_replace('![^a-z0-9]+!i', '-', $row['Title'])) . "-" . $row['MovieID'] . ".php" . '">' . $row['Title'] . '<span>' . DateFormat($row['AiringDateTime']) . '</span></a></li>';
        }
        echo '</ul></div>';
    } else {
        echo "";
    }
    echo '</div><div style="clear:both;"></div>';
    $num = ceil(mysql_num_rows($res1) / $numberofrow);
    if ($num > 1) {
        echo '<div class="ajax_pagination_div">';
        for ($i = 1; $i <= $num; $i++) {
            if ($currentpage == $i) {
                echo '<a class="ajax_pagination_curr" onclick="return false;" href="#">' . $i . '</a>';
            } else {
                echo '<a class="ajax_pagination" onclick="getMovieListingData(\'\',\'\',\'' . $i . '\');return false;" href="#">' . $i . '</a>';
            }