-
Notifications
You must be signed in to change notification settings - Fork 0
/
effect.php
40 lines (35 loc) · 1.21 KB
/
effect.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
require_once('propierty.php');
require_once('importance.php');
class effect
{
var $link;
function create($project_id,$factor_id,$action_id)
{
// crear efecto
$name="nn";
$description="";
$nature=-1;
$sql="INSERT INTO effects(project_id,factor_id,action_id,name,description,nature)
VALUES(".$project_id.",".$factor_id.",".$action_id.",'".$name."','".$description."',".$nature.")";
mysqli_query($this->link,$sql) or die(mysqli_error($this->link)."error : ".$sql);
$effect_id=mysqli_insert_id($this->link);
// crear las propiedades
$sql="SELECT id FROM effect_propierties WHERE project_id='".$project_id."'";
$result=mysqli_query($this->link,$sql) or die(mysqli_error($this->link)."error : ".$sql);
if($result and mysqli_num_rows($result)>0)
{
while($linea=mysqli_fetch_array($result,MYSQLI_ASSOC))
{
$P=new propierty();
$P->link=$this->link;
$P->create($effect_id,$linea['id'],$cuts);
}
}
// crear la importancia
$IM=new importance();
$IM->link=$this->link;
$IM->insert_single_importance($project_id,$effect_id,2);
}
}
?>