باز نشدن فرم ها ست کردن GET query

پرسیده شده
فعالیت 953 روز پیش
دیده شده 362 بار
0

با سلام
پروژه من مشابه پروژه هست با این تفاوت به جای فولدر, پروژه وجود داره.
به جای تسک هم هدف برای تکمیل پروژه

برای وارد کردن پروژه و هدف های پروژه از Button استفاده میکنم که وقتی کیلک میشه فرم نمایش داده بشه

 

وقتی برای اضافه کردن تسک ها از Get query استفاده میکنم, اگر Get query تعریف نشده باشه فرم ها هیچ کدوم بعد از کلیک کردن نمایش داده نمیشن, فقط زمانی توی Get query url ثبت شده باشه فرم ها قابل نمایش هستن
 

برای ثبت پروژه توی صفحه اصلی به مشکل میخورم

 

Handler

<?php
include_once "../bootstrap/init.php";



switch ($_POST['action']) {
    case 'addProject':

        $projectName = $_POST['project'];
        addNewProject($projectName);

        break;
    
    case 'addAssignment':
        
        $AssignmenName = $_POST['AssignmentTitle'];
        $ProjectId = $_POST['ProjectId'];
        $deadl = $_POST['deadline'];
        $deadline = deadtime($deadl) ;
        addNewAssignment($ProjectId , $AssignmenName , $deadline);

        break;
        
    default:
        echo "invalid Action!" ;
        break;
}

// $projectName = $_POST['project'];

// addNewProject($projectName);



?>

 

index

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title><?= SITE_TITLE ?></title>

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
  <link rel="stylesheet" href="./assets/css/style.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
  <link rel="stylesheet" href="./assets/css/mystyle.css">


</head>

<body>
  <!-- partial:index.partial.html -->

  <div class="app-container">
    <div class="app-header">
      <div class="app-header-left">
        <span class="app-icon"></span>
        <p class="app-name">Portfolio</p>
        <div class="search-wrapper">
          <input class="search-input" type="text" placeholder="جست و جو">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="feather feather-search" viewBox="0 0 24 24">
            <defs></defs>
            <circle cx="11" cy="11" r="8"></circle>
            <path d="M21 21l-4.35-4.35"></path>
          </svg>
        </div>
      </div>


      <div class="app-header-right">
        <button class="mode-switch" title="Switch Theme">
          <svg class="moon" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="24" height="24" viewBox="0 0 24 24">
            <defs></defs>
            <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
          </svg>
        </button>



        <button class="notification-btn">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bell">
            <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" />
            <path d="M13.73 21a2 2 0 0 1-3.46 0" />
          </svg>
        </button>
        <button class="profile-btn">
          <img src="https://assets.codepen.io/3306515/IMG_2025.jpg" />
          <span>آرمان محمدی پور</span>
        </button>
      </div>
      <button class="messages-btn">
        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-message-circle">
          <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" />
        </svg>
      </button>
    </div>



    <div class="app-content">
      <div class="app-sidebar">
        <a href="" class="app-sidebar-link active">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home">
            <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
            <polyline points="9 22 9 12 15 12 15 22" />
          </svg>
        </a>
        <a href="" class="app-sidebar-link">
          <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="feather feather-pie-chart" viewBox="0 0 24 24">
            <defs />
            <path d="M21.21 15.89A10 10 0 118 2.83M22 12A10 10 0 0012 2v10z" />
          </svg>
        </a>

        <a href="" class="app-sidebar-link">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="bi bi-folder-plus" viewBox="0 0 16 16">
            <path d="m.5 3 .04.87a1.99 1.99 0 0 0-.342 1.311l.637 7A2 2 0 0 0 2.826 14H9v-1H2.826a1 1 0 0 1-.995-.91l-.637-7A1 1 0 0 1 2.19 4h11.62a1 1 0 0 1 .996 1.09L14.54 8h1.005l.256-2.819A2 2 0 0 0 13.81 3H9.828a2 2 0 0 1-1.414-.586l-.828-.828A2 2 0 0 0 6.172 1H2.5a2 2 0 0 0-2 2zm5.672-1a1 1 0 0 1 .707.293L7.586 3H2.19c-.24 0-.47.042-.683.12L1.5 2.98a1 1 0 0 1 1-.98h3.672z" />
            <path d="M13.5 10a.5.5 0 0 1 .5.5V12h1.5a.5.5 0 1 1 0 1H14v1.5a.5.5 0 1 1-1 0V13h-1.5a.5.5 0 0 1 0-1H13v-1.5a.5.5 0 0 1 .5-.5z" />
          </svg>
        </a>

        <a href="login.php" class="app-sidebar-link">
          <svg aria-labelledby="svg-inline--fa-title-N46xHuwbgBWo" data-prefix="far" data-icon="sign-in-alt" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-sign-in-alt fa-w-16 fa-fw fa-lg">
            <title id="svg-inline--fa-title-N46xHuwbgBWo" class="">Sign In</title>
            <path fill="currentColor" d="M144 112v51.6H48c-26.5 0-48 21.5-48 48v88.6c0 26.5 21.5 48 48 48h96v51.6c0 42.6 51.7 64.2 81.9 33.9l144-143.9c18.7-18.7 18.7-49.1 0-67.9l-144-144C195.8 48 144 69.3 144 112zm192 144L192 400v-99.7H48v-88.6h144V112l144 144zm80 192h-84c-6.6 0-12-5.4-12-12v-24c0-6.6 5.4-12 12-12h84c26.5 0 48-21.5 48-48V160c0-26.5-21.5-48-48-48h-84c-6.6 0-12-5.4-12-12V76c0-6.6 5.4-12 12-12h84c53 0 96 43 96 96v192c0 53-43 96-96 96z" class=""></path>
          </svg>
          <rect x="3" y="4" width="18" height="18" rx="2" ry="2" />
          <line x1="16" y1="2" x2="16" y2="6" />
          <line x1="8" y1="2" x2="8" y2="6" />
          <line x1="3" y1="10" x2="21" y2="10" /></svg>
        </a>
        <a href="" class="app-sidebar-link">
          <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="feather feather-settings" viewBox="0 0 24 24">
            <defs />
            <circle cx="12" cy="12" r="3" />
            <path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z" />
          </svg>
        </a>
      </div>



      <div class="projects-section">


        <div class="projects-section-header">
          <button class="projectbt" title="Add New Project" onclick="openAddProject()">
            افزودن پروژه جدید
          </button>

          <div class="form-popup" id="addproject">
            <form action="" class="form-container" method="POST">
              <h4>افزودن پروژه</h4>

              <label for="project"><b>نام پروژه را وارد کنید.</b></label>
              <input type="text" id="newProjectinp" placeholder="نام پروژه را وارد کنید" name="project" required>

              <button type="submit" id="addProjects" class="addProjectbutton">افزودن</button>
              <button type="button" class="btn cancel" onclick="closeAddProject()">بستن</button>
            </form>
          </div>
          <p class="time"><?= jdate("j , F"); ?></p>
        </div>

        <div class="project-boxes jsGridView">



          <div class="project-box-wrapper">
            <div class="project-box" style="background-color: #fee4cb;">
              <div class="project-box-header">
                <span>اردیبهشت ۱۰, ۱۳۹۹</span>
                <div class="more-wrapper">
                  <button class="project-btn-more">
                    <i class="fa fa-trash"></i>
                  </button>
                </div>
              </div>
              <div class="project-box-content-header">
                <p class="box-content-header">طراحی سایت</p>
              </div>
              <div class="box-progress-wrapper">
                <p class="box-progress-header">پیشرفت</p>
                <div class="box-progress-bar">
                  <span class="box-progress" style="width: 60%; background-color: #ff942e"></span>
                </div>
                <p class="box-progress-percentage">۶۰%</p>
              </div>
              <div class="project-box-footer">
                <div class="participants">
                  <button class="add-participant" style="color: #ff942e;">
                    <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus">
                      <path d="M12 5v14M5 12h14" />
                    </svg>
                  </button>
                </div>
                <div class="days-left" style="color: #ff942e;">
                  ۲ روز مانده
                </div>
              </div>
            </div>
          </div>



          <?php foreach ($getpro as $project) : ?>

            <div class="project-box-wrapper">
              <div class="project-box" style="background-color: #e9e7fd;">
                <div class="project-box-header">
                  <span><?php $timeInDb = $project->created_at;
                        echo chengTime($timeInDb);
                        ?></span>



                  <a href="?delete_id=<?= $project->id ?>">
                    <div class="more-wrapper">
                      <button class="project-btn-more" id="delproject">
                        <i class="fa fa-trash"></i>
                      </button>
                    </div>
                  </a>
                </div>

                <a class="projectNameD" href="?project_id=<?= $project->id ?>">
                  <div class="project-box-content-header">
                    <p class="box-content-header"><?= $project->name ?></p>
                  </div>
                </a>
                <div class="box-progress-wrapper">
                  <p class="box-progress-header">پیشرفت پروژه</p>
                  <div class="box-progress-bar">
                    <span class="box-progress" style="width: 50%; background-color: #4f3ff0"></span>
                  </div>
                  <p class="box-progress-percentage">۴۳%</p>
                </div>
                <div class="project-box-footer">
                  <div class="participants">
                    <button class="add-participant" style="color: #4f3ff0;" onclick="openForm()">
                      <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus">
                        <path d="M12 5v14M5 12h14" />
                      </svg>
                    </button>

                    <div class="form-popup" id="addassignment">
                      <form action="" class="form-container">
                        <h4>افزودن هدف برای پروژه <?= $project->name ?></h4>

                        <label for="assignment"><b>نام هدف</b></label>
                        <input type="text" placeholder="هدف را وارد کنید." id="inpAssigtbtn" class="addAssignmentinput" name="assignment" required>

                        <label for="assignment"><b>روز های مورد نیاز جهت تکمیل</b></label>
                        <input type="text" placeholder="تعداد روز را وارد کنید" id="inpAssigtdead" class="addAssignmentinput" name="assignment" required>

                        <button type="submit" id="addAssigtbtn" class="addAssignmentbutton">افزودن</button>
                        <button type="button" class="btn cancel" onclick="closeForm()">بستن</button>
                      </form>
                    </div>
                  </div>
                  <div class="days-left" style="color: #4f3ff0;">
                    اهداف باقی مانده : ۶ تا


                  </div>
                </div>
              </div>
            </div>
          <?php endforeach; ?>



        </div>
      </div>

      <div id="openass" class="messages-section" ;>
        <?php foreach ($getAss as $Assignment) : ?>
          <div class="project-box-wrapper">
            <div class="project-box" style="background-color: #ffd3e2;">
              <div class="project-box-header">
                <span> زمان ثبت : <?php $timeInDb = $Assignment->created_at;
                                  echo chengTime($timeInDb); ?></span>
                <div class="more-wrapper">
                  <a href="?deleteAssignment=<?= $Assignment->id ?>"><i class="fa fa-trash"></i></a>
                </div>
              </div>
              <div class="chekbox">
                <p><?= $Assignment->title ?></p>
                <div class="iconchekbox">
                  <input type="checkbox" id="myCheck" onclick="chekbox()">
                  <p id="text" style="display:none">هدف تکمیل شد.</p>
                </div>
              </div>
              <div class="project-box-footer">
                <div class="days-left" style="color: #ff942e;">
                  <?php $timeInDtb = $Assignment->deadline;
                  echo deadline($timeInDtb); ?>
                  روز مانده تا پایان زمان مشخص شده</div>
              </div>
            </div>
          </div>

        <?php endforeach; ?>
      </div>




      <script src="./assets/js/script.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.js" integrity="sha512-n/4gHW3atM3QqRcbCn6ewmpxcLAHGaDjpEBu4xZd47N0W2oQ+6q7oc3PXstrJYXcbNU1OHdQ1T7pAP+gi5Yu8g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>


      <script>
        function openForm() {
          document.getElementById("addassignment").style.display = "block";
        }

        function closeForm() {
          document.getElementById("addassignment").style.display = "none";
        }

        function openAddProject() {
          document.getElementById("addproject").style.display = "block";
        }

        function closeAddProject() {
          document.getElementById("addproject").style.display = "none";
        }

        $(document).ready(function() {
          var btnp = $('#addProjects');
          var project = $('#newProjectinp');

          var btnA = $('#addAssigtbtn');
          var inpA = $('#inpAssigtbtn');
          var inpD = $('#inpAssigtdead');

          btnp.click(function() {
            $.ajax({
              url: 'process/ajaxHandler.php',
              method: 'POST',
              data: {
                action: "addProject",
                project: project.val()
              },
              success: function(response) {
                alert(response);
              },
              error: function(response) {
                alert(response);
              }
            });
          })

          btnA.click(function() {
            $.ajax({
              url: 'process/ajaxHandler.php',
              method: 'POST',
              data: {
                action: "addAssignment",
                ProjectId: <?= getProjectId() ?>,
                AssignmenName: inpA.val(),
                deadl: inpD.val(),
              },
              success: function(response) {
                alert(response);
              },
              error: function(response) {
                alert(response);
              }
            });
          })

        });


      </script>

      </script>
</body>

</html>
فایل پیوست

آرمان محمدی پور
آرمان محمدی پور

19 شهریور 00

0
حذف شده

*index

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title><?= SITE_TITLE ?></title>

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
  <link rel="stylesheet" href="./assets/css/style.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
  <link rel="stylesheet" href="./assets/css/mystyle.css">


</head>

<body>
  <!-- partial:index.partial.html -->

  <div class="app-container">
    <div class="app-header">
      <div class="app-header-left">
        <span class="app-icon"></span>
        <p class="app-name">Portfolio</p>
        <div class="search-wrapper">
          <input class="search-input" type="text" placeholder="جست و جو">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="feather feather-search" viewBox="0 0 24 24">
            <defs></defs>
            <circle cx="11" cy="11" r="8"></circle>
            <path d="M21 21l-4.35-4.35"></path>
          </svg>
        </div>
      </div>


      <div class="app-header-right">
        <button class="mode-switch" title="Switch Theme">
          <svg class="moon" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="24" height="24" viewBox="0 0 24 24">
            <defs></defs>
            <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
          </svg>
        </button>



        <button class="notification-btn">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bell">
            <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" />
            <path d="M13.73 21a2 2 0 0 1-3.46 0" />
          </svg>
        </button>
        <button class="profile-btn">
          <img src="https://assets.codepen.io/3306515/IMG_2025.jpg" />
          <span>آرمان محمدی پور</span>
        </button>
      </div>
      <button class="messages-btn">
        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-message-circle">
          <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" />
        </svg>
      </button>
    </div>



    <div class="app-content">
      <div class="app-sidebar">
        <a href="" class="app-sidebar-link active">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home">
            <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
            <polyline points="9 22 9 12 15 12 15 22" />
          </svg>
        </a>
        <a href="" class="app-sidebar-link">
          <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="feather feather-pie-chart" viewBox="0 0 24 24">
            <defs />
            <path d="M21.21 15.89A10 10 0 118 2.83M22 12A10 10 0 0012 2v10z" />
          </svg>
        </a>

        <a href="" class="app-sidebar-link">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="bi bi-folder-plus" viewBox="0 0 16 16">
            <path d="m.5 3 .04.87a1.99 1.99 0 0 0-.342 1.311l.637 7A2 2 0 0 0 2.826 14H9v-1H2.826a1 1 0 0 1-.995-.91l-.637-7A1 1 0 0 1 2.19 4h11.62a1 1 0 0 1 .996 1.09L14.54 8h1.005l.256-2.819A2 2 0 0 0 13.81 3H9.828a2 2 0 0 1-1.414-.586l-.828-.828A2 2 0 0 0 6.172 1H2.5a2 2 0 0 0-2 2zm5.672-1a1 1 0 0 1 .707.293L7.586 3H2.19c-.24 0-.47.042-.683.12L1.5 2.98a1 1 0 0 1 1-.98h3.672z" />
            <path d="M13.5 10a.5.5 0 0 1 .5.5V12h1.5a.5.5 0 1 1 0 1H14v1.5a.5.5 0 1 1-1 0V13h-1.5a.5.5 0 0 1 0-1H13v-1.5a.5.5 0 0 1 .5-.5z" />
          </svg>
        </a>

        <a href="login.php" class="app-sidebar-link">
          <svg aria-labelledby="svg-inline--fa-title-N46xHuwbgBWo" data-prefix="far" data-icon="sign-in-alt" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-sign-in-alt fa-w-16 fa-fw fa-lg">
            <title id="svg-inline--fa-title-N46xHuwbgBWo" class="">Sign In</title>
            <path fill="currentColor" d="M144 112v51.6H48c-26.5 0-48 21.5-48 48v88.6c0 26.5 21.5 48 48 48h96v51.6c0 42.6 51.7 64.2 81.9 33.9l144-143.9c18.7-18.7 18.7-49.1 0-67.9l-144-144C195.8 48 144 69.3 144 112zm192 144L192 400v-99.7H48v-88.6h144V112l144 144zm80 192h-84c-6.6 0-12-5.4-12-12v-24c0-6.6 5.4-12 12-12h84c26.5 0 48-21.5 48-48V160c0-26.5-21.5-48-48-48h-84c-6.6 0-12-5.4-12-12V76c0-6.6 5.4-12 12-12h84c53 0 96 43 96 96v192c0 53-43 96-96 96z" class=""></path>
          </svg>
          <rect x="3" y="4" width="18" height="18" rx="2" ry="2" />
          <line x1="16" y1="2" x2="16" y2="6" />
          <line x1="8" y1="2" x2="8" y2="6" />
          <line x1="3" y1="10" x2="21" y2="10" /></svg>
        </a>
        <a href="" class="app-sidebar-link">
          <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="feather feather-settings" viewBox="0 0 24 24">
            <defs />
            <circle cx="12" cy="12" r="3" />
            <path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z" />
          </svg>
        </a>
      </div>



      <div class="projects-section">


        <div class="projects-section-header">
          <button class="projectbt" title="Add New Project" onclick="openAddProject()">
            افزودن پروژه جدید
          </button>

          <div class="form-popup" id="addproject">
            <form action="" class="form-container" method="POST">
              <h4>افزودن پروژه</h4>

              <label for="project"><b>نام پروژه را وارد کنید.</b></label>
              <input type="text" id="newProjectinp" placeholder="نام پروژه را وارد کنید" name="project" required>

              <button type="submit" id="addProjects" class="addProjectbutton">افزودن</button>
              <button type="button" class="btn cancel" onclick="closeAddProject()">بستن</button>
            </form>
          </div>
          <p class="time"><?= jdate("j , F"); ?></p>
        </div>

        <div class="project-boxes jsGridView">



          <div class="project-box-wrapper">
            <div class="project-box" style="background-color: #fee4cb;">
              <div class="project-box-header">
                <span>اردیبهشت ۱۰, ۱۳۹۹</span>
                <div class="more-wrapper">
                  <button class="project-btn-more">
                    <i class="fa fa-trash"></i>
                  </button>
                </div>
              </div>
              <div class="project-box-content-header">
                <p class="box-content-header">طراحی سایت</p>
              </div>
              <div class="box-progress-wrapper">
                <p class="box-progress-header">پیشرفت</p>
                <div class="box-progress-bar">
                  <span class="box-progress" style="width: 60%; background-color: #ff942e"></span>
                </div>
                <p class="box-progress-percentage">۶۰%</p>
              </div>
              <div class="project-box-footer">
                <div class="participants">
                  <button class="add-participant" style="color: #ff942e;">
                    <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus">
                      <path d="M12 5v14M5 12h14" />
                    </svg>
                  </button>
                </div>
                <div class="days-left" style="color: #ff942e;">
                  ۲ روز مانده
                </div>
              </div>
            </div>
          </div>



          <?php foreach ($getpro as $project) : ?>

            <div class="project-box-wrapper">
              <div class="project-box" style="background-color: #e9e7fd;">
                <div class="project-box-header">
                  <span><?php $timeInDb = $project->created_at;
                        echo chengTime($timeInDb);
                        ?></span>



                  <a href="?delete_id=<?= $project->id ?>">
                    <div class="more-wrapper">
                      <button class="project-btn-more" id="delproject">
                        <i class="fa fa-trash"></i>
                      </button>
                    </div>
                  </a>
                </div>

                <a class="projectNameD" href="?project_id=<?= $project->id ?>">
                  <div class="project-box-content-header">
                    <p class="box-content-header"><?= $project->name ?></p>
                  </div>
                </a>
                <div class="box-progress-wrapper">
                  <p class="box-progress-header">پیشرفت پروژه</p>
                  <div class="box-progress-bar">
                    <span class="box-progress" style="width: 50%; background-color: #4f3ff0"></span>
                  </div>
                  <p class="box-progress-percentage">۴۳%</p>
                </div>
                <div class="project-box-footer">
                  <div class="participants">
                    <button class="add-participant" style="color: #4f3ff0;" onclick="openForm()">
                      <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus">
                        <path d="M12 5v14M5 12h14" />
                      </svg>
                    </button>

                    <div class="form-popup" id="addassignment">
                      <form action="" class="form-container">
                        <h4>افزودن هدف برای پروژه <?= $project->name ?></h4>

                        <label for="assignment"><b>نام هدف</b></label>
                        <input type="text" placeholder="هدف را وارد کنید." id="inpAssigtbtn" class="addAssignmentinput" name="assignment" required>

                        <label for="assignment"><b>روز های مورد نیاز جهت تکمیل</b></label>
                        <input type="text" placeholder="تعداد روز را وارد کنید" id="inpAssigtdead" class="addAssignmentinput" name="assignment" required>

                        <button type="submit" id="addAssigtbtn" class="addAssignmentbutton">افزودن</button>
                        <button type="button" class="btn cancel" onclick="closeForm()">بستن</button>
                      </form>
                    </div>
                  </div>
                  <div class="days-left" style="color: #4f3ff0;">
                    اهداف باقی مانده : ۶ تا


                  </div>
                </div>
              </div>
            </div>
          <?php endforeach; ?>



        </div>
      </div>

      <div id="openass" class="messages-section" ;>
        <?php foreach ($getAss as $Assignment) : ?>
          <div class="project-box-wrapper">
            <div class="project-box" style="background-color: #ffd3e2;">
              <div class="project-box-header">
                <span> زمان ثبت : <?php $timeInDb = $Assignment->created_at;
                                  echo chengTime($timeInDb); ?></span>
                <div class="more-wrapper">
                  <a href="?deleteAssignment=<?= $Assignment->id ?>"><i class="fa fa-trash"></i></a>
                </div>
              </div>
              <div class="chekbox">
                <p><?= $Assignment->title ?></p>
                <div class="iconchekbox">
                  <input type="checkbox" id="myCheck" onclick="chekbox()">
                  <p id="text" style="display:none">هدف تکمیل شد.</p>
                </div>
              </div>
              <div class="project-box-footer">
                <div class="days-left" style="color: #ff942e;">
                  <?php $timeInDtb = $Assignment->deadline;
                  echo deadline($timeInDtb); ?>
                  روز مانده تا پایان زمان مشخص شده</div>
              </div>
            </div>
          </div>

        <?php endforeach; ?>
      </div>




      <script src="./assets/js/script.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.js" integrity="sha512-n/4gHW3atM3QqRcbCn6ewmpxcLAHGaDjpEBu4xZd47N0W2oQ+6q7oc3PXstrJYXcbNU1OHdQ1T7pAP+gi5Yu8g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>


      <script>
        function openForm() {
          document.getElementById("addassignment").style.display = "block";
        }

        function closeForm() {
          document.getElementById("addassignment").style.display = "none";
        }

        function openAddProject() {
          document.getElementById("addproject").style.display = "block";
        }

        function closeAddProject() {
          document.getElementById("addproject").style.display = "none";
        }

        $(document).ready(function() {
          var btnp = $('#addProjects');
          var project = $('#newProjectinp');

          var btnA = $('#addAssigtbtn');
          var inpA = $('#inpAssigtbtn');
          var inpD = $('#inpAssigtdead');

          btnp.click(function() {
            $.ajax({
              url: 'process/ajaxHandler.php',
              method: 'POST',
              data: {
                action: "addProject",
                project: project.val()
              },
              success: function(response) {
                alert(response);
              },
              error: function(response) {
                alert(response);
              }
            });
          })

          btnA.click(function() {
            $.ajax({
              url: 'process/ajaxHandler.php',
              method: 'POST',
              data: {
                action: "addAssignment",
                ProjectId: <?= $_GET['project_id']?>,
                AssignmenName: inpA.val(),
                deadl: inpD.val(),
              },
              success: function(response) {
                alert(response);
              },
              error: function(response) {
                alert(response);
              }
            });
          })

        });

      </script>

      </script>
</body>

</html>
فایل پیوست

آرمان محمدی پور

توسط

آرمان محمدی پور

19 شهریور 00

0
حذف شده

درود

لطفا کل پروژتون رو زیپ کنید آپلود کنید

فایل پیوست

امیر صالحی

توسط

امیر صالحی

20 شهریور 00

0
حذف شده

مشکل قبلی برطرف شد اما یه مشکل کوچیک دیگه توی نمایش تاریخ deadTime تعداد روز های مانده برای انجام دادن هدف وجود داره
راه که استفاده شده خیلی پیچیده شده و یه جاهایی هم به مشکل میخوره
خواستم اگه وقت داشته باشید یه بررسی انجام بدید که یه راه بهتر برای انجامش بهم معرفی کنید.

https://uploadb.me/direct/lu08ivd94moc/ProjectManagment.zip.html
 

فایل پیوست

آرمان محمدی پور

توسط

آرمان محمدی پور

27 شهریور 00