function admin_user_index()
{
    $pagination = pagination(15, 'users');
    $subject_index = '<table class="table table-hover table-bordered">';
    $subject_index .= '<tr><th>ID</th><th>Name</th><th>Activation</th><th>User type</th><th>Modification</th></tr>';
    while ($subject = mysql_fetch_array($pagination['query'])) {
        $subject_index .= '<tr>';
        $subject_index .= '<td>' . $subject['id'] . '</td>';
        $subject_index .= '<td>' . $subject['username'] . '</td>';
        if ($subject['activation'] == 1) {
            $subject_index .= '<td>Yes</td>';
        } else {
            $subject_index .= '<td>No</td>';
        }
        if ($subject['user_type'] == 1) {
            $subject_index .= '<td>Admin</td>';
        } elseif ($subject['user_type'] == 2) {
            $subject_index .= '<td>Customer</td>';
        } else {
            $subject_index .= '<td>' . $subject['user_type'] . '</td>';
        }
        $subject_index .= '<td><a href="' . site_options('link') . 'admin/edit_user.php?user='******'id'] . '">Edit </a>';
        $alert = "'Are you sure you want to delete this page?'";
        $subject_index .= '/&nbsp;<a href="' . site_options('link') . 'admin/delete_user.php?user='******'id'] . '" onclick="return confirm(' . $alert . ');">Delete</a></td>';
        $subject_index .= '</tr>';
    }
    $subject_index .= '</table>';
    $subject_index .= $pagination['index'];
    return $subject_index;
}
function admin_subject_index()
{
    $pagination = pagination(15, 'subjects');
    $subject_index = '<table class="table table-hover table-bordered">';
    $subject_index .= '<tr><th>Name</th><th>Navigation ID</th><th>Position</th><th>Visible</th><th>Modification</th></tr>';
    while ($subject = mysql_fetch_array($pagination['query'])) {
        $subject_index .= '<tr>';
        $subject_index .= '<td>' . $subject['name'] . '</td>';
        $subject_index .= '<td>';
        if ($subject['nav_id'] == 1) {
            $subject_index .= $subject['nav_id'] = 'Sidebar';
        } else {
            $subject_index .= $subject['nav_id'] = 'Top';
        }
        $subject_index .= '</td>';
        $subject_index .= '<td>' . $subject['position'] . '</td>';
        $subject_index .= '<td>';
        if ($subject['visible'] == 1) {
            $subject_index .= $subject['visible'] = 'Yes';
        } else {
            $subject_index .= $subject['visible'] = 'No';
        }
        $subject_index .= '</td>';
        //$subject_index .= '<td>' . $subject['visible'] = 'Yes' . '</td>';
        $subject_index .= '<td><a href="' . site_options('link') . 'admin/edit_subject.php?subject=' . $subject['id'] . '">Edit </a>';
        $alert = "'Are you sure you want to delete this page?'";
        $subject_index .= '/&nbsp;<a href="' . site_options('link') . 'admin/delete_subject.php?subject=' . $subject['id'] . '" onclick="return confirm(' . $alert . ');">Delete</a></td>';
        $subject_index .= '</tr>';
    }
    $subject_index .= '</table>';
    $subject_index .= $pagination['index'];
    return $subject_index;
}
function admin_page_index()
{
    $pagination = pagination(15, 'pages');
    $page_index = '<table class="table table-hover table-bordered">';
    $page_index .= '<tr><th>Name</th><th>Subject</th><th>Position</th><th>Visible</th><th>Product</th><th>Modification</th></tr>';
    while ($page = mysql_fetch_array($pagination['query'])) {
        $page_index .= '<tr>';
        $page_index .= '<td>' . $page['page_name'] . '</td>';
        // to get page name and its id start
        global $connection;
        $query = "SELECT name FROM page_subjects WHERE id=" . $page['subject_id'];
        $subject_set = mysql_query($query, $connection);
        confirm_query($subject_set);
        while ($subject = mysql_fetch_array($subject_set)) {
            $page_index .= '<td>' . $subject['name'] . '</td>';
        }
        // get page name from id end
        $page_index .= '<td>' . $page['position'] . '</td>';
        if ($page['visible'] == 1) {
            $page_index .= '<td>' . ($page['visible'] = 'Yes' . '</td>');
        } else {
            $page_index .= '<td>' . ($page['visible'] = 'No' . '</td>');
        }
        // to get product
        global $connection;
        $query = "SELECT * FROM products WHERE page_id=" . $page['id'];
        $product_set = mysql_query($query, $connection);
        confirm_query($product_set);
        $pro_id = 0;
        $pro = 'No';
        while ($product = mysql_fetch_array($product_set)) {
            if ($product['page_id'] == $page['id']) {
                $pro = $product['name'];
                $pro_id = $product['id'];
            }
        }
        // get products
        if ($pro != 'No') {
            $page_index .= '<td>' . $pro . '</td>';
        } else {
            $page_index .= '<td>No</td>';
        }
        $page_index .= '<td><a href="' . site_options('link') . 'admin/edit_page.php?page=' . $page['id'] . '">Edit</a>&nbsp;';
        $alert = "'Are you sure you want to delete this page?'";
        $page_index .= '/&nbsp;<a href="' . site_options('link') . 'admin/delete_page.php?page=' . $page['id'];
        /*if($pro_id != 0){
        			$page_index .='&product='.$pro_id;
        		}*/
        $page_index .= '" onclick="return confirm(' . $alert . ');">Delete</a></td>';
        $page_index .= '</tr>';
    }
    $page_index .= '</table>';
    $page_index .= $pagination['index'];
    return $page_index;
}
function admin_products_index()
{
    $pagination = pagination(15, 'products');
    $product_index = '<table class="table table-hover table-bordered">';
    $product_index .= '<tr><th>Product#</th><th>Name</th><th>Page</th><th>Position</th><th>Visible</th><th>Price</th><th>Modification</th></tr>';
    while ($product = mysql_fetch_array($pagination['query'])) {
        $product_index .= '<tr>';
        $product_index .= '<td>' . $product['id'] . '</td>';
        $product_index .= '<td>' . $product['name'] . '</td>';
        // to get page name and its id start
        global $connection;
        $query = "SELECT * FROM page_data WHERE id=" . $product['page_id'] . " LIMIT 1";
        $page_data = mysql_query($query, $connection);
        confirm_query($page_data);
        while ($page = mysql_fetch_array($page_data)) {
            $product_index .= '<td>' . $page['page_name'] . '</td>';
            $pg_id = $page['id'];
        }
        // get page name from id end
        $product_index .= '<td>' . $product['position'] . '</td>';
        $product_index .= '<td>';
        if ($product['visible'] == 1) {
            $product_index .= $product['visible'] = 'Yes';
        } else {
            $product_index .= $product['visible'] = 'No';
        }
        $product_index .= '<td>$' . $product['price'] . '</td>';
        $product_index .= '</td>';
        $product_index .= '<td><a href="' . site_options('link') . 'admin/edit_page.php?page=' . urlencode($pg_id) . '">Edit </a>';
        $alert = "'Are you sure you want to delete this page?'";
        $product_index .= '/&nbsp;<a href="' . site_options('link') . 'admin/delete_page.php?product=' . urlencode($product['id']) . '" onclick="return confirm(' . $alert . ');">Delete</a></td>';
        $product_index .= '</tr>';
    }
    $product_index .= '</table>' . $pagination['index'];
    return $product_index;
}
Example #5
0
?>
			
			
			<article class="col-lg-9">
				<h3>Page Settings</h3>
				
					<?php 
if (isset($_GET['updated'])) {
    echo '<p class="alert alert-success">Page updated Successfully.</p>';
} elseif (isset($_GET['added'])) {
    echo '<p class="alert alert-success">Page added Successfully.</p>';
} elseif (isset($_GET['deleted'])) {
    echo '<p class="alert alert-success">Page deleted Successfully.</p>';
} elseif (isset($_GET['error'])) {
    echo '<p class="alert alert-danger">There is an error .</p>';
}
echo admin_page_index();
?>
				
			<div class="row"><a class="btn btn-success" href="<?php 
echo site_options('link');
?>
admin/new_page.php">New page</a></div>
			</article>
		
	
	
		</div>

<?php 
require_once '../includes/footer.php';
Example #6
0
    $users_index .= '<tr>';
    $users_index .= '<td>' . $users['id'] . '</td>';
    $users_index .= '<td>' . $users['username'] . '</td>';
    if ($users['activation'] == 1) {
        $users_index .= '<td>Yes</td>';
    } else {
        $users_index .= '<td>No</td>';
    }
    if ($users['user_type'] == 1) {
        $users_index .= '<td>Admin</td>';
    } elseif ($users['user_type'] == 2) {
        $users_index .= '<td>Customer</td>';
    } else {
        $users_index .= '<td>' . $users['user_type'] . '</td>';
    }
    $users_index .= '<td><a href="' . site_options('link') . 'admin/edit_user.php?user='******'id'] . '">Edit </a>';
    $users_index .= '</tr>';
}
$users_index .= '</table>';
echo $users_index;
?>
				
				
			</article>
		
	
	
		</div>

<?php 
require_once '../includes/footer.php';
Example #7
0
?>
content.php">
					<img src="<?php 
echo site_options('link') . site_options('logo');
?>
"  class="pull-left" >
					</a>
				</div>	
			</div>	
			
			<div class="col-md-8  pull-right text-right top-text">
				<h1 class="hidden-xs top-text"><?php 
echo site_options('title');
?>
</h1>
				<p><?php 
echo site_options('description');
?>
</p>
			</div>
		</div>
	</div>
	
</div>



<!-- header ends .///-->


	<div class="container">
			<div><?php 
echo $sel_page['page_value'];
?>
</div>
			

		  </div>
		  <div class="modal-footer">
			<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<?php 
if (logged_in()) {
    ?>
						<input type="button" class="btn btn-primary" value="Add to Cart" onclick="addtocart(<?php 
    echo $product['id'];
    ?>
)" />
						<?php 
} else {
    ?>
						<input type="button" class="btn btn-warning" value="Register" onclick="location.href='<?php 
    echo site_options('link') . '/register.php';
    ?>
'" />
						<?php 
}
?>
		  </div>
		</div><!-- /.modal-content -->
	  </div><!-- /.modal-dialog -->
	</div><!-- /.modal -->						
					
Example #9
0
function confirm_admin()
{
    if ($_SESSION['user_type'] != 1) {
        redirect_to(site_options('link') . 'index.php');
    }
}
Example #10
0
<?php

require_once 'includes/connection.php';
require_once 'includes/functions.php';
require_once 'includes/session.php';
logged_out();
redirect_to(site_options('link') . 'login.php?logout=1');
exit;
// close connection after logged out !
if (isset($connection)) {
    mysql_close($connection);
}
Example #11
0
function get_navigation($nav_id, $nav)
{
    global $sel_subject;
    global $sel_page;
    $subject_parent = get_main_subjects('parent');
    if ($nav == 'sidebar') {
        while ($subject = mysql_fetch_array($subject_parent)) {
            if ($subject['nav_id'] == $nav_id) {
                echo '<li class="list-group-item  no-padding';
                if ($subject['id'] == $sel_subject['id']) {
                    echo ' active">';
                } else {
                    echo '">';
                }
                $link = '<a href="' . site_options('link') . 'content.php?subject=' . urlencode($subject['id']) . '">';
                $link .= $subject['name'];
                $link .= '</a>';
                echo $link;
                echo '<ul>';
                $subject_child = get_main_subjects('child');
                while ($child = mysql_fetch_array($subject_child)) {
                    if ($subject['id'] == $sel_subject['id'] && $subject['id'] == $child['parent_id']) {
                        $link = '<li><a ';
                        $link .= 'href="' . site_options('link') . 'content.php?subject=' . urlencode($subject['id']) . '&child=' . urlencode($child['id']) . '">';
                        $link .= $child['name'];
                        $link .= '</a>';
                        echo $link;
                        echo '</li>';
                    }
                }
                /*$pages = get_subjects_for_pages($subject['id']);
                
                				while($page = mysql_fetch_array($pages)){
                					if($subject['id'] == $sel_subject['id']){	
                						
                						$link	=	'<li><a ';
                					
                						if($page['id'] == $sel_page['id']){
                							$link .= 'class="active" ';
                						}
                						$link	.=	'href="'. site_options('link') .'content.php?subject=' . urlencode($subject['id']) . '&page=' . urlencode($page['id']) . '">';
                						$link	.=	$page['page_name'];
                						$link	.=	'</a>';
                						echo $link;
                						echo '</li>';
                					}
                				}*/
                echo '</ul>';
                echo '</li>';
            }
        }
    } elseif ($nav == 'top') {
        while ($subject = mysql_fetch_array($subject_parent)) {
            if ($subject['nav_id'] == $nav_id) {
                echo '<li>';
                if ($subject['id'] == $sel_subject['id']) {
                    echo '<li class="active">';
                } else {
                    echo '<li>';
                }
                $link = '<a href="' . site_options('link') . 'content.php?subject=' . urlencode($subject['id']) . '">';
                $link .= $subject['name'];
                $link .= '</a>';
                echo $link;
                echo '</li>';
            }
        }
    } else {
        echo '<li><a href="#">No Slot Selected</a></li>';
    }
}
function admin_order_index()
{
    $pagination = pagination(15, 'orders');
    $subject_index = '<table class="table table-hover table-bordered">';
    $subject_index .= '<tr><th>Order #</th><th>Order by</th><th>Order Total</th><th>Status</th><th>Modification</th></tr>';
    while ($subject = mysql_fetch_array($pagination['query'])) {
        $subject_index .= '<tr>';
        $subject_index .= '<td>' . $subject['id'] . '</td>';
        // get user name by its id !
        $order_by = get_user_by_id($subject['user_id']);
        $subject_index .= '<td>' . $order_by['username'] . '</td>';
        $subject_index .= '<td style="color: green;">$' . $subject['order_total'] . '</td>';
        if ($subject['status'] == 1) {
            $subject_index .= '<td style="color: red;">Recieved</td>';
        } elseif ($subject['status'] == 2) {
            $subject_index .= '<td style="color: orange;">Process</td>';
        } elseif ($subject['status'] == 3) {
            $subject_index .= '<td style="color: green;">Completed</td>';
        } else {
            $subject_index .= '<td>No Status !</td>';
        }
        $subject_index .= '<td><a href="' . site_options('link') . 'admin/edit_order.php?order=' . $subject['id'] . '">Details </a>';
        $alert = "'Are you sure you want to delete this page?'";
        $subject_index .= '/&nbsp;<a href="' . site_options('link') . 'admin/delete_order.php?order=' . $subject['id'] . '" onclick="return confirm(' . $alert . ');">Delete</a></td>';
        $subject_index .= '</tr>';
    }
    $subject_index .= '</table>';
    $subject_index .= $pagination['index'];
    return $subject_index;
}
Example #13
0
        $dated = date('Y-m-d H:i:s');
        $result = mysql_query("insert into orders values('','{$dated}','{$user_id}','1','" . get_order_total() . "','{$order_note}')");
        confirm_query($result);
        $orderid = mysql_insert_id();
        // send email after user activation !
        $mail_subject = "Your Order at: " . site_options('title');
        $email_message = 'Hello! Your order is been recieved, order ID is #' . $orderid . ' , Thanks.';
        $from = site_options('email');
        $mail_headers = "From:" . $from;
        mail($_SESSION['email'], $mail_subject, $email_message, $mail_headers);
        // send email after user activation to admin !
        $mail_subject = "New order from: " . $_SESSION['user_name'];
        $email_message = 'New order recieved, order ID is #' . $orderid . ' , Thanks.';
        $from = $_SESSION['email'];
        $mail_headers = "From:" . $from;
        mail(site_options('email'), $mail_subject, $email_message, $mail_headers);
        $max = count($_SESSION['cart']);
        for ($i = 0; $i < $max; $i++) {
            $pid = $_SESSION['cart'][$i]['productid'];
            $p_note = $_SESSION['cart'][$i]['productnote'];
            $q = $_SESSION['cart'][$i]['qty'];
            $price = get_price($pid);
            $order_details = mysql_query("insert into order_detail (order_id, product_id, quantity, price, note) values ({$orderid},{$pid},{$q},{$price},'{$p_note}')");
            confirm_query($order_details);
        }
        if (isset($_SESSION['cart'])) {
            unset($_SESSION['cart']);
        }
        redirect_to('billing.php?orderSubmited=1');
    }
}
Example #14
0
              <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,</p>
            </div>
            <div class="bb-custom-side"> <img src="images/slider-img.png" /> </div>
          </div>
          <div class="bb-item">
            <div class="bb-custom-firstpage">
              <h1><span>New Product 4</span>A Christmas Gift</h1>
              <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,</p>
            </div>
            <div class="bb-custom-side"> <img src="images/slider-img.png" /> </div>
          </div>
        </div>
        <div class="slider-nav"> <a id="bb-nav-prev" href="#" ><img src="images/pre-arrow.png"></a> <a id="bb-nav-next" href="#" ><img src="images/next-arrow.png"></a>
          </nav>
        </div>
      </div>
      <div  class="hidden-xs slider-bg">&nbsp;</div>
      
      <!--/main-Slider -->			
			
			<?php 
echo site_options('welcome');
$pagination = pagination(site_options('new_products'), 'products');
echo '<div class="row"><div class="col-lg-12"><h3 class="pro-header">New Products</h3></div>';
while ($product = mysql_fetch_array($pagination['query'])) {
    include 'products_loop.php';
}
echo '</div>';
echo $pagination['index'];
?>
	
Example #15
0
		
			
			<h1><?php 
    echo $sel_subject_child['name'];
    ?>
</h1>					
			<p><?php 
    echo $sel_subject_child['content'];
    ?>
</p>	


<?php 
    if (isset($_GET['child'])) {
        echo '<div class="row"><div class="col-lg-12"><h3 class="pro-header">' . $sel_subject_child['name'] . '</h3></div>';
        $pagination = pagination(site_options('new_products'), 'cat_products', $sel_subject_child['id']);
        while ($product = mysql_fetch_array($pagination['query'])) {
            include 'products_loop.php';
        }
        echo $pagination['index'];
        echo '</div>';
    }
    ?>
	
			
	
	<?php 
}
?>
	
	</div>