Commit 84aa2e69 authored by majidbeigi's avatar majidbeigi

first init

parents
Options -indexes
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../adminn/login/');
}
$db = new DB();
$db->connect();
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script>
$(function(){
$("div.holder").jPages({
containerID : "container",
perPage:10
});
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div id="main" align="center" class="ui-corner-all , ui-widget-content">
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
متولدین امروز
<hr />
<table dir="rtl" border="0" cellpadding="6" cellspacing="0" style="width: 800px;">
<tr>
<td style="width: 40px;background: #C8E0E4;"> ردیف </td>
<td style="width: 300px;background: #C8E0E4;"> نام و نام خانوادگی </td>
<td style="width: 150px;background: #C8E0E4;"> موبایل </td>
<td style="width: 100px;background: #C8E0E4;"> سن </td>
<td style="width: 150px;background: #C8E0E4;"> تاریخ تولد </td>
</tr>
<tbody id="container">
<?php
$date = Date_new();
$today = substr($date,5,5);
$res = $db->select("lead"," birthday and mobile "," birthday desc");
$i=0;
$j=0;
while(isset($res[$i]['id_lead']))
{
$y = substr($res[$i]['birthday'],5,5);
if($y === $today)
{
$year1 = substr($res[$i]['birthday'],0,4);
$year2 = substr($date,0,4);
$age = (intval($year2)-intval($year1))+1;
if($age<61)
{
print"<tr><td>".($j+1)."</td>";
print"<td>".$res[$i]['name']." ".$res[$i]['family']."</td>";
print"<td>".$res[$i]['mobile']."</td>";
print"<td>".$age."</td>";
print"<td>".Date_mTosh($res[$i]['birthday'])."</td></tr>";
$j++;
}
}
$i++;
}
?>
</tbody>
</table>
<div dir="ltr" class="holder"></div>
<div>تعداد متولدین امروز <?php echo $j ?></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
$err = null;
if(isset($_POST['addbrand']))
{
$namef = $_POST['namef'];
$namee = $_POST['namee'];
$code = $_POST['code'];
$price = $_POST['price'];
$description = $_POST['description'];
$tmp = new PRODUCT();
if($tmp->addbrand($namef,$namee,$code,$price,$description))
{
$db = new DB();
$db->connect();
$where = "code='$code'";
$res = $db->select("brand",$where);
$id = $res[0]['id_brand'];
header('location:../brand/edit.php?id='.$id);
}
else
{
$err = $tmp->error;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script type="text/javascript" src="js/jscripts/tiny_mce/tiny_mce.js"></script>
<script>
tinyMCE.init({
// General options
language: 'fa',
mode : "exact",
elements : "description" ,
theme : "advanced",
forced_root_block : false,
directionality : "rtl",
height : 220,
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
// Theme options
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,|,tablecontrols",
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,code,|,preview,|,forecolor,backcolor,hr,|,sub,sup,|,charmap,emotions,|,ltr,rtl",
theme_advanced_resizing : false,
theme_advanced_font_sizes: "10px,12px,13px,14px,16px,18px,20px",
font_size_style_values: "12px,13px,14px,16px,18px,20px",
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div dir="rtl" id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت آپشن استاندارد
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<div align="right">
<form method="post" action="">
<h2 style="font-weight: normal;margin-left: 20px;font-size: 17px;">
فرم ایجاد آپشن استاندارد
</h2>
<table>
<tr>
<td style="width: 100px;">نام فارسی : </td><td><input type="text" name="namef" style="width: 300px;" /> </td>
</tr>
<tr>
<td>نام انگلیسی : </td><td><input type="text" name="namee" style="width: 300px;" /> </td>
</tr>
<tr>
<td>کد : </td><td><input type="text" name="code" style="width: 170px;" /></td>
</tr>
<tr>
<td>قیمت : </td><td><input type="text" name="price" style="width: 170px;" /></td>
</tr>
<tr>
<td colspan="2">توضیحات :<br /><textarea name="description"></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="ثبت" name="addbrand" /></td></td>
</tr>
</table>
</form>
<?php
if($err)
{
echo $err;
}
?>
</div>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
$id = $_GET['id'];
$err = null;
$db = new DB();
$db->connect();
if(isset($_POST['edit']))
{
$namef = $_POST['namef'];
$namee = $_POST['namee'];
$code = $_POST['code'];
$price = $_POST['price'];
$description = $_POST['description'];
$tmp = new PRODUCT();
if($tmp->updatebrand($id,$namef,$namee,$code,$price,$description))
{
$err=true;
}
}
if(isset($_POST['delete']))
{
$image = $_POST['image'];
if(file_exists("../../images/products/brand/".$image))
{
unlink("../../images/products/brand/".$image);
}
if(file_exists("../../images/products/brand/th/th".$image))
{
unlink("../../images/products/brand/th/th".$image);
}
$data=array("image"=>"''");
$where="id_brand=$id";
$db->update("brand",$data,$where);
}
define ("MAX_SIZE","4000");
if(isset($_POST['upload']))
{
$image =$_FILES['image']['name'];
if($image){
$uploadedfile = $_FILES['image']['tmp_name'];
$size = $_FILES['image']['size'];
if($size > MAX_SIZE * 1004)
{
echo "You have exceeded the size limit";
}
else
{
if( ($_FILES['image']['type']== "image/jpeg") || ($_FILES['image']['type']== "image/pjpeg") )
{
$src = imagecreatefromjpeg($uploadedfile);
}
elseif($_FILES['image']['type']== "image/png")
{
$src = imagecreatefrompng($uploadedfile);
}
else
{
echo "فایل نامعتبر";
}
if($src)
{
list($width, $height) = getimagesize($uploadedfile);
// image
$newwidth = 600;
$newheight= ($height / $width) * $newwidth;
$tmp = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($tmp, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
$imagename = mt_rand(1000,9999). $image;
$filename = "../../images/products/brand/".$imagename;
imagejpeg($tmp, $filename, 100);
//th_image
$newwidth_th = 120;
$newheight_th= 80;
$tmp_th = imagecreatetruecolor($newwidth_th, $newheight_th);
imagecopyresampled($tmp_th, $src, 0, 0, 0, 0, $newwidth_th, $newheight_th, $width, $height);
$imagename_th ="th".$imagename;
$filename_th = "../../images/products/brand/th/".$imagename_th;
imagejpeg($tmp_th, $filename_th, 100);
imagedestroy($tmp_th);
imagedestroy($src);
imagedestroy($tmp);
$data=array("image"=>"'$imagename'");
$where="id_brand=$id";
$db->update("brand",$data,$where);
}
}
}
}
$brand = new PRODUCT();
$brands = $brand->loadbrand($id);
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script type="text/javascript" src="js/jscripts/tiny_mce/tiny_mce.js"></script>
<script>
tinyMCE.init({
// General options
language: 'fa',
mode : "exact",
elements : "description" ,
theme : "advanced",
forced_root_block : false,
directionality : "rtl",
height : 220,
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
// Theme options
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,|,tablecontrols",
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,code,|,preview,|,forecolor,backcolor,hr,|,sub,sup,|,charmap,emotions,|,ltr,rtl",
theme_advanced_resizing : false,
theme_advanced_font_sizes: "10px,12px,13px,14px,16px,18px,20px",
font_size_style_values: "12px,13px,14px,16px,18px,20px",
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div dir="rtl" id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت آپشن استاندارد
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<div align="right">
<form method="post" action="">
<h2 style="font-weight: normal;margin-left: 20px;font-size: 17px;">
فرم ایجاد آپشن استاندارد
</h2>
<table>
<tr>
<td style="width: 100px;">نام فارسی : </td><td><input type="text" name="namef" value='<?php echo $brands[0]['namef']; ?>' style="width: 300px;" /> </td>
</tr>
<tr>
<td>نام انگلیسی : </td><td><input type="text" name="namee" value='<?php echo $brands[0]['namee']; ?>' style="width: 300px;" /> </td>
</tr>
<tr>
<td>کد : </td><td><input type="text" name="code" value='<?php echo $brands[0]['code']; ?>' style="width: 170px;" /></td>
</tr>
<tr>
<td>قیمت : </td><td><input type="text" name="price" value='<?php echo $brands[0]['price']; ?>' style="width: 170px;" /></td>
</tr>
<tr>
<td colspan="2">توضیحات :<br /><textarea name="description"><?php echo $brands[0]['description']; ?></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="ثبت" name="edit" />
<?php
if($err)
print"ویرایش با موفقیت انجام شد";
?>
</td></td>
</tr>
</form>
<tr>
<td>تصویر</td>
<td>
<?php
if($brands[0]['image'])
{
print"<img src='images/products/brand/th/th".$brands[0]['image']."' style='padding:1px;border:1px solid #C0C0C0;float:right;margin-left:10px;' />";
print'<form method="post" action="">';
print'<input type="hidden" name="image" value="'.$brands[0]['image'].'" />
<input type="submit" name="delete" value="حذف" onclick="return confirm(\'حذف شود؟\');" />';
print'</form>';
}
else
{
print'<form method="post" action="" enctype="multipart/form-data">';
print '<input type="file" name="image" /><input type="submit" name="upload" value="آپلود" />';
print'</form>';
}
?>
</td>
</tr>
</table>
</div>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
$err = null;
if(isset($_POST['delete']))
{
$id = $_POST['id'];
$tmp = new PRODUCT();
$tmp->deletebrand($id);
}
if(isset($_POST['addbrand2tobrand']))
{
$id_brand = $_POST['brand'];
$id_brand2 = $_POST['brand2'];
$tmp = new PRODUCT();
$tmp->addBrandAndBrand2($id_brand,$id_brand2);
$err = $tmp->error;
}
if(isset($_POST['deletebrand2frombrand']))
{
$id_brand = $_POST['brand'];
$id_brand2 = $_POST['brand2'];
$tmp = new PRODUCT();
$tmp->deleteBrand2FromBrand($id_brand,$id_brand2);
$err = $tmp->error;
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script>
$(function(){
$("div.holder").jPages({
containerID : "container",
perPage:3
});
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div dir="rtl" id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت آپشن استاندارد
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<div align="right">
<span style="font-weight: bold;margin-left: 20px;">
<a href="adminn/brand/add.php"> فرم ایجاد آپشن استاندارد </a>
</span>
</div>
<hr />
<div align="right">
<form method="post" action="">
<span style="font-weight: bold;margin-left: 30px;">
فرم ارتباط دادن آپشن جایگزین به استاندارد
</span><br />
استاندارد :
<select name="brand" style="width: 400px;">
<option value="0">استاندارد را انتخاب نمایید</option>
<?php
$selectbrand = new PRODUCT();
$brand = $selectbrand->loadbrand();
$i=0;
while(isset($brand[$i]['id_brand']) && $brand[$i]['id_brand'])
{
print"<option dir='ltr' value='".$brand[$i]['id_brand']."'>".$brand[$i]['code']." - ".$brand[$i]['namee']."</option>";
$i++;
}
?>
</select>
<br />
جایگزین :
<select name="brand2" style="width: 400px;">
<option value="0">جایگزین را انتخاب نمایید</option>
<?php
$selectbrand2 = new PRODUCT();
$brand2 = $selectbrand2->loadbrand2();
$i=0;
while(isset($brand2[$i]['id_brand2']) && $brand2[$i]['id_brand2'])
{
print"<option dir='ltr' value='".$brand2[$i]['id_brand2']."'>".$brand2[$i]['code']." - ".$brand2[$i]['namee']."</option>";
$i++;
}
?>
</select>
<input type="submit" value="ثبت" name="addbrand2tobrand" />
</form>
<?php
if($err)
{
echo $err;
}
?>
</div>
<hr />
<table dir="rtl" border="1" cellpadding="6" cellspacing="0" style="width: 100%;">
<thead>
<tr>
<td align="center" style="width: 200px;background: #C8E0E4;"> نام فارسی </td>
<td align="center" style="width: 200px;background: #C8E0E4;"> نام انگلیسی </td>
<td align="center" style="width: 200px;background: #C8E0E4;"> کد </td>
<td align="center" style="width: 40px;background: #C8E0E4;"> ویرایش </td>
<td align="center" style="width: 40px;background: #C8E0E4;"> حذف </td>
<td align="center" style="width: 200px;background: #C8E0E4;"> جایگزین </td>
</tr>
</thead>
<tbody id="container">
<?php
$brand = new PRODUCT();
$res = $brand->loadbrand();
$i=0;
while(isset($res[$i]['id_brand']) && $res[$i]['id_brand'] )
{
print"<tr><td align='right'>".$res[$i]['namef']."</td>";
print"<td align='left'>".$res[$i]['namee']."</td>";
print"<td align='center'>".$res[$i]['code']."</td>";
print"<td align='center'><a href='adminn/brand/edit.php?id=".$res[$i]['id_brand']."'><div class='edit'></div></a></td>";
print"<td>
<form method='post' action=''>
<input type='hidden' value=".$res[$i]['id_brand']." name='id' />
<input type='submit' value='' class='delete' name='delete' onclick=\"return confirm('delete?');\" />
</form>
</td>";
print"<td><div style='height:150px;overflow: scroll;'>";
$brand_brand2 = $brand->loadBrandAndBrand2($res[$i]['id_brand']);
$j=0;
while(isset($brand_brand2[$j]['id_brand_brand2']) && $brand_brand2[$j]['id_brand_brand2'] )
{
$brand2name = $brand->loadbrand2($brand_brand2[$j]['brand2_id']);
echo "<div align='left' dir='ltr' class=\"ui-corner-all , ui-widget-content\" style='margin:1px;padding:5px;'>";
print"<div style='float:left' >
<form method='post' action=''>
<input type='hidden' value=".$brand_brand2[$j]['brand_id']." name='brand' />
<input type='hidden' value=".$brand_brand2[$j]['brand2_id']." name='brand2' />
<input type='submit' value='X' style='border:none;background:none;cursor:pointer;' name='deletebrand2frombrand' onclick=\"return confirm('حذف شود؟');\" />
</form></div> <a style='color:red' target='_blank' href='adminn/brand2/edit.php?id=".$brand2name[0]['id_brand2']."'>EDIT</a> ".$brand2name[0]['code']." - ".$brand2name[0]['namee'];
echo "</div>";
$j++;
}
print"</div></td>";
print"</tr>";
$i++;
}
?>
</tbody>
</table>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
$err = null;
if(isset($_POST['addbrand2']))
{
$namef = $_POST['namef'];
$namee = $_POST['namee'];
$code = $_POST['code'];
$price = $_POST['price'];
$description = $_POST['description'];
$tmp = new PRODUCT();
if($tmp->addbrand2($namef,$namee,$code,$price,$description))
{
$db = new DB();
$db->connect();
$where = "code='$code'";
$res = $db->select("brand2",$where);
$id = $res[0]['id_brand2'];
header('location:../brand2/edit.php?id='.$id);
}
else
{
$err = $tmp->error;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script type="text/javascript" src="js/jscripts/tiny_mce/tiny_mce.js"></script>
<script>
tinyMCE.init({
// General options
language: 'fa',
mode : "exact",
elements : "description" ,
theme : "advanced",
forced_root_block : false,
directionality : "rtl",
height : 220,
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
// Theme options
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,|,tablecontrols",
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,code,|,preview,|,forecolor,backcolor,hr,|,sub,sup,|,charmap,emotions,|,ltr,rtl",
theme_advanced_resizing : false,
theme_advanced_font_sizes: "10px,12px,13px,14px,16px,18px,20px",
font_size_style_values: "12px,13px,14px,16px,18px,20px",
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div dir="rtl" id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت آپشن جایگزینی
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<div align="right">
<form method="post" action="">
<h2 style="font-weight: normal;margin-left: 20px;font-size: 17px;">
فرم ایجاد آپشن جایگزینی
</h2>
<table>
<tr>
<td style="width: 100px;">نام فارسی : </td><td><input type="text" name="namef" style="width: 300px;" /> </td>
</tr>
<tr>
<td>نام انگلیسی : </td><td><input type="text" name="namee" style="width: 300px;" /></td>
</tr>
<tr>
<td>کد : </td><td><input type="text" name="code" style="width: 170px;" /></td>
</tr>
<tr>
<td>قیمت :</td><td><input type="text" name="price" style="width: 170px;" /></td>
</tr>
<tr>
<td colspan="2">توضیحات :<br /><textarea name="description"></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="ثبت" name="addbrand2" /></td></td>
</tr>
</table>
</form>
<?php
if($err)
{
echo $err;
}
?>
</div>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
if(isset($_GET['id']) && $_GET['id'])
{
$id = $_GET['id'];
}
else
{
header('location:../brand2/');
}
$db = new DB();
$db->connect();
$err = null;
if(isset($_POST['edit']))
{
$namef = $_POST['namef'];
$namee = $_POST['namee'];
$price = $_POST['price'];
$code = $_POST['code'];
$description = $_POST['description'];
$tmp = new PRODUCT();
if($tmp->updatebrand2($id,$namef,$namee,$code,$price,$description))
{
$err=true;
}
}
if(isset($_POST['delete']))
{
$image = $_POST['image'];
if(file_exists("../../images/products/brand2/".$image))
{
unlink("../../images/products/brand2/".$image);
}
if(file_exists("../../images/products/brand2/th/th".$image))
{
unlink("../../images/products/brand2/th/th".$image);
}
$data=array("image"=>"''");
$where="id_brand2=$id";
$db->update("brand2",$data,$where);
}
define ("MAX_SIZE","4000");
if(isset($_POST['upload']))
{
$image =$_FILES['image']['name'];
if($image){
$uploadedfile = $_FILES['image']['tmp_name'];
$size = $_FILES['image']['size'];
if($size > MAX_SIZE * 1004)
{
echo "You have exceeded the size limit";
}
else
{
if( ($_FILES['image']['type']== "image/jpeg") || ($_FILES['image']['type']== "image/pjpeg") )
{
$src = imagecreatefromjpeg($uploadedfile);
}
elseif($_FILES['image']['type']== "image/png")
{
$src = imagecreatefrompng($uploadedfile);
}
else
{
echo "فایل نامعتبر";
}
if($src)
{
list($width, $height) = getimagesize($uploadedfile);
// image
$newwidth = 600;
$newheight= ($height / $width) * $newwidth;
$tmp = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($tmp, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
$imagename = mt_rand(1000,9999). $image;
$filename = "../../images/products/brand2/".$imagename;
imagejpeg($tmp, $filename, 100);
//th_image
$newwidth_th = 120;
$newheight_th= 80;
$tmp_th = imagecreatetruecolor($newwidth_th, $newheight_th);
imagecopyresampled($tmp_th, $src, 0, 0, 0, 0, $newwidth_th, $newheight_th, $width, $height);
$imagename_th ="th".$imagename;
$filename_th = "../../images/products/brand2/th/".$imagename_th;
imagejpeg($tmp_th, $filename_th, 100);
imagedestroy($tmp_th);
imagedestroy($src);
imagedestroy($tmp);
$data=array("image"=>"'$imagename'");
$where="id_brand2=$id";
$db->update("brand2",$data,$where);
}
}
}
}
$brand2 = new PRODUCT();
$brand2s = $brand2->loadbrand2($id);
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script type="text/javascript" src="js/jscripts/tiny_mce/tiny_mce.js"></script>
<script>
tinyMCE.init({
// General options
language: 'fa',
mode : "exact",
elements : "description" ,
theme : "advanced",
forced_root_block : false,
directionality : "rtl",
height : 220,
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
// Theme options
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,|,tablecontrols",
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,code,|,preview,|,forecolor,backcolor,hr,|,sub,sup,|,charmap,emotions,|,ltr,rtl",
theme_advanced_resizing : false,
theme_advanced_font_sizes: "10px,12px,13px,14px,16px,18px,20px",
font_size_style_values: "12px,13px,14px,16px,18px,20px",
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div dir="rtl" id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت آپشن جایگزینی
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<div align="right">
<form method="post" action="">
<h2 style="font-weight: normal;margin-left: 20px;font-size: 17px;">
فرم ایجاد آپشن جایگزینی
</h2>
<table>
<tr>
<td style="width: 100px;">نام فارسی : </td><td><input type="text" name="namef" value='<?php echo $brand2s[0]['namef']; ?>' style="width: 300px;" /> </td>
</tr>
<tr>
<td>نام انگلیسی : </td><td><input type="text" name="namee" value='<?php echo $brand2s[0]['namee']; ?>' style="width: 300px;" /></td>
</tr>
<tr>
<td>کد : </td><td><input type="text" name="code" value='<?php echo $brand2s[0]['code']; ?>' style="width: 170px;" /></td>
</tr>
<tr>
<td>قیمت :</td><td><input type="text" name="price" value='<?php echo $brand2s[0]['price']; ?>'style="width: 170px;" /></td>
</tr>
<tr>
<td colspan="2">توضیحات :<br /><textarea name="description"><?php echo $brand2s[0]['description']; ?></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="ثبت" name="edit" />
<?php
if($err)
print"ویرایش با موفقیت انجام شد";
?>
</td></td>
</tr>
</form>
<tr>
<td>تصویر</td>
<td>
<?php
if($brand2s[0]['image'])
{
print"<img src='images/products/brand2/th/th".$brand2s[0]['image']."' style='padding:1px;border:1px solid #C0C0C0;float:right;margin-left:10px;' />";
print'<form method="post" action="">';
print'<input type="hidden" name="image" value="'.$brand2s[0]['image'].'" />
<input type="submit" name="delete" value="حذف" onclick="return confirm(\'حذف شود؟\');" />';
print'</form>';
}
else
{
print'<form method="post" action="" enctype="multipart/form-data">';
print '<input type="file" name="image" /><input type="submit" name="upload" value="آپلود" />';
print'</form>';
}
?>
</td>
</tr>
</table>
</div>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
$err = null;
if(isset($_POST['delete']))
{
$id = $_POST['id'];
$tmp = new PRODUCT();
$tmp->deletebrand2($id);
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script>
$(function(){
$("div.holder").jPages({
containerID : "container",
perPage:6
});
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div dir="rtl" id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت آپشن جایگزین
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<div align="right">
<span style="font-weight: bold;margin-left: 20px;">
<a href="adminn/brand2/add.php"> فرم ایجاد آپشن جایگزین </a>
</span>
</div>
<hr />
<table dir="rtl" border="1" cellpadding="6" cellspacing="0" style="width: 100%;">
<thead>
<tr>
<td style="width: 200px;background: #C8E0E4;"> نام فارسی </td>
<td style="width: 200px;background: #C8E0E4;"> نام انگلیسی </td>
<td style="width: 200px;background: #C8E0E4;"> کد </td>
<td style="width: 40px;background: #C8E0E4;"> ویرایش </td>
<td style="width: 40px;background: #C8E0E4;"> حذف </td>
</tr>
</thead>
<tbody id="container">
<?php
$brand2 = new PRODUCT();
$res = $brand2->loadbrand2();
$i=0;
while(isset($res[$i]['id_brand2']) && $res[$i]['id_brand2'] )
{
print"<tr><td>".$res[$i]['namef']."</td>";
print"<td>".$res[$i]['namee']."</td>";
print"<td>".$res[$i]['code']."</td>";
print"<td><a href='adminn/brand2/edit.php?id=".$res[$i]['id_brand2']."'><div class='edit'></div></a></td>";
print"<td>
<form method='post' action=''>
<input type='hidden' value=".$res[$i]['id_brand2']." name='id' />
<input type='submit' value='' class='delete' name='delete' onclick=\"return confirm('delete?');\" />
</form>
</td></tr>";
$i++;
}
?>
</tbody>
</table>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
$err = null;
if(isset($_POST['addbrand3']))
{
$namef = $_POST['namef'];
$namee = $_POST['namee'];
$code = $_POST['code'];
$price = $_POST['price'];
$description = $_POST['description'];
$tmp = new PRODUCT();
if($tmp->addbrand3($namef,$namee,$code,$price,$description))
{
$db = new DB();
$db->connect();
$where = "code='$code'";
$res = $db->select("brand3",$where);
$id = $res[0]['id_brand3'];
header('location:../brand3/edit.php?id='.$id);
}
else
{
$err = $tmp->error;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script type="text/javascript" src="js/jscripts/tiny_mce/tiny_mce.js"></script>
<script>
tinyMCE.init({
// General options
language: 'fa',
mode : "exact",
elements : "description" ,
theme : "advanced",
forced_root_block : false,
directionality : "rtl",
height : 220,
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
// Theme options
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,|,tablecontrols",
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,code,|,preview,|,forecolor,backcolor,hr,|,sub,sup,|,charmap,emotions,|,ltr,rtl",
theme_advanced_resizing : false,
theme_advanced_font_sizes: "10px,12px,13px,14px,16px,18px,20px",
font_size_style_values: "12px,13px,14px,16px,18px,20px",
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div dir="rtl" id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت آپشن اضافه شدنی
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<div align="right">
<form method="post" action="">
<h2 style="font-weight: normal;margin-left: 20px;font-size: 17px;">
فرم ایجاد آپشن اضافه شدنی
</h2>
<table>
<tr>
<td style="width: 100px;">نام فارسی : </td><td><input type="text" name="namef" style="width: 300px;" /> </td>
</tr>
<tr>
<td>نام انگلیسی : </td><td><input type="text" name="namee" style="width: 300px;" /></td>
</tr>
<tr>
<td>کد : </td><td><input type="text" name="code" style="width: 170px;" /></td>
</tr>
<tr>
<td>قیمت :</td><td><input type="text" name="price" style="width: 170px;" /></td>
</tr>
<tr>
<td colspan="2">توضیحات :<br /><textarea name="description"></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="ثبت" name="addbrand3" /></td></td>
</tr>
</table>
</form>
<?php
if($err)
{
echo $err;
}
?>
</div>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
if(isset($_GET['id']) && $_GET['id'])
{
$id = $_GET['id'];
}
else
{
header('location:../brand3/');
}
print $id;
$db = new DB();
$db->connect();
$err = null;
if(isset($_POST['edit']))
{
$namef = $_POST['namef'];
$namee = $_POST['namee'];
$price = $_POST['price'];
$code = $_POST['code'];
$description = $_POST['description'];
$tmp = new PRODUCT();
if($tmp->updatebrand3($id,$namef,$namee,$code,$price,$description))
{
$err=true;
}
}
if(isset($_POST['delete']))
{
$image = $_POST['image'];
if(file_exists("../../images/products/brand3/".$image))
{
unlink("../../images/products/brand3/".$image);
}
if(file_exists("../../images/products/brand3/th/th".$image))
{
unlink("../../images/products/brand3/th/th".$image);
}
$data=array("image"=>"''");
$where="id_brand3=$id";
$db->update("brand3",$data,$where);
}
define ("MAX_SIZE","4000");
if(isset($_POST['upload']))
{
$image =$_FILES['image']['name'];
if($image){
$uploadedfile = $_FILES['image']['tmp_name'];
$size = $_FILES['image']['size'];
if($size > MAX_SIZE * 1004)
{
echo "You have exceeded the size limit";
}
else
{
if( ($_FILES['image']['type']== "image/jpeg") || ($_FILES['image']['type']== "image/pjpeg") )
{
$src = imagecreatefromjpeg($uploadedfile);
}
elseif($_FILES['image']['type']== "image/png")
{
$src = imagecreatefrompng($uploadedfile);
}
else
{
echo "فایل نامعتبر";
}
if($src)
{
list($width, $height) = getimagesize($uploadedfile);
// image
$newwidth = 600;
$newheight= ($height / $width) * $newwidth;
$tmp = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($tmp, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
$imagename = mt_rand(1000,9999). $image;
$filename = "../../images/products/brand3/".$imagename;
imagejpeg($tmp, $filename, 100);
//th_image
$newwidth_th = 120;
$newheight_th= 80;
$tmp_th = imagecreatetruecolor($newwidth_th, $newheight_th);
imagecopyresampled($tmp_th, $src, 0, 0, 0, 0, $newwidth_th, $newheight_th, $width, $height);
$imagename_th ="th".$imagename;
$filename_th = "../../images/products/brand3/th/".$imagename_th;
imagejpeg($tmp_th, $filename_th, 100);
imagedestroy($tmp_th);
imagedestroy($src);
imagedestroy($tmp);
$data=array("image"=>"'$imagename'");
$where="id_brand3=$id";
$db->update("brand3",$data,$where);
}
}
}
}
$brand3 = new PRODUCT();
$brand3s = $brand3->loadbrand3($id);
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script type="text/javascript" src="js/jscripts/tiny_mce/tiny_mce.js"></script>
<script>
tinyMCE.init({
// General options
language: 'fa',
mode : "exact",
elements : "description" ,
theme : "advanced",
forced_root_block : false,
directionality : "rtl",
height : 220,
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
// Theme options
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,|,tablecontrols",
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,code,|,preview,|,forecolor,backcolor,hr,|,sub,sup,|,charmap,emotions,|,ltr,rtl",
theme_advanced_resizing : false,
theme_advanced_font_sizes: "10px,12px,13px,14px,16px,18px,20px",
font_size_style_values: "12px,13px,14px,16px,18px,20px",
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div dir="rtl" id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت آپشن اضافه شدنی
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<div align="right">
<form method="post" action="">
<h2 style="font-weight: normal;margin-left: 20px;font-size: 17px;">
فرم ایجاد آپشن اضافه شدنی
</h2>
<table>
<tr>
<td style="width: 100px;">نام فارسی : </td><td><input type="text" name="namef" value='<?php echo $brand3s[0]['namef']; ?>' style="width: 300px;" /> </td>
</tr>
<tr>
<td>نام انگلیسی : </td><td><input type="text" name="namee" value='<?php echo $brand3s[0]['namee']; ?>' style="width: 300px;" /></td>
</tr>
<tr>
<td>کد : </td><td><input type="text" name="code" value='<?php echo $brand3s[0]['code']; ?>' style="width: 170px;" /></td>
</tr>
<tr>
<td>قیمت :</td><td><input type="text" name="price" value='<?php echo $brand3s[0]['price']; ?>'style="width: 170px;" /></td>
</tr>
<tr>
<td colspan="2">توضیحات :<br /><textarea name="description"><?php echo $brand3s[0]['description']; ?></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="ثبت" name="edit" />
<?php
if($err)
print"ویرایش با موفقیت انجام شد";
?>
</td></td>
</tr>
</form>
<tr>
<td>تصویر</td>
<td>
<?php
if($brand3s[0]['image'])
{
print"<img src='images/products/brand3/th/th".$brand3s[0]['image']."' style='padding:1px;border:1px solid #C0C0C0;float:right;margin-left:10px;' />";
print'<form method="post" action="">';
print'<input type="hidden" name="image" value="'.$brand3s[0]['image'].'" />
<input type="submit" name="delete" value="حذف" onclick="return confirm(\'حذف شود؟\');" />';
print'</form>';
}
else
{
print'<form method="post" action="" enctype="multipart/form-data">';
print '<input type="file" name="image" /><input type="submit" name="upload" value="آپلود" />';
print'</form>';
}
?>
</td>
</tr>
</table>
</div>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
$err = null;
if(isset($_POST['delete']))
{
$id = $_POST['id'];
$tmp = new PRODUCT();
$tmp->deletebrand3($id);
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script>
$(function(){
$("div.holder").jPages({
containerID : "container",
perPage:6
});
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div dir="rtl" id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت آپشن اضافه شدنی
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<div align="right">
<span style="font-weight: bold;margin-left: 20px;">
<a href="adminn/brand3/add.php"> فرم ایجاد آپشن اضافه شدنی </a>
</span>
</div>
<hr />
<table dir="rtl" border="1" cellpadding="6" cellspacing="0" style="width: 100%px;">
<thead>
<tr>
<td style="width: 200px;background: #C8E0E4;"> نام فارسی </td>
<td style="width: 200px;background: #C8E0E4;"> نام انگلیسی </td>
<td style="width: 200px;background: #C8E0E4;"> قیمت </td>
<td style="width: 150px;background: #C8E0E4;"> کد </td>
<td style="width: 40px;background: #C8E0E4;"> ویرایش </td>
<td style="width: 40px;background: #C8E0E4;"> حذف </td>
</tr>
</thead>
<tbody id="container">
<?php
$brand3 = new PRODUCT();
$res = $brand3->loadbrand3();
$i=0;
while(isset($res[$i]['id_brand3']) && $res[$i]['id_brand3'] )
{
print"<tr><td>".$res[$i]['namef']."</td>";
print"<td>".$res[$i]['namee']."</td>";
print"<td>".$res[$i]['price']."</td>";
print"<td>".$res[$i]['code']."</td>";
print"<td><a href='adminn/brand3/edit.php?id=".$res[$i]['id_brand3']."'><div class='edit'></div></a></td>";
print"<td>
<form method='post' action=''>
<input type='hidden' value=".$res[$i]['id_brand3']." name='id' />
<input type='submit' value='' class='delete' name='delete' onclick=\"return confirm('delete?');\" />
</form>
</td></tr>";
$i++;
}
?>
</tbody>
</table>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$db = new DB();
$db->connect();
$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
$suser = isset($_POST['suser']) ? mysql_real_escape_string($_POST['suser']) : '';
$offset = ($page-1)*$rows;
$result = array();
if($_POST['suser'])
{
$where=" user_id=$suser ";
}
else
{
$where="";
}
$re = $db->select("lead_comments",$where);
$result["total"] = count($re);
$order = "id_lead_comments desc limit $offset,$rows ";
$rs = $db->select("lead_comments",$where,$order);
$rows = array();
$r = array();
$i=0;
while(isset($rs[$i]['id_lead_comments']) && $rs[$i]['id_lead_comments']){
$lead_id = $rs[$i]['lead_id'];
$where="id_lead = $lead_id";
$res = $db->select("lead",$where);
$user_id=$rs[$i]['user_id'];
$where="id_user = $user_id";
$user = $db->select("user",$where);
$r['lead_id'] = $rs[$i]['lead_id'];
$r['name'] = "<a href='user/lead/view/index.php?id=".$res[0]['id_lead']."' target='_blank' >".$res[0]['name']." ".$res[0]['family']."</a>";
$r['create_date'] = "<span dir='ltr' >".Date_mTosh($rs[$i]['create_date'])."</span>";
$r['text'] = $rs[$i]['text'];
$r['user'] = $user[0]['name'];
array_push($rows, $r);
$i++;
}
$result["rows"] = $rows;
echo json_encode($result);
?>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script type="text/javascript">
function doSearch(){
$('#tt').datagrid('load',{
suser: $('#suser').val()
});
}
</script>
</head>
<body dir="rtl">
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div id="main" align="center" class="ui-corner-all , ui-widget-content">
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
یادداشت ها
<hr />
<table id="tt" class="easyui-datagrid" style="width:940px;height: 410px;" url="adminn/comments/gd.php"
rownumbers="true" toolbar="#tb" nowrap="false" pagination="true" singleSelect="true" pageList="[12,20,30]" pageSize="12" >
<thead>
<tr>
<th field="lead_id" width="40">سرنخ</th>
<th field="name" width="130">دکتر</th>
<th field="text" width="500" >یاداشت</th>
<th field="user" width="80" >کاربر</th>
<th align='left' field="create_date" width="130" dir="ltr">تاریخ</th>
</tr>
</thead>
</table>
<div id="tb" style="padding:3px">
<span>کاربر:</span>
<select id="suser" >
<?php
$user = new USER();
$user->load();
$i=0;
while(isset($user->id_user[$i]) && $user->id_user[$i])
{
print"<option value='".$user->id_user[$i]."'>".$user->name[$i]."</option>";
$i++;
}
?>
</select>
<a href="#" class="easyui-linkbutton" style="border: 1px solid gray;" plain="true" onclick="doSearch()">بروزرسانی</a>
</div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../../adminn/login/');
}
if(isset($_GET['p']) && $_GET['p'])
{
$cpage = $_GET['p'];
}
else{
$cpage=1;
}
$db = new DB();
$db->connect();
if(isset($_POST['delete']))
{
$doctor_id = $_POST['doctor_id'];
$db->delete("doctor","id_doctor",$doctor_id);
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script>
$(function() {
$("#close").click(function(){
$('#text').html(null);
$("#test").css('visibility','hidden');
});
$(".username").click(function(){
$("#test").css('visibility','visible');
var str = $(this).attr("id");
$.post("adminn/user/post.php",{ username: str },function(result){
$('#text').html(result);
});
});
$(".pagination").button();
});
</script>
<style>
.username{
cursor: pointer;
color: blue;
}
</style>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div id="test" class="ui-corner-all , ui-widget-content" align="center" style="color: black; visibility: hidden; margin-top: 100px;margin-left: 100px; opacity:0.9; position: absolute;width: 500px;height: 250px;">
مشخصات کاربر
<div id="text" align="center" dir="rtl" class="ui-corner-all , ui-widget-content" style=" margin: 3px;height: 210px;border: 1px solid blue;font-size: 12px;line-height: 18px;">
</div>
<div id="close" align="center" class="ui-corner-all , ui-widget-content" align="center" style="cursor: pointer; position: absolute; bottom: 0; color: red;font-size: 10px;width: 50px;border: 1px dashed red;"> close </div>
</div>
<div id="main" align="center" style="height: 480px;" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<table dir="rtl" style="width: 90%;">
<tr>
<td>
<form method="post" action="adminn/doctor/index.php" dir="rtl">
نام خانوادگی : <input type="text" name="susername" /> <input type="submit" value="جستجو" name="search" />
</form>
</tr>
</table>
<table dir="rtl" border="0" cellpadding="6" cellspacing="0" style="width: 600px;">
<tr>
<td style="width: 50px;background: #C8E0E4;"> ID </td>
<td style="width: 200px;background: #C8E0E4;"> نام </td>
<td style="width: 200px;background: #C8E0E4;"> نام خانوادگی </td>
<td style="width: 50px;background: #C8E0E4;"> نظام پزشکی </td>
</tr>
<tbody >
<?php
if(isset($_POST['search']) && $_POST['search'])
{
$susername = $_POST['susername'];
$cpage = 1;
$res = $db->select("doctor"," family LIKE '%$susername%' "," id_doctor desc ");
}
else
{
$res = $db->select("doctor",""," id_doctor desc ");
}
$npage = count($res);
$ppage = 7;
$tpage = round($npage/$ppage);
$i=0;
while(isset($res[$i]['id_doctor']) && $res[$i]['id_doctor'])
{
if($i < (($cpage-1)*$ppage))
{
$i++;
continue;
}
print"<tr><td style='border-bottom: 1px solid #A1C4C8;'>".$res[$i]['id_doctor']."</td>";
print"<td style='border-bottom: 1px solid #A1C4C8;'>".$res[$i]['name']."</td>";
print"<td style='border-bottom: 1px solid #A1C4C8;' >".$res[$i]['family']."</td>";
print"<td style='border-bottom: 1px solid #A1C4C8;' >".$res[$i]['nezam_pezeshki']."</td>";
print"</tr>";
if($i+1 > (($cpage*$ppage)-1))
{
break;
}
$i++;
}
?>
</tbody>
</table>
<table>
<tr>
<td>
<a class="pagination" href="adminn/doctor/index.php?p=1">ابتدا</a>
</td>
<td>
<a class="pagination" href="adminn/doctor/index.php?p=<?php echo $cpage-1; ?>">قبلی</a>
</td>
<td>
<a class="pagination" href="adminn/doctor/index.php?p=<?php echo $cpage; ?>"><?php echo $cpage; ?></a>
</td>
<td>
<a class="pagination" href="adminn/doctor/index.php?p=<?php echo $cpage+1; ?>">بعدی</a>
</td>
<td>
<a class="pagination" href="adminn/doctor/index.php?p=<?php echo $tpage; ?>">انتها</a>
</td>
</tr>
</table>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
[09-Jun-2014 07:04:44 UTC] PHP Fatal error: Uncaught exception 'PHPExcel_Reader_Exception' with message 'Could not open for reading! File does not exist.' in /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/Reader/Excel2007.php:82
Stack trace:
#0 /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/IOFactory.php(280): PHPExcel_Reader_Excel2007->canRead(NULL)
#1 /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/IOFactory.php(191): PHPExcel_IOFactory::createReaderForFile(NULL)
#2 /home/farazden/public_html/crm/adminn/email/index.php(137): PHPExcel_IOFactory::load(NULL)
#3 {main}
thrown in /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/Reader/Excel2007.php on line 82
[09-Jun-2014 07:07:46 UTC] PHP Fatal error: Uncaught exception 'PHPExcel_Reader_Exception' with message 'Could not open for reading! File does not exist.' in /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/Reader/Excel2007.php:82
Stack trace:
#0 /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/IOFactory.php(280): PHPExcel_Reader_Excel2007->canRead(NULL)
#1 /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/IOFactory.php(191): PHPExcel_IOFactory::createReaderForFile(NULL)
#2 /home/farazden/public_html/crm/adminn/email/index.php(137): PHPExcel_IOFactory::load(NULL)
#3 {main}
thrown in /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/Reader/Excel2007.php on line 82
[09-Jun-2014 07:09:51 UTC] PHP Fatal error: Uncaught exception 'PHPExcel_Reader_Exception' with message 'Could not open for reading! File does not exist.' in /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/Reader/Excel2007.php:82
Stack trace:
#0 /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/IOFactory.php(280): PHPExcel_Reader_Excel2007->canRead(NULL)
#1 /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/IOFactory.php(191): PHPExcel_IOFactory::createReaderForFile(NULL)
#2 /home/farazden/public_html/crm/adminn/email/index.php(137): PHPExcel_IOFactory::load(NULL)
#3 {main}
thrown in /home/farazden/public_html/crm/adminn/email/Classes/PHPExcel/Reader/Excel2007.php on line 82
[09-Jun-2014 07:17:10 UTC] PHP Warning: require_once(Classess/PHPExcel.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home/farazden/public_html/crm/adminn/email/index.php on line 135
[09-Jun-2014 07:17:10 UTC] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'Classess/PHPExcel.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/farazden/public_html/crm/adminn/email/index.php on line 135
[09-Jun-2014 07:19:44 UTC] PHP Warning: fopen() [<a href='function.fopen'>function.fopen</a>]: Filename cannot be empty in /home/farazden/public_html/crm/adminn/email/index.php on line 136
[09-Jun-2014 07:19:44 UTC] PHP Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /home/farazden/public_html/crm/adminn/email/index.php on line 157
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../adminn/login/');
}
$db = new DB();
$db->connect();
if(isset($_POST['add']))
{
$create_date = jstrftime('%Y/%m/%e - %H:%M');
$name = $_POST['name'];
$data=array("name"=>"'$name'","create_date"=>"'$create_date'");
$db->insert("email_list",$data);
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script>
$(function(){
$("div.holder").jPages({
containerID : "container",
perPage:8
});
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل پیامک
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<br />
<table dir="rtl" border="0" cellpadding="6" cellspacing="0" style="width: 900px;">
<tr>
<td colspan="3">
<form method="post" action="">
<table style="width: 100%;">
<tr>
<td>
عنوان : <input type="text" name="name" style="width: 300px;" />
<input type="submit" value="ثبت" name="add" />
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td style="width: 20px;background: #C8E0E4;"> ردیف </td>
<td style="width: 350px;background: #C8E0E4;"> عنوان </td>
<td style="width: 350px;background: #C8E0E4;"> عملیات </td>
<td style="background: #C8E0E4;"> تاریخ </td>
</tr>
<tbody id="container">
<?php
$res = $db->select("email_list","","id_email_list desc");
$i=0;
while(isset($res[$i]['id_email_list']) && $res[$i]['id_email_list'])
{
print"<tr><td style='border-bottom: 1px solid #A1C4C8;'>".($i+1)."</td>";
print"<td style='border-bottom: 1px solid #A1C4C8;' >".$res[$i]['name']."</td>";
print"<td style='border-bottom: 1px solid #A1C4C8;' >";
print'
<form method="post" action="" enctype="multipart/form-data">
<input type="file" name="infile" />
<input type="hidden" name="id" value="'.$res[$i]['id_email_list'].'" />
<input type="submit" value="آپلود" name="upload" class="btn" />
</form>
';
print"</td>";
print"<td style='border-bottom: 1px solid #A1C4C8;' dir='ltr' >".$res[$i]['create_date']."</td>";
print"</tr>";
$i++;
}
?>
</tbody>
</table>
<?php
if(isset($_POST['upload']))
{
$id = $_POST['id'];
$file = $_FILES['infile']['tmp_name'];
$handle = fopen($file,"r");
$cnt=0;
//loop through the csv file and insert into database
do {
if ($data[0]) {
$A=addslashes($data[0]);
$A = substr($A,0,-1);
$A = substr($A,0,-1);
$B=addslashes($data[1]);
$where = "email='$A'";
$res = $db->select("email",$where);
if(count($res)>0)
{
$data=array("opened"=>"$B");
$db->update("email",$data,$where);
$cnt++;
}
else
{
$data=array("email"=>"'$A'","opened"=>"$B","email_list_id"=>"$id");
$db->insert("email",$data);
$cnt++;
}
}
} while ($data = fgetcsv($handle,1000,",","'"));
print"
<script>
alert('".$cnt."');
</script>
";
}
?>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../adminn/login/');
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div id="main" align="center" class="ui-corner-all , ui-widget-content">
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<br />
<h1> پنل مدیریت نرم افزار مدیریت قراردادهای فراز دندان </h1>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../adminn/login/');
}
$db = new DB();
$db->connect();
if(isset($_POST['add']))
{
$ip = $_POST['ip'];
$data=array("ip"=>"'$ip'");
$db->insert("ipvalid",$data);
}
if(isset($_POST['delete']))
{
$id = $_POST['id'];
$db->delete("ipvalid","id_ipvalid",$id);
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
<script>
$(function(){
$("div.holder").jPages({
containerID : "container",
perPage:8
});
});
</script>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل آی پی مجاز
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<br />
<table dir="rtl" border="0" cellpadding="6" cellspacing="0" style="width: 900px;">
<tr>
<td colspan="3">
<form method="post" action="">
<table style="width: 100%;" dir="rtl">
<tr>
<td>
IP : <input type="text" name="ip" style="width: 300px;" />
<input type="submit" value="ثبت" name="add" />
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td style="width: 20px;background: #C8E0E4;"> ردیف </td>
<td style="width: 150px;background: #C8E0E4;"> IP </td>
<td style="width: 100px;background: #C8E0E4;"> عملیات </td>
</tr>
<tbody id="container">
<?php
$res = $db->select("ipvalid","","id_ipvalid desc");
$i=0;
while(isset($res[$i]['id_ipvalid']) && $res[$i]['id_ipvalid'])
{
print"<tr><td style='border-bottom: 1px solid #A1C4C8;'>".($i+1)."</td>";
print"<td style='border-bottom: 1px solid #A1C4C8;' >".$res[$i]['ip']."</td>";
print"<td style='border-bottom: 1px solid #A1C4C8;'>
<form method='post' action=''>
<input type='hidden' value=".$res[$i]['id_ipvalid']." name='id' />
<input type='submit' value='' class='delete' name='delete' onclick=\"return confirm('delete?');\" />
</form>
</td>";
print"</tr>";
$i++;
}
?>
</tbody>
</table>
<div dir="ltr" class="holder"></div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<div dir="rtl" style="background: #B6D8FE;height: 40px;">
<table dir="rtl" cellpadding="0" cellspacing="0" style="width: 100%;">
<tr>
<td>
<ul class="dropdown">
<li>
<a href="adminn">داشبورد</a>
</li>
<li>
<a href="adminn">گزارشات</a>
<ul class="sub_menu">
<li><a href="adminn/comments/"> یادداشت ها </a></li>
</ul>
</li>
<li>
<a href="adminn/main/"> تنظیمات </a>
<ul class="sub_menu">
<li><a href="adminn/user/"> کاربران </a></li>
<li><a href="adminn/doctor/"> دکترها </a></li>
<li><a href="adminn/ipvalid/"> IP مجاز </a></li>
</ul>
</li>
<li>
<a>تعریف محصول</a>
<ul class="sub_menu">
<li><a href="adminn/model3/"> مدیریت گروه </a></li>
<li><a href="adminn/model2/"> مدیریت مدل </a></li>
<li><a href="adminn/model/"> مدیریت محصول </a></li>
<li><a href="adminn/brand/"> آپشن استاندارد </a></li>
<li><a href="adminn/brand2/"> آپشن جایگزین </a></li>
<li><a href="adminn/brand3/"> آپشن اضافه </a></li>
</ul>
</li>
<li>
<a>خدمات</a>
<ul class="sub_menu">
<li><a href="#">تست</a></li>
</ul>
</li>
<li>
<a>تبلیغات</a>
<ul class="sub_menu">
<li><a href="adminn/nemayeshgah/"> نمایشگاه </a></li>
<li><a href="adminn/sms/"> پیامک </a></li>
<li><a href="adminn/email/"> ایمیل </a></li>
<li><a href="adminn/birthday/"> متولدین امروز </a></li>
</ul>
</li>
</ul>
</td>
<td>
<div align="left" style="padding-top: 5px;padding-left: 10px;">
<div align="left" style="width:270px;">
<table dir="ltr" cellpadding="0" cellspacing="0">
<tr>
<td style="width:80px">
<a href="login/logout.php"> <div id="logout"></div> </a>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
</div>
<hr style="border: 0px;border-top: 1px solid #51A2FD;" />
\ No newline at end of file
[18-Jun-2014 08:30:14 UTC] PHP Fatal error: Call to undefined function IPvalid() in /home/farazden/public_html/crm/adminn/login/index.php on line 2
[18-Jun-2014 08:30:15 UTC] PHP Fatal error: Call to undefined function IPvalid() in /home/farazden/public_html/crm/adminn/login/index.php on line 2
[18-Jun-2014 08:30:20 UTC] PHP Fatal error: Call to undefined function IPvalid() in /home/farazden/public_html/crm/adminn/login/index.php on line 2
[18-Jun-2014 08:30:24 UTC] PHP Fatal error: Call to undefined function IPvalid() in /home/farazden/public_html/crm/adminn/login/index.php on line 2
[18-Jun-2014 08:31:00 UTC] PHP Fatal error: Call to undefined function IPvalid() in /home/farazden/public_html/crm/adminn/login/index.php on line 2
[18-Jun-2014 08:31:17 UTC] PHP Fatal error: Call to a member function select() on a non-object in /home/farazden/public_html/crm/library/config.php on line 84
[18-Jun-2014 08:31:19 UTC] PHP Fatal error: Call to a member function select() on a non-object in /home/farazden/public_html/crm/library/config.php on line 84
<?php
include_once('../../library/config.php');
if(strcmp($_SERVER['SERVER_NAME'],"dentalstock.ir")==0)
{
header('location: http://www.dentalstock.ir/adminn/login/');
}
$logadmin = new ADMIN();
if($logadmin->logincheck()){
header('location:../../adminn/');
}
if(isset($_POST['login']))
{
$username=$_POST['username'];
$password=$_POST['password'];
if( $logadmin->login($username,$password))
{
header('location:../../adminn/');
}
else
{
$err=$logadmin ->error;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div id="main" align="center" class="ui-corner-all , ui-widget-content">
ورود به مدیریت
<?php
if(isset($err))
{
echo "<span style='position:absolute;left :50%; color:red;font-size:12px;margin-top:100px;'>".$err."</span>";
}
?>
<div dir="rtl" style="margin-top: 100px;" >
<form dir="rtl" method="post" action="" style="padding: 10px;">
نام کاربری : <input type="text" name="username" style="line-height: 28px; font-size: 14px; outline: none;vertical-align: middle; width: 150px;height: 25px;" />
<br />
کلمه عبور : <input type="password" name="password" style="line-height: 28px;font-size: 14px;outline: none;vertical-align: middle;margin-top: 8px; width: 150px;height: 25px;" />
<br />
<input type="submit" name="login" value="ورود" style="font-family: tahoma;margin-left: 50px;margin-top: 3px;"/>
</form>
</div>
</div>
</td>
</tr>
<!-- Footer -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/footer.php');
?>
</table>
</body>
</html>
\ No newline at end of file
<?php
include_once('../../library/config.php');
$logadmin = new ADMIN();
if(!$logadmin->logincheck()){
header('location:../adminn/login/');
}
if(isset($_POST['edit']))
{
$title = $_POST['title'];
$meta_d = $_POST['meta_d'];
$meta_k = $_POST['meta_k'];
$db = new DB();
$db->connect();
$data = array("title"=>"'$title'","meta_d"=>"'$meta_d'","meta_k"=>"'$meta_k'");
$db->update("main",$data,null);
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].SITE.'/library/head.php');
?>
</head>
<body>
<!-- Base Table -->
<table class="body" cellspacing="0" cellpadding="0" align="center">
<!-- Head -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/library/header.php');
?>
<tr>
<!-- Main -->
<td align="center" >
<div id="main" align="center" class="ui-corner-all , ui-widget-content">
<div align="left" style="padding: 5px;"> <a href="login/logout.php"> LOGOUT </a> </div>
<?php
echo $_SESSION['admin_name'];
?>
پنل مدیریت
<hr />
<!-- Top Menu -->
<?php
include($_SERVER['DOCUMENT_ROOT'].SITE.'/adminn/library/topmenu.php');
?>
<br />
<?php
$db = new DB();
$db->connect();
$result = $db->select("main");
?>
<form method="post" action="">
<table align="right" dir="rtl">
<tr>
<td>
عنوان (title) :
</td>
<td align="right">
<textarea name="title" cols="50" rows="3"><?php echo $result[0]['title']; ?></textarea>
</td>
</tr>
<tr>
<td>
توضیحات (meta description) :
</td>
<td align="right">
<textarea name="meta_d" cols="50" rows="3"><?php echo $result[0]['meta_d']; ?></textarea>
</td>
</tr>
<tr>
<td>
کلمات کلیدی(meta keywords) :
</td>
<td align="right">
<textarea name="meta_k" cols="50" rows="3"><?php echo $result[0]['meta_k']; ?></textarea>
</td>