<?php



include("asl.php");


ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(E_ALL);


?>



<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html ; charset=utf-8" />
	<meta http-equiv="content-type" content="text/html" />
	<meta name="author" content="persian" />

	<title>پنل اختصاصی ربات تلگرام گروه توسعه دهندگان AHP</title>
	
	
    <link rel="Stylesheet" type="text/css" href="style.css" />

<style>

  @font-face
{
font-family: 'amir' ;
src:url('font/BKoodakBold.ttf')format('truetype'),
url('font/BKoodakBold.eot')format('eot'),
url('font/BKoodakBold.woff')format('woff');

}
.font{
    font-family:amir;
}

</style>



</head>

<body dir="rtl" align="center" >
<div align="center" >
<?php
//error_reporting(E_ALL);
//ini_set('display_errors', '1');
// import_request_variables("p" , "a_");


//old import
function checkarray($summerarray,$mainkey,$mainarray){
    if(in_array($mainkey, $summerarray)){
        unset($mainarray["$mainkey"]);
        return$mainarray;
    }
    else{
        return"ok";
    }
}

$summerarray=array();
$artest=$_POST;
foreach($artest as $postinfo){

    $ar_mainkey = array_search($postinfo, $artest);
    if(checkarray($summerarray,$ar_mainkey,$artest) != "ok"){
        $artest= checkarray($summerarray,$ar_mainkey,$artest) ;
        $ar_mainkey = array_search($postinfo, $artest);
    }
    ${'a_'.$ar_mainkey} = $postinfo;
    $summerarray[]=$ar_mainkey;
}
//old import


try {
    $conn = new PDO("mysql:host=$servername;dbname=$mydb", $username, $password ,  array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4"));
    // set the PDO error mode to exception

    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    }
catch(PDOException $e)
    {
    echo "Connection failed: " . $e->getMessage();
    }




              $sql = "select * from admin";
                $stmt =   $conn->prepare($sql);
                    $stmt->execute();

                        $result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
                         $show =$stmt->fetch()  ;

              $user = $show["user"];
              $pass= $show["pass"];


              $getpass= hash_hmac('md5',$a_pass , 'salt');


                 if($user == $a_user && $pass == $getpass){
   
  
  
  
  
  
    
 if(!$_FILES['myfile']['name']=="" && $_FILES["myfile"]["error"]==0  ){



      
$ext = end(explode('.',$_FILES['myfile']['name']));

$formats = array('jpg','JPG','gif','GIF','png','PNG','RAR','rar','ZIP','zip','mp4','3gp','mov');
if(!in_array($ext,$formats)){

    print"<p style='color:green' >پسوند معتبر برای آپلود نیست</p>";
    
    }
    elseif( file_exists('upload/'.$_FILES["myfile"]["name"])){
        print"<p style='color:green' >متاسفیم این فایل قبلا اپلود شده لطفا نام ان را تغییر دهید</p>";
      
    }
    elseif( 536870912 < $_FILES["myfile"]["size"]){
        

        print"<p style='color:green' >سایز فایل باید کمتر از نیم گیگ باشد</p>";
    }
    else{
        $path="upload/".$_FILES["myfile"]["name"];
        move_uploaded_file($_FILES["myfile"]["tmp_name"] , $path);
        print"
        <span class='green' >
        اپلود با موفقیت انجام 
        شد
        </span>
        ";
        
    }
  $thenamemyfile1=$_FILES["myfile"]["name"];

    $time=time();

    
    if($a_noa=="edit"){
         $sql = "update products set photo=\"$thenamemyfile1\" where id=\"$a_id\" ";
         $conn->exec($sql); 
    }
    
      
    }
    
    
    
  
  

  
  
   if(!$_FILES['myfile2']['name']=="" && $_FILES["myfile2"]["error"]==0  ){



      
$ext = end(explode('.',$_FILES['myfile2']['name']));

$formats = array('jpg','JPG','gif','GIF','png','PNG','RAR','rar','ZIP','zip','mp4','3gp','mov','ZIP','zip','rar','RAR','PDF','pdf');
if(!in_array($ext,$formats)){

    print"<p style='color:green' >پسوند معتبر برای آپلود نیست</p>";
    
    }
    elseif( file_exists('thefile/'.$_FILES["myfile2"]["name"])){
        print"<p style='color:green' >متاسفیم این فایل قبلا اپلود شده لطفا نام ان را تغییر دهید</p>";
      
    }
    elseif( 536870912 < $_FILES["myfile2"]["size"]){
        

        print"<p style='color:green' >سایز فایل باید کمتر از نیم گیگ باشد</p>";
    }
    else{
        $path="thefile/".$_FILES["myfile2"]["name"];
        move_uploaded_file($_FILES["myfile2"]["tmp_name"] , $path);
        print"
        <span class='green' >
        اپلود با موفقیت انجام 
        شد
        </span>
        ";
        
    }
  $thenamefile2=$_FILES["myfile2"]["name"];

    $time=time();

    
    if($a_noa=="edit"){
         $sql = "update products set fileaddress=\"$thenamefile2\" where id=\"$a_id\" ";
         $conn->exec($sql); 
    }
    
      
    }
  
  
  

    if($a_noa =='restore'){
    
        $c = $_POST['id_message3'];
        $page_section = $_POST['page_section'];

        // مقدار اولیه `id_message3` که در فرم `hidden` ارسال شده است
    $original_id_message3 = isset($_POST["original_id_message3"]) ? floatval($_POST["original_id_message3"]) : null;

    $problem = isset($_POST["problem"]) ? $_POST["problem"] : null;
    $problem_value = isset($_POST["problem_value"]) ? floatval($_POST["problem_value"]) : null;

    if ($original_id_message3 !== null && $problem_value !== null) {
        $initial_difference = $original_id_message3   - $problem_value;

    }


    // $sql="delete from  products where id=\"$a_id\" ";
    $sql = "UPDATE `products` SET `chatid` = 'not_assigned', `status` = 'ready', `problem` = 'no', `e_problem` = '', c='$c', ekhtelaf='$initial_difference', page_section='$page_section' WHERE `products`.`id` = \"$a_id\";";
    // $sql = "UPDATE `products` SET `chatid` = 'not_assigned', `status` = 'ready' WHERE `products`.`id` = \"$a_id\";";
    $conn->exec($sql);


    echo "<p style='color:green' >اکانت بازیابی  شد !</p>";
                             
    }

   
    
}

    
    
    
    
if($a_noa == "edit"){
        
                 $sql = "update  products  set id_message1='".$_POST['id_message1']."'  ,id_message2='".$_POST['id_message2']."' ,id_message3='".$_POST['id_message3']."',id_message4='".$_POST['id_message4']."',id_message5='".$_POST['id_message5']."',id_message6='".$_POST['id_message6']."',id_message7='".$_POST['id_message7']."',id_message8='".$_POST['id_message8']."',id_message9='".$_POST['id_message9']."',id_message10='".$_POST['id_message10']."' ,name='$name' 
                 where id='$a_id' ";
                 $conn->exec($sql);
                 echo "<p style='color:green' >محصول آپدیت شد</p>";
             
                
    }
    
    if($a_noa == "insert"){
        

        
                $sql="select * from products `status` = 'problem' ";
        $stmt = $conn->prepare($sql);
        $stmt->execute();
        $stmt->setFetchMode(PDO::FETCH_ASSOC);      
        $getter = $stmt->fetchAll();
        $numrowfusers = $stmt->rowCount();
        $newrow=$numrowfusers + 1; 
        
                $sql = "insert into products(a,b,c,id_message4,id_message5,id_message6,id_message7,id_message8,id_message9,id_message10,name,subject,page_section, cate) values (
                '".$_POST['a']."',
                '".$_POST['b']."',
                '".$_POST['c']."',
                '".$_POST['id_message4']."',
                '".$_POST['id_message5']."',
                '".$_POST['id_message6']."',
                '".$_POST['id_message7']."',
                '".$_POST['id_message8']."',
                '".$_POST['id_message9']."',
                '".$_POST['id_message10']."',

                \"$a_name\",
                \"$a_subjects\",
                \"$a_page_sections\",
                ''
                )";

                // print$sql;
         $conn->exec($sql);
    echo "<p style='color:green' >افزوده شد !</p>";
             
                
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
          




        else{
        
        
        
                    //   echo "<p style='color:red' >يوزرنيم و يا پسورد اشتباه وارد شده </p><br />
                    //   <a href='enter.php' target='_blank' >بازگشت به صفحه ی ورود</a>
              
                    //   ";
                      
     
     
                      function redirect($url){
     if (!headers_sent()){
         header('Location: '.$url); exit;
     }else{
         echo '<script type="text/javascript">';
         echo 'window.location.href="'.$url.'";';
         echo '</script>';
         echo '<noscript>';
         echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
         echo '</noscript>'; exit;
     }
     
     
     
    
     
     
 }
 
//   redirect("enter.php");
 
 
 
                      
                      
                      
        }







?>

<h1 class="white">پنل ربات تلگرام AHP</h1>
<br></br>
<h4 class="white">پنل اختصاصی ربات تلگرام نسخه1</h4>
<div id="content" align="right" >
<div id="content-content" >



<br />
<br /> 
<a href="https://telegram.me" target="_blank" >
<input class='button-blue' style="width:725px;" type="button" value="رفتن به داخل ربات" />
</a>

<br />

    <?php

    $sql="select mykey from layertwo  ";
    $stmt = $conn->prepare($sql);
    $stmt->execute();
    $stmt->setFetchMode(PDO::FETCH_ASSOC);
    $allCategories = $stmt->fetchAll();
    $numrowfusers = $stmt->rowCount();
    $newrow=$numrowfusers + 1;



    ?>
<div id="fish">

<!-- <table>


 <h5 class='gray'>◄ افزودن محتوای جدید</h5>

<form  enctype='multipart/form-data' method='post' action='group_a.php' >
<table>
<tr>

<th class='th' >a</th>
<th class='th'  >b</th>


</tr>
<tr>

<td align='center' class='td'  ><input placeholder="" type="text" name="a" class="font"></td>
<td align='center' class='td'  >    <input placeholder="" type="text" name="b" class="font"><br />
<input  type='hidden' name='user' value="<?php echo $a_user  ?>"  />
<input  type='hidden' name='pass' value="<?php echo $a_pass  ?>" class='font'  />
<input  type='hidden' name='noa' value="insert"  />
</td>

</tr>


<tr>
<th class='th' >c</th>
<th class='th'  >#</th>
</tr>
<tr>
<td align='center' class='td'  ><input placeholder="" type="text" name="c" class="font"></td>
<td align='center' class='td'  >#</td>ss
</tr>



<tr>

<th class='th' >گروه</th>
<th class='th'  >زیر گروه</th>


</tr>
<tr>
    
    <td  align='center' class='td' >

 <select name="subjects" class='font'>

 <option value='1' >1</option>
 <option value='2' >2</option>
 <option value='3' >3</option>
 <option value='4' >4</option>
 <option value='5' >5</option>
 <option value='6' >6</option>
</select>
                                    
</td>

    <td  align='center' class='td' >

 <select name="page_sections" class='font'>
 <option value='10' >10</option>
 <option value='25' >25</option>
 <option value='50' >50</option>
 <option value='100' >100</option>


</select>

</td>
</tr>


<tr>



    <td>


        <input type='submit' class='font' value='افزودن'  /> </td>

</tr>

</table>
</form>




   <br />
      <br />
         <br />
            <br />








<hr />
<hr />
<hr /> -->


<h3 class='gray'>◄ صفحه ی مشکلات A</h3>


<form method='post' action='a_problems.php'>
    <table>
        <tr>
            <th class='th'>مشکل</th>

        </tr>
        <tr>
            <td align='center' class='td'>
                <select name="problem" >
                    <option value="e">e</option>
                    <option value="f">f</option>
                    <option value="g">g</option>
                    <option value="h">h</option>
                    <option value="i">i</option>
                    <option value="p">p</option>
                </select>
                <input type='hidden' name='user' value="<?php echo $a_user  ?>" />
                <input type='hidden' name='pass' value="<?php echo $a_pass  ?>" />
            </td>




        </tr>


        <tr>

            <td> <input type='submit' name='search' class='font' value='تغيير' /> </td>

        </tr>

    </table>
</form>

<?php

if(isset($_POST['search'])){

    $problem = $_POST['problem'];
    $sql="select * from products WHERE problem='$problem' " ;
    print"<p>جست و جو برای  : $problem  </p>";
}
else{
    // $sql="select * from products order by id desc ";
    $sql="select * from products where `status`='problem' order by id desc ";

    
}
        $stmt = $conn->prepare($sql);
        $stmt->execute();
        $stmt->setFetchMode(PDO::FETCH_ASSOC);      
        $getter = $stmt->fetchAll();
        $numrowfusers = $stmt->rowCount();
        
        
  print" <h5 class='gray'>◄ تعداد محتوا ها : $numrowfusers </h5>";

?>


  </form>





      <?php


//      foreach($getter as $v){
       
 
        
//         $id_message1=$v["a"];
//         $id_message2=$v["b"];
//         $id_message3=$v["c"];
//         $problem=$v["problem"];
       

//         $name=$v["name"];
//         $id=$v["id"];
        
//         $subject=$v["subject"];
//         $page_section=$v["page_section"];
        
        

        



// print"
// <form  enctype='multipart/form-data' method='post' action='group_a.php' >
// <table>
// <tr>

// <th class='th' > a</th>
// <th class='th'  > b</th>


// </tr>
// <tr>

// <td align='center' class='td'  >

//     <input  type='text' class='font'  name='id_message1'       value=\"$id_message1\"  placeholder=''  />
// <td align='center' class='td'  >	

//     <input  type='text' class='font'  name='id_message2'       value=\"$id_message2\"  placeholder=''  />

// <br />




// <input  type='hidden' name='user' value=\"$a_user\"  />
// <input  type='hidden' name='pass' value=\"$a_pass\" class='font'  />
// <input  type='hidden' name='id' value=\"$id\" class='font'  />
// <input  type='hidden' name='noa' value=\"edit\" class='font'  />
// </td>




// </tr>






// <tr>
// <th class='th' > c</th>
// <th class='th'  >مشکل</th>
// </tr>
// <tr>
// <td align='center' class='td'  ><input  type='text' class='font'  name='id_message3' value=\"$id_message3\"  placeholder=''  /></td>
// <td align='center' class='td'  >$problem</td>
// </tr>





// <tr>

// <th class='th' >گروه</th>
// <th class='th'  >زیرگروه</th>


// </tr>
// <tr>
//     <td  align='center' class='td' >
//      $subject
// </td>

//     <td  align='center' class='td' >
//     $page_section
// </td>
// </tr>


// <tr>




// <td> 



// </tr>

// </table>
// </form>

//     <form method='post' action='group_a.php' >
//     <input  type='hidden' name='user' value=\"$a_user\" />
//         <input  type='hidden' name='pass' value=\"$a_pass\"\" class='font'  />
//         <input  type='hidden' name='noa' value='restore' class='font'  />
//         <input  type='hidden' name='id' value=\"$id\"  />
//         <input  type='submit'  value='بازیابی' class='font'  />
//     </form>
//     </td>
//       </form>
// <hr /><hr /><hr />


// ";

//      }



// foreach($getter as $v){
//     $id_message1 = $v["a"];
//     $id_message2 = $v["b"];
//     $id_message3 = $v["c"];
//     $problem = $v["problem"];
//     $e_problem = $v["e_problem"];
//     $h_problem = $v["h_problem"];
//     $g_problem = $v["g_problem"];
//     $f_problem = $v["f_problem"];
//     $p_problem = $v["p_problem"];
//     $i_problem = $v["i_problem"];
//     $name = $v["name"];
//     $id = $v["id"];
//     $subject = $v["subject"];
//     $page_section = $v["page_section"];

//     print "
//     <form enctype='multipart/form-data' method='post' action='a_problems.php'>
//         <table>
//             <tr>
//                 <th class='th'>a</th>
//                 <th class='th'>b</th>
//             </tr>
//             <tr>
//                 <td align='center' class='td'>
//                     <input type='text' class='font' name='id_message1' value=\"$id_message1\" placeholder='' />
//                 </td>
//                 <td align='center' class='td'>
//                     <input type='text' class='font' name='id_message2' value=\"$id_message2\" placeholder='' />
//                 </td>
//             </tr>
//             <tr>
//                 <th class='th'>c</th>
//                 <th class='th'>مشکل</th>
//             </tr>
//             <tr>
//                 <td align='center' class='td'>
//                     <input type='text' class='font' name='id_message3' value=\"$id_message3\" placeholder='' />
//                 </td>
//                 <td align='center' class='td'>$problem</td>
//             </tr>";

//     // Check if $problem is equal to 'e' and show the extra column
//     if ($problem == 'e') {
//         print "
//             <tr>
//                 <th class='th'>مقدار مشکل e</th>
//                 <th class='th'>اختلاف e - c</th>
//             </tr>
			
//             <tr>
//                 <td align='center' class='td'>$e_problem</td>
//                 <td align='center' class='td'>".(floatval($id_message3) - floatval($e_problem))."</td>
//             </tr>";
//     }

//     if ($problem == 'h') {
//         print "
//             <tr>
//                 <th class='th'>مقدار مشکل h</th>
//                 <th class='th'>اختلاف h - c</th>
//             </tr>
			
//             <tr>
//                 <td align='center' class='td'>$h_problem</td>
//                 <td align='center' class='td'>".(floatval($id_message3) - floatval($e_problem))."</td>
//             </tr>";
//     }

//     if ($problem == 'f') {
//         print "
//             <tr>
//                 <th class='th'>مقدار مشکل f</th>
//                 <th class='th'>اختلاف f - c</th>
//             </tr>
			
//             <tr>
//                 <td align='center' class='td'>$f_problem</td>
//                 <td align='center' class='td'>".(floatval($id_message3) - floatval($e_problem))."</td>
//             </tr>";
//     }

//     if ($problem == 'g') {
//         print "
//             <tr>
//                 <th class='th'>مقدار مشکل g</th>
//                 <th class='th'>اختلاف g - c</th>
//             </tr>
			
//             <tr>
//                 <td align='center' class='td'>$g_problem</td>
//                 <td align='center' class='td'>".(floatval($id_message3) - floatval($g_problem))."</td>
//             </tr>";
//     }

//     if ($problem == 'p') {
//         print "
//             <tr>
//                 <th class='th'>مقدار مشکل p</th>
//                 <th class='th'>اختلاف p - c</th>
//             </tr>
			
//             <tr>
//                 <td align='center' class='td'>$p_problem</td>
//                 <td align='center' class='td'>".(floatval($id_message3) - floatval($p_problem))."</td>
//             </tr>";
//     }

//     if ($problem == 'i') {
//         print "
//             <tr>
//                 <th class='th'>مقدار مشکل p</th>
//                 <th class='th'>اختلاف i - c</th>
//             </tr>
			
//             <tr>
//                 <td align='center' class='td'>$i_problem</td>
//                 <td align='center' class='td'>".(floatval($id_message3) - floatval($i_problem))."</td>
//             </tr>";
//     }

//     print "
//             <tr>
//                 <th class='th'>گروه</th>
//                 <th class='th'>زیرگروه</th>
//             </tr>
			
//             <tr>
//                 <td align='center' class='td'>$subject</td>
//                 <td align='center' class='td'>$page_section</td>
//             </tr>
//         </table>
//     </form>

//     <form method='post' action='a_problems.php'>
//         <input type='hidden' name='user' value=\"$a_user\" />
//         <input type='hidden' name='pass' value=\"$a_pass\" class='font' />
//         <input type='hidden' name='noa' value='restore' class='font' />
//         <input type='hidden' name='id' value=\"$id\" />
//         <input type='submit' value='بازیابی' class='font' />
//     </form>
//     <hr /><hr /><hr />";
// }


// foreach($getter as $v) {
//     $id_message1 = $v["a"];
//     $id_message2 = $v["b"];
//     $id_message3 = $v["c"]; // مقدار اولیه که باید ذخیره شود
//     $problem = $v["problem"];
//     $e_problem = $v["e_problem"];
//     $h_problem = $v["h_problem"];
//     $g_problem = $v["g_problem"];
//     $f_problem = $v["f_problem"];
//     $p_problem = $v["p_problem"];
//     $i_problem = $v["i_problem"];
//     $name = $v["name"];
//     $id = $v["id"];
//     $subject = $v["subject"];
//     $page_section = $v["page_section"];

//     // مقدار مشکل مربوطه را پیدا کنیم
//     $problem_value = null;
//     if ($problem == 'e') $problem_value = $e_problem;
//     elseif ($problem == 'h') $problem_value = $h_problem;
//     elseif ($problem == 'f') $problem_value = $f_problem;
//     elseif ($problem == 'g') $problem_value = $g_problem;
//     elseif ($problem == 'p') $problem_value = $p_problem;
//     elseif ($problem == 'i') $problem_value = $i_problem;

//     print "
//     <form enctype='multipart/form-data' method='post' action='a_problems.php'>
//         <table>
//             <tr>
//                 <th class='th'>a</th>
//                 <th class='th'>b</th>
//             </tr>
//             <tr>
//                 <td align='center' class='td'>
//                     <input type='text' class='font' name='id_message1' value=\"$id_message1\" placeholder='' />
//                 </td>
//                 <td align='center' class='td'>
//                     <input type='text' class='font' name='id_message2' value=\"$id_message2\" placeholder='' />
//                 </td>
//             </tr>
//             <tr>
//                 <th class='th'>c (قابل تغییر)</th>
//                 <th class='th'>مشکل</th>
//             </tr>
//             <tr>
//                 <td align='center' class='td'>
//                     <input type='text' class='font' name='id_message3' value=\"$id_message3\" />
//                 </td>
//                 <td align='center' class='td'>$problem</td>
//             </tr>";

//     if ($problem_value !== null) {
//         print "
//             <tr>
//                 <th class='th'>مقدار مشکل $problem</th>
//                 <th class='th'>اختلاف اولیه ($problem - c)</th>
//             </tr>
//             <tr>
//                 <td align='center' class='td'>$problem_value</td>
//                 <td align='center' class='td'>".(floatval($id_message3 ) - floatval($problem_value))."</td>
//             </tr>";
//     }

//     print "
//             <tr>
//                 <th class='th'>گروه</th>
//                 <th class='th'>زیرگروه</th>
//             </tr>
//             <tr>
//                 <td align='center' class='td'>$subject</td>
//                 <td align='center' class='td'>$page_section</td>
//             </tr>
//         </table>

//         <!-- مقدار اولیه `id_message3` را در hidden ذخیره کنیم -->
//         <input type='hidden' name='original_id_message3' value=\"$id_message3\" />
//         <input type='hidden' name='problem' value=\"$problem\" />
//         <input type='hidden' name='problem_value' value=\"$problem_value\" />
//         <input type='hidden' name='id' value=\"$id\" />

//         <input type='hidden' name='noa' value='restore' class='font' />
//         <input type='hidden' name='user' value='$a_user' />
//         <input type='hidden' name='pass' value='$a_pass' />

//         <input type='submit' value='بازیابی' class='font' />
//     </form>
//     <hr /><hr /><hr />";
// }


foreach($getter as $v) {
    $id_message1 = $v["a"];
    $id_message2 = $v["b"];
    $id_message3 = $v["c"]; // مقدار اولیه که باید ذخیره شود
    $problem = $v["problem"];
    $e_problem = $v["e_problem"];
    $h_problem = $v["h_problem"];
    $g_problem = $v["g_problem"];
    $f_problem = $v["f_problem"];
    $p_problem = $v["p_problem"];
    $i_problem = $v["i_problem"];
    $name = $v["name"];
    $id = $v["id"];
    $subject = $v["subject"];
    $page_section = $v["page_section"];

    // مقدار مشکل مربوطه را پیدا کنیم
    $problem_value = null;
    if ($problem == 'e') $problem_value = $e_problem;
    elseif ($problem == 'h') $problem_value = $h_problem;
    elseif ($problem == 'f') $problem_value = $f_problem;
    elseif ($problem == 'g') $problem_value = $g_problem;
    elseif ($problem == 'p') $problem_value = $p_problem;
    elseif ($problem == 'i') $problem_value = $i_problem;

    print "
    <form enctype='multipart/form-data' method='post' action='a_problems.php'>
        <table>
            <tr>
                <th class='th'>a</th>
                <th class='th'>b</th>
            </tr>
            <tr>
                <td align='center' class='td'>
                    <input type='text' class='font' name='id_message1' value=\"$id_message1\" placeholder='' />
                </td>
                <td align='center' class='td'>
                    <input type='text' class='font' name='id_message2' value=\"$id_message2\" placeholder='' />
                </td>
            </tr>
            <tr>
                <th class='th'>c (قابل تغییر)</th>
                <th class='th'>مشکل</th>
            </tr>
            <tr>
                <td align='center' class='td'>
                    <input type='text' class='font' name='id_message3' value=\"$id_message3\" />
                </td>
                <td align='center' class='td'>$problem</td>
            </tr>";

    if ($problem_value !== null) {
        print "
            <tr>
                <th class='th'>مقدار مشکل $problem</th>
                <th class='th'>اختلاف اولیه ($problem - c)</th>
            </tr>
            <tr>
                <td align='center' class='td'>$problem_value</td>
                <td align='center' class='td'>".(floatval($id_message3 ) - floatval($problem_value))."</td>
            </tr>";
    }

    // Modify this part to make 'page_section' editable as a dropdown
    print "
            <tr>
                <th class='th'>گروه</th>
                <th class='th'>زیرگروه</th>
            </tr>
            <tr>
                <td align='center' class='td'>$subject</td>
                <td align='center' class='td'>
                    <select name='page_section' class='font'>
                        <option value='10' ".($page_section == '10' ? 'selected' : '').">10</option>
                        <option value='25' ".($page_section == '25' ? 'selected' : '').">25</option>
                        <option value='50' ".($page_section == '50' ? 'selected' : '').">50</option>
                        <option value='100' ".($page_section == '100' ? 'selected' : '').">100</option>
                    </select>
                </td>
            </tr>
        </table>

        <!-- مقدار اولیه `id_message3` را در hidden ذخیره کنیم -->
        <input type='hidden' name='original_id_message3' value=\"$id_message3\" />
        <input type='hidden' name='problem' value=\"$problem\" />
        <input type='hidden' name='problem_value' value=\"$problem_value\" />
        <input type='hidden' name='id' value=\"$id\" />

        <input type='hidden' name='noa' value='restore' class='font' />
        <input type='hidden' name='user' value='$a_user' />
        <input type='hidden' name='pass' value='$a_pass' />

        <input type='submit' value='بازیابی' class='font' />
    </form>
    <hr /><hr /><hr />";
}





?>































<hr />
<hr />
<hr />



<br />
<br />
</div>
   </div>




<a style="text-decoration:none ;" href="http://ahpteam.com" target="_blank" class="gray" >طراحي شده توسط تيم توسعه دهندگان AHP</a>
</div>

<?php
  $conn = null;
?>
</body>
</html>